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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? os_task.c

?? uCOS的新版本uCOS-280
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
*                                             STACK CHECKING
*
* Description: This function is called to check the amount of free memory left on the specified task's
*              stack.
*
* Arguments  : prio          is the task priority
*
*              p_stk_data    is a pointer to a data structure of type OS_STK_DATA.
*
* Returns    : OS_NO_ERR           upon success
*              OS_PRIO_INVALID     if the priority you specify is higher that the maximum allowed
*                                  (i.e. > OS_LOWEST_PRIO) or, you have not specified OS_PRIO_SELF.
*              OS_TASK_NOT_EXIST   if the desired task has not been created or is assigned to a Mutex PIP
*              OS_TASK_OPT_ERR     if you did NOT specified OS_TASK_OPT_STK_CHK when the task was created
*              OS_ERR_PDATA_NULL   if 'p_stk_data' is a NULL pointer
*********************************************************************************************************
*/
#if OS_TASK_CREATE_EXT_EN > 0
INT8U  OSTaskStkChk (INT8U prio, OS_STK_DATA *p_stk_data)
{
    OS_TCB    *ptcb;
    OS_STK    *pchk;
    INT32U     free;
    INT32U     size;
#if OS_CRITICAL_METHOD == 3                            /* Allocate storage for CPU status register     */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_ARG_CHK_EN > 0
    if (prio > OS_LOWEST_PRIO) {                       /* Make sure task priority is valid             */
        if (prio != OS_PRIO_SELF) {
            return (OS_PRIO_INVALID);
        }
    }
    if (p_stk_data == (OS_STK_DATA *)0) {              /* Validate 'p_stk_data'                        */
        return (OS_ERR_PDATA_NULL);
    }
#endif
    p_stk_data->OSFree = 0;                            /* Assume failure, set to 0 size                */
    p_stk_data->OSUsed = 0;
    OS_ENTER_CRITICAL();
    if (prio == OS_PRIO_SELF) {                        /* See if check for SELF                        */
        prio = OSTCBCur->OSTCBPrio;
    }
    ptcb = OSTCBPrioTbl[prio];
    if (ptcb == (OS_TCB *)0) {                         /* Make sure task exist                         */
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);
    }
    if (ptcb == (OS_TCB *)1) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);
    }
    if ((ptcb->OSTCBOpt & OS_TASK_OPT_STK_CHK) == 0) { /* Make sure stack checking option is set       */
        OS_EXIT_CRITICAL();
        return (OS_TASK_OPT_ERR);
    }
    free = 0;
    size = ptcb->OSTCBStkSize;
    pchk = ptcb->OSTCBStkBottom;
    OS_EXIT_CRITICAL();
#if OS_STK_GROWTH == 1
    while (*pchk++ == (OS_STK)0) {                    /* Compute the number of zero entries on the stk */
        free++;
    }
#else
    while (*pchk-- == (OS_STK)0) {
        free++;
    }
#endif
    p_stk_data->OSFree = free * sizeof(OS_STK);           /* Compute number of free bytes on the stack */
    p_stk_data->OSUsed = (size - free) * sizeof(OS_STK);  /* Compute number of bytes used on the stack */
    return (OS_NO_ERR);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                            SUSPEND A TASK
*
* Description: This function is called to suspend a task.  The task can be the calling task if the
*              priority passed to OSTaskSuspend() is the priority of the calling task or OS_PRIO_SELF.
*
* Arguments  : prio     is the priority of the task to suspend.  If you specify OS_PRIO_SELF, the
*                       calling task will suspend itself and rescheduling will occur.
*
* Returns    : OS_NO_ERR                if the requested task is suspended
*              OS_TASK_SUSPEND_IDLE     if you attempted to suspend the idle task which is not allowed.
*              OS_PRIO_INVALID          if the priority you specify is higher that the maximum allowed
*                                       (i.e. >= OS_LOWEST_PRIO) or, you have not specified OS_PRIO_SELF.
*              OS_TASK_SUSPEND_PRIO     if the task to suspend does not exist
*              OS_TASK_NOT_EXITS        if the task is assigned to a Mutex PIP
*
* Note       : You should use this function with great care.  If you suspend a task that is waiting for
*              an event (i.e. a message, a semaphore, a queue ...) you will prevent this task from
*              running when the event arrives.
*********************************************************************************************************
*/

