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

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

?? os_task.c

?? Micrium-uCOS-II 2.86版
?? C
?? 第 1 頁 / 共 4 頁
字號:
                }
            } else {
                OS_EXIT_CRITICAL();
            }
        } else {                                              /* Must be pending on event              */
            OS_EXIT_CRITICAL();
        }
        return (OS_ERR_NONE);
    }
    OS_EXIT_CRITICAL();
    return (OS_ERR_TASK_NOT_SUSPENDED);
}
#endif
/*$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_ERR_NONE            upon success
*              OS_ERR_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_ERR_TASK_NOT_EXIST  if the desired task has not been created or is assigned to a Mutex PIP
*              OS_ERR_TASK_OPT        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_STAT_STK_CHK_EN > 0) && (OS_TASK_CREATE_EXT_EN > 0)
INT8U  OSTaskStkChk (INT8U prio, OS_STK_DATA *p_stk_data)
{
    OS_TCB    *ptcb;
    OS_STK    *pchk;
    INT32U     nfree;
    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_ERR_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_ERR_TASK_NOT_EXIST);
    }
    if (ptcb == OS_TCB_RESERVED) {
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);
    }
    if ((ptcb->OSTCBOpt & OS_TASK_OPT_STK_CHK) == 0) { /* Make sure stack checking option is set       */
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_OPT);
    }
    nfree = 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 */
        nfree++;
    }
#else
    while (*pchk-- == (OS_STK)0) {
        nfree++;
    }
