亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? schedpxlib.c

?? posix在vxworks上的實現源代碼
?? C
字號:
/* schedPxLib.c - scheduling library (POSIX) *//* Copyright 1984-1995 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01d,24jan95,rhp  doc: clarify relation between struct sched_param and priority    19jan95,jdi  doc cleanup.01c,01feb94,dvs  documentation cleanup.01b,05jan94,kdl  changed include to private/schedP.h; general cleanup.01a,04nov93,dvs  written*//*DESCRIPTION: This library provides POSIX-compliance scheduling routines.  The routinesin this library allow the user to get and set priorities and schedulingschemes, get maximum and minimum priority values, and get the time sliceif round-robin scheduling is enabled.The POSIX standard specifies a priority numbering scheme in whichhigher priorities are indicated by larger numbers.  The VxWorks nativenumbering scheme is the reverse of this, with higher priorities indicatedby smaller numbers.  For example, in the VxWorks native priority numberingscheme, the highest priority task has a priority of 0.In VxWorks, POSIX scheduling interfaces are implemented using the POSIXpriority numbering scheme.  This means that the priority numbers used bythis library \f2do not\f1 match those reported and used in all the otherVxWorks components.  It is possible to change the priority numberingscheme used by this library by setting the global variable`posixPriorityNumbering'.  If this variable is set to FALSE, the VxWorksnative numbering scheme (small number = high priority) is used, andpriority numbers used by this library will match those used by the otherportions of VxWorks.The routines in this library are compliant with POSIX 1003.1b.  Inparticular, task priorities are set and reported through the structure`sched_setparam', which has a single member:.CSstruct sched_param		/@ Scheduling parameter structure @/    {    int sched_priority;		/@ scheduling priority @/    };.CEPOSIX 1003.1b specifies this indirection to permit future extensionsthrough the same calling interface.  For example, becausesched_setparam() takes this structure as an argument (rather thanusing the priority value directly) its type signature need not changeif future schedulers require other parameters.INCLUDE FILES: sched.hSEE ALSO: POSIX 1003.1b document, taskLib*//* INCLUDES */#include "vxWorks.h"#include "private/schedP.h"		/* includes sched.h */#include "timers.h"#include "taskLib.h"#include "drv/timer/timerDev.h"/* globals */BOOL posixPriorityNumbering = TRUE;	/* default use POSIX numbering *//* externals */extern BOOL	roundRobinOn;		/* BOOL for round-robin scheduling */extern ULONG	roundRobinSlice;	/* time slice in ticks for RR sched *//******************************************************************************** sched_setparam - set a task's priority (POSIX)** This routine sets the priority of a specified task, <tid>.  If <tid> is 0,* it sets the priority of the calling task.  Valid priority numbers are 0* through 255.* * The <param> argument is a structure whose member `sched_priority' is* the integer priority value.  For example, the following program fragment* sets the calling task's priority to 13 using POSIX interfaces:* * .CS* #include "sched.h"*  ...* struct sched_param AppSchedPrio;*  ...* AppSchedPrio.sched_priority = 13;* if ( sched_setparam (0, &AppSchedPrio) != OK )*     {*     ... /@ recovery attempt or abort message @/*     }*  ...* .CE** NOTE: If the global variable 'posixPriorityNumbering' is FALSE, the VxWorks* native priority numbering scheme is used, in which higher priorities are* indicated by smaller numbers.  This is different than the priority numbering * scheme specified by POSIX, in which higher priorities are indicated by* larger numbers.** RETURNS: 0 (OK) if successful, or -1 (ERROR) on error.** ERRNO: *  EINVAL*     - scheduling priority is outside valid range.*  ESRCH*     - task ID is invalid.**/int sched_setparam    (    pid_t 				tid,	/* task ID */    const struct sched_param * 		param	/* scheduling parameter */    )    {    if (taskPrioritySet (tid, PX_VX_PRIORITY_CONVERT (param->sched_priority)) 	== ERROR)	{	/* map errno to that specified by POSIX */	switch (errno)	    {	    case S_taskLib_ILLEGAL_PRIORITY:		errno = EINVAL;		break;	    case S_objLib_OBJ_ID_ERROR:		errno = ESRCH;		break;	    default:				break; 			/* No generic error to use */	    }	return (ERROR);	}    return (OK);    }/******************************************************************************** sched_getparam - get the scheduling parameters for a specified task (POSIX)** This routine gets the scheduling priority for a specified task, <tid>.* If <tid> is 0, it gets the priority of the calling task.  The task's* priority is copied to the `sched_param' structure pointed to by <param>.** NOTE: If the global variable 'posixPriorityNumbering' is FALSE, the VxWorks* native priority numbering scheme is used, in which higher priorities are* indicated by smaller numbers.  This is different than the priority numbering * scheme specified by POSIX, in which higher priorities are indicated by* larger numbers.** RETURNS: 0 (OK) if successful, or -1 (ERROR) on error.** ERRNO: *  ESRCH*     - invalid task ID.**/int sched_getparam    (    pid_t 			tid,	/* task ID */    struct sched_param *	param	/* scheduling param to store priority */    )    {    if (taskPriorityGet (tid, &(param->sched_priority)) == ERROR)	{	errno = ESRCH;			/* invalid task ID */	return (ERROR);	}    /* convert priority if necessary */    param->sched_priority = PX_VX_PRIORITY_CONVERT (param->sched_priority);    return (OK);    }/******************************************************************************** sched_setscheduler - set scheduling policy and scheduling parameters (POSIX)** This routine sets the scheduling policy and scheduling parameters for a* specified task, <tid>.  If <tid> is 0, it sets the scheduling policy and* scheduling parameters for the calling task.** Because VxWorks does not set scheduling policies (e.g., round-robin scheduling) on a * task-by-task basis, setting a scheduling policy that conflicts with the * current system policy simply fails and errno is set to EINVAL.  If the * requested scheduling policy is the same as the current system policy, then * this routine acts just like sched_setparam().** NOTE: If the global variable 'posixPriorityNumbering' is FALSE, the VxWorks* native priority numbering scheme is used, in which higher priorities are* indicated by smaller numbers.  This is different than the priority numbering * scheme specified by POSIX, in which higher priorities are indicated by* larger numbers.** RETURNS: The previous scheduling policy (SCHED_FIFO or SCHED_RR), or * -1 (ERROR) on error.** ERRNO:*  EINVAL*     - scheduling priority is outside valid range, or it is impossible to set*       the specified scheduling policy.*  ESRCH*     - invalid task ID.**/int sched_setscheduler    (    pid_t 			tid,	/* task ID */    int 			policy,	/* scheduling policy requested */    const struct sched_param *	param	/* scheduling parameters requested */    )    {    /* currently do not support SCHED_OTHER */    if (policy == SCHED_OTHER)	{	errno = EINVAL;	return (ERROR);	}    /*      * is requested scheduling policy same as system policy? If not, fail      * request.      */    if (((roundRobinOn == TRUE) && (policy != SCHED_RR)) ||	((roundRobinOn == FALSE) && (policy != SCHED_FIFO)))	{	errno = EINVAL;	return (ERROR);	}    /* set task priority; don't convert priority number - sched_setparam will */    /* note that sched_setparam calls taskPrioritySet which validates the tid */    if (sched_setparam (tid, param) == ERROR)	return (ERROR);        return (OK);    }/******************************************************************************** sched_getscheduler - get the current scheduling policy (POSIX)** This routine returns the currents scheduling policy (i.e., SCHED_FIFO * or SCHED_RR).  ** RETURNS: Current scheduling policy (SCHED_FIFO or SCHED_RR), or -1 (ERROR) * on error.** ERRNO: *  ESRCH*     - invalid task ID.**/int sched_getscheduler    (    pid_t tid		/* task ID */    )    {    /* validate tid */    if ((taskIdVerify (tid) == ERROR) && (tid != 0))	{	errno = ESRCH;	return (ERROR);	}    return (roundRobinOn == TRUE ? SCHED_RR : SCHED_FIFO);    }/******************************************************************************** sched_yield - relinquish the CPU (POSIX)** This routine forces the running task to give up the CPU.** RETURNS: 0 (OK) if successful, or -1 (ERROR) on error.**/int sched_yield (void)    {    return (taskDelay (0));    }/******************************************************************************** sched_get_priority_max - get the maximum priority (POSIX)** This routine returns the value of the highest possible task priority for a * specified scheduling policy (SCHED_FIFO or SCHED_RR).** NOTE: If the global variable 'posixPriorityNumbering' is FALSE, the VxWorks* native priority numbering scheme is used, in which higher priorities are* indicated by smaller numbers.  This is different than the priority numbering * scheme specified by POSIX, in which higher priorities are indicated by* larger numbers.** RETURNS: Maximum priority value, or -1 (ERROR) on error.** ERRNO: *  EINVAL*     - invalid scheduling policy.**/int sched_get_priority_max    (    int policy		/* scheduling policy */    )    {    /* check if policy is valid */    if ((policy != SCHED_RR) && (policy != SCHED_FIFO))	{	errno = EINVAL;	return (ERROR);	}    /* return highest possible priority */    if (policy == SCHED_RR)	return (PX_NUMBER_CONVERT (SCHED_RR_HIGH_PRI));    else	return (PX_NUMBER_CONVERT (SCHED_FIFO_HIGH_PRI));    }    /******************************************************************************** sched_get_priority_min - get the minimum priority (POSIX)** This routine returns the value of the lowest possible task priority for a * specified scheduling policy (SCHED_FIFO or SCHED_RR).** NOTE: If the global variable 'posixPriorityNumbering' is FALSE, the VxWorks* native priority numbering scheme is used, in which higher priorities are* indicated by smaller numbers.  This is different than the priority numbering * scheme specified by POSIX, in which higher priorities are indicated by* larger numbers.** RETURNS: Minimum priority value, or -1 (ERROR) on error.** ERRNO: *  EINVAL*     - invalid scheduling policy.**/int sched_get_priority_min    (    int policy		/* scheduling policy */    )    {    /* check if policy is valid */    if ((policy != SCHED_RR) && ( policy != SCHED_FIFO))	{	errno = EINVAL;	return (ERROR);	}    /* return lowest possible priority */    if (policy == SCHED_RR)	return (PX_NUMBER_CONVERT (SCHED_RR_LOW_PRI));    else	return (PX_NUMBER_CONVERT (SCHED_FIFO_LOW_PRI));    }    /******************************************************************************** sched_rr_get_interval - get the current time slice (POSIX)** This routine sets <interval> to the current time slice period if round-robin* scheduling is currently enabled. ** RETURNS: 0 (OK) if successful, -1 (ERROR) on error.** ERRNO: *  EINVAL*     - round-robin scheduling is not currently enabled.*  ESRCH*     - invalid task ID.** INTERNAL: A slight race condition could exist between the time that* we check that round-robin is on and when we get and report the time slice.**/int sched_rr_get_interval    (    pid_t		tid,		/* task ID */    struct timespec * 	interval	/* struct to store time slice */    )    {    time_t		rate;		/* clock rate in ticks */    time_t		timeSlice;	/* time slice in ticks */    /* validate tid - tid = 0 references current task */    if ((taskIdVerify (tid) == ERROR) && (tid != 0))	{	errno = ESRCH;	return (ERROR);	}    /* validate that round-robin is on */    if (roundRobinOn != TRUE)	{	errno = EINVAL;	return (ERROR);	}    /* get clock rate and time slice */    rate = sysClkRateGet();    timeSlice = roundRobinSlice;    /* convert ticks to seconds/nanoseconds */    interval->tv_sec = (time_t) (timeSlice / rate);    interval->tv_nsec = (timeSlice % rate) * (1000000000 / rate);    return (OK);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩嫩av羞羞动漫久久久| 另类小说一区二区三区| 久久99精品国产| 色综合天天天天做夜夜夜夜做| 91精品在线观看入口| 亚洲天堂2014| 国产乱子伦视频一区二区三区| 欧美日韩在线播| 亚洲欧洲一区二区在线播放| 国内精品不卡在线| 欧美一区午夜视频在线观看| 亚洲免费观看高清完整| 成人在线视频首页| 精品久久久久香蕉网| 天天综合天天综合色| 色偷偷久久一区二区三区| 欧美经典一区二区| 激情欧美一区二区三区在线观看| 欧美男女性生活在线直播观看| 亚洲欧美日韩一区二区三区在线观看| 国产乱码精品一区二区三| 日韩一区二区电影| 五月婷婷综合激情| 欧美三级三级三级| 亚洲综合精品久久| 91老师片黄在线观看| 国产精品另类一区| 国产成人精品综合在线观看| 精品欧美久久久| 欧美aaaaa成人免费观看视频| 欧美日韩精品综合在线| 亚洲精品国产品国语在线app| 99久久精品国产导航| 国产精品午夜在线| 成人激情午夜影院| 亚洲国产成人私人影院tom| 国产乱码精品一品二品| 久久夜色精品国产噜噜av| 精品亚洲国内自在自线福利| 日韩视频在线观看一区二区| 日本大胆欧美人术艺术动态| 在线成人av网站| 日本三级亚洲精品| 日韩欧美一区在线| 久久国产成人午夜av影院| 欧美sm极限捆绑bd| 国产在线不卡一区| 久久精品亚洲精品国产欧美kt∨| 国产一区二区成人久久免费影院| 久久久久久99久久久精品网站| 国产一区二区日韩精品| 久久精品无码一区二区三区| 成人综合婷婷国产精品久久蜜臀 | 国产精品一区在线观看你懂的| 欧美va亚洲va| 国产精品1区2区3区在线观看| 国产清纯白嫩初高生在线观看91| 国产成a人亚洲| ...中文天堂在线一区| 色哟哟在线观看一区二区三区| 亚洲在线视频免费观看| 欧美浪妇xxxx高跟鞋交| 久久精品国内一区二区三区 | 99久久伊人精品| 亚洲视频在线一区| 欧美日韩在线一区二区| 蜜芽一区二区三区| 国产亚洲人成网站| 99久久综合精品| 一区二区三区不卡视频在线观看| 欧美日韩国产综合一区二区三区| 蜜臀久久99精品久久久久宅男 | 色天使色偷偷av一区二区| 亚洲一二三四在线| 日韩欧美在线观看一区二区三区| 国产精品18久久久久| 亚洲天天做日日做天天谢日日欢| 91福利在线免费观看| 日日夜夜精品视频天天综合网| 欧美xxxxx裸体时装秀| 成人免费av网站| 亚洲v中文字幕| 精品国产乱码久久久久久1区2区| 丁香六月综合激情| 午夜视频一区在线观看| www国产成人| 91电影在线观看| 精品伊人久久久久7777人| 中文字幕永久在线不卡| 欧美高清激情brazzers| 高清在线不卡av| 亚洲国产视频在线| 国产亚洲欧美日韩在线一区| 欧美性极品少妇| 激情欧美一区二区| 一区二区三区在线高清| 欧美成人aa大片| 99久久夜色精品国产网站| 日韩精品每日更新| 中文字幕av一区二区三区| 在线不卡中文字幕播放| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 国产福利不卡视频| 亚洲国产sm捆绑调教视频| 国产肉丝袜一区二区| 欧美日韩成人综合天天影院 | 亚洲国产精品久久不卡毛片| 久久一二三国产| 欧美日韩电影一区| 成人黄色综合网站| 琪琪久久久久日韩精品| 亚洲人精品午夜| 久久久av毛片精品| 欧美日高清视频| 91美女精品福利| 国产毛片精品视频| 日韩av不卡一区二区| 一区二区三区美女视频| 国产拍欧美日韩视频二区| 91麻豆精品国产综合久久久久久| 99精品欧美一区二区蜜桃免费 | 午夜精品一区在线观看| 国产精品久久看| 欧美精品一区二区蜜臀亚洲| 欧美伊人精品成人久久综合97 | 免费成人在线播放| 一区二区不卡在线播放 | 精品国产网站在线观看| 欧美三级日韩三级国产三级| 99久久精品情趣| 国产成a人无v码亚洲福利| 久久精品国产秦先生| 亚洲h动漫在线| 一区二区三区四区视频精品免费 | 国产天堂亚洲国产碰碰| 日韩情涩欧美日韩视频| 欧美色精品在线视频| av在线一区二区| 成人一区二区三区视频| 国产综合色在线| 久久电影网站中文字幕 | 国产精品视频一区二区三区不卡| 精品精品国产高清一毛片一天堂| 欧美一区日韩一区| 欧美丰满美乳xxx高潮www| 欧美性猛交xxxxxxxx| 欧洲精品在线观看| 色综合久久天天| 色综合久久中文综合久久牛| 91在线视频免费91| 99久久99久久精品免费观看| 不卡一区在线观看| 不卡免费追剧大全电视剧网站| 国产精品亚洲人在线观看| 国产乱妇无码大片在线观看| 国产综合色产在线精品| 国产一区二区三区免费| 国内久久婷婷综合| 国产又黄又大久久| 国产高清成人在线| 国产一区二区三区综合| 国产精品综合av一区二区国产馆| 精品亚洲国产成人av制服丝袜| 久久99最新地址| 国产福利一区在线| 成人免费三级在线| 91亚洲精华国产精华精华液| 一本一本久久a久久精品综合麻豆| 91污在线观看| 欧美性大战久久| 91精品国产综合久久久久久久| 91麻豆精品久久久久蜜臀| 日韩精品一区二区三区在线播放| 精品国产一区久久| 国产清纯美女被跳蛋高潮一区二区久久w | 成人免费毛片片v| 色综合夜色一区| 欧美视频一区二| 欧美一个色资源| 久久久亚洲精品石原莉奈 | 欧美日韩第一区日日骚| 亚洲少妇30p| 亚洲视频一区在线观看| 亚洲影院理伦片| 日韩不卡一区二区三区| 精品一区二区三区在线播放| 国产69精品久久久久777| 99久久综合精品| 精品1区2区3区| 精品久久久久久久人人人人传媒| 国产亚洲精品bt天堂精选| 亚洲丝袜精品丝袜在线| 亚洲成a人片综合在线| 久久精品久久99精品久久| 成人一级片在线观看| 91久久一区二区| 日韩一卡二卡三卡四卡| 国产午夜精品一区二区三区四区| 亚洲品质自拍视频| 美日韩一区二区|