#if OS_TASK_SUSPEND_EN > 0
INT8U  OSTaskSuspend (INT8U prio)
{
    BOOLEAN    self;
    OS_TCB    *ptcb;
	INT8U      y;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_ARG_CHK_EN > 0
    if (prio == OS_IDLE_PRIO) {                                 /* Not allowed to suspend idle task    */
        return (OS_TASK_SUSPEND_IDLE);
    }
    if (prio >= OS_LOWEST_PRIO) {								/* Task priority valid ?               */
        if (prio != OS_PRIO_SELF) {
            return (OS_PRIO_INVALID);
        }
    }
#endif
    OS_ENTER_CRITICAL();
    if (prio == OS_PRIO_SELF) {                                 /* See if suspend SELF                 */
        prio = OSTCBCur->OSTCBPrio;
        self = TRUE;
    } else if (prio == OSTCBCur->OSTCBPrio) {                   /* See if suspending self              */
        self = TRUE;
    } else {
        self = FALSE;                                           /* No suspending another task          */
    }
    ptcb = OSTCBPrioTbl[prio];
    if (ptcb == (OS_TCB *)0) {                                  /* Task to suspend must exist          */
        OS_EXIT_CRITICAL();
        return (OS_TASK_SUSPEND_PRIO);
    }
    if (ptcb == (OS_TCB *)1) {                                  /* See if assigned to Mutex            */
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);
    }
	y            = ptcb->OSTCBY;
	OSRdyTbl[y] &= ~ptcb->OSTCBBitX;							/* Make task not ready                 */
    if (OSRdyTbl[y] == 0) {
        OSRdyGrp &= ~ptcb->OSTCBBitY;
    }
    ptcb->OSTCBStat |= OS_STAT_SUSPEND;                         /* Status of task is 'SUSPENDED'       */
    OS_EXIT_CRITICAL();
    if (self == TRUE) {                                         /* Context switch only if SELF         */
        OS_Sched();
    }
    return (OS_NO_ERR);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                            QUERY A TASK
*
* Description: This function is called to obtain a copy of the desired task's TCB.
*
* Arguments  : prio         is the priority of the task to obtain information from.
*
*              p_task_data  is a pointer to where the desired task's OS_TCB will be stored.
*
* Returns    : OS_NO_ERR          if the requested task is suspended
*              OS_PRIO_INVALID    if the priority you specify is higher that the maximum allowed
*                                 (i.e. > OS_LOWEST_PRIO) or, you have not specified OS_PRIO_SELF.
*              OS_PRIO_ERR        if the desired task has not been created
*              OS_TASK_NOT_EXIST  if the task is assigned to a Mutex PIP
*              OS_ERR_PDATA_NULL  if 'p_task_data' is a NULL pointer
*********************************************************************************************************
*/