#endif
    p_stk_data->OSFree = nfree * sizeof(OS_STK);          /* Compute number of free bytes on the stack */
    p_stk_data->OSUsed = (size - nfree) * sizeof(OS_STK); /* Compute number of bytes used on the stack */
    return (OS_ERR_NONE);
}
#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_ERR_NONE               if the requested task is suspended
*              OS_ERR_TASK_SUSPEND_IDLE  if you attempted to suspend the idle task which is not allowed.
*              OS_ERR_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_ERR_TASK_SUSPEND_PRIO  if the task to suspend does not exist
*              OS_ERR_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_ERR_TASK_SUSPEND_IDLE);
    }
    if (prio >= OS_LOWEST_PRIO) {                               /* Task priority valid ?               */
        if (prio != OS_PRIO_SELF) {
            return (OS_ERR_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_ERR_TASK_SUSPEND_PRIO);
    }
    if (ptcb == OS_TCB_RESERVED) {                              /* See if assigned to Mutex            */
        OS_EXIT_CRITICAL();
        return (OS_ERR_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();                                             /* Find new highest priority task      */
    }
    return (OS_ERR_NONE);
}
#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_ERR_NONE            if the requested task is suspended
*              OS_ERR_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_ERR_PRIO            if the desired task has not been created
*              OS_ERR_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_ERR_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_ERR_PRIO);
    }
    if (ptcb == OS_TCB_RESERVED) {               /* Task to query must not be assigned to a Mutex      */
        OS_EXIT_CRITICAL();
        return (OS_ERR_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_ERR_NONE);
}
#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_STAT_STK_CHK_EN > 0) && (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一区二区三区免费野_久草精品视频
日日摸夜夜添夜夜添亚洲女人| 福利电影一区二区| 亚洲在线成人精品| 亚洲人吸女人奶水| 日韩美女视频19| 中文字幕av资源一区| 久久久久久久电影| 国产精品美女久久久久久2018| 久久九九久久九九| 国产欧美一区二区三区在线看蜜臀| 国产日韩欧美制服另类| 26uuu国产电影一区二区| 2020国产精品自拍| 国产亚洲制服色| 中文字幕av在线一区二区三区| 国产精品久久久久aaaa樱花| 国产精品欧美久久久久无广告| 中文字幕一区三区| 亚洲夂夂婷婷色拍ww47| 亚洲成年人网站在线观看| 亚洲成人动漫精品| 美洲天堂一区二卡三卡四卡视频| 蜜桃91丨九色丨蝌蚪91桃色| 国产麻豆日韩欧美久久| 成人免费观看视频| 91色在线porny| 欧美日韩一区二区三区四区五区| 91精品福利在线一区二区三区 | 波多野结衣91| 日本大香伊一区二区三区| 欧美性感一区二区三区| 欧美一区二区精品久久911| 久久亚洲综合av| 国产精品毛片高清在线完整版| 亚洲欧美日韩中文播放| 日日骚欧美日韩| 国产麻豆欧美日韩一区| 日本丰满少妇一区二区三区| 7777精品伊人久久久大香线蕉最新版| 精品国产伦一区二区三区观看方式 | 91国偷自产一区二区开放时间 | 91精品国产乱码久久蜜臀| 久久五月婷婷丁香社区| 亚洲人成在线观看一区二区| 一本色道久久综合亚洲aⅴ蜜桃| 欧美在线啊v一区| 精品久久久久久综合日本欧美| 中文字幕av免费专区久久| 亚洲一区二区在线免费观看视频| 免费高清不卡av| 99视频精品在线| 欧美一区二区在线不卡| 国产精品久久久久三级| 天堂成人国产精品一区| 成人丝袜18视频在线观看| 欧美精品九九99久久| 中文字幕电影一区| 蜜臀av性久久久久av蜜臀妖精| 国产成人精品影视| 337p亚洲精品色噜噜狠狠| 国产日韩欧美精品综合| 午夜精品视频在线观看| 不卡视频免费播放| 日韩网站在线看片你懂的| 亚洲免费视频中文字幕| 国产精华液一区二区三区| 欧美日韩免费视频| 亚洲欧洲韩国日本视频| 国产在线看一区| 欧美乱妇15p| 亚洲天堂精品视频| 国产精一品亚洲二区在线视频| 欧美色男人天堂| 国产精品久久久久桃色tv| 久久99精品国产.久久久久| 欧美吻胸吃奶大尺度电影 | 国产成人av影院| 正在播放亚洲一区| 亚洲一区二区精品久久av| 成人综合在线网站| 久久久五月婷婷| 麻豆成人av在线| 欧美日韩国产综合一区二区| 亚洲欧洲日产国产综合网| 国产黄人亚洲片| 日韩你懂的在线播放| 婷婷夜色潮精品综合在线| 色婷婷亚洲精品| 中文字幕中文在线不卡住| 国产99久久久国产精品潘金 | 国产精品影视在线| 91精品国产综合久久蜜臀| 日韩精品一级中文字幕精品视频免费观看 | 久久欧美中文字幕| 亚洲精品你懂的| 99在线精品视频| 国产精品麻豆视频| 国产成人自拍网| 精品国产伦一区二区三区免费 | 一本色道久久综合亚洲aⅴ蜜桃| 欧美激情一区二区在线| 国产精品一线二线三线精华| 26uuu欧美日本| 国产在线播放一区二区三区| 精品国产不卡一区二区三区| 九一九一国产精品| 日韩精品在线一区| 麻豆91精品91久久久的内涵| 日韩女优av电影在线观看| 蜜臀av一区二区三区| 日韩一区二区三| 美国三级日本三级久久99| 日韩精品中午字幕| 久久99久久99小草精品免视看| 日韩精品一区二区在线观看| 久久成人综合网| 2023国产精品| 成人小视频免费观看| 中文字幕欧美一区| 91麻豆国产精品久久| 亚洲成a天堂v人片| 欧美丰满少妇xxxbbb| 麻豆精品在线视频| 久久久美女毛片| 成人免费福利片| 亚洲欧美另类小说视频| 欧美性生活大片视频| 日韩**一区毛片| 精品久久久久av影院| 东方aⅴ免费观看久久av| 亚洲欧美中日韩| 欧美日韩一区久久| 久久se精品一区二区| 国产精品一级片在线观看| 中文字幕 久热精品 视频在线| av一二三不卡影片| 国产91在线观看| 国产精品一二三四五| 国产精品一线二线三线| 成人福利视频在线| 色八戒一区二区三区| 国产成人午夜精品影院观看视频| 久久99热这里只有精品| 国产精品久久久久久久久搜平片 | 欧美一区欧美二区| 国内成人免费视频| 亚洲人成影院在线观看| 欧美一区二区三区的| 国产91在线|亚洲| 亚洲成人精品一区| 国产欧美一区二区精品忘忧草| 色视频一区二区| 久久精品国产**网站演员| 椎名由奈av一区二区三区| 日韩一区二区在线免费观看| 国产经典欧美精品| 午夜精品福利在线| 日本一二三四高清不卡| 欧美日韩国产在线观看| 久久综合九色综合欧美亚洲| 99久久精品国产网站| 蜜臀久久99精品久久久久宅男| 中文字幕日本乱码精品影院| 日韩欧美高清dvd碟片| 99久久免费视频.com| 免费成人你懂的| 亚洲精品第1页| 国产网站一区二区三区| 欧美日韩成人高清| 成人av影院在线| 美女视频一区在线观看| 亚洲自拍偷拍网站| 欧美激情中文字幕| 日韩欧美一级二级三级| 91成人免费网站| 成人自拍视频在线| 久久精品久久精品| 午夜精品成人在线| 亚洲色图欧洲色图| 欧美激情一二三区| 精品国产一区二区在线观看| 欧美日韩在线电影| 91在线视频网址| 国产成人在线视频网址| 玖玖九九国产精品| 亚洲超碰97人人做人人爱| 亚洲日本免费电影| 国产精品污www在线观看| 欧美zozo另类异族| 在线综合视频播放| 欧美系列亚洲系列| 色综合天天做天天爱| 99精品视频一区二区| 国产91丝袜在线播放0| 久久9热精品视频| 麻豆视频一区二区| 日韩高清中文字幕一区| 亚洲第一二三四区| 午夜久久久久久久久久一区二区| 一区二区三区色|