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

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

?? os_core.c

?? VC版式的 UCOSII ! 修改前人255任務(wù)的那個(gè)版本! 已經(jīng)改為286u版! 可用VC6直接編過(guò)!
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             CORE FUNCTIONS
*
*                              (c) Copyright 1992-2007, Micrium, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_CORE.C
* By      : Jean J. Labrosse
* Version : V2.86
*
* LICENSING TERMS:
* ---------------
*   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.  
* If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license 
* its use in your product. We provide ALL the source code for your convenience and to help you experience 
* uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a 
* licensing fee.
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#define  OS_GLOBALS
#include <ucos_ii.h>
#endif

/*
*********************************************************************************************************
*                                       PRIORITY RESOLUTION TABLE
*
* Note: Index into table is bit pattern to resolve highest priority
*       Indexed value corresponds to highest priority bit position (i.e. 0..7)
*********************************************************************************************************
*/

INT8U  const  OSUnMapTbl[256] = {
    0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x00 to 0x0F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x10 to 0x1F                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x20 to 0x2F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x30 to 0x3F                             */
    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x40 to 0x4F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x50 to 0x5F                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x60 to 0x6F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x70 to 0x7F                             */
    7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x80 to 0x8F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x90 to 0x9F                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xA0 to 0xAF                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xB0 to 0xBF                             */
    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xC0 to 0xCF                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xD0 to 0xDF                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xE0 to 0xEF                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0        /* 0xF0 to 0xFF                             */
};

/*$PAGE*/
/*
*********************************************************************************************************
*                                       FUNCTION PROTOTYPES
*********************************************************************************************************
*/

static  void  OS_InitEventList(void);

static  void  OS_InitMisc(void);

static  void  OS_InitRdyList(void);

static  void  OS_InitTaskIdle(void);

#if OS_TASK_STAT_EN > 0
static  void  OS_InitTaskStat(void);
#endif

static  void  OS_InitTCBList(void);

static  void  OS_SchedNew(void);

/*$PAGE*/
/*
*********************************************************************************************************
*                         GET THE NAME OF A SEMAPHORE, MUTEX, MAILBOX or QUEUE
*
* Description: This function is used to obtain the name assigned to a semaphore, mutex, mailbox or queue.
*
* Arguments  : pevent    is a pointer to the event group.  'pevent' can point either to a semaphore,
*                        a mutex, a mailbox or a queue.  Where this function is concerned, the actual
*                        type is irrelevant.
*
*              pname     is a pointer to an ASCII string that will receive the name of the semaphore,
*                        mutex, mailbox or queue.  The string must be able to hold at least
*                        OS_EVENT_NAME_SIZE characters.
*
*              perr      is a pointer to an error code that can contain one of the following values:
*
*                        OS_ERR_NONE                if the name was copied to 'pname'
*                        OS_ERR_EVENT_TYPE          if 'pevent' is not pointing to the proper event
*                                                   control block type.
*                        OS_ERR_PNAME_NULL          You passed a NULL pointer for 'pname'
*                        OS_ERR_PEVENT_NULL         if you passed a NULL pointer for 'pevent'
*                        OS_ERR_NAME_GET_ISR        if you are trying to call this function from an ISR
*
* Returns    : The length of the string or 0 if the 'pevent' is a NULL pointer.
*********************************************************************************************************
*/

