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

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

?? os_task.c

?? ucCos移植到廣州友善nano2410
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*$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_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
*********************************************************************************************************
*/
#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;



    cpu_sr = 0;                                        /* Prevent compiler warning                     */
#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);
        }
    }
#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;



    cpu_sr = 0;                                                 /* Prevent compiler warning            */
#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] == 0x00) { 
        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
*********************************************************************************************************
*/

#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;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
#if OS_ARG_CHK_EN > 0
    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;
    }
    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久久久久久| 日韩电影一区二区三区| 亚洲国产精品久久不卡毛片| 日韩福利电影在线观看| 成人av免费在线观看| 日韩视频不卡中文| 一区二区三区不卡在线观看| 国内精品免费**视频| 欧美色倩网站大全免费| 中文字幕中文字幕在线一区 | 欧美色网一区二区| 久久久精品蜜桃| 无吗不卡中文字幕| 色婷婷激情久久| 中文字幕不卡的av| 国产成人亚洲综合a∨猫咪| 欧美二区三区的天堂| 亚洲自拍与偷拍| 91在线视频免费观看| 国产日韩v精品一区二区| 日韩成人午夜精品| 欧美日韩午夜精品| 亚洲国产一区视频| 欧美影视一区二区三区| 亚洲激情综合网| 99精品桃花视频在线观看| 久久精品视频网| 狠狠色丁香久久婷婷综合_中| 亚洲欧美在线另类| 国产成人在线免费观看| 精品人在线二区三区| 日韩—二三区免费观看av| 欧美女孩性生活视频| 午夜激情一区二区| 欧美老女人在线| 日韩国产欧美在线视频| 911精品产国品一二三产区| 视频一区在线播放| 欧美一区二区在线观看| 蜜桃一区二区三区四区| 欧美一区二区三区视频在线 | 欧美日韩国产综合一区二区三区 | 日韩欧美高清一区| 麻豆国产一区二区| 久久午夜羞羞影院免费观看| 久久97超碰国产精品超碰| 久久亚洲一级片| 国产老肥熟一区二区三区| 国产日韩欧美高清| 91在线观看污| 亚洲午夜一区二区| 777精品伊人久久久久大香线蕉| 日韩福利视频导航| 久久精品一区四区| 99久久精品国产一区二区三区| 成人免费一区二区三区视频 | 亚洲一区欧美一区| 欧美日韩精品久久久| 久热成人在线视频| 国产精品第四页| 欧美在线免费观看亚洲| 免费观看在线综合| 久久久精品免费观看| 色偷偷88欧美精品久久久| 日韩成人一级大片| 国产精品久线在线观看| 欧美日韩免费观看一区二区三区| 蜜臀91精品一区二区三区| 国产色产综合产在线视频| 色综合天天做天天爱| 免费观看一级欧美片| 国产精品免费视频观看| 欧美日韩另类国产亚洲欧美一级| 韩国欧美国产1区| 亚洲自拍与偷拍| 国产无一区二区| 欧美日韩不卡视频| 国产不卡视频在线观看| 午夜精品久久久久久久久久久| 久久亚洲综合色| 欧美精品三级日韩久久| 成人激情动漫在线观看| 青青草原综合久久大伊人精品优势| 日韩欧美电影在线| 91亚洲国产成人精品一区二三| 免费一区二区视频| 亚洲国产一区二区视频| 国产精品网站在线观看| 欧美一区二区三区在线观看视频| 成人av午夜电影| 欧美日韩亚洲综合一区| 国产精品91一区二区| 日本在线播放一区二区三区| 综合av第一页| 久久精品综合网| 日韩亚洲欧美在线| 在线观看免费亚洲| a级精品国产片在线观看| 国产在线视频一区二区三区| 视频一区免费在线观看| 亚洲一区二区高清| 亚洲欧美日本在线| 国产精品理论在线观看| 久久亚洲私人国产精品va媚药| 91精品国产91久久综合桃花 | 成人app网站| 国产一区二区三区av电影| 日韩中文欧美在线| 日韩极品在线观看| 亚洲成人综合在线| 亚洲成年人影院| 亚洲自拍偷拍av| 亚洲制服丝袜一区| 一区二区三区四区不卡在线 | 一区二区三区鲁丝不卡| 中文字幕一区二区不卡| 国产精品色在线| 亚洲少妇屁股交4| 中文字幕一区二区三区不卡| 中文字幕一区二区三区蜜月| 亚洲欧洲日产国产综合网| 亚洲欧美一区二区三区孕妇| 中文字幕一区二区三区在线播放| 亚洲欧洲日韩综合一区二区| 亚洲女子a中天字幕| 亚洲国产精品综合小说图片区| 亚洲精品乱码久久久久久| 亚洲一区二区三区国产| 日本欧美一区二区| 激情成人综合网| 国产精品一区2区| 成人免费观看av| 91在线视频官网| 欧美午夜电影一区| 日韩写真欧美这视频| 精品美女在线观看| 欧美激情在线免费观看| 中文字幕佐山爱一区二区免费| 一区二区三区日本| 蜜臀av一区二区在线免费观看| 国产一区二区不卡在线| av电影在线观看完整版一区二区| 色综合中文字幕国产 | 国产亚洲视频系列| 中文字幕免费一区| 亚洲影视资源网| 老色鬼精品视频在线观看播放| 精一区二区三区| 成人黄色小视频| 欧美亚洲国产bt| 精品国产髙清在线看国产毛片| 国产欧美精品一区二区色综合| 国模套图日韩精品一区二区 | 欧美喷水一区二区| 久久久久久久电影| 一区二区日韩av| 另类小说视频一区二区| 成人福利电影精品一区二区在线观看| 色婷婷av一区二区三区大白胸| 日韩一区二区三区免费看 | 粉嫩av亚洲一区二区图片| 日本乱人伦一区| 久久综合九色综合欧美98| 最新久久zyz资源站| 麻豆成人久久精品二区三区小说| 成人av网站免费| 日韩一区二区三区四区 | 蜜臀久久久99精品久久久久久| 成人免费看的视频| 欧美久久婷婷综合色| 国产精品国产三级国产aⅴ原创 | 亚洲超碰97人人做人人爱| 国产99一区视频免费| 日韩视频免费观看高清完整版 | 国产区在线观看成人精品| 丝袜亚洲另类欧美| 色综合欧美在线视频区| 国产亚洲精久久久久久| 免费高清视频精品| 日本道在线观看一区二区| 欧美国产精品中文字幕| 精品一区二区三区在线播放视频| 色av综合在线| 亚洲欧洲性图库| 国产福利91精品一区| 日韩欧美精品在线视频| 午夜精品免费在线观看| 日本久久电影网| 国产精品三级av| 国产宾馆实践打屁股91| 欧美精品一区二区三区蜜桃视频| 亚洲超碰97人人做人人爱| 日本高清不卡一区| 亚洲人成7777| 色综合中文字幕国产| 国产精品久久久久久久裸模| 成人性视频免费网站| 国产欧美一区二区精品性色超碰| 久久精品国产亚洲a| 欧美成人女星排名|