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

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

?? os_task.c

?? 基于GE00 實(shí)驗(yàn)系統(tǒng)開發(fā)板的實(shí)驗(yàn)指導(dǎo)用途
?? C
?? 第 1 頁 / 共 3 頁
字號:
#endif
    if (prio == OS_PRIO_SELF) {                  /* See if caller desires to set it's own name         */
        prio = OSTCBCur->OSTCBPrio;
    }
    ptcb = OSTCBPrioTbl[prio];
    if (ptcb == (OS_TCB *)0) {                   /* Does task exist?                                   */
        OS_EXIT_CRITICAL();                      /* No                                                 */
        *err = OS_TASK_NOT_EXIST;
        return;
    }
    len = strlen(pname);                         /* Yes, Can we fit the string in the TCB?             */
    if (len > (OS_TASK_NAME_SIZE - 1)) {         /*      No                                            */
        OS_EXIT_CRITICAL();
        *err = OS_ERR_TASK_NAME_TOO_LONG;
        return;
    } 
    (void)strcpy(ptcb->OSTCBTaskName, pname);    /*      Yes, copy to TCB                              */
    OS_EXIT_CRITICAL();
    *err = OS_NO_ERR;
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                        RESUME A SUSPENDED TASK
*
* Description: This function is called to resume a previously suspended task.  This is the only call that
*              will remove an explicit task suspension.
*
* Arguments  : prio     is the priority of the task to resume.
*
* Returns    : OS_NO_ERR                if the requested task is resumed
*              OS_PRIO_INVALID          if the priority you specify is higher that the maximum allowed
*                                       (i.e. >= OS_LOWEST_PRIO)
*              OS_TASK_RESUME_PRIO      if the task to resume does not exist
*              OS_TASK_NOT_SUSPENDED    if the task to resume has not been suspended
*********************************************************************************************************
*/

#if OS_TASK_SUSPEND_EN > 0
INT8U  OSTaskResume (INT8U prio)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif
    OS_TCB    *ptcb;


#if OS_ARG_CHK_EN > 0
    if (prio >= OS_LOWEST_PRIO) {                               /* Make sure task priority is valid    */
        return (OS_PRIO_INVALID);
    }
#endif
    OS_ENTER_CRITICAL();
    ptcb = OSTCBPrioTbl[prio];
    if (ptcb == (OS_TCB *)0) {                                  /* Task to suspend must exist          */
        OS_EXIT_CRITICAL();
        return (OS_TASK_RESUME_PRIO);
    }
    if ((ptcb->OSTCBStat & OS_STAT_SUSPEND) != OS_STAT_RDY) {   /* Task must be suspended              */
        ptcb->OSTCBStat &= ~OS_STAT_SUSPEND;					/* Remove suspension                   */
        if (ptcb->OSTCBStat == OS_STAT_RDY) {                      
            if (ptcb->OSTCBDly  == 0) {                         /* Must not be delayed                 */
                OSRdyGrp               |= ptcb->OSTCBBitY;      /* Make task ready to run              */
                OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
                OS_EXIT_CRITICAL();
                OS_Sched();
			} else {
			    OS_EXIT_CRITICAL();
			}
        } else {
            OS_EXIT_CRITICAL();
        }
        return (OS_NO_ERR);
    }
    OS_EXIT_CRITICAL();
    return (OS_TASK_NOT_SUSPENDED);
}
#endif
/*$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
*
*              pdata    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
*              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 *pdata)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif
    OS_TCB    *ptcb;
    OS_STK    *pchk;
    INT32U     free;
    INT32U     size;


#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
    pdata->OSFree = 0;                                 /* Assume failure, set to 0 size                */
    pdata->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
    pdata->OSFree = free * sizeof(OS_STK);            /* Compute number of free bytes on the stack     */
    pdata->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
*
* 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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif
    BOOLEAN    self;
    OS_TCB    *ptcb;
	INT8U      y;


#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);
    }
	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.
*
* 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
*********************************************************************************************************
*/

#if OS_TASK_QUERY_EN > 0
INT8U  OSTaskQuery (INT8U prio, OS_TCB *pdata)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif
    OS_TCB    *ptcb;


#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);
    }
    memcpy(pdata, ptcb, sizeof(OS_TCB));                   /* Copy TCB into user storage area          */
    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一区二区三区免费野_久草精品视频
