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

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

?? os_task.c

?? 一個(gè)boot采集的測試程序!僅供ARM學(xué)習(xí)者參考。
?? 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩午夜在线观看视频| 成人免费视频免费观看| 欧美日韩国产区一| 首页国产欧美日韩丝袜| 欧美日韩一二区| 午夜精品免费在线观看| 91精品国产免费| 国产精品一区二区免费不卡| 日本一区二区三区四区| 色婷婷综合久久久中文字幕| 午夜电影久久久| 久久久精品免费网站| 成人性生交大片免费看中文| 亚洲精品一二三| 日韩一区二区在线观看视频| 岛国精品一区二区| 亚洲一区二区高清| 久久久久国产精品麻豆ai换脸 | 亚洲综合视频在线观看| 欧美酷刑日本凌虐凌虐| 国产又粗又猛又爽又黄91精品| 国产亚洲一区二区三区四区| 色哟哟一区二区三区| 男女性色大片免费观看一区二区| 国产日韩欧美电影| 欧美日韩1区2区| 国产一区二区剧情av在线| 亚洲女女做受ⅹxx高潮| 精品美女一区二区| 一本色道久久综合狠狠躁的推荐| 蜜臀av国产精品久久久久| 中文字幕日韩一区二区| 欧美一级欧美一级在线播放| 99v久久综合狠狠综合久久| 美女免费视频一区二区| 亚洲综合免费观看高清完整版| xfplay精品久久| 欧美三级日韩三级| 成人国产免费视频| 久久国内精品自在自线400部| 国产精品国产三级国产有无不卡| 日韩一区二区三区视频| 91黄色在线观看| 高清不卡一区二区| 久久99国产乱子伦精品免费| 亚洲一区中文日韩| 国产精品成人网| 久久久精品天堂| 精品国精品自拍自在线| 欧美疯狂做受xxxx富婆| 色综合久久久久| 成人av网在线| 国产乱码精品一区二区三区忘忧草| 亚洲电影一区二区三区| 国产精品九色蝌蚪自拍| 国产欧美日韩亚州综合| 精品黑人一区二区三区久久 | 日本一二三四高清不卡| 精品久久99ma| 欧美日韩一区在线观看| 91猫先生在线| 91在线播放网址| 99免费精品在线| 成人中文字幕电影| 成人av电影免费在线播放| 国产99精品在线观看| 国产一区二区三区av电影| 久久99精品久久久久久动态图| 蜜臀久久99精品久久久久久9 | 麻豆成人综合网| 午夜激情久久久| 亚洲成av人片在www色猫咪| 亚洲自拍偷拍综合| 亚洲国产一二三| 午夜视频在线观看一区二区| 亚洲地区一二三色| 亚洲国产精品自拍| 国产精品99久久久久久似苏梦涵| 日欧美一区二区| 青青草一区二区三区| 日韩精品一二三区| 久久精品国产第一区二区三区| 蜜桃视频一区二区三区在线观看 | 日韩视频一区在线观看| 欧美一三区三区四区免费在线看| 7777精品伊人久久久大香线蕉经典版下载 | 91在线精品一区二区三区| 波多野结衣一区二区三区| 国产成人一区二区精品非洲| 成人一区二区三区在线观看| 成人一级黄色片| 91丝袜呻吟高潮美腿白嫩在线观看| 成人精品免费网站| 日本道色综合久久| 日本韩国一区二区三区| 欧美一区二区在线看| 精品av综合导航| 国产精品无遮挡| 亚洲影视在线观看| 蜜臀久久99精品久久久久宅男| 国产剧情在线观看一区二区| jlzzjlzz亚洲女人18| 欧美日本韩国一区二区三区视频| 欧美一区二区三区精品| 亚洲国产精品成人综合色在线婷婷| 亚洲欧洲成人自拍| 视频一区二区三区入口| 国产精品一级片在线观看| 成人高清视频在线| 欧美日韩国产另类一区| 精品99一区二区| 中文字幕一区不卡| 日韩国产成人精品| 成人a级免费电影| 欧美一级生活片| 国产精品久久看| 日本v片在线高清不卡在线观看| 精品一区二区三区av| 91美女在线看| 久久亚洲春色中文字幕久久久| 亚洲日本在线看| 精品一区二区av| 欧美视频中文字幕| 2024国产精品| 夜夜精品浪潮av一区二区三区| 精品一区二区三区的国产在线播放| 91丨九色丨国产丨porny| 日韩久久久精品| 亚洲欧美电影一区二区| 黄页网站大全一区二区| 欧美午夜一区二区三区免费大片| 久久亚洲一区二区三区四区| 丝袜亚洲另类丝袜在线| 不卡一区二区在线| 精品国产百合女同互慰| 午夜国产精品一区| 色哟哟精品一区| 国产精品对白交换视频| 国产精品一区在线观看乱码| 欧美疯狂性受xxxxx喷水图片| 亚洲免费高清视频在线| 成人手机在线视频| 678五月天丁香亚洲综合网| 亚洲欧美区自拍先锋| 国产jizzjizz一区二区| 337p粉嫩大胆色噜噜噜噜亚洲| 性做久久久久久免费观看| 色网站国产精品| 综合中文字幕亚洲| 成人性生交大片免费看在线播放| 精品福利二区三区| 麻豆91免费观看| 欧美一级理论片| 日日夜夜免费精品| 欧美日韩国产高清一区二区三区| 亚洲另类在线视频| 色婷婷狠狠综合| 一区二区三区国产精华| 91在线免费视频观看| 亚洲品质自拍视频网站| 91麻豆免费在线观看| 亚洲免费成人av| 欧美日韩免费观看一区三区| 玉米视频成人免费看| 色香色香欲天天天影视综合网| 亚洲欧美日韩国产综合| 色婷婷精品久久二区二区蜜臂av| 一区二区三区中文免费| 在线观看欧美黄色| 香蕉成人啪国产精品视频综合网| 欧美在线一区二区| 亚洲成人精品一区二区| 欧美精品欧美精品系列| 三级不卡在线观看| 精品噜噜噜噜久久久久久久久试看 | 欧美精品电影在线播放| 午夜日韩在线电影| 欧美老人xxxx18| 精品在线观看视频| 国产亚洲一区二区三区| www.亚洲国产| 亚洲综合一区在线| 欧美夫妻性生活| 国产一区欧美一区| 中文字幕高清一区| 91蝌蚪porny成人天涯| 亚洲成人高清在线| 精品久久久久香蕉网| www.日韩在线| 亚洲成a人片在线观看中文| 精品国产区一区| 成人av综合在线| 日韩国产欧美在线视频| 久久久影视传媒| 日本视频一区二区三区| 久久久久久久久伊人| 欧美在线视频全部完| 另类欧美日韩国产在线| 中文字幕一区二区三区在线观看| 欧美性受xxxx|