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

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

?? os_task.c

?? ucosII在arm7上的移植實(shí)驗(yàn)
?? 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一区二区三区免费野_久草精品视频
国产aⅴ综合色| 国产a视频精品免费观看| 国产精品亚洲午夜一区二区三区 | 日韩一区二区三区视频| 日本不卡一二三区黄网| 国产女人水真多18毛片18精品视频| 91一区二区三区在线观看| 亚洲福利一区二区| 国产日韩欧美麻豆| 欧美一级爆毛片| 色噜噜狠狠一区二区三区果冻| 亚洲综合在线第一页| 99视频超级精品| 国产精品99久久久久久宅男| 国产福利一区二区三区视频| 1024国产精品| 国产精品久久久一区麻豆最新章节| 久久久精品人体av艺术| 久久久99免费| 中文字幕成人在线观看| 中文字幕在线不卡国产视频| 亚洲男人的天堂在线观看| 亚洲午夜精品久久久久久久久| 天堂影院一区二区| 国产一区 二区 三区一级| jvid福利写真一区二区三区| 日本精品视频一区二区三区| 国产精品久99| 51精品视频一区二区三区| 精品福利一区二区三区免费视频| 久久久无码精品亚洲日韩按摩| 中文字幕精品一区二区精品绿巨人 | 91丨九色丨尤物| 欧美老女人在线| 久久嫩草精品久久久久| 亚洲精品国产无天堂网2021| 蜜桃av一区二区| 91啪九色porn原创视频在线观看| 欧美日韩电影一区| 国产女人aaa级久久久级| 午夜在线成人av| 国产米奇在线777精品观看| 91福利资源站| 久久久av毛片精品| 天天综合天天综合色| 成人免费视频网站在线观看| 欧美一级久久久久久久大片| 亚洲视频 欧洲视频| 久久成人免费电影| 欧美日韩综合色| 中文字幕一区二区三区在线播放 | 在线视频一区二区免费| 欧美成人精品高清在线播放| 一区在线中文字幕| 国内精品伊人久久久久av影院| 在线视频中文字幕一区二区| 久久久久99精品一区| 免费观看在线综合| 欧美午夜影院一区| 综合久久久久久| 成人久久视频在线观看| 2023国产一二三区日本精品2022| 亚洲高清不卡在线| 在线视频综合导航| 综合亚洲深深色噜噜狠狠网站| 国产精品香蕉一区二区三区| 日韩欧美高清一区| 石原莉奈一区二区三区在线观看| 91美女精品福利| 国产精品初高中害羞小美女文| 极品美女销魂一区二区三区 | 北条麻妃国产九九精品视频| 久久久蜜桃精品| 狠狠狠色丁香婷婷综合激情| 日韩精品专区在线影院观看| 久久不见久久见中文字幕免费| 91精品综合久久久久久| 亚洲理论在线观看| 欧美无乱码久久久免费午夜一区 | 国产精品久久久久影院色老大| 国产成人免费在线| 亚洲国产精品黑人久久久| 久久精品国产免费看久久精品| 欧美电影在线免费观看| 全国精品久久少妇| 欧美xxxxxxxx| 久久超级碰视频| 国产视频一区不卡| 成人精品小蝌蚪| 亚洲蜜臀av乱码久久精品蜜桃| 色综合久久88色综合天天免费| 亚洲激情第一区| 欧美日韩精品欧美日韩精品一 | 风间由美一区二区av101| 国产亚洲va综合人人澡精品| 不卡一区在线观看| 亚洲第一搞黄网站| 精品捆绑美女sm三区| 国产999精品久久| 一区二区三区成人在线视频| 91麻豆精品国产自产在线观看一区| 久久国产精品免费| 中文字幕第一区第二区| 欧美日韩在线免费视频| 久久成人精品无人区| 中文字幕一区二区视频| 7777精品伊人久久久大香线蕉| 精品一区二区三区视频| 亚洲人成网站色在线观看| 欧美无乱码久久久免费午夜一区| 久久成人麻豆午夜电影| 亚洲欧美另类在线| 精品成人佐山爱一区二区| 99精品视频在线观看| 日韩国产高清影视| 亚洲欧洲一区二区三区| 日韩欧美123| 日本韩国视频一区二区| 国产一区二区视频在线播放| 亚洲综合无码一区二区| 国产亚洲精品7777| 丝袜诱惑制服诱惑色一区在线观看| 国产成人在线看| 午夜国产精品影院在线观看| 国产午夜亚洲精品不卡 | 香港成人在线视频| 国产欧美日韩不卡免费| 欧美一区二区精品久久911| 国产精品一色哟哟哟| 日本不卡视频在线观看| 亚洲综合精品久久| 中文字幕在线观看一区| 久久综合国产精品| 7777精品伊人久久久大香线蕉完整版 | 91国产免费观看| 国产成人综合网站| 久久se精品一区二区| 日韩在线观看一区二区| 最新欧美精品一区二区三区| 欧美精品一区在线观看| 日韩午夜在线观看| 欧美肥大bbwbbw高潮| 欧美色区777第一页| 色综合色狠狠综合色| 国产成人av一区二区三区在线| 韩国女主播成人在线| 免费成人美女在线观看| 亚洲h在线观看| 亚洲午夜羞羞片| 国产精品传媒在线| 一色屋精品亚洲香蕉网站| 中文字幕一区二区三区视频| 国产精品美女视频| 国产精品美女久久久久久久网站| 久久亚洲一区二区三区明星换脸 | 高清国产一区二区三区| 国产一区二区成人久久免费影院 | 亚洲欧美一区二区三区国产精品 | 亚洲在线观看免费视频| 亚洲综合在线免费观看| 亚洲成人中文在线| 三级欧美在线一区| 美女脱光内衣内裤视频久久网站 | 欧美男人的天堂一二区| 精品视频免费在线| 日韩一区二区在线看片| 日韩欧美资源站| 久久综合九色综合97_久久久| 国产丝袜在线精品| 亚洲婷婷综合色高清在线| 亚洲黄色在线视频| 日韩精品国产欧美| 国产一区二区h| 不卡的看片网站| 欧美午夜寂寞影院| 欧美成人a∨高清免费观看| 久久久亚洲欧洲日产国码αv| 国产精品水嫩水嫩| 亚洲电影你懂得| 国产综合色在线| 91天堂素人约啪| 3d动漫精品啪啪一区二区竹菊| 日韩三级中文字幕| 国产精品的网站| 日本不卡不码高清免费观看| 国产精品影视网| 欧美性xxxxx极品少妇| 精品国产一区二区三区久久影院| 中文字幕成人av| 日本在线不卡一区| 成人午夜电影久久影院| 欧美日韩一区二区在线观看视频| 久久你懂得1024| 久久婷婷国产综合国色天香| 欧美日韩高清在线| 国产调教视频一区| 五月婷婷另类国产| 91在线视频18| 国产日产欧美一区二区视频| 亚洲一区二区三区视频在线|