eeuss鲁片一区二区三区在线看| 成人av在线影院| 久久精品一级爱片| 欧美日韩一级二级三级| 国产成人午夜片在线观看高清观看| 亚洲综合区在线| 亚洲精品在线三区| 欧美日韩一区二区三区高清| 高清久久久久久| 精品夜夜嗨av一区二区三区| 亚洲午夜av在线| 亚洲视频一区在线| 国产人伦精品一区二区| 欧美性极品少妇| www.66久久| 国产精品一级片| 久久国产精品99久久久久久老狼| 亚洲欧美国产毛片在线| 日本一区二区三区电影| 欧美va亚洲va国产综合| 欧美顶级少妇做爰| 欧美午夜免费电影| 色综合久久六月婷婷中文字幕| 国产高清精品网站| 精品亚洲porn| 久久精品国产一区二区三| 日韩高清在线一区| 亚洲成年人网站在线观看| 一区二区三区高清| 一区二区三区四区蜜桃| 中文字幕一区二区三区四区| 欧美激情一区二区| 国产人久久人人人人爽| 国产欧美视频一区二区三区| 2022国产精品视频| 欧美刺激脚交jootjob| 日韩精品专区在线| 欧美α欧美αv大片| 日韩精品中午字幕| 欧美zozozo| 国产无一区二区| 欧美高清在线一区二区| 国产精品视频免费| 国产精品卡一卡二| 成人欧美一区二区三区视频网页 | 亚洲色图视频网| 亚洲激情五月婷婷| 性欧美疯狂xxxxbbbb| 日韩电影在线观看网站| 久久成人麻豆午夜电影| 国产精品自在欧美一区| 国产大陆亚洲精品国产| 成人亚洲一区二区一| 91免费视频观看| 欧美日韩在线播放一区| 日韩免费观看高清完整版| 精品福利av导航| 国产精品免费av| 一区二区三区成人| 三级欧美韩日大片在线看| 美女一区二区在线观看| 国产成人免费视频一区| 99精品黄色片免费大全| 欧美日韩成人高清| 久久只精品国产| 亚洲欧洲国产日韩| 日韩精品成人一区二区在线| 国产综合一区二区| 一本在线高清不卡dvd| 91精品午夜视频| 国产肉丝袜一区二区| 亚洲综合av网| 激情综合色综合久久| 99re热这里只有精品免费视频| 欧美四级电影网| 精品久久国产老人久久综合| 日韩理论在线观看| 日韩在线一二三区| 成人午夜又粗又硬又大| 欧美日韩亚洲不卡| 国产日韩精品久久久| 亚洲一区av在线| 国产一区二区三区在线观看精品| 99视频超级精品| 日韩欧美一区在线观看| 国产精品色婷婷| 日韩av中文字幕一区二区三区| 国产精品一区不卡| 91精品一区二区三区久久久久久 | 亚洲乱码精品一二三四区日韩在线| 亚洲成人综合网站| 成人福利在线看| 日韩一区二区免费在线电影| 国产精品水嫩水嫩| 久久精品国产一区二区三区免费看| 色一情一乱一乱一91av| 精品国产91乱码一区二区三区| 亚洲国产乱码最新视频 | 国产盗摄精品一区二区三区在线| 欧美亚洲国产怡红院影院| 26uuu国产一区二区三区| 亚洲在线成人精品| caoporn国产精品| 精品国一区二区三区| 午夜欧美在线一二页| 99综合影院在线| 久久精品亚洲国产奇米99| 婷婷成人激情在线网| 一本大道av一区二区在线播放| 久久精品视频在线免费观看| 日本成人中文字幕在线视频| 日本韩国精品一区二区在线观看| 中文字幕第一页久久| 精品亚洲porn| 日韩美一区二区三区| 偷拍亚洲欧洲综合| 91福利国产成人精品照片| 中文字幕一区三区| 丁香一区二区三区| 久久久一区二区三区| 激情小说亚洲一区| 日韩精品一区二| 日韩和欧美一区二区| 欧美色倩网站大全免费| 一区二区三区欧美久久| 99久久精品国产导航| 国产精品国产三级国产普通话蜜臀| 国产一区中文字幕| 精品成人在线观看| 久久99精品久久久| 日韩欧美三级在线| 久久99精品国产麻豆不卡| 日韩一区二区中文字幕| 日本视频一区二区三区| 日韩视频永久免费| 精品制服美女丁香| 久久蜜桃香蕉精品一区二区三区| 国产最新精品免费| 国产亚洲精品中文字幕| 成人性生交大合| 国产精品对白交换视频 | 精品国产伦一区二区三区观看方式| 日本欧美在线观看| 欧美成人一区二区三区片免费| 老司机午夜精品99久久| 欧美xxxxxxxx| 国产黄人亚洲片| 国产精品理论片| 在线免费观看一区| 日韩成人免费在线| 欧美成人综合网站| 成人午夜视频福利| 亚洲日本在线天堂| 欧美日韩国产中文| 精品综合免费视频观看| 国产精品欧美一区二区三区| a亚洲天堂av| 亚洲高清在线视频| 欧美不卡激情三级在线观看| 岛国av在线一区| 亚洲精品欧美激情| 91精品国产色综合久久不卡蜜臀| 久久国产欧美日韩精品| 亚洲国产精品成人综合| 一本色道久久加勒比精品| 日韩av二区在线播放| 国产欧美一区二区精品仙草咪| www.视频一区| 秋霞电影网一区二区| 久久久美女艺术照精彩视频福利播放| 国产成人精品亚洲日本在线桃色| 亚洲人成网站在线| 91精品在线观看入口| 国产91精品欧美| 日韩在线一区二区三区| 国产欧美一区二区精品久导航| 欧美又粗又大又爽| 国产精品一区三区| 亚洲一区二区三区四区在线免费观看| 欧美一二三区在线观看| 99久久99久久综合| 美洲天堂一区二卡三卡四卡视频| 亚洲欧洲精品一区二区三区| 678五月天丁香亚洲综合网| 成人影视亚洲图片在线| 视频一区视频二区中文| 国产偷国产偷精品高清尤物| 欧美日韩午夜在线| www.亚洲人| 激情都市一区二区| 亚洲国产精品久久不卡毛片| 国产亚洲一区二区三区四区| 欧美午夜精品免费| 大胆亚洲人体视频| 久久不见久久见免费视频7| 亚洲黄一区二区三区| 国产日韩av一区| 欧美大胆人体bbbb| 欧美揉bbbbb揉bbbbb| 99综合电影在线视频|