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

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

?? os_core.c

?? ucos-ii 的完整代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*
*********************************************************************************************************
*                                                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 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美色图激情小说| 色综合天天综合网天天狠天天| 欧美精品日韩精品| 日韩福利视频网| 久久久久久久av麻豆果冻| 国产成人综合在线| 中文字幕日韩av资源站| 欧美日韩中文国产| 麻豆成人在线观看| 国产欧美在线观看一区| 99视频超级精品| 香蕉成人啪国产精品视频综合网| 666欧美在线视频| 国产专区综合网| 日韩美女视频一区二区| 欧美精品在线视频| 国产精品一二三四五| 亚洲日本一区二区三区| 欧美精品亚洲一区二区在线播放| 狠狠色丁香婷婷综合| 国产精品免费视频一区| 欧美日韩二区三区| 国产精品影视天天线| 亚洲精品国久久99热| 欧美一级一区二区| 不卡高清视频专区| 日本不卡视频一二三区| 国产精品久久一卡二卡| 欧美顶级少妇做爰| 9l国产精品久久久久麻豆| 视频一区二区三区入口| 日本一区二区视频在线观看| 欧洲av在线精品| 国产成人8x视频一区二区 | 国产精品一级黄| 伊人婷婷欧美激情| 久久网站热最新地址| 日本精品视频一区二区三区| 国产精品综合一区二区| 夜夜亚洲天天久久| 国产欧美日韩卡一| 欧美成人精品3d动漫h| 色综合久久88色综合天天 | 丝袜诱惑制服诱惑色一区在线观看| 久久这里只精品最新地址| 欧美午夜寂寞影院| 不卡一二三区首页| 国产福利一区在线| 免费不卡在线观看| 性做久久久久久免费观看欧美| 中文字幕视频一区| 国产午夜亚洲精品理论片色戒| 日韩午夜在线播放| 欧美久久久影院| 在线视频观看一区| 97久久超碰国产精品电影| 福利91精品一区二区三区| 麻豆成人久久精品二区三区红 | 欧美色大人视频| 成人免费观看视频| 国产精品自拍一区| 免费观看在线综合| 日本女人一区二区三区| 夜夜亚洲天天久久| 亚洲免费观看高清在线观看| 中文字幕一区二区三区精华液| 日本一区二区三区四区| www欧美成人18+| 精品久久久久久最新网址| 日韩一卡二卡三卡| 欧美一区二区三区精品| 91麻豆精品国产| 欧美精品三级日韩久久| 555www色欧美视频| 欧美一区二区三区在线看| 欧美日韩国产一二三| 777奇米四色成人影色区| 欧美日韩高清一区二区不卡| 欧美精品v国产精品v日韩精品| 欧美午夜精品电影| 这里只有精品免费| 日韩午夜中文字幕| 久久日韩粉嫩一区二区三区| 久久久国产精品不卡| 日本一区二区动态图| 中文字幕一区二区三区四区| 亚洲精品美国一| 亚洲成人福利片| 美腿丝袜一区二区三区| 国产精品12区| 97久久精品人人澡人人爽| 欧美在线小视频| 欧美一区二区三区系列电影| 欧美成人乱码一区二区三区| 久久精品在线观看| 亚洲视频免费观看| 亚洲.国产.中文慕字在线| 美女在线视频一区| 国产成人精品免费视频网站| 色国产综合视频| 91精品国产福利| 国产欧美日韩另类一区| 亚洲黄色小说网站| 日产欧产美韩系列久久99| 国产麻豆成人传媒免费观看| 91麻豆蜜桃一区二区三区| 欧美日本韩国一区| 久久久亚洲精品一区二区三区 | 欧美精品aⅴ在线视频| 久久综合色婷婷| 亚洲啪啪综合av一区二区三区| 亚洲国产一区二区三区| 经典三级在线一区| 91啪九色porn原创视频在线观看| 欧美主播一区二区三区| 久久精品夜色噜噜亚洲aⅴ| 樱桃视频在线观看一区| 麻豆精品在线看| 在线日韩一区二区| 日本一区二区综合亚洲| 午夜精品aaa| 97se亚洲国产综合自在线不卡| 在线成人免费视频| 中文字幕一区二区视频| 免费在线观看日韩欧美| 99久久综合国产精品| 日韩免费电影网站| 亚洲另类一区二区| 国产高清成人在线| 91精品国产高清一区二区三区蜜臀| 国产精品久久久久久久久图文区 | 精品久久人人做人人爽| 曰韩精品一区二区| 福利91精品一区二区三区| 欧美一级欧美三级在线观看| 亚洲男人的天堂一区二区| 国产伦精品一区二区三区免费| 欧美欧美午夜aⅴ在线观看| 最新中文字幕一区二区三区| 国产一区二区三区免费在线观看 | 色综合久久88色综合天天6| 精品美女一区二区| 亚洲18女电影在线观看| 色视频一区二区| 亚洲国产高清在线观看视频| 韩国av一区二区三区在线观看| 91麻豆精品国产自产在线观看一区| 亚洲精品日日夜夜| 成人毛片在线观看| 久久久久国产免费免费| 美日韩一区二区| 日韩视频一区二区三区在线播放| 亚洲午夜激情av| 在线视频国产一区| 亚洲综合色成人| 99国产一区二区三精品乱码| 国产精品午夜久久| 国产精品一级在线| 国产亚洲精品精华液| 国产一区二区免费看| 亚洲精品一线二线三线| 精品一区二区综合| 精品国产乱码久久久久久牛牛| 日本欧美韩国一区三区| 欧美一区二区福利在线| 美女视频一区二区| 精品99一区二区三区| 久久国内精品自在自线400部| 日韩欧美亚洲一区二区| 国产综合久久久久久鬼色 | 日韩一区二区免费在线观看| 免费在线观看成人| 日韩欧美高清在线| 久久99精品久久久久久国产越南 | 欧美三级日韩在线| 五月天丁香久久| 欧美一区在线视频| 国产在线观看一区二区| 日本一区二区免费在线观看视频| 成人听书哪个软件好| 亚洲欧美一区二区三区久本道91| 色欧美乱欧美15图片| 午夜精品福利一区二区三区蜜桃| 欧美一区二区三区公司| 国产精品99久久久久久久vr| 中文字幕高清不卡| 色婷婷久久一区二区三区麻豆| 亚洲一二三四在线| 欧美一级黄色录像| 国产丶欧美丶日本不卡视频| 亚洲欧洲成人精品av97| 欧美狂野另类xxxxoooo| 久草中文综合在线| 中文字幕一区二区三区精华液 | 日韩 欧美一区二区三区| 久久精品在这里| 91原创在线视频| 肉色丝袜一区二区| 久久综合狠狠综合久久综合88 | 国产欧美一区二区三区鸳鸯浴|