#if (OS_EVENT_EN) && (OS_EVENT_NAME_SIZE > 1)
INT8U  OSEventNameGet (OS_EVENT *pevent, INT8U *pname, INT8U *perr)
{
    INT8U      len;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_ARG_CHK_EN > 0
    if (perr == (INT8U *)0) {                    /* Validate 'perr'                                    */
        return (0);
    }
    if (pevent == (OS_EVENT *)0) {               /* Is 'pevent' a NULL pointer?                        */
        *perr = OS_ERR_PEVENT_NULL;
        return (0);
    }
    if (pname == (INT8U *)0) {                   /* Is 'pname' a NULL pointer?                         */
        *perr = OS_ERR_PNAME_NULL;
        return (0);
    }
#endif
    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        *perr  = OS_ERR_NAME_GET_ISR;
        return (0);
    }
    switch (pevent->OSEventType) {
        case OS_EVENT_TYPE_SEM:
        case OS_EVENT_TYPE_MUTEX:
        case OS_EVENT_TYPE_MBOX:
        case OS_EVENT_TYPE_Q:
             break;

        default:
             *perr = OS_ERR_EVENT_TYPE;
             return (0);
    }
    OS_ENTER_CRITICAL();
    len   = OS_StrCopy(pname, pevent->OSEventName);   /* Copy name from OS_EVENT                       */
    OS_EXIT_CRITICAL();
    *perr = OS_ERR_NONE;
    return (len);
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                         ASSIGN A NAME TO A SEMAPHORE, MUTEX, MAILBOX or QUEUE
*
* Description: This function assigns a name to a semaphore, mutex, mailbox or queue.
*
* Arguments  : pevent    is a pointer to the event group.  'pevent' can point either to a semaphore,
*                        a mutex, a mailbox or a queue.  Where this function is concerned, it doesn't
*                        matter the actual type.
*
*              pname     is a pointer to an ASCII string that will be used as the name of the semaphore,
*                        mutex, mailbox or queue.  The string must be able to hold at least
*                        OS_EVENT_NAME_SIZE characters.
*
*              perr      is a pointer to an error code that can contain one of the following values:
*
*                        OS_ERR_NONE                if the requested task is resumed
*                        OS_ERR_EVENT_TYPE          if 'pevent' is not pointing to the proper event
*                                                   control block type.
*                        OS_ERR_PNAME_NULL          You passed a NULL pointer for 'pname'
*                        OS_ERR_PEVENT_NULL         if you passed a NULL pointer for 'pevent'
*                        OS_ERR_NAME_SET_ISR        if you called this function from an ISR
*
* Returns    : None
*********************************************************************************************************
*/

