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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? os_task.c

?? UCOS移植到三星ARM芯片S3C44B0上程序的范例,并有移植成功后的應用
?? 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品短视频| 亚洲尤物视频在线| 蜜桃91丨九色丨蝌蚪91桃色| 欧美午夜片在线看| 欧美精品一区二区高清在线观看| 国产精品久久久久影院老司| 久久99国产精品免费| 色综合久久久久综合体| 国产亚洲综合色| 美女精品自拍一二三四| 欧美日韩国产bt| 伊人婷婷欧美激情| 97久久精品人人做人人爽| 精品对白一区国产伦| 三级成人在线视频| 色婷婷av一区二区三区软件| 国产精品素人一区二区| 麻豆精品视频在线观看视频| 欧美精品九九99久久| 一区二区三区在线看| 91麻豆免费看| 亚洲欧美电影院| 91色porny蝌蚪| 亚洲日本丝袜连裤袜办公室| 91在线精品一区二区| 中文字幕不卡在线播放| 国产aⅴ综合色| 国产欧美一区二区三区鸳鸯浴 | 欧美日韩卡一卡二| 国产精品伦理在线| 日韩区在线观看| 亚洲成人手机在线| 欧美少妇一区二区| 亚洲伊人色欲综合网| 色成人在线视频| 亚洲午夜私人影院| 欧美日韩高清一区二区不卡| 日日夜夜免费精品| 欧美一区二区三区日韩视频| 老司机精品视频导航| 精品1区2区在线观看| 国产v日产∨综合v精品视频| 中文字幕亚洲电影| 91蜜桃传媒精品久久久一区二区| 亚洲日本va在线观看| 欧美三级欧美一级| 日韩av中文字幕一区二区| 日韩免费成人网| 成人久久久精品乱码一区二区三区 | 亚洲老妇xxxxxx| 欧洲人成人精品| 天天综合网 天天综合色| 日韩欧美一区中文| 懂色中文一区二区在线播放| 亚洲理论在线观看| 欧美一区二区成人| 国产福利一区二区| 夜夜揉揉日日人人青青一国产精品| 在线观看www91| 久久国产免费看| 中文字幕制服丝袜成人av| 欧美探花视频资源| 国产麻豆91精品| 国产真实乱子伦精品视频| 国产精品乱码久久久久久| 欧美日韩在线三区| 国产精品综合网| 亚洲一级二级在线| 亚洲精品在线观看网站| 色一区在线观看| 日本va欧美va欧美va精品| 国产精品嫩草99a| 欧美日韩高清一区| 99精品视频一区二区三区| 日韩激情视频在线观看| 国产精品视频一区二区三区不卡| 欧美性一二三区| 懂色av一区二区三区免费观看| 亚洲va韩国va欧美va| 中文成人综合网| 欧美成人性战久久| 欧美影视一区在线| 国产91丝袜在线播放九色| 日本女优在线视频一区二区| 亚洲欧洲另类国产综合| 久久综合中文字幕| 在线播放亚洲一区| 在线区一区二视频| 国产不卡视频一区| 国内精品嫩模私拍在线| 午夜精品成人在线视频| 一区二区三区影院| 精品久久久久久久一区二区蜜臀| 91日韩一区二区三区| 久久国产精品99久久人人澡| 亚欧色一区w666天堂| 国产精品免费久久久久| 久久久久久一级片| 欧美一区二区福利在线| 欧美人与禽zozo性伦| 日本电影亚洲天堂一区| aaa欧美大片| 成人18视频日本| 成人精品国产免费网站| 国产成人精品亚洲777人妖| 精品一区二区免费| 激情深爱一区二区| 国内成人精品2018免费看| 七七婷婷婷婷精品国产| 秋霞电影一区二区| 蜜臀久久99精品久久久画质超高清 | 国产91综合网| 国产精品一卡二| 日韩中文字幕一区二区三区| 欧美日本精品一区二区三区| 成人看片黄a免费看在线| 国产成人午夜精品5599| 国模套图日韩精品一区二区 | 欧美成人女星排行榜| 6080yy午夜一二三区久久| 欧美日韩精品三区| 91精品国产aⅴ一区二区| 欧美福利视频一区| 日韩欧美激情在线| 久久精品视频一区二区三区| 久久综合色鬼综合色| 国产日韩三级在线| 国产精品九色蝌蚪自拍| 日韩美女视频一区二区 | 欧美日韩一区二区三区不卡| 欧美日韩一区视频| 日韩色在线观看| 欧美国产丝袜视频| 久久欧美一区二区| 国产精品久久久久久久久久免费看| 久久久青草青青国产亚洲免观| 国产亚洲一区二区三区在线观看| 欧美国产综合色视频| 亚洲免费观看在线观看| 同产精品九九九| 国产精品一区二区男女羞羞无遮挡 | 久久丁香综合五月国产三级网站| 国产一区二区三区视频在线播放| av在线播放不卡| 欧美欧美欧美欧美| 国产人成一区二区三区影院| 亚洲激情六月丁香| 久久狠狠亚洲综合| 97精品久久久午夜一区二区三区| 欧美另类高清zo欧美| 久久―日本道色综合久久| 亚洲欧洲制服丝袜| 麻豆国产91在线播放| 看电视剧不卡顿的网站| 国产精品综合网| 91福利区一区二区三区| 日韩一级成人av| **性色生活片久久毛片| 老司机精品视频在线| 91在线视频官网| 欧美精品一区二区三区视频| 亚洲三级免费观看| 国产在线观看一区二区| 91久久人澡人人添人人爽欧美| 精品少妇一区二区三区免费观看| 午夜久久久久久电影| 处破女av一区二区| 欧美一区二区福利视频| 一级特黄大欧美久久久| 国产激情91久久精品导航| 欧美肥妇free| 亚洲欧美在线视频观看| 国产一区在线观看视频| 欧美绝品在线观看成人午夜影视| 《视频一区视频二区| 国产精品资源网站| 91麻豆精品国产自产在线| 一区二区久久久久久| 成人精品视频一区二区三区尤物| 日韩女优电影在线观看| 五月婷婷色综合| 欧美性一区二区| 日韩一区在线免费观看| 成人一级片网址| 国产日韩欧美电影| 国内精品免费**视频| 欧美成人r级一区二区三区| 天堂精品中文字幕在线| 在线观看日韩精品| 亚洲精品成人a在线观看| 99久久免费视频.com| 中文幕一区二区三区久久蜜桃| 国产精品资源在线观看| 久久免费看少妇高潮| 国产麻豆精品久久一二三| 精品国产一区二区三区忘忧草| 蜜臀av性久久久久蜜臀aⅴ流畅| 3atv一区二区三区| 日本怡春院一区二区| 日韩亚洲欧美综合|