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

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

?? os_task.c

?? 完整ucos, 可以在s3c440x上行
?? C
?? 第 1 頁 / 共 3 頁
字號:
    }
    ptcb = OSTCBPrioTbl[prio];
    if (ptcb == (OS_TCB *)0) {                   /* Does task exist?                                   */
        OS_EXIT_CRITICAL();                      /* No                                                 */
        *err = OS_TASK_NOT_EXIST;
        return;
    }
    len = OS_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)OS_StrCopy(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
*
*              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
*              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)
{
#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
    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
*
* 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.
*
*              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
*********************************************************************************************************
*/

#if OS_TASK_QUERY_EN > 0
INT8U  OSTaskQuery (INT8U prio, OS_TCB *p_task_data)
{
#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);
    }
                                                 /* 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一区二区三区免费野_久草精品视频
另类欧美日韩国产在线| 欧美日韩一区二区在线观看 | 久久久久久久久久电影| 一区二区三区在线观看欧美 | 天天爽夜夜爽夜夜爽精品视频| 不卡区在线中文字幕| 国产精品色一区二区三区| 成人av网在线| 一区二区三区毛片| 欧美一区二区视频在线观看| 蜜桃精品在线观看| 国产欧美精品国产国产专区| 色94色欧美sute亚洲线路一ni| 一区二区国产视频| 欧美一区二视频| 麻豆免费精品视频| 欧美激情一区二区三区全黄| 日本福利一区二区| 美女脱光内衣内裤视频久久影院| 久久久99精品免费观看| 色婷婷综合久久久久中文一区二区 | 日本成人超碰在线观看| 精品国产91乱码一区二区三区| 国产suv精品一区二区6| 一区二区不卡在线视频 午夜欧美不卡在 | 欧美日韩午夜在线| 国产真实精品久久二三区| 最新热久久免费视频| 欧美日本精品一区二区三区| 国产麻豆成人传媒免费观看| 亚洲精品国产精品乱码不99| 日韩精品资源二区在线| 色婷婷av一区二区三区软件 | 亚洲成人免费在线观看| 久久久久久夜精品精品免费| 一本到高清视频免费精品| 美女一区二区三区在线观看| 亚洲日本成人在线观看| 欧美成人三级在线| 欧美丝袜丝交足nylons图片| 国产精品亚洲一区二区三区在线| 一区二区国产视频| 欧美—级在线免费片| 7777精品伊人久久久大香线蕉经典版下载 | 国产69精品久久99不卡| 日韩和欧美一区二区| 国产精品乱人伦中文| 精品久久久久久久久久久院品网| 一本色道**综合亚洲精品蜜桃冫| 国产精品自在在线| 日韩不卡在线观看日韩不卡视频| 亚洲乱码国产乱码精品精的特点| 精品粉嫩超白一线天av| 欧美精品免费视频| 色综合天天综合色综合av | 成人18视频在线播放| 毛片av中文字幕一区二区| 一个色综合网站| 亚洲日本一区二区| 成人免费在线播放视频| 26uuu另类欧美| 日韩视频一区二区三区| 色婷婷激情综合| 不卡av在线免费观看| 国产乱理伦片在线观看夜一区| 丝袜美腿高跟呻吟高潮一区| 亚洲一级二级三级| 亚洲综合一区在线| 18成人在线视频| 国产精品第一页第二页第三页 | 国产精品第五页| 国产情人综合久久777777| 精品sm捆绑视频| 精品久久久久久久久久久久久久久| 欧美丰满少妇xxxxx高潮对白| 欧美影片第一页| 欧日韩精品视频| 欧美在线制服丝袜| 欧美午夜精品电影| 欧美日韩国产高清一区二区| 欧美日韩一级二级三级| 欧美日韩国产a| 欧美精品色一区二区三区| 欧美私模裸体表演在线观看| 91免费在线看| 欧美亚洲国产一区在线观看网站 | 成人开心网精品视频| 成人网页在线观看| 色婷婷精品久久二区二区蜜臂av | 91精选在线观看| 51午夜精品国产| 精品国产乱码久久久久久夜甘婷婷 | 免费观看在线色综合| 精品一区二区三区免费视频| 国产精品一级片在线观看| 国产一区二区免费在线| 成人av免费在线观看| 91蜜桃视频在线| 欧美高清性hdvideosex| 欧美大尺度电影在线| 久久久久久亚洲综合| 综合激情成人伊人| 日韩在线一区二区三区| 蜜臀av亚洲一区中文字幕| 国产精品一区在线| 色琪琪一区二区三区亚洲区| 欧美精品少妇一区二区三区| 国产亚洲精品7777| 一区二区三区欧美日韩| 日韩国产欧美三级| 国产精品99久久久久久久vr| 日本精品免费观看高清观看| 日韩欧美国产三级| 亚洲人成精品久久久久久| 三级久久三级久久| 福利一区在线观看| 欧美日本一道本在线视频| 久久精品欧美一区二区三区不卡| 亚洲欧美激情小说另类| 免费人成在线不卡| 91浏览器入口在线观看| 91精品国产入口| 国产精品白丝在线| 男女性色大片免费观看一区二区 | 另类的小说在线视频另类成人小视频在线| 国产一区日韩二区欧美三区| 在线观看亚洲精品视频| 精品美女被调教视频大全网站| 亚洲精品免费电影| 国产激情偷乱视频一区二区三区| 在线视频综合导航| 日本一区二区三区四区| 免费久久99精品国产| 91激情五月电影| 国产视频一区二区在线观看| 五月天激情综合| 99综合影院在线| 久久综合丝袜日本网| 亚洲超碰97人人做人人爱| 丁香婷婷深情五月亚洲| 日韩久久久精品| 午夜精品久久久久久不卡8050| 成人黄动漫网站免费app| 精品欧美一区二区久久| 亚洲国产美女搞黄色| 色综合欧美在线| 中文字幕欧美激情| 国产精品亚洲专一区二区三区| 日韩午夜激情av| 婷婷久久综合九色国产成人 | 亚洲视频精选在线| 成人精品一区二区三区四区 | 中文字幕一区二区三区蜜月 | 椎名由奈av一区二区三区| 国产一区二区不卡| 日韩视频在线观看一区二区| 亚洲国产精品一区二区久久| 色综合久久精品| 亚洲精品乱码久久久久久日本蜜臀| 国产成人免费9x9x人网站视频| 日韩美女在线视频| 精品影视av免费| 日韩免费性生活视频播放| 男男成人高潮片免费网站| 欧美裸体一区二区三区| 亚洲成a人v欧美综合天堂下载| 欧美性色黄大片手机版| 亚洲综合久久久久| 欧美性大战久久久| 香港成人在线视频| 91麻豆精品国产91久久久久久| 性做久久久久久久免费看| 欧美久久久久中文字幕| 性感美女极品91精品| 欧美一区永久视频免费观看| 奇米影视一区二区三区| 精品人在线二区三区| 国产精品中文字幕日韩精品| 久久久精品欧美丰满| 国产成人综合网站| 中文字幕在线不卡视频| 一本大道av一区二区在线播放| 亚洲精品成人天堂一二三| 在线观看视频91| 日韩精品高清不卡| 精品久久久久久无| 成人在线综合网站| 亚洲免费资源在线播放| 欧美日韩一区二区三区在线看| 日韩主播视频在线| 久久嫩草精品久久久精品| 北条麻妃国产九九精品视频| 一区二区三区 在线观看视频| 欧美一区二区三区在线观看| 国产专区综合网| 亚洲欧美日韩国产一区二区三区| 欧美三级电影精品| 狠狠色伊人亚洲综合成人| 中文字幕在线观看一区二区| 91麻豆精品国产无毒不卡在线观看 |