#if (OS_EVENT_EN) && (OS_EVENT_NAME_SIZE > 1)
void  OSEventNameSet (OS_EVENT *pevent, INT8U *pname, INT8U *perr)
{
    INT8U      len;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_ARG_CHK_EN > 0
    if (perr == (INT8U *)0) {                    /* Validate 'perr'                                    */
        return;
    }
    if (pevent == (OS_EVENT *)0) {               /* Is 'pevent' a NULL pointer?                        */
        *perr = OS_ERR_PEVENT_NULL;
        return;
    }
    if (pname == (INT8U *)0) {                   /* Is 'pname' a NULL pointer?                         */
        *perr = OS_ERR_PNAME_NULL;
        return;
    }
#endif
    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        *perr = OS_ERR_NAME_SET_ISR;
        return;
    }
    switch (pevent->OSEventType) {
        case OS_EVENT_TYPE_SEM:
        case OS_EVENT_TYPE_MUTEX:
        case OS_EVENT_TYPE_MBOX:
        case OS_EVENT_TYPE_Q:
             break;

        default:
             *perr = OS_ERR_EVENT_TYPE;
             return;
    }
    OS_ENTER_CRITICAL();
    len = OS_StrLen(pname);                           /* Can we fit the string in the storage area?    */
    if (len > (OS_EVENT_NAME_SIZE - 1)) {             /* No                                            */
        OS_EXIT_CRITICAL();
        *perr = OS_ERR_EVENT_NAME_TOO_LONG;
        return;
    }
    (void)OS_StrCopy(pevent->OSEventName, pname);     /* Yes, copy name to the event control block     */
    OS_EXIT_CRITICAL();
    *perr = OS_ERR_NONE;
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                      PEND ON MULTIPLE EVENTS
*
* Description: This function waits for multiple events.  If multiple events are ready at the start of the
*              pend call, then all available events are returned as ready.  If the task must pend on the
*              multiple events, then only the first posted or aborted event is returned as ready.
*
* Arguments  : pevents_pend  is a pointer to a NULL-terminated array of event control blocks to wait for.
*
*              pevents_rdy   is a pointer to an array to return which event control blocks are available
*                            or ready.  The size of the array MUST be greater than or equal to the size
*                            of the 'pevents_pend' array, including terminating NULL.
*
*              pmsgs_rdy     is a pointer to an array to return messages from any available message-type
*                            events.  The size of the array MUST be greater than or equal to the size of
*                            the 'pevents_pend' array, excluding the terminating NULL.  Since NULL
*                            messages are valid messages, this array cannot be NULL-terminated.  Instead,
*                            every available message-type event returns its messages in the 'pmsgs_rdy'
*                            array at the same index as the event is returned in the 'pevents_rdy' array.
*                            All other 'pmsgs_rdy' array indices are filled with NULL messages.
*
*              timeout       is an optional timeout period (in clock ticks).  If non-zero, your task will
*                            wait for the resources up to the amount of time specified by this argument.
*                            If you specify 0, however, your task will wait forever for the specified
*                            events or, until the resources becomes available (or the events occur).
*
*              perr          is a pointer to where an error message will be deposited.  Possible error
*                            messages are:
*
*                            OS_ERR_NONE         The call was successful and your task owns the resources
*                                                or, the events you are waiting for occurred; check the
*                                                'pevents_rdy' array for which events are available.
*                            OS_ERR_PEND_ABORT   The wait on the events was aborted; check the
*                                                'pevents_rdy' array for which events were aborted.
*                            OS_ERR_TIMEOUT      The events were not received within the specified
*                                                'timeout'.
*                            OS_ERR_PEVENT_NULL  If 'pevents_pend', 'pevents_rdy', or 'pmsgs_rdy' is a 
*                                                NULL pointer.
*                            OS_ERR_EVENT_TYPE   If you didn't pass a pointer to an array of semaphores, 
*                                                mailboxes, and/or queues.
*                            OS_ERR_PEND_ISR     If you called this function from an ISR and the result
*                                                would lead to a suspension.
*                            OS_ERR_PEND_LOCKED  If you called this function when the scheduler is locked.
*
* Returns    : >  0          the number of events returned as ready or aborted.
*              == 0          if no events are returned as ready because of timeout or upon error.
*
* Notes      : 1) a. Validate 'pevents_pend' array as valid OS_EVENTs : 
*
*                        semaphores, mailboxes, queues
*
*                 b. Return ALL available events and messages, if any
*
*                 c. Add    current task priority as pending to   each events's wait list
*                      Performed in OS_EventTaskWaitMulti()
*
*                 d. Wait on any of multiple events
*
*                 e. Remove current task priority as pending from each events's wait list
*                      Performed in OS_EventTaskRdy(), if events posted or aborted
*
*                 f. Return any event posted or aborted, if any
*                      else
*                    Return timeout
*
*              2) 'pevents_rdy' initialized to NULL PRIOR to all other validation or function handling in 
*                 case of any error(s).

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精三区欧美精三区| 日韩三级视频在线观看| 免费欧美日韩国产三级电影| 国产精品天干天干在线综合| 欧美精品成人一区二区三区四区| 成人av网在线| 国产一区二区三区四| 亚洲国产欧美一区二区三区丁香婷| 久久一区二区三区国产精品| 欧美精品v日韩精品v韩国精品v| 99综合电影在线视频| 国内精品久久久久影院一蜜桃| 亚洲一区二区三区美女| 国产精品妹子av| 久久日一线二线三线suv| 3751色影院一区二区三区| 97久久超碰精品国产| 国产精品一品视频| 久久国产日韩欧美精品| 五月婷婷久久综合| 一区二区三区在线免费播放| 中文字幕一区二区三中文字幕| 久久久综合九色合综国产精品| 日韩一区和二区| 欧美日韩国产综合一区二区| 欧美性淫爽ww久久久久无| 99re热这里只有精品免费视频| 粉嫩av一区二区三区粉嫩| 国产做a爰片久久毛片 | 高清不卡在线观看| 黄页网站大全一区二区| 奇米四色…亚洲| 日韩国产精品久久久久久亚洲| 亚洲综合免费观看高清完整版在线 | www.欧美色图| 成人h动漫精品一区二区| 国产丶欧美丶日本不卡视频| 国产伦理精品不卡| 国产一区二区三区| 国产激情视频一区二区在线观看| 国产在线视频一区二区| 国产一区在线精品| 国产乱子伦一区二区三区国色天香| 精品一区中文字幕| 国产乱对白刺激视频不卡| 国产一区二区精品久久| 国产成人免费在线视频| 国产91在线观看丝袜| av不卡在线播放| 色94色欧美sute亚洲线路二| 精品视频免费看| 91精品国产综合久久久蜜臀图片 | 6080日韩午夜伦伦午夜伦| 7777女厕盗摄久久久| 日韩欧美一区二区视频| 久久美女艺术照精彩视频福利播放 | 成人免费在线视频| 亚洲主播在线播放| 日韩在线一区二区三区| 免费看欧美美女黄的网站| 国产激情一区二区三区桃花岛亚洲| 成人午夜短视频| 一本大道久久a久久综合| 欧美日韩大陆在线| 精品国产一区二区三区四区四| 欧美激情一区二区三区不卡| 一区二区三区小说| 免费成人你懂的| 春色校园综合激情亚洲| 欧美亚洲国产一区二区三区| 日韩欧美一区二区视频| 欧美经典一区二区三区| 亚洲综合丁香婷婷六月香| 日本欧美一区二区| 国产精品99久久久| 91国产成人在线| 精品女同一区二区| 亚洲欧美日韩国产中文在线| 丝袜美腿一区二区三区| 国产精品一级黄| 欧美三级韩国三级日本三斤| 久久久一区二区| 亚洲一区二区四区蜜桃| 国内精品国产三级国产a久久| 91激情五月电影| 精品国产亚洲在线| 亚洲免费在线电影| 久久99精品一区二区三区三区| 91亚洲精华国产精华精华液| 日韩欧美一二三区| 亚洲欧美激情视频在线观看一区二区三区 | 国产乱色国产精品免费视频| 欧美亚洲国产一卡| 国产精品―色哟哟| 美女在线观看视频一区二区| 色久优优欧美色久优优| 久久久一区二区三区捆绑**| 日欧美一区二区| av男人天堂一区| 久久嫩草精品久久久久| 午夜精品久久久久久不卡8050| 成人爱爱电影网址| 精品久久人人做人人爽| 午夜精品免费在线| 91麻豆视频网站| 亚洲国产精品成人综合色在线婷婷| 日日摸夜夜添夜夜添国产精品 | 天堂精品中文字幕在线| 91在线视频免费91| 久久婷婷成人综合色| 日韩国产精品久久| 欧美亚洲国产一卡| 亚洲少妇30p| 北条麻妃国产九九精品视频| 欧美精品一区二区三区蜜桃| 三级久久三级久久久| 欧美伊人久久久久久午夜久久久久| 中文字幕一区二区在线播放| 国产成人av网站| 久久这里只有精品视频网| 天天操天天干天天综合网| 欧洲在线/亚洲| 亚洲最大色网站| 色偷偷成人一区二区三区91| 亚洲日本欧美天堂| 92国产精品观看| 亚洲色图一区二区三区| av在线不卡电影| ...xxx性欧美| 99久久精品国产网站| 国产精品国产三级国产aⅴ无密码| 大美女一区二区三区| 久久久久国产成人精品亚洲午夜| 精品在线观看免费| 欧美精品一区视频| 国产一区二区福利视频| 久久婷婷色综合| 高清不卡在线观看| 国产精品久久久久久久午夜片 | 午夜欧美一区二区三区在线播放| 欧美在线免费观看亚洲| 亚洲国产精品一区二区久久 | 久久综合色天天久久综合图片| 日韩av不卡一区二区| 欧美一区二区三区在线看| 免费日韩伦理电影| www成人在线观看| 国产成人精品亚洲日本在线桃色 | 国产精品久久三| 色综合久久88色综合天天| 亚洲午夜精品在线| 91精品国产一区二区三区蜜臀| 琪琪久久久久日韩精品| 久久这里只有精品首页| 成人精品在线视频观看| 国产精品入口麻豆原神| 91国偷自产一区二区使用方法| 日韩精彩视频在线观看| 欧美mv日韩mv亚洲| 成人午夜精品一区二区三区| 一区二区三区日韩| 欧美一区午夜视频在线观看 | 91久久精品一区二区二区| 亚洲国产中文字幕在线视频综合| 在线不卡免费av| 国产精品一区二区三区乱码| 亚洲欧美日韩在线播放| 制服丝袜中文字幕亚洲| 高清不卡一区二区| 一区二区三区高清不卡| 日韩精品影音先锋| 99精品热视频| 久久精品国产亚洲a| 国产精品第五页| 欧美一区二区女人| 99久久精品费精品国产一区二区| 视频一区在线播放| 国产亚洲成年网址在线观看| 在线观看亚洲a| 韩国成人在线视频| 亚洲永久免费视频| 久久亚洲精品国产精品紫薇| 91福利视频久久久久| 激情欧美一区二区| 一区二区三区在线观看国产| 久久久夜色精品亚洲| 欧美视频精品在线| 国产黑丝在线一区二区三区| 亚洲va韩国va欧美va| 国产精品三级电影| 日韩欧美在线123| 91福利区一区二区三区| 国产v综合v亚洲欧| 舔着乳尖日韩一区| 亚洲欧美国产三级| 国产亚洲婷婷免费| 欧美一区二区三区日韩视频| 欧美伊人精品成人久久综合97 | 国产一区二区三区在线看麻豆| 亚洲一级电影视频|