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

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

?? os_task.c

?? ucou-II最婦最全的源文件,里面的文件用英文注解
?? 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一区二区三区免费野_久草精品视频
精品日本一线二线三线不卡| 麻豆91小视频| 99视频有精品| 亚洲视频一二三区| 99久久99久久精品国产片果冻| 中文字幕电影一区| 色老汉一区二区三区| 亚洲www啪成人一区二区麻豆| 欧美群妇大交群的观看方式| 欧美日韩一区二区三区高清| 午夜成人免费电影| 精品不卡在线视频| 成人app在线| 亚洲成精国产精品女| 日韩你懂的电影在线观看| 国产一区在线不卡| 自拍偷拍亚洲欧美日韩| 欧美日韩综合在线| 国产资源精品在线观看| 国产精品国产三级国产aⅴ入口| 一本到不卡免费一区二区| 婷婷夜色潮精品综合在线| 26uuu国产一区二区三区| av不卡在线观看| 午夜精品一区二区三区免费视频| 精品国产免费久久| 91美女片黄在线| 奇米色一区二区| 国产婷婷色一区二区三区在线| 91精品办公室少妇高潮对白| 老司机精品视频导航| 国产精品不卡在线观看| 91麻豆精品国产91久久久| 国产精品一区二区你懂的| 亚洲靠逼com| 久久网站热最新地址| 91久久精品网| 国产成人精品影院| 亚洲成av人片在线| 中文字幕中文字幕一区二区| 欧美一级黄色片| 色悠悠久久综合| 国产精品一品二品| 五月天丁香久久| 亚洲黄色免费电影| 国产精品无遮挡| 日韩欧美中文字幕一区| 91黄色激情网站| 成人性生交大片免费看视频在线| 天使萌一区二区三区免费观看| 国产精品国产三级国产三级人妇 | 日本三级亚洲精品| 国产精品另类一区| 欧美精品一区二区三| 制服丝袜成人动漫| 欧美日韩一区在线观看| av不卡免费电影| 国产成人综合在线| 久久99精品久久久久婷婷| 亚洲午夜电影在线观看| ...xxx性欧美| 国产精品免费丝袜| 国产视频亚洲色图| 久久影音资源网| 日韩欧美激情一区| 欧美一区二区在线免费观看| 在线观看国产日韩| 91视频.com| 92精品国产成人观看免费| 成人午夜私人影院| 国产黄人亚洲片| 国产成人综合在线观看| 韩国精品久久久| 久久激情综合网| 久久99精品久久只有精品| 裸体健美xxxx欧美裸体表演| 日本免费新一区视频| 日韩精品一二区| 日本女优在线视频一区二区| 日韩成人dvd| 日韩精品每日更新| 青青青爽久久午夜综合久久午夜| 成人国产精品视频| 99久久精品国产一区二区三区 | 国内精品自线一区二区三区视频| 日韩1区2区3区| 免费在线观看视频一区| 久久国产婷婷国产香蕉| 久久99国产精品成人| 国产精品一区二区黑丝| 成人激情小说乱人伦| 99久久久久久| 欧美日韩在线不卡| 日韩欧美一区二区在线视频| 欧美精品一区二区三区视频| 国产三级一区二区| 日韩美女啊v在线免费观看| 一区二区高清免费观看影视大全| 亚洲高清免费一级二级三级| 日本不卡视频在线| 国产成人精品影院| 日本精品视频一区二区| 制服丝袜日韩国产| 久久精品人人做人人综合| 中文字幕一区日韩精品欧美| 亚洲一区二区成人在线观看| 免费看欧美美女黄的网站| 国产不卡视频一区| 在线观看亚洲精品| 亚洲精品一区二区三区99| 国产精品久久二区二区| 午夜av电影一区| 国产精品中文字幕欧美| 色久综合一二码| 欧美一二三区在线| 国产精品久久二区二区| 日韩精品亚洲一区二区三区免费| 国产精品一区二区在线播放| 色婷婷综合久久| 欧美成人a视频| 亚洲色图色小说| 久久99久久精品欧美| 99re成人精品视频| 欧美成人精品1314www| 亚洲人吸女人奶水| 国产一区二区三区久久久| 色欧美片视频在线观看在线视频| 日韩欧美国产午夜精品| 亚洲欧美日韩国产一区二区三区 | 亚洲一二三级电影| 免费成人在线播放| 色婷婷亚洲综合| 欧美激情一区二区三区在线| 丝袜亚洲精品中文字幕一区| kk眼镜猥琐国模调教系列一区二区| 制服丝袜成人动漫| 一个色妞综合视频在线观看| 久久97超碰色| 欧美丰满一区二区免费视频| 国产精品盗摄一区二区三区| 精品一区二区免费视频| 在线观看91精品国产麻豆| 亚洲婷婷在线视频| 国产精品一区专区| 日韩小视频在线观看专区| 一二三四社区欧美黄| eeuss影院一区二区三区| 久久综合久色欧美综合狠狠| 五月婷婷久久丁香| 在线影视一区二区三区| 国产精品不卡视频| 成人深夜福利app| 国产亚洲欧美日韩日本| 久久99国产精品麻豆| 7777精品伊人久久久大香线蕉完整版| 亚洲人吸女人奶水| 91在线观看一区二区| 国产精品国产三级国产普通话99| 国产揄拍国内精品对白| 日韩精品最新网址| 久久精品国产亚洲一区二区三区 | 色婷婷国产精品久久包臀| 国产亚洲1区2区3区| 国产美女久久久久| 26uuu成人网一区二区三区| 精品一区免费av| 日韩精品一区二区三区四区视频| 日韩av高清在线观看| 777欧美精品| 麻豆精品一区二区av白丝在线| 欧美日韩国产高清一区| 天堂av在线一区| 日韩一区二区三区精品视频| 免费成人在线观看视频| 日韩三级视频中文字幕| 精一区二区三区| 精品1区2区在线观看| 国产在线看一区| 久久久不卡网国产精品一区| 国产精品亚洲а∨天堂免在线| 久久久91精品国产一区二区精品| 国产一区在线观看视频| 国产农村妇女毛片精品久久麻豆| 懂色av中文字幕一区二区三区 | 亚洲久草在线视频| 欧美色图激情小说| 天天操天天色综合| 日韩欧美久久久| 国产九色精品成人porny| 日本一区二区三区在线不卡 | 日本电影欧美片| 亚洲国产一二三| 精品剧情在线观看| 国产成人精品影视| 亚洲乱码国产乱码精品精98午夜| 欧美在线观看18| 精品一区二区三区在线观看 | 国产综合色在线| 中文字幕亚洲一区二区va在线| 欧美在线看片a免费观看|