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

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

?? os_task.c

?? uCOS-II 移植到ARM7上
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/*$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

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美国产精品| 国产精品三级电影| 成人av免费在线观看| 午夜激情一区二区三区| 国产亚洲欧美日韩在线一区| 欧美日韩在线播放一区| 成人h动漫精品一区二| 午夜在线成人av| 亚洲日穴在线视频| 久久日一线二线三线suv| 欧美亚洲国产一区在线观看网站| 国产米奇在线777精品观看| 一区二区三区欧美亚洲| 欧美国产欧美亚州国产日韩mv天天看完整 | 丁香桃色午夜亚洲一区二区三区| 香蕉久久夜色精品国产使用方法 | 无码av免费一区二区三区试看| 国产精品全国免费观看高清 | 成人动漫一区二区在线| 久久er精品视频| 午夜精品久久久久久久久久| 亚洲女与黑人做爰| 欧美高清在线一区二区| 久久亚洲春色中文字幕久久久| 制服丝袜中文字幕一区| 在线观看网站黄不卡| 高潮精品一区videoshd| 国产一区二区调教| 久久er精品视频| 免费三级欧美电影| 五月天久久比比资源色| 亚洲精品免费在线观看| 亚洲色图另类专区| 国产精品国产三级国产有无不卡 | 99这里只有久久精品视频| 国产麻豆精品在线| 国产精品亚洲а∨天堂免在线| 精品亚洲成av人在线观看| 日本伊人午夜精品| 日韩1区2区3区| 日韩不卡一二三区| 日韩 欧美一区二区三区| 日韩成人免费电影| 日韩高清在线不卡| 青青草国产成人99久久| 久久激情五月激情| 国产一区二区三区久久悠悠色av| 精品一区二区三区免费观看| 激情六月婷婷综合| 国产91精品一区二区麻豆网站| 欧美日韩国产中文| 欧美日韩久久久| 欧美猛男gaygay网站| 51精品秘密在线观看| 日韩欧美亚洲另类制服综合在线| 欧美一区二区视频免费观看| 精品剧情在线观看| 久久综合999| 国产精品伦一区| 亚洲三级在线看| 亚洲福利一区二区三区| 五月天丁香久久| 久88久久88久久久| 成人在线综合网| 91丨porny丨在线| 欧美三级午夜理伦三级中视频| 91麻豆精品国产91久久久使用方法| 日韩一区二区在线观看| 久久精品无码一区二区三区| 亚洲啪啪综合av一区二区三区| 午夜欧美2019年伦理| 久久99精品久久久久久| 波多野结衣中文一区| 欧美日韩性生活| 久久精品一区蜜桃臀影院| 亚洲色图制服诱惑| 日韩激情视频网站| 懂色av一区二区三区免费观看| 欧美系列在线观看| 日韩一级黄色片| 亚洲图片你懂的| 老司机精品视频线观看86| 99综合影院在线| 日韩欧美一级片| 亚洲摸摸操操av| 久久精品国产在热久久| 波多野结衣亚洲一区| 91麻豆精品国产91久久久更新时间| 久久午夜免费电影| 亚洲超碰97人人做人人爱| 国产一区91精品张津瑜| 欧美日韩亚洲综合一区| 国产精品毛片a∨一区二区三区| 偷拍一区二区三区| 9l国产精品久久久久麻豆| 欧美成人一区二区| 一区二区三区在线免费观看| 国产主播一区二区| 欧美美女bb生活片| 亚洲免费观看高清在线观看| 精品亚洲porn| 欧美视频在线不卡| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 欧美一卡在线观看| 亚洲精品久久久蜜桃| 国产一区二区三区综合| 欧美视频一区二区三区在线观看 | www.亚洲国产| 日韩三级伦理片妻子的秘密按摩| 亚洲欧美色图小说| 国产91综合一区在线观看| 欧美一区二区三区视频在线观看| 亚洲人亚洲人成电影网站色| 国产真实乱子伦精品视频| 7777精品久久久大香线蕉| 亚洲男人天堂av| 成人黄色一级视频| 久久久综合视频| 美女高潮久久久| 91精品国产综合久久久蜜臀图片| 亚洲综合色丁香婷婷六月图片| 91在线看国产| 国产精品久久久久久亚洲毛片| 国产盗摄一区二区| 久久久久久麻豆| 国产精品小仙女| 久久众筹精品私拍模特| 国内精品久久久久影院色| 欧美挠脚心视频网站| 午夜视频在线观看一区| 欧美亚洲一区二区在线观看| 亚洲精品乱码久久久久久| 91麻豆视频网站| 亚洲精品久久嫩草网站秘色| 色就色 综合激情| 亚洲午夜一区二区| 欧美视频第二页| 午夜精品一区二区三区三上悠亚| 欧美午夜一区二区三区| 亚洲国产成人porn| 欧美日韩中文精品| 五月激情综合色| 欧美xxxxxxxx| 韩国v欧美v日本v亚洲v| 久久综合九色综合97婷婷女人 | 亚洲欧美日韩一区二区 | 日韩一区二区三免费高清| 日本三级韩国三级欧美三级| 日韩欧美一二区| 国产黄色成人av| 国产精品人人做人人爽人人添| 91免费国产视频网站| 亚洲已满18点击进入久久| 欧美日韩精品福利| 免费观看在线综合| 国产午夜精品福利| 99国产精品久久| 午夜日韩在线观看| 精品国产乱码久久久久久久| 国产一区二区视频在线播放| **性色生活片久久毛片| 在线观看免费一区| 美女任你摸久久| 国产精品美女久久久久av爽李琼 | 久久久精品欧美丰满| gogo大胆日本视频一区| 亚洲aaa精品| 久久久99久久| 色先锋aa成人| 老汉av免费一区二区三区| 国产精品免费免费| 欧美日韩大陆在线| 国产乱码精品1区2区3区| 亚洲欧美日韩久久精品| 制服丝袜国产精品| 丁香六月综合激情| 亚洲成人免费视频| 日本一区二区免费在线| 欧美午夜精品免费| 国产一区二区三区蝌蚪| 一区二区在线看| 久久综合给合久久狠狠狠97色69| 色综合久久中文字幕综合网| 免费成人结看片| 日韩一区在线看| 欧美电影免费观看高清完整版在线| av日韩在线网站| 久久精品免费看| 亚洲夂夂婷婷色拍ww47 | 亚洲视频一区二区免费在线观看| 欧美一区二区三区免费观看视频| 成人黄页毛片网站| 另类的小说在线视频另类成人小视频在线| 国产精品理伦片| 欧美刺激午夜性久久久久久久| 91麻豆福利精品推荐| 国产精品 日产精品 欧美精品| 午夜精品成人在线视频| 欧美高清在线视频| 26uuu欧美|