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

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

?? os_task.c

?? UcOS2.76在ATMEL AT91RM9200 ARM9上的移植代碼
?? 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一区二区三区免费野_久草精品视频
亚洲一区在线电影| 成人黄动漫网站免费app| 激情丁香综合五月| 91黄色免费版| 亚洲精品一区二区三区福利| 亚洲一区二区三区在线看| 国产在线看一区| 欧美剧情电影在线观看完整版免费励志电影 | 国产精品18久久久久久久久久久久| 91在线观看一区二区| 欧美sm极限捆绑bd| 午夜电影一区二区三区| 在线看一区二区| 亚洲欧洲综合另类在线| 风间由美一区二区三区在线观看| 欧美一区在线视频| 亚洲精品日韩综合观看成人91| 国产精品456| 久久综合国产精品| 麻豆91精品视频| 欧美一区二区播放| 亚洲国产毛片aaaaa无费看| 成人91在线观看| 国产精品色一区二区三区| 国产成人av影院| 国产亚洲女人久久久久毛片| 激情五月婷婷综合网| 日韩欧美一区二区久久婷婷| 天涯成人国产亚洲精品一区av| 欧亚洲嫩模精品一区三区| 伊人婷婷欧美激情| 91福利社在线观看| 亚洲电影第三页| 欧美日韩成人一区二区| 天堂一区二区在线| 日本久久一区二区三区| 亚洲日本免费电影| 色乱码一区二区三区88| 亚洲国产精品欧美一二99| 欧美三级乱人伦电影| 亚洲国产日韩精品| 8x8x8国产精品| 日本怡春院一区二区| 欧美tickle裸体挠脚心vk| 国产在线麻豆精品观看| 国产亲近乱来精品视频| 成人av在线资源网| 亚洲一区二区三区不卡国产欧美| 欧美视频完全免费看| 丝袜美腿亚洲一区| 久久欧美中文字幕| 成人黄色一级视频| 亚洲18色成人| 久久99久久99小草精品免视看| 另类小说综合欧美亚洲| 在线视频综合导航| 日韩黄色在线观看| 久久只精品国产| 91视视频在线直接观看在线看网页在线看 | 日韩西西人体444www| 国内精品视频666| 亚洲青青青在线视频| 4438成人网| 成人免费黄色在线| 五月综合激情网| 国产亚洲成av人在线观看导航 | 色狠狠色狠狠综合| 日本亚洲三级在线| 国产精品欧美一区二区三区| 欧美日韩精品福利| 国产成人av电影免费在线观看| 亚洲免费在线电影| 精品成人一区二区三区| 成人手机在线视频| 美女在线一区二区| 亚洲免费在线播放| 久久久午夜精品| 欧美视频三区在线播放| 高清在线不卡av| 视频一区中文字幕国产| 国产精品白丝在线| 欧美α欧美αv大片| 色婷婷久久久综合中文字幕| 国产一区二区三区免费观看| 亚洲国产aⅴ天堂久久| 精品对白一区国产伦| 欧美亚洲丝袜传媒另类| 丁香亚洲综合激情啪啪综合| 日韩vs国产vs欧美| 亚洲美女在线一区| 日本一区二区不卡视频| 精品精品国产高清一毛片一天堂| 色偷偷成人一区二区三区91| 国产成人亚洲综合a∨婷婷| 婷婷夜色潮精品综合在线| 自拍偷拍国产亚洲| 欧美国产激情二区三区| 精品成人佐山爱一区二区| 3d动漫精品啪啪一区二区竹菊 | 精品一区二区三区免费毛片爱| 伊人夜夜躁av伊人久久| 国产精品久久久久国产精品日日| 2023国产精品自拍| 精品免费日韩av| 91精品国产高清一区二区三区蜜臀| 在线视频综合导航| 91女厕偷拍女厕偷拍高清| 成人国产在线观看| 成人精品高清在线| 不卡视频免费播放| 国产69精品久久99不卡| 国产精品资源网| 国产精品一二二区| 国产成人日日夜夜| 国产成人啪免费观看软件| 国内成+人亚洲+欧美+综合在线| 蜜桃视频在线一区| 美女网站一区二区| 久久成人免费网| 精品亚洲免费视频| 国产又黄又大久久| 国产精品一区二区久久不卡 | 亚洲成人动漫av| 五月婷婷激情综合网| 丝袜亚洲精品中文字幕一区| 日韩经典中文字幕一区| 麻豆精品久久久| 国产精品一区不卡| av在线一区二区| 欧美无砖专区一中文字| 日韩一区二区精品在线观看| 91精品国产色综合久久ai换脸| 精品国产欧美一区二区| 国产精品你懂的在线欣赏| 亚洲精品中文字幕在线观看| 亚洲国产综合91精品麻豆| 午夜伊人狠狠久久| 国产精品中文字幕一区二区三区| 成人性视频免费网站| 欧美三级日韩在线| 精品国产一区二区亚洲人成毛片| 中文字幕乱码一区二区免费| 一区二区三区久久| 免费成人av在线播放| 国产1区2区3区精品美女| 一本久久综合亚洲鲁鲁五月天| 7777精品伊人久久久大香线蕉| 337p粉嫩大胆噜噜噜噜噜91av| 国产精品女同互慰在线看| 亚洲成人精品一区| 国产一区二区美女| 日本精品裸体写真集在线观看| 6080日韩午夜伦伦午夜伦| 久久久久国产精品麻豆ai换脸| 亚洲免费观看高清在线观看| 青青草精品视频| 成人sese在线| 欧美日韩国产中文| 国产精品美女www爽爽爽| 丝袜a∨在线一区二区三区不卡| 国产不卡视频在线播放| 欧美一区二区三区在线观看| 国产精品美女久久久久高潮 | 亚洲一区二区在线视频| 精品在线视频一区| 欧美在线你懂的| 国产日韩欧美电影| 免费的成人av| 91极品美女在线| 中文字幕 久热精品 视频在线| 视频在线在亚洲| 色噜噜狠狠色综合欧洲selulu| 国产亚洲欧美日韩俺去了| 蜜桃视频在线一区| 欧美群妇大交群中文字幕| 亚洲欧洲综合另类在线| 成人黄色一级视频| 国产日韩欧美精品一区| 久久国产福利国产秒拍| 欧美日本一区二区三区| 伊人婷婷欧美激情| 97se亚洲国产综合自在线不卡 | 欧美成人伊人久久综合网| 亚洲综合丁香婷婷六月香| av一本久道久久综合久久鬼色| 日韩精品中文字幕在线不卡尤物| 亚洲自拍与偷拍| 一本色道亚洲精品aⅴ| 中文字幕一区在线观看| 国产精品影视在线观看| 精品精品国产高清一毛片一天堂| 奇米777欧美一区二区| 欧美日产在线观看| 天涯成人国产亚洲精品一区av| 欧美少妇一区二区| 亚洲福利视频一区| 欧美高清视频一二三区| 日韩专区在线视频| 日韩一区国产二区欧美三区| 日日夜夜一区二区|