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

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

?? os_task.c

?? ucos操作系統(tǒng)在s3c44b0上的移植
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                            TASK MANAGEMENT
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                           All Rights Reserved
*
*                                                  V2.00
*
* File : OS_TASK.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "includes.h"
#endif

/*
*********************************************************************************************************
*                                        LOCAL FUNCTION PROTOTYPES
*********************************************************************************************************
*/


static  void  OSDummy(void);

/*
*********************************************************************************************************
*                                            DUMMY FUNCTION
*
* Description: This function doesn't do anything.  It is called by OSTaskDel() to ensure that interrupts
*              are disabled immediately after they are enabled.
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

static void  OSDummy (void)
{
}

/*$PAGE*/
/*
*********************************************************************************************************
*                                        CHANGE PRIORITY OF A TASK
*
* Description: This function allows you to change the priority of a task dynamically.  Note that the new
*              priority MUST be available.
*
* Arguments  : oldp     is the old priority
*
*              newp     is the new priority
*
* Returns    : OS_NO_ERR        is the call was successful
*              OS_PRIO_INVALID  if the priority you specify is higher that the maximum allowed 
*                               (i.e. >= OS_LOWEST_PRIO)
*              OS_PRIO_EXIST    if the new priority already exist.
*              OS_PRIO_ERR      there is no task with the specified OLD priority (i.e. the OLD task does
*                               not exist.
*********************************************************************************************************
*/