#if OS_TASK_QUERY_EN > 0
INT8U  OSTaskQuery (INT8U prio, OS_TCB *p_task_data)
{
    OS_TCB    *ptcb;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_ARG_CHK_EN > 0
    if (prio > OS_LOWEST_PRIO) {				 /* Task priority valid ?    	                       */
        if (prio != OS_PRIO_SELF) {
            return (OS_PRIO_INVALID);
        }
    }
    if (p_task_data == (OS_TCB *)0) {            /* Validate 'p_task_data'                             */
        return (OS_ERR_PDATA_NULL);
    }
#endif
    OS_ENTER_CRITICAL();
    if (prio == OS_PRIO_SELF) {                  /* See if suspend SELF                                */
        prio = OSTCBCur->OSTCBPrio;
    }
    ptcb = OSTCBPrioTbl[prio];
    if (ptcb == (OS_TCB *)0) {                   /* Task to query must exist                           */
        OS_EXIT_CRITICAL();
        return (OS_PRIO_ERR);
    }
    if (ptcb == (OS_TCB *)1) {                   /* Task to query must not be assigned to a Mutex      */
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);
    }
                                                 /* Copy TCB into user storage area                    */
    OS_MemCopy((INT8U *)p_task_data, (INT8U *)ptcb, sizeof(OS_TCB));
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                        CLEAR TASK STACK
*
* Description: This function is used to clear the stack of a task (i.e. write all zeros)
*
* Arguments  : pbos     is a pointer to the task's bottom of stack.  If the configuration constant
*                       OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. from high
*                       memory to low memory).  'pbos' will thus point to the lowest (valid) memory
*                       location of the stack.  If OS_STK_GROWTH is set to 0, 'pbos' will point to the
*                       highest memory location of the stack and the stack will grow with increasing
*                       memory locations.  'pbos' MUST point to a valid 'free' data item.
*
*              size     is the number of 'stack elements' to clear.
*
*              opt      contains additional information (or options) about the behavior of the task.  The
*                       LOWER 8-bits are reserved by uC/OS-II while the upper 8 bits can be application
*                       specific.  See OS_TASK_OPT_??? in uCOS-II.H.
*
* Returns    : none
*********************************************************************************************************
*/
#if OS_TASK_CREATE_EXT_EN > 0
void  OS_TaskStkClr (OS_STK *pbos, INT32U size, INT16U opt)
{
    if ((opt & OS_TASK_OPT_STK_CHK) != 0x0000) {       /* See if stack checking has been enabled       */
        if ((opt & OS_TASK_OPT_STK_CLR) != 0x0000) {   /* See if stack needs to be cleared             */
#if OS_STK_GROWTH == 1
            while (size > 0) {                         /* Stack grows from HIGH to LOW memory          */
                size--;
                *pbos++ = (OS_STK)0;                   /* Clear from bottom of stack and up!           */
            }
#else
            while (size > 0) {                         /* Stack grows from LOW to HIGH memory          */
                size--;
                *pbos-- = (OS_STK)0;                   /* Clear from bottom of stack and down          */
            }
#endif
        }
    }
}

