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

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

?? os_task.c

?? 這套代碼已經(jīng)成功一直到S3C44B0X開發(fā)板上
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*$PAGE*/
/*
*********************************************************************************************************
*                                             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
*********************************************************************************************************
*/
#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;



    cpu_sr = 0;                                        /* Prevent compiler warning                     */
#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);
        }
    }
#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;



    cpu_sr = 0;                                                 /* Prevent compiler warning            */
#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] == 0x00) { 
        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
*********************************************************************************************************
*/

#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;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
#if OS_ARG_CHK_EN > 0
    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;
    }
    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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一级女性全黄久久生活片免费| 91精品国产日韩91久久久久久| 久久精品免视看| 国内精品国产三级国产a久久| 精品国产麻豆免费人成网站| 精品在线免费观看| 国产欧美一区视频| 色综合久久久久久久久久久| 亚洲午夜电影在线| 日韩一区二区三区高清免费看看| 久久精品国产精品亚洲精品| 久久久久久99久久久精品网站| 成人av网站在线| 午夜视频在线观看一区二区| 欧美日韩一区中文字幕| 久草中文综合在线| 国产精品久久二区二区| 在线精品视频小说1| 秋霞成人午夜伦在线观看| 精品国产一区二区三区av性色| 成人一道本在线| 午夜精品久久久久久久蜜桃app | 日本女优在线视频一区二区| 日韩欧美国产综合一区| 成人短视频下载| 午夜精品福利一区二区三区蜜桃| 久久久天堂av| 欧美少妇一区二区| 国产成人丝袜美腿| 精品亚洲国产成人av制服丝袜| 欧美国产国产综合| 欧美久久婷婷综合色| 成人综合婷婷国产精品久久免费| 亚洲综合色噜噜狠狠| 精品成人私密视频| 欧美性猛片aaaaaaa做受| 国产一区二区三区蝌蚪| 亚洲一区二区av电影| 久久久91精品国产一区二区精品| 日本韩国一区二区| 国产成人免费xxxxxxxx| 日本美女一区二区三区视频| 国产精品久久久久久久久免费樱桃 | 国产精品色哟哟| 69堂精品视频| 色综合久久中文字幕综合网 | 国产成人自拍高清视频在线免费播放| 玉米视频成人免费看| 国产婷婷色一区二区三区四区| 欧美日韩在线播放一区| 91免费国产在线| 国产一区二区三区免费在线观看| 日韩精品一二三四| 亚洲日本欧美天堂| 国产精品日产欧美久久久久| 精品成人a区在线观看| 欧美精品一级二级三级| 91成人免费在线| 99国产精品久久久久久久久久久 | 欧洲一区在线观看| 成人av电影免费在线播放| 黄一区二区三区| 日本不卡123| 三级影片在线观看欧美日韩一区二区| 中文字幕日韩av资源站| 国产精品久久久久久久久免费桃花 | 国产精品99久久久久久久vr| 秋霞电影一区二区| 免费观看日韩电影| 欧美a级一区二区| 天天色图综合网| 午夜视频一区在线观看| 日韩精品高清不卡| 舔着乳尖日韩一区| 日韩av一区二| 日韩黄色在线观看| 欧美aⅴ一区二区三区视频| 日韩av中文字幕一区二区三区| 亚洲va天堂va国产va久| 午夜精品一区二区三区三上悠亚| 午夜私人影院久久久久| 免费在线一区观看| 狠狠色丁香婷婷综合| 国产aⅴ综合色| www.亚洲免费av| 一道本成人在线| 欧美日韩一区二区三区视频 | 亚洲免费观看高清| 亚洲久本草在线中文字幕| 亚洲乱码国产乱码精品精小说| 亚洲综合一区二区三区| 五月婷婷激情综合网| 青青草91视频| 国产精品996| 97精品久久久久中文字幕| 欧洲亚洲国产日韩| 欧美一卡2卡3卡4卡| 久久久久国产精品麻豆| 国产区在线观看成人精品| 亚洲人成亚洲人成在线观看图片| 午夜a成v人精品| 激情久久五月天| 99精品在线观看视频| 欧美日韩国产色站一区二区三区| 日韩无一区二区| 国产精品欧美精品| 亚洲高清一区二区三区| 精品一区二区三区在线播放| 不卡视频一二三| 91精品福利在线一区二区三区 | 成人欧美一区二区三区黑人麻豆| 亚洲精品欧美综合四区| 久草这里只有精品视频| 99国产精品久久久久久久久久| 欧美精品成人一区二区三区四区| 久久影院视频免费| 一区二区三区四区在线免费观看 | 亚洲成人中文在线| 国产精品18久久久久久久久 | 狠狠色丁香久久婷婷综| 91久久人澡人人添人人爽欧美| 日韩一区二区三区高清免费看看| 中文字幕在线观看一区| 人人爽香蕉精品| 91啦中文在线观看| 久久无码av三级| 亚洲bdsm女犯bdsm网站| 成人综合激情网| 3751色影院一区二区三区| 国产精品久久久久影视| 美腿丝袜一区二区三区| 91国偷自产一区二区三区观看 | 国产在线播精品第三| 在线观看日韩av先锋影音电影院| 国产亚洲成年网址在线观看| 亚洲成人你懂的| caoporm超碰国产精品| 久久综合色播五月| 视频在线观看91| 色欧美88888久久久久久影院| ww亚洲ww在线观看国产| 午夜欧美在线一二页| 色美美综合视频| 一区二区中文字幕在线| 国产资源在线一区| 日韩视频免费观看高清完整版| 亚洲自拍偷拍av| 色综合天天综合在线视频| 国产精品久久久久久久久果冻传媒 | 国产视频视频一区| 蜜桃视频免费观看一区| 欧美美女视频在线观看| 一级中文字幕一区二区| 色综合久久综合| 亚洲精品国产一区二区精华液 | 在线视频一区二区三| 国产精品对白交换视频| 国产美女一区二区| 欧美变态tickling挠脚心| 日本视频在线一区| 8x8x8国产精品| 亚洲成国产人片在线观看| 欧美色男人天堂| 亚洲国产毛片aaaaa无费看| 91麻豆国产香蕉久久精品| 亚洲男同性恋视频| 欧洲另类一二三四区| 亚洲永久精品大片| 欧美日韩视频在线一区二区| 午夜精品福利视频网站| 在线成人高清不卡| 麻豆国产精品官网| 久久久久国产成人精品亚洲午夜| 国产精品一区二区你懂的| 国产欧美日韩精品a在线观看| 国产电影一区在线| 国产精品超碰97尤物18| 91片黄在线观看| 性久久久久久久久久久久| 这里只有精品电影| 经典三级视频一区| 国产偷v国产偷v亚洲高清 | 欧美亚洲动漫制服丝袜| 亚洲影视在线观看| 91精品欧美一区二区三区综合在| 免费看日韩精品| 久久精品亚洲麻豆av一区二区| 丰满白嫩尤物一区二区| 亚洲欧洲日韩综合一区二区| 欧美最猛性xxxxx直播| 丝袜国产日韩另类美女| 精品国内片67194| 不卡一区二区中文字幕| 香蕉影视欧美成人| 精品国产凹凸成av人网站| 成人教育av在线| 亚洲电影中文字幕在线观看| 欧美大片一区二区| av激情亚洲男人天堂| 午夜欧美电影在线观看|