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

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

?? os_task.c

?? 基于GE00 實驗系統開發板的實驗指導用途
?? 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一区二区三区免费野_久草精品视频
亚洲日韩欧美一区二区在线| 国产精品卡一卡二| 国产精品一二三区在线| 久久精品一区二区三区av| 91在线一区二区三区| 婷婷开心激情综合| 国产精品―色哟哟| 亚洲欧美另类久久久精品| 日韩视频一区二区三区| 欧美影院午夜播放| 国内精品不卡在线| 亚洲男同性视频| 日本一区二区视频在线观看| 欧美日韩久久一区二区| 91香蕉视频污在线| 国产在线看一区| 亚洲成a人在线观看| 18成人在线视频| xfplay精品久久| 色狠狠色狠狠综合| av午夜一区麻豆| 精品一区二区三区免费播放| 天天综合日日夜夜精品| 亚洲美女偷拍久久| 日本一区二区成人| 久久久精品影视| 日韩一区二区免费电影| 成人免费高清视频| 国产.欧美.日韩| 美国三级日本三级久久99| 亚洲欧美综合另类在线卡通| 久久久久久97三级| 国产日韩欧美不卡在线| 欧美一级免费大片| 99热这里都是精品| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 美国毛片一区二区三区| 日韩二区三区四区| 亚洲第一av色| 亚洲一区二区三区国产| 亚洲成人激情av| 一区二区三区欧美日韩| 欧美激情艳妇裸体舞| 中文字幕免费不卡| 国产欧美日韩综合| 国产精品久久久久久妇女6080| 久久这里都是精品| 日韩免费高清视频| 久久精品欧美一区二区三区不卡| 精品国产网站在线观看| 欧美日韩国产综合一区二区三区| 91国产丝袜在线播放| 91美女片黄在线观看91美女| 91久久精品一区二区三| 91丝袜高跟美女视频| 国产精品亚洲一区二区三区妖精 | 亚洲欧美另类小说视频| 中文字幕一区在线| 国产欧美一区二区三区沐欲| 久久久久9999亚洲精品| 中文av一区二区| 国产精品蜜臀在线观看| 怡红院av一区二区三区| 亚洲国产综合色| 亚洲国产日韩精品| 日韩精品午夜视频| 青草国产精品久久久久久| 91精品在线免费观看| 日韩欧美一二三四区| 久久网站最新地址| 成人欧美一区二区三区小说| 中文字幕在线观看不卡视频| 亚洲国产精品尤物yw在线观看| 日韩在线观看一区二区| 亚洲成a天堂v人片| 国产99久久久国产精品潘金网站| 成年人网站91| 欧美一区二区三区小说| 久久精品水蜜桃av综合天堂| 精品久久久久久久久久久久久久久 | 久久国产精品99久久久久久老狼 | 综合欧美亚洲日本| 青青青爽久久午夜综合久久午夜 | 午夜精品久久久久久久蜜桃app| 免费精品99久久国产综合精品| 精品一区二区三区免费视频| 国产suv精品一区二区三区| 欧美日韩专区在线| 久久精品一区二区三区av| 亚洲人精品一区| 国产一区二区三区香蕉| 91视频观看视频| 久久亚洲春色中文字幕久久久| 国产精品国产三级国产有无不卡 | 国精产品一区一区三区mba桃花| 99免费精品视频| 欧美mv日韩mv| 亚洲视频中文字幕| 国产传媒欧美日韩成人| 欧美亚洲国产一区二区三区va | 国产精品电影一区二区三区| 亚洲国产wwwccc36天堂| 亚洲成人一二三| 成人一区二区三区| 91精品在线一区二区| 亚洲精品菠萝久久久久久久| 久久成人免费日本黄色| 99国产欧美另类久久久精品| 精品国产乱码久久久久久蜜臀| 综合激情网...| 成人美女视频在线观看18| 欧美三级韩国三级日本一级| 欧美激情综合五月色丁香小说| 日本v片在线高清不卡在线观看| 成人av手机在线观看| 国产无人区一区二区三区| 亚洲午夜激情av| 99久久精品99国产精品| 中文字幕免费一区| 久久9热精品视频| 日韩一区二区麻豆国产| 亚洲在线观看免费视频| 日韩欧美在线一区二区三区| 亚洲激情自拍偷拍| 成人爽a毛片一区二区免费| 久久精品日韩一区二区三区| 青青青爽久久午夜综合久久午夜| 欧洲人成人精品| 国产精品成人网| 国产精品综合av一区二区国产馆| 日韩美女在线视频| 日本sm残虐另类| 欧美蜜桃一区二区三区| 亚洲精品视频在线看| www.99精品| 亚洲欧美日韩国产一区二区三区| 国产成人免费在线| 欧美国产综合一区二区| 国产乱码精品一区二区三区av | 99久久免费视频.com| 国产精品伦理在线| 国产成人自拍高清视频在线免费播放| 日韩女优电影在线观看| 日韩精品一二三四| 91精品国产综合久久久蜜臀粉嫩| 奇米在线7777在线精品| 91精品久久久久久久99蜜桃 | 欧美国产丝袜视频| 久久国产精品99久久久久久老狼| 日韩美女视频在线| 精品一区二区三区不卡| 国产日韩欧美a| 丰满放荡岳乱妇91ww| 久久久www免费人成精品| 不卡的av网站| 亚洲免费观看高清完整版在线观看| 在线欧美一区二区| 亚洲成在人线免费| 欧美婷婷六月丁香综合色| 奇米777欧美一区二区| 欧美xxxxx裸体时装秀| 成人中文字幕电影| 亚洲欧美另类在线| 色综合天天综合网天天狠天天| 午夜精品在线看| 欧美tk—视频vk| 成人黄色在线视频| 夜夜嗨av一区二区三区网页| 欧美在线观看一二区| 无码av中文一区二区三区桃花岛| 日韩一级视频免费观看在线| 高清成人免费视频| 亚洲精品国产视频| 日韩三级免费观看| 国产91丝袜在线18| 国产精品人成在线观看免费| 成人精品一区二区三区四区 | 国产精品美女久久久久久久久| 国产99精品视频| 三级一区在线视频先锋| 精品成人一区二区三区四区| 色综合咪咪久久| 麻豆精品视频在线观看| 久久精品亚洲麻豆av一区二区 | 日韩精品一区二区三区视频播放| 粉嫩一区二区三区在线看| 亚洲国产色一区| 精品国产电影一区二区| av激情综合网| 午夜欧美电影在线观看| 国产欧美久久久精品影院| 欧美性色综合网| 国产成人在线影院| 日韩精品一二三区| 日本一区二区成人| 欧美电影免费观看高清完整版 | 91啪亚洲精品| 久久 天天综合| 性欧美大战久久久久久久久| 中文字幕久久午夜不卡|