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

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

?? os_task.c

?? 在IAR EWARM開發(fā)環(huán)境下的ucos_2操作系統(tǒng)在LPC2200上的應(yīng)用
?? 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人猛片aaaaaaa| 欧美日韩国产乱码电影| 日韩专区在线视频| 自拍偷拍欧美精品| 怡红院av一区二区三区| 一区二区三区在线免费| 亚洲午夜av在线| 亚洲国产wwwccc36天堂| 日本视频中文字幕一区二区三区| 丝袜美腿亚洲色图| 精品一区二区三区在线观看| 国产一区二三区| 国产乱子伦一区二区三区国色天香| 国产一区二区三区四区在线观看| 国产乱子伦视频一区二区三区 | 在线观看一区二区视频| 国产美女精品人人做人人爽| 韩国理伦片一区二区三区在线播放| 国内不卡的二区三区中文字幕| 国产永久精品大片wwwapp | 精品国产露脸精彩对白| 久久久久久久久久美女| 国产精品妹子av| 一区二区三区色| 日韩精品一二三| 久久国产三级精品| 91首页免费视频| 欧美日韩第一区日日骚| 久久夜色精品一区| 伊人色综合久久天天| 日本成人超碰在线观看| 成人小视频免费观看| 欧美性videosxxxxx| 欧美哺乳videos| 亚洲欧美一区二区三区国产精品 | 石原莉奈在线亚洲二区| 国产一区二区在线看| 91首页免费视频| 日韩精品一区二区三区视频在线观看| 国产三级一区二区| 午夜视频一区在线观看| 国产乱人伦偷精品视频不卡| 在线一区二区三区四区五区| 精品国免费一区二区三区| 一区精品在线播放| 精品一区中文字幕| 欧洲另类一二三四区| 国产午夜久久久久| 日韩av高清在线观看| 一本到不卡精品视频在线观看| 欧美午夜宅男影院| 中文字幕亚洲不卡| 国产原创一区二区| 欧美三级在线播放| 亚洲乱码一区二区三区在线观看| 精品一区二区成人精品| 欧美三级资源在线| 一区二区久久久| 国产精品资源在线看| 日韩区在线观看| 午夜视频在线观看一区二区 | 色琪琪一区二区三区亚洲区| 久久色在线视频| 美女www一区二区| 欧美精品乱码久久久久久| 中文字幕一区视频| 成人永久aaa| 久久先锋影音av鲁色资源| 麻豆视频观看网址久久| 欧美视频在线一区| 一区二区三区在线观看动漫 | 精品福利一区二区三区免费视频| 欧美三级韩国三级日本一级| 欧美高清在线精品一区| 日本特黄久久久高潮| 欧美三级视频在线播放| 不卡一卡二卡三乱码免费网站| 2023国产精华国产精品| 色94色欧美sute亚洲线路一ni| 日韩av不卡在线观看| 中文字幕在线不卡一区二区三区| 欧美放荡的少妇| 91玉足脚交白嫩脚丫在线播放| 日本亚洲天堂网| 亚洲人成网站在线| 久久久亚洲精品石原莉奈 | 日韩三级视频在线观看| av电影一区二区| 激情综合色丁香一区二区| 亚洲精品老司机| 国产精品无码永久免费888| 91精品国产一区二区三区| 99视频有精品| 国产成人综合在线观看| 免费观看久久久4p| 亚洲高清视频的网址| 亚洲国产精品99久久久久久久久| 欧美xxxxx牲另类人与| 欧美在线不卡视频| 91视频国产观看| 成人黄色综合网站| 国产真实精品久久二三区| 视频一区二区不卡| 亚洲成av人片在线| 91在线视频观看| 日本一区二区综合亚洲| 久久久久久久网| 2023国产精华国产精品| 精品国产一区久久| 日韩美女在线视频| 日韩一区二区三区四区| 777欧美精品| 欧美日本不卡视频| 欧美日韩中文精品| 欧美日韩综合在线| 欧美高清激情brazzers| 欧美丝袜丝交足nylons图片| 日本电影欧美片| 在线国产电影不卡| 欧美人与z0zoxxxx视频| 欧美精品少妇一区二区三区| 欧美二区在线观看| 欧美一区二区三区精品| 日韩精品一区在线| 久久综合久久99| 国产精品三级在线观看| 综合自拍亚洲综合图不卡区| 亚洲免费大片在线观看| 一区二区视频免费在线观看| 亚洲国产日产av| 男女性色大片免费观看一区二区| 蜜桃在线一区二区三区| 国产精品123| 91免费版pro下载短视频| 在线观看av不卡| 欧美一区在线视频| 久久嫩草精品久久久精品| 亚洲欧洲av色图| 亚洲午夜视频在线观看| 青青青伊人色综合久久| 国产在线播放一区三区四| 成人在线视频一区| 欧美在线视频不卡| 精品毛片乱码1区2区3区 | 亚洲欧洲韩国日本视频| 亚洲一区二区三区美女| 免费看精品久久片| 成人在线综合网站| 欧美人与z0zoxxxx视频| 精品国产一区二区三区不卡 | 国产精品美女久久久久aⅴ国产馆| 亚洲视频在线观看三级| 婷婷久久综合九色综合绿巨人| 激情六月婷婷久久| 色一区在线观看| 日韩欧美国产电影| 亚洲另类色综合网站| 麻豆精品久久久| 91片在线免费观看| 精品日韩一区二区三区| 一区二区三区四区视频精品免费| 日本成人在线网站| 色综合中文综合网| 国产精品毛片高清在线完整版| 亚洲图片自拍偷拍| 国产成人综合网| 欧美剧情电影在线观看完整版免费励志电影 | 亚洲欧美国产77777| 久久99精品久久久| 欧美性大战xxxxx久久久| 久久久天堂av| 日本麻豆一区二区三区视频| 一本大道久久a久久综合婷婷 | 欧美日韩国产精品成人| 国产精品无遮挡| 国产在线精品不卡| 欧美一区二区三区播放老司机| 亚洲日本韩国一区| 成人性生交大片免费看中文 | 久久麻豆一区二区| 日韩中文欧美在线| 色素色在线综合| 亚洲私人影院在线观看| 国产成人av一区| 久久日韩精品一区二区五区| 日韩av一二三| 欧美日韩美女一区二区| 亚洲综合色成人| 在线视频中文字幕一区二区| 中文字幕在线不卡一区| 成人一级片网址| 国产目拍亚洲精品99久久精品| 精品综合免费视频观看| 欧美一级片免费看| 日韩国产精品久久久| 欧美老女人在线| 日本在线不卡一区| 91精品国产美女浴室洗澡无遮挡| 亚洲高清免费视频| 欧美久久久久久蜜桃|