#if OS_TASK_CHANGE_PRIO_EN
INT8U OSTaskChangePrio (INT8U oldprio, INT8U newprio)
{
    OS_TCB   *ptcb;
    OS_EVENT *pevent;
    INT8U     x;
    INT8U     y;
    INT8U     bitx;
    INT8U     bity;


    if ((oldprio >= OS_LOWEST_PRIO && oldprio != OS_PRIO_SELF)  || 
         newprio >= OS_LOWEST_PRIO) {
        return (OS_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    if (OSTCBPrioTbl[newprio] != (OS_TCB *)0) {                 /* New priority must not already exist */
        OS_EXIT_CRITICAL();
        return (OS_PRIO_EXIST);
    } else {
        OSTCBPrioTbl[newprio] = (OS_TCB *)1;                    /* Reserve the entry to prevent others */
        OS_EXIT_CRITICAL();
        y    = newprio >> 3;                                    /* Precompute to reduce INT. latency   */
        bity = OSMapTbl[y];
        x    = newprio & 0x07;
        bitx = OSMapTbl[x];
        OS_ENTER_CRITICAL();
        if (oldprio == OS_PRIO_SELF) {                          /* See if changing self                */
            oldprio = OSTCBCur->OSTCBPrio;                      /* Yes, get priority                   */
        }
        if ((ptcb = OSTCBPrioTbl[oldprio]) != (OS_TCB *)0) {    /* Task to change must exist           */
            OSTCBPrioTbl[oldprio] = (OS_TCB *)0;                /* Remove TCB from old priority        */
            if (OSRdyTbl[ptcb->OSTCBY] & ptcb->OSTCBBitX) {     /* If task is ready make it not ready  */
                if ((OSRdyTbl[ptcb->OSTCBY] &= ~ptcb->OSTCBBitX) == 0) {
                    OSRdyGrp &= ~ptcb->OSTCBBitY;
                }
                OSRdyGrp    |= bity;                            /* Make new priority ready to run      */
                OSRdyTbl[y] |= bitx;
            } else {
                if ((pevent = ptcb->OSTCBEventPtr) != (OS_EVENT *)0) { /* Remove from event wait list  */
                    if ((pevent->OSEventTbl[ptcb->OSTCBY] &= ~ptcb->OSTCBBitX) == 0) {
                        pevent->OSEventGrp &= ~ptcb->OSTCBBitY;
                    }
                    pevent->OSEventGrp    |= bity;              /* Add new priority to wait list       */
                    pevent->OSEventTbl[y] |= bitx;
                }
            }
            OSTCBPrioTbl[newprio] = ptcb;                       /* Place pointer to TCB @ new priority */
            ptcb->OSTCBPrio       = newprio;                    /* Set new task priority               */
            ptcb->OSTCBY          = y;
            ptcb->OSTCBX          = x;
            ptcb->OSTCBBitY       = bity;
            ptcb->OSTCBBitX       = bitx;
            OS_EXIT_CRITICAL();
            OSSched();                                          /* Run highest priority task ready     */
            return (OS_NO_ERR);
        } else {
            OSTCBPrioTbl[newprio] = (OS_TCB *)0;                /* Release the reserved prio.          */
            OS_EXIT_CRITICAL();
            return (OS_PRIO_ERR);                               /* Task to change didn't exist         */
        }
    }
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                            CREATE A TASK
*
* Description: This function is used to have uC/OS-II manage the execution of a task.  Tasks can either
*              be created prior to the start of multitasking or by a running task.  A task cannot be
*              created by an ISR.
*
* Arguments  : task     is a pointer to the task's code
*
*              pdata    is a pointer to an optional data area which can be used to pass parameters to
*                       the task when the task first executes.  Where the task is concerned it thinks
*                       it was invoked and passed the argument 'pdata' as follows:
*
*                           void Task (void *pdata)
*                           {
*                               for (;;) {
*                                   Task code;
*                               }
*                           }
*
*              ptos     is a pointer to the task's top 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).  'pstk' will thus point to the highest (valid) memory 
*                       location of the stack.  If OS_STK_GROWTH is set to 0, 'pstk' will point to the 
*                       lowest memory location of the stack and the stack will grow with increasing
*                       memory locations.
*
*              prio     is the task's priority.  A unique priority MUST be assigned to each task and the
*                       lower the number, the higher the priority.
*
* Returns    : OS_NO_ERR        if the function was successful.
*              OS_PRIO_EXIT     if the task priority already exist 
*                               (each task MUST have a unique priority).
*              OS_PRIO_INVALID  if the priority you specify is higher that the maximum allowed 
*                               (i.e. >= OS_LOWEST_PRIO)
*********************************************************************************************************
*/

#if OS_TASK_CREATE_EN
INT8U OSTaskCreate (void (*task)(void *pd), void *pdata, OS_STK *ptos, INT8U prio)
{
    void   *psp;
    INT8U   err;


    if (prio > OS_LOWEST_PRIO) {             /* Make sure priority is within allowable range           */
        return (OS_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    if (OSTCBPrioTbl[prio] == (OS_TCB *)0) { /* Make sure task doesn't already exist at this priority  */
        OSTCBPrioTbl[prio] = (OS_TCB *)1;    /* Reserve the priority to prevent others from doing ...  */
                                             /* ... the same thing until task is created.              */
        OS_EXIT_CRITICAL();
        psp = (void *)OSTaskStkInit(task, pdata, ptos, 0); /* Initialize the task's stack              */
        err = OSTCBInit(prio, psp, (void *)0, 0, 0, (void *)0, 0);         
        if (err == OS_NO_ERR) {
            OS_ENTER_CRITICAL();
            OSTaskCtr++;                                   /* Increment the #tasks counter             */
            OSTaskCreateHook(OSTCBPrioTbl[prio]);          /* Call user defined hook                   */
            OS_EXIT_CRITICAL();
            if (OSRunning) {                 /* Find highest priority task if multitasking has started */
                OSSched();
            }
        } else {
            OS_ENTER_CRITICAL();
            OSTCBPrioTbl[prio] = (OS_TCB *)0;/* Make this priority available to others                 */
            OS_EXIT_CRITICAL();
        }
        return (err);
    } else {
        OS_EXIT_CRITICAL();
        return (OS_PRIO_EXIST);
    }
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                     CREATE A TASK (Extended Version)
*
* Description: This function is used to have uC/OS-II manage the execution of a task.  Tasks can either
*              be created prior to the start of multitasking or by a running task.  A task cannot be
*              created by an ISR.  This function is similar to OSTaskCreate() except that it allows
*              additional information about a task to be specified.
*
* Arguments  : task     is a pointer to the task's code
*
*              pdata    is a pointer to an optional data area which can be used to pass parameters to
*                       the task when the task first executes.  Where the task is concerned it thinks
*                       it was invoked and passed the argument 'pdata' as follows:
*
*                           void Task (void *pdata)
*                           {
*                               for (;;) {
*                                   Task code;
*                               }
*                           }
*
*              ptos     is a pointer to the task's top 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).  'pstk' will thus point to the highest (valid) memory 
*                       location of the stack.  If OS_STK_GROWTH is set to 0, 'pstk' will point to the 
*                       lowest memory location of the stack and the stack will grow with increasing
*                       memory locations.  'pstk' MUST point to a valid 'free' data item.
*
*              prio     is the task's priority.  A unique priority MUST be assigned to each task and the
*                       lower the number, the higher the priority.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产乱码精品一区二区三| 欧美日韩一区二区三区不卡| 色94色欧美sute亚洲13| 欧美色涩在线第一页| 国产欧美精品一区二区色综合| 亚洲愉拍自拍另类高清精品| 国产成人精品一区二区三区网站观看| 欧美综合一区二区三区| 国产精品理伦片| 久久国产精品一区二区| 8x8x8国产精品| 一区二区三区成人| av不卡免费在线观看| 久久久青草青青国产亚洲免观| 亚洲成人在线免费| 91麻豆国产香蕉久久精品| 国产女同互慰高潮91漫画| 久久国产精品色婷婷| 欧美精品乱码久久久久久按摩| 日韩伦理av电影| 国产成人综合亚洲网站| 精品粉嫩aⅴ一区二区三区四区| 亚洲成人av免费| 色吧成人激情小说| 亚洲精品写真福利| 99re这里只有精品6| 国产精品成人网| 成人av一区二区三区| 欧美激情综合在线| 国产精品系列在线播放| 久久久高清一区二区三区| 久久精品国产99| 久久品道一品道久久精品| 激情综合色综合久久综合| 欧美大片日本大片免费观看| 日本不卡在线视频| 日韩精品一区国产麻豆| 国产制服丝袜一区| 久久精品视频一区二区三区| 国产成人精品亚洲日本在线桃色| 国产三级精品视频| 国产成人三级在线观看| 国产精品夫妻自拍| kk眼镜猥琐国模调教系列一区二区 | 美女视频第一区二区三区免费观看网站| 欧美在线观看视频在线| 日韩中文欧美在线| 欧美va亚洲va在线观看蝴蝶网| 精品一区二区三区久久| 国产精品每日更新在线播放网址| 国产成人小视频| 国产片一区二区| 99国产精品99久久久久久| 亚洲va欧美va人人爽午夜| 欧美精品18+| 久久国产三级精品| 成人免费一区二区三区视频| 欧美午夜精品理论片a级按摩| 丝袜亚洲另类丝袜在线| 欧美不卡在线视频| 粉嫩蜜臀av国产精品网站| 亚洲欧美日韩电影| 555夜色666亚洲国产免| 成人网在线免费视频| 亚洲午夜精品久久久久久久久| 日韩一区二区精品在线观看| 成人18精品视频| 午夜精品福利视频网站| 2024国产精品| 在线一区二区三区四区五区| 国产在线不卡一区| 亚洲一区二区三区激情| 国产亚洲欧美色| 欧美日韩国产天堂| 成人一二三区视频| 日本欧美在线看| 亚洲欧洲精品一区二区三区不卡| 在线播放亚洲一区| 99久免费精品视频在线观看| 美女mm1313爽爽久久久蜜臀| 亚洲摸摸操操av| 精品国产一区二区在线观看| 欧美三区在线视频| 成人午夜短视频| 日产欧产美韩系列久久99| 中文字幕字幕中文在线中不卡视频| 91精品国产欧美一区二区| 99国产欧美另类久久久精品| 国产原创一区二区| 日韩中文字幕亚洲一区二区va在线 | 91精品国产色综合久久ai换脸| 成人免费视频一区| 激情综合一区二区三区| 日韩二区三区四区| 亚洲最色的网站| 成人欧美一区二区三区1314 | 国产一区二区三区观看| 天堂在线一区二区| 亚洲一区二区三区爽爽爽爽爽| 国产精品久久免费看| 久久综合狠狠综合久久激情| 日韩亚洲欧美在线| 欧美日韩国产高清一区二区| 色婷婷国产精品久久包臀| 99国产一区二区三精品乱码| 国产成人欧美日韩在线电影| 国产老肥熟一区二区三区| 精品无人码麻豆乱码1区2区 | wwwwxxxxx欧美| 精品精品国产高清a毛片牛牛 | 欧美亚一区二区| 欧美日韩一级视频| 99国产精品99久久久久久| 成人高清视频在线| 波多野结衣中文一区| 成人小视频在线| 成人av一区二区三区| 99久久久免费精品国产一区二区| 成人手机电影网| 国产99久久久久久免费看农村| 韩国欧美国产1区| 国产在线不卡一区| 国产成都精品91一区二区三| 成人精品小蝌蚪| 99精品一区二区三区| 色婷婷av一区| 欧美日产国产精品| 日韩一级免费观看| 2017欧美狠狠色| 欧美国产日韩亚洲一区| 日韩伦理电影网| 午夜免费久久看| 久久99精品一区二区三区| 国产精品一线二线三线| 成人动漫一区二区在线| 在线一区二区三区做爰视频网站| 欧美视频一区二区三区四区| 日韩一区二区麻豆国产| 国产欧美一区二区三区鸳鸯浴| 亚洲国产电影在线观看| 亚洲一区二区3| 男男成人高潮片免费网站| 粉嫩av一区二区三区粉嫩| 91国产成人在线| 日韩三级免费观看| 国产欧美日韩激情| 亚洲一区二区三区三| 狠狠色丁香婷综合久久| 色婷婷精品大在线视频| 日韩天堂在线观看| 国产精品成人在线观看| 秋霞午夜鲁丝一区二区老狼| 国产成人免费在线观看不卡| 欧美日韩精品一区视频| 国产欧美日韩在线看| 亚洲观看高清完整版在线观看| 国产在线视频一区二区三区| 91国偷自产一区二区开放时间| 日韩丝袜美女视频| 亚洲精品亚洲人成人网| 国产一区久久久| 欧美色图激情小说| 欧美激情艳妇裸体舞| 亚洲成国产人片在线观看| 成人网在线播放| 日韩精品一区在线观看| 亚洲午夜免费视频| 国产99久久久国产精品免费看| 91精品一区二区三区久久久久久| 国产精品美女久久久久久| 免费在线观看一区| 欧美伊人久久大香线蕉综合69 | 国产凹凸在线观看一区二区| 欧美最新大片在线看| 国产精品素人视频| 久久精品噜噜噜成人av农村| 日本久久一区二区| 欧美高清在线视频| 国产呦萝稀缺另类资源| 欧美一区二区三区在线看| 亚洲靠逼com| 99久久精品情趣| 国产人久久人人人人爽| 国产一区二区精品久久99| 日韩一区二区三区免费看 | 国产成人免费视频网站高清观看视频| 欧美蜜桃一区二区三区| 亚洲成人777| 欧美三级中文字| 亚洲精品视频在线看| av激情成人网| 中文字幕av不卡| 成人免费毛片aaaaa**| 欧美激情一区二区三区四区| 国产美女精品一区二区三区| 精品久久久久久久久久久久包黑料| 麻豆高清免费国产一区| 欧美日韩国产在线观看| 五月天亚洲婷婷| 制服丝袜中文字幕亚洲|