#endif

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99这里只有精品| 精品国产一区二区三区久久影院 | 91浏览器打开| 精品奇米国产一区二区三区| 久久久亚洲精品石原莉奈| 欧美色精品在线视频| 99久久精品国产导航| 亚洲精品国产无天堂网2021 | 99久久99久久综合| 91豆麻精品91久久久久久| 欧美日韩国产高清一区二区三区 | 亚洲综合丁香婷婷六月香| 色噜噜狠狠成人网p站| 欧美精品精品一区| 色妞www精品视频| 天天综合天天综合色| 一区二区在线观看免费| 日韩一区二区视频在线观看| 欧美午夜影院一区| 一区二区三区精品视频在线| 97久久精品人人爽人人爽蜜臀 | 欧美日韩精品系列| 国产69精品久久777的优势| 一区二区三区国产精华| 亚洲精品伦理在线| 久久网站热最新地址| 一区二区三区精品视频在线| 偷拍亚洲欧洲综合| 久久99精品久久久久久国产越南 | 另类的小说在线视频另类成人小视频在线| 天堂成人国产精品一区| 国产日韩精品视频一区| 91黄色在线观看| 一区二区三区高清| 国产乱国产乱300精品| 欧美猛男超大videosgay| 久久综合久久综合亚洲| 中文字幕一区二区5566日韩| 欧美疯狂性受xxxxx喷水图片| 91蝌蚪porny成人天涯| 国产精品一二三四五| 午夜婷婷国产麻豆精品| 亚洲成av人片| 亚洲综合色区另类av| 国产精品三级视频| 3d动漫精品啪啪一区二区竹菊| 在线观看免费视频综合| 日韩欧美视频在线| 久久久久久久网| 亚洲图片激情小说| 亚洲欧美另类久久久精品| 蜜乳av一区二区三区| 午夜精品福利一区二区三区av| 丝袜美腿亚洲综合| 国产成人av电影在线播放| 成人激情综合网站| 国产福利精品导航| 美脚の诱脚舐め脚责91| 国产91在线观看| 99久久精品国产麻豆演员表| 欧美情侣在线播放| 风流少妇一区二区| 日本亚洲欧美天堂免费| 高清在线不卡av| 欧美日韩在线三级| 国产亚洲欧美一区在线观看| 亚洲一区视频在线| 高清成人免费视频| 欧美一区二区网站| 美腿丝袜亚洲色图| 91视频观看视频| 91精品国产色综合久久久蜜香臀| 亚洲一区二区三区四区中文字幕| 丝袜美腿成人在线| 欧美视频在线观看一区二区| 中文字幕不卡在线播放| 一区二区三区四区乱视频| 爽爽淫人综合网网站| 在线一区二区三区四区五区 | 日韩一区精品视频| av影院午夜一区| 国产三级精品三级在线专区| 日本网站在线观看一区二区三区| 亚洲综合成人在线视频| 欧美裸体一区二区三区| 免费成人小视频| 亚洲午夜视频在线观看| 一区二区三区精品视频| 91国在线观看| 久久免费看少妇高潮| 国产精品18久久久久久久网站| 日韩欧美一级二级三级| 日韩欧美一区二区不卡| 亚洲精品成人天堂一二三| 欧美日韩一区国产| 国产不卡视频一区二区三区| 天天综合色天天综合色h| 日韩一区二区免费高清| av在线播放一区二区三区| 亚洲成人自拍网| 国产午夜精品久久| 国产成人av一区| 亚洲一卡二卡三卡四卡无卡久久 | 欧美裸体一区二区三区| 一区二区三区美女| 色天天综合色天天久久| 日本vs亚洲vs韩国一区三区二区 | 成人av手机在线观看| 成人精品一区二区三区中文字幕 | 久久蜜桃av一区二区天堂| 99久久婷婷国产精品综合| 亚洲第一福利一区| 欧美成人一区二区| 91.成人天堂一区| 国产在线国偷精品免费看| 亚洲精品在线网站| 欧美精品久久99久久在免费线| 国产成人一区在线| 欧美日本在线一区| 日本亚洲欧美天堂免费| 午夜国产精品一区| 亚洲人精品一区| 久久久久久一二三区| 欧美一区中文字幕| av激情亚洲男人天堂| 天天av天天翘天天综合网色鬼国产 | 精品久久久久久久久久久久久久久 | 在线亚洲高清视频| 成人国产亚洲欧美成人综合网 | 91在线国内视频| 日韩精品福利网| 26uuu精品一区二区| 国产乱码一区二区三区| 午夜精品福利在线| 一区二区激情视频| 亚洲激情av在线| 亚洲国产精品久久人人爱蜜臀 | 一区二区三区中文在线| 亚洲少妇30p| 3d动漫精品啪啪1区2区免费 | 丁香啪啪综合成人亚洲小说 | 精品88久久久久88久久久| 精品国产乱码久久久久久影片| 欧美日韩一区二区在线视频| 国产在线播精品第三| 91色在线porny| 欧美日韩精品欧美日韩精品| 91在线观看免费视频| 一本色道久久综合狠狠躁的推荐| 91在线观看污| 国产日韩成人精品| 精品国产免费人成在线观看| 久久久一区二区三区捆绑**| 久久久久国产精品麻豆ai换脸 | 国产精品动漫网站| 亚洲丝袜另类动漫二区| 1区2区3区欧美| 五月天久久比比资源色| 蜜桃av一区二区三区| 久久99精品一区二区三区三区| 色呦呦国产精品| 国产亚洲精品aa午夜观看| 中文字幕亚洲成人| 成人免费不卡视频| 色婷婷久久一区二区三区麻豆| 欧美一区二区三区视频| 欧美一级欧美三级| 亚洲高清视频在线| av高清久久久| 91精品国产综合久久久久| 成人免费在线观看入口| 97久久精品人人爽人人爽蜜臀| 欧美日韩激情一区| 精品久久久久久久人人人人传媒| 亚洲第一久久影院| 激情av综合网| 久草精品在线观看| www国产精品av| 国产成人综合自拍| 欧美二区在线观看| 蜜桃视频第一区免费观看| 色先锋资源久久综合| 久久久久久久久免费| 日韩精品一区第一页| 国产亚洲精品bt天堂精选| 蜜桃视频在线一区| 日韩美女视频一区二区在线观看| 亚洲精品成人a在线观看| 国产成人综合在线播放| 欧美精品一区二区三区在线播放| 韩国欧美国产1区| 欧美日韩一区成人| 国产一区二区免费看| 欧美一级久久久| 国产精品久线观看视频| www..com久久爱| 亚洲成人资源网| 精品国产乱码久久久久久牛牛| 免费的国产精品| 91精品国产美女浴室洗澡无遮挡|