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

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

?? os_task.c

?? UCOS2.83移植的s3c44b0x的最終版,如果那為燒友有好的建議請EMAIL我,不勝感激!
?? C
?? 第 1 頁 / 共 4 頁
字號:
*********************************************************************************************************
*                                             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_TASK_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 = OS_TRUE;
    } else if (prio == OSTCBCur->OSTCBPrio) {                   /* See if suspending self              */
        self = OS_TRUE;
    } else {
        self = OS_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 == OS_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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
懂色av一区二区夜夜嗨| 蜜桃视频第一区免费观看| 欧美唯美清纯偷拍| 国产在线精品国自产拍免费| 天堂久久一区二区三区| 欧美激情一区三区| 不卡一区二区中文字幕| 成人国产精品免费观看动漫| 日韩黄色一级片| 中文字幕免费不卡在线| 日韩午夜av电影| 国内精品久久久久影院薰衣草| 另类中文字幕网| 亚洲欧美日韩人成在线播放| 欧美在线影院一区二区| 成人在线视频一区二区| 免费在线观看一区| 成人免费三级在线| 97久久精品人人做人人爽50路| 日本亚洲免费观看| 亚洲成人三级小说| 一区二区三区色| 《视频一区视频二区| 91麻豆精品国产91| 色欧美片视频在线观看在线视频| 国产成a人亚洲| 国产尤物一区二区| 琪琪久久久久日韩精品| 亚洲图片激情小说| 日韩高清中文字幕一区| 亚洲va中文字幕| 亚洲国产精品视频| 亚洲你懂的在线视频| 欧美一区二区日韩| 国产香蕉久久精品综合网| 欧美大黄免费观看| 欧美成人乱码一区二区三区| 欧美日韩亚州综合| 欧美网站大全在线观看| 亚洲女与黑人做爰| 国产精品国产a级| 精品国产亚洲在线| 日韩手机在线导航| 91精品国产91热久久久做人人 | 在线精品视频免费播放| 亚洲第一成人在线| 五月天视频一区| 久久婷婷色综合| 欧美一区二区二区| 成人免费毛片嘿嘿连载视频| 亚洲123区在线观看| 亚洲香蕉伊在人在线观| 亚洲卡通动漫在线| 亚洲人成伊人成综合网小说| 亚洲图片激情小说| 亚洲自拍偷拍综合| 日韩高清在线一区| 性做久久久久久免费观看欧美| 韩国在线一区二区| 成人av第一页| 色琪琪一区二区三区亚洲区| 欧美日韩国产片| 91污片在线观看| 精品日韩欧美一区二区| 久久久久国产精品麻豆| 中文字幕一区二区三区四区| 亚洲日本欧美天堂| 午夜电影久久久| 国产精品污污网站在线观看| 亚洲精品成人少妇| 中文字幕中文乱码欧美一区二区 | 奇米一区二区三区av| 国产精品一区二区男女羞羞无遮挡 | 精品一区二区三区在线播放视频 | 91农村精品一区二区在线| 久久99精品网久久| 国产一区二区三区日韩| 亚洲制服丝袜在线| 日韩精品三区四区| 精品一区二区成人精品| 成人久久久精品乱码一区二区三区| bt7086福利一区国产| 欧美伦理视频网站| 久久久99免费| 午夜欧美2019年伦理| 午夜精品一区二区三区免费视频| 国产乱色国产精品免费视频| 在线精品视频小说1| 欧美xxxx老人做受| 亚洲欧美成aⅴ人在线观看| 中文在线资源观看网站视频免费不卡| 免费观看一级欧美片| caoporn国产一区二区| 制服丝袜中文字幕一区| 中文天堂在线一区| 五月婷婷欧美视频| 国产不卡视频在线观看| 欧美日韩一区二区三区高清| 国产亚洲精品超碰| 亚洲五月六月丁香激情| 国产精品一区二区果冻传媒| 欧美无砖专区一中文字| 国产亚洲精品福利| 日本午夜一区二区| 粉嫩aⅴ一区二区三区四区五区| 91精品国产综合久久久久久| 中文字幕日本不卡| 国产在线精品一区二区夜色 | 成人性视频免费网站| 久久精品一级爱片| 亚洲成av人**亚洲成av**| 亚洲精品视频一区二区| 国产91丝袜在线观看| 不卡的av在线播放| 亚洲久本草在线中文字幕| 国产一区福利在线| 欧美一区二区在线免费观看| |精品福利一区二区三区| 99久久国产综合色|国产精品| 精品国产一区二区三区四区四| 国产午夜精品一区二区三区嫩草| 久久se精品一区二区| 免费欧美在线视频| 精品国产麻豆免费人成网站| 日韩高清在线不卡| 久久精品综合网| 91伊人久久大香线蕉| 亚洲欧美偷拍另类a∨色屁股| 99久久免费视频.com| 亚洲精品免费在线观看| 欧美三级乱人伦电影| 五月天激情综合| 精品久久人人做人人爽| 国产乱码精品一区二区三| 精品成人私密视频| 成人午夜免费av| 亚洲人成在线播放网站岛国| 日韩欧美第一区| 欧美在线视频日韩| 久久久精品免费观看| 欧美性一级生活| 久久国产精品99久久人人澡| 91亚洲国产成人精品一区二区三| 亚洲人123区| 日本vs亚洲vs韩国一区三区二区 | 欧美日韩卡一卡二| 九九国产精品视频| 精品国产制服丝袜高跟| 视频在线在亚洲| 欧美精品国产精品| 全部av―极品视觉盛宴亚洲| 成人小视频免费观看| 一区二区三区自拍| 在线精品视频免费播放| 亚洲国产综合在线| 欧美精品在线观看播放| 日本欧美肥老太交大片| 欧美三级一区二区| 国产一区二区精品久久91| 日本不卡不码高清免费观看| 亚洲欧洲一区二区三区| 国产欧美一区在线| 成人国产精品免费| 国产中文字幕一区| 午夜a成v人精品| 日韩二区三区四区| 成人一级视频在线观看| 在线看一区二区| 精品理论电影在线观看 | 波多野结衣中文字幕一区| 91麻豆精东视频| 欧美videofree性高清杂交| 久久久高清一区二区三区| 亚洲制服丝袜一区| 成人天堂资源www在线| 日本精品一级二级| 亚洲精品在线免费观看视频| 亚洲三级电影网站| 国产福利一区在线| 欧美日韩高清一区二区三区| 中文字幕精品三区| 美腿丝袜一区二区三区| 欧美日本不卡视频| 亚洲伦理在线精品| 国产成人精品三级| 中文字幕一区二区三区视频| www.久久久久久久久| 亚洲国产精品精华液2区45| 亚洲va韩国va欧美va| 欧美日韩日日夜夜| 五月激情综合色| 欧美激情综合网| 丁香网亚洲国际| 五月天激情小说综合| 欧美性生活大片视频| 国产精品久久久一区麻豆最新章节| 天天综合日日夜夜精品| 国产成人在线免费观看| 精品剧情v国产在线观看在线| 欧美aaa在线|