linux下的sched头文件Word格式.docx
- 文档编号:13858501
- 上传时间:2022-10-14
- 格式:DOCX
- 页数:30
- 大小:30.87KB
linux下的sched头文件Word格式.docx
《linux下的sched头文件Word格式.docx》由会员分享,可在线阅读,更多相关《linux下的sched头文件Word格式.docx(30页珍藏版)》请在冰豆网上搜索。
linux/kernel.h>
linux/types.h>
linux/times.h>
linux/timex.h>
linux/rbtree.h>
asm/system.h>
asm/semaphore.h>
asm/page.h>
asm/ptrace.h>
asm/mmu.h>
linux/smp.h>
linux/tty.h>
linux/sem.h>
linux/signal.h>
linux/securebits.h>
linux/fs_struct.h>
linux/low-latency.h>
structexec_domain;
*cloningflags:
#defineCSIGNAL0x000000ff/*signalmasktobesentatexit*/
#defineCLONE_VM0x00000100/*setifVMsharedbetweenprocesses*/
#defineCLONE_FS0x00000200/*setiffsinfosharedbetweenprocesses*/
#defineCLONE_FILES0x00000400/*setifopenfilessharedbetweenprocesses*/
#defineCLONE_SIGHAND0x00000800/*setifsignalhandlersandblockedsignalsshared*/
#defineCLONE_PID0x00001000/*setifpidshared*/
#defineCLONE_PTRACE0x00002000/*setifwewanttolettracingcontinueonthechildtoo*/
#defineCLONE_VFORK0x00004000/*setiftheparentwantsthechildtowakeituponmm_release*/
#defineCLONE_PARENT0x00008000/*setifwewanttohavethesameparentasthecloner*/
#defineCLONE_THREAD0x00010000/*Samethreadgroup?
#defineCLONE_NEWNS0x00020000/*Newnamespacegroup?
#defineCLONE_SIGNAL(CLONE_SIGHAND|CLONE_THREAD)
*Thesearetheconstantusedtofakethefixed-pointload-average
*counting.Somenotes:
*-11bitfractionsexpandto22bitsbythemultiplies:
thisgives
*aload-averageprecisionof10bitsinteger+11bitsfractional
*-ifyouwanttocountload-averagesmoreoften,youneedmore
*precision,orroundingwillgetyou.With2-secondcountingfreq,
*theEXP_nvalueswouldbe1981,2034and2043ifstillusingonly
*11bitfractions.
externunsignedlongavenrun[];
/*Loadaverages*/
#defineFSHIFT11/*nrofbitsofprecision*/
#defineFIXED_1(1<
<
FSHIFT)/*1.0asfixed-point*/
#defineLOAD_FREQ(5*HZ)/*5secintervals*/
#defineEXP_11884/*1/exp(5sec/1min)asfixed-point*/
#defineEXP_52014/*1/exp(5sec/5min)*/
#defineEXP_152037/*1/exp(5sec/15min)*/
#defineCALC_LOAD(load,exp,n)\
load*=exp;
\
load+=n*(FIXED_1-exp);
load>
>
=FSHIFT;
#defineCT_TO_SECS(x)((x)/HZ)
#defineCT_TO_USECS(x)(((x)%HZ)*1000000/HZ)
externintnr_threads;
externintlast_pid;
externunsignedlongnr_running(void);
externunsignedlongnr_uninterruptible(void);
linux/fs.h>
linux/time.h>
linux/param.h>
linux/resource.h>
linux/timer.h>
asm/processor.h>
//进程状态
#defineTASK_RUNNING0
#defineTASK_INTERRUPTIBLE1
#defineTASK_UNINTERRUPTIBLE2
#defineTASK_ZOMBIE4
#defineTASK_STOPPED8
#define__set_task_state(tsk,state_value)\
do{(tsk)->
state=(state_value);
}while(0)
#ifdefCONFIG_SMP
#defineset_task_state(tsk,state_value)\
set_mb((tsk)->
state,(state_value))
#else
__set_task_state((tsk),(state_value))
#endif
#define__set_current_state(state_value)\
do{current->
#defineset_current_state(state_value)\
set_mb(current->
__set_current_state(state_value)
*Schedulingpolicies
#defineSCHED_OTHER0
#defineSCHED_FIFO1
#defineSCHED_RR2
structsched_param{
intsched_priority;
};
structcompletion;
#ifdef__KERNEL__
linux/spinlock.h>
*Thisserializes"
schedule()"
andalsoprotects
*therun-queuefromdeletions/modifications(but
*_adding_tothebeginningoftherun-queuehas
*aseparatelock).
externrwlock_ttasklist_lock;
externspinlock_tmmlist_lock;
typedefstructtask_structtask_t;
//将task_t定义为task_sturct的结构类型
externvoidsched_init(void);
externvoidinit_idle(task_t*idle,intcpu);
externvoidshow_state(void);
externvoidshow_stack(unsignedlong*esp);
externvoidcpu_init(void);
externvoidtrap_init(void);
externvoidupdate_process_times(intuser);
externvoidupdate_one_process(task_t*p,unsignedlonguser,
unsignedlongsystem,intcpu);
externvoidscheduler_tick(intuser_tick,intsystem);
externvoidmigration_init(void);
externunsignedlongcache_decay_ticks;
externintset_user(uid_tnew_ruid,intdumpclear);
#defineMAX_SCHEDULE_TIMEOUTLONG_MAX
externsignedlongFASTCALL(schedule_timeout(signedlongtimeout));
asmlinkagevoidschedule(void);
externintschedule_task(structtq_struct*task);
externvoidflush_scheduled_tasks(void);
externi
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- linux sched 文件
![提示](https://static.bdocx.com/images/bang_tan.gif)