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

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

?? os_task.c

?? UCOS-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_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] == 0) {
        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
*              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一区二区三区免费野_久草精品视频
99久久er热在这里只有精品15| 日韩av不卡一区二区| 粉嫩嫩av羞羞动漫久久久 | 成人黄色a**站在线观看| 日本一区二区免费在线观看视频| 国产成人午夜电影网| 国产蜜臀97一区二区三区| 成人不卡免费av| 一区二区三区精品视频在线| 91精品国产一区二区| 韩国午夜理伦三级不卡影院| 国产精品污网站| 91传媒视频在线播放| 偷拍一区二区三区四区| 欧美xfplay| av在线综合网| 日韩综合小视频| 久久丝袜美腿综合| 91麻豆福利精品推荐| 天堂av在线一区| 日本一区二区三区四区在线视频 | 国产精品美女久久久久久久久久久| 北岛玲一区二区三区四区| 亚洲主播在线观看| 2023国产精华国产精品| 一本大道综合伊人精品热热 | 精品免费国产一区二区三区四区| 国产乱码精品一区二区三区忘忧草 | 亚洲精品中文字幕在线观看| 欧美日韩免费电影| 国产一区二区三区四区五区美女| 国产精品国产三级国产有无不卡| 在线观看91精品国产入口| 韩日欧美一区二区三区| 亚洲久草在线视频| 久久免费精品国产久精品久久久久| 91污在线观看| 久久精品国产亚洲aⅴ| 自拍偷拍欧美激情| 日韩精品一区二区三区在线观看| 99久久综合精品| 免费人成黄页网站在线一区二区| 国产精品久久久久久久久快鸭 | 日本在线不卡视频| 国产精品理论片在线观看| 日韩午夜在线观看| 精品裸体舞一区二区三区| 日本伦理一区二区| 国产成人h网站| 日韩激情一二三区| 一区二区三区丝袜| 国产精品三级视频| 久久久久久久久97黄色工厂| 精品视频在线看| 成人精品亚洲人成在线| 理论片日本一区| 亚洲大尺度视频在线观看| 综合欧美亚洲日本| 欧美激情中文字幕| 国产香蕉久久精品综合网| 欧美福利一区二区| 在线视频欧美精品| 91丝袜高跟美女视频| 国产精品99久久久久久有的能看| 日本不卡一区二区三区高清视频| 一区二区三区日韩精品| 亚洲精品国久久99热| 国产精品卡一卡二| 亚洲国产高清在线| 欧美韩日一区二区三区| 精品国产污污免费网站入口 | 欧洲精品中文字幕| 日本韩国一区二区三区视频| 成人v精品蜜桃久久一区| 韩国三级在线一区| 久久精品免费看| 久久精品国产一区二区三区免费看| 婷婷综合久久一区二区三区| 亚洲成人激情av| 午夜激情一区二区| 日本一区中文字幕| 日韩av电影天堂| 美国毛片一区二区三区| 久久精品二区亚洲w码| 久久国产精品99久久久久久老狼 | 久久九九久久九九| 国产亚洲一区二区在线观看| 国产午夜一区二区三区| 中文幕一区二区三区久久蜜桃| 国产日韩欧美精品综合| 亚洲国产岛国毛片在线| 亚洲欧美日本韩国| 亚洲国产精品久久久久秋霞影院| 亚瑟在线精品视频| 免费观看一级欧美片| 亚洲午夜久久久久中文字幕久| 国产视频亚洲色图| 国产精品不卡在线| 自拍视频在线观看一区二区| 国产精品三级av| 亚洲视频电影在线| 中文字幕制服丝袜成人av| 国产精品入口麻豆九色| 亚洲国产精品传媒在线观看| 国产精品盗摄一区二区三区| 国产精品成人在线观看| 欧美经典一区二区三区| 一区二区三区四区高清精品免费观看| 亚洲色欲色欲www在线观看| 亚洲综合成人在线视频| 亚洲va欧美va人人爽| 免费欧美在线视频| 精品在线视频一区| 国产精品一二三在| 成人激情av网| 日本精品一区二区三区高清 | 国产精品久久久久一区| 亚洲在线观看免费视频| 日韩高清一区在线| 激情久久五月天| 波多野结衣在线一区| 91免费版在线| 色综合久久综合中文综合网| 精品少妇一区二区三区日产乱码| 国产欧美精品在线观看| 一区二区在线观看免费视频播放| 亚洲小少妇裸体bbw| 精品一区二区三区在线观看国产 | 一区二区三区日韩在线观看| 五月天网站亚洲| 美女一区二区三区在线观看| 99久久精品国产一区| 欧美剧在线免费观看网站| www国产成人| 亚洲在线免费播放| 国产精品99久久久久久宅男| 7777精品伊人久久久大香线蕉 | 欧美日产国产精品| 日韩一级精品视频在线观看| 久久综合资源网| 亚洲五月六月丁香激情| 国产精品456露脸| 欧美午夜精品一区二区三区| 久久久久久一级片| 亚洲另类中文字| av动漫一区二区| 日韩视频不卡中文| 亚洲黄色在线视频| 国产一区美女在线| 欧美日韩成人一区| 亚洲激情自拍偷拍| 成人免费av在线| 日韩一卡二卡三卡| 亚洲精品成人a在线观看| 国产mv日韩mv欧美| 久久精品欧美一区二区三区不卡 | 91麻豆精品国产综合久久久久久| 亚洲国产精品v| 久久国产乱子精品免费女| 欧美日韩另类一区| 亚洲欧美国产77777| 国产精品一色哟哟哟| 欧美精品色综合| 亚洲天天做日日做天天谢日日欢| 国产91综合网| 久久久久久综合| 美国十次了思思久久精品导航| 欧美天天综合网| 亚洲综合色自拍一区| 97久久精品人人做人人爽50路| 久久久精品免费免费| 久久国产尿小便嘘嘘尿| 91.xcao| 日产精品久久久久久久性色| 色拍拍在线精品视频8848| 国产精品天美传媒| 国产成人在线免费| 久久久久久久久久久电影| 盗摄精品av一区二区三区| 久久综合色综合88| 国产一区二区三区香蕉| 日韩欧美不卡在线观看视频| 免费观看在线综合| 国产香蕉久久精品综合网| 国产精品亚洲第一区在线暖暖韩国 | 亚洲乱码国产乱码精品精的特点| 精品在线免费观看| 国产精品视频一二三区| 国产69精品久久777的优势| 国产精品天天摸av网| 成人av先锋影音| 国产精品久久久爽爽爽麻豆色哟哟| 国产精品888| 1024亚洲合集| 中文字幕一区二区三区在线播放| 精品无人区卡一卡二卡三乱码免费卡| 在线观看中文字幕不卡| 夜夜嗨av一区二区三区网页 | 精品一区二区三区在线播放 | 欧美激情综合五月色丁香|