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

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

?? os_core.c

?? ucosIIV283,from The company
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             CORE FUNCTIONS
*
*                          (c) Copyright 1992-2006, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_CORE.C
* By      : Jean J. Labrosse
* Version : V2.83
*********************************************************************************************************
*/

#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.
*
*              err       is a pointer to an error code that can contain one of the following values:
*
*                        OS_NO_ERR                  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'
*
* 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 *err)
{
    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 (err == (INT8U *)0) {                     /* Validate 'err'                                     */
        return (0);
    }
    if (pevent == (OS_EVENT *)0) {               /* Is 'pevent' a NULL pointer?                        */
        *err = OS_ERR_PEVENT_NULL;
        return (0);
    }
    if (pname == (INT8U *)0) {                   /* Is 'pname' a NULL pointer?                         */
        *err = OS_ERR_PNAME_NULL;
        return (0);
    }
#endif
    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:
             *err = OS_ERR_EVENT_TYPE;
             return (0);
    }
    OS_ENTER_CRITICAL();
    len  = OS_StrCopy(pname, pevent->OSEventName);    /* Copy name from OS_EVENT                       */
    OS_EXIT_CRITICAL();
    *err = OS_NO_ERR;
    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.
*
*              err       is a pointer to an error code that can contain one of the following values:
*
*                        OS_NO_ERR                  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'
*
* Returns    : None
*********************************************************************************************************
*/

#if OS_EVENT_EN && (OS_EVENT_NAME_SIZE > 1)
void  OSEventNameSet (OS_EVENT *pevent, INT8U *pname, INT8U *err)
{
    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 (err == (INT8U *)0) {                     /* Validate 'err'                                     */
        return;
    }
    if (pevent == (OS_EVENT *)0) {               /* Is 'pevent' a NULL pointer?                        */
        *err = OS_ERR_PEVENT_NULL;
        return;
    }
    if (pname == (INT8U *)0) {                    /* Is 'pname' a NULL pointer?                         */
        *err = OS_ERR_PNAME_NULL;
        return;
    }
#endif
    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:
             *err = 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();
        *err = OS_ERR_EVENT_NAME_TOO_LONG;
        return;
    }
    (void)OS_StrCopy(pevent->OSEventName, pname);     /* Yes, copy name to the event control block     */
    OS_EXIT_CRITICAL();
    *err = OS_NO_ERR;
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                             INITIALIZATION
*
* Description: This function is used to initialize the internals of uC/OS-II and MUST be called prior to
*              creating any uC/OS-II object and, prior to calling OSStart().
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

void  OSInit (void)
{
#if OS_VERSION >= 204
    OSInitHookBegin();                                           /* Call port specific initialization code   */
#endif

    OS_InitMisc();                                               /* Initialize miscellaneous variables       */

    OS_InitRdyList();                                            /* Initialize the Ready List                */

    OS_InitTCBList();                                            /* Initialize the free list of OS_TCBs      */

    OS_InitEventList();                                          /* Initialize the free list of OS_EVENTs    */

#if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
    OS_FlagInit();                                               /* Initialize the event flag structures     */
#endif

#if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
    OS_MemInit();                                                /* Initialize the memory manager            */
#endif

#if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
    OS_QInit();                                                  /* Initialize the message queue structures  */
#endif

    OS_InitTaskIdle();                                           /* Create the Idle Task                     */
#if OS_TASK_STAT_EN > 0
    OS_InitTaskStat();                                           /* Create the Statistic Task                */
#endif

#if OS_TMR_EN > 0
    OSTmr_Init();                                                /* Initialize the Timer Manager             */
#endif

#if OS_VERSION >= 204
    OSInitHookEnd();                                             /* Call port specific init. code            */
#endif

#if OS_VERSION >= 270 && OS_DEBUG_EN > 0
    OSDebugInit();
#endif
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                              ENTER ISR
*
* Description: This function is used to notify uC/OS-II that you are about to service an interrupt
*              service routine (ISR).  This allows uC/OS-II to keep track of interrupt nesting and thus
*              only perform rescheduling at the last nested ISR.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) This function should be called ith interrupts already disabled
*              2) Your ISR can directly increment OSIntNesting without calling this function because
*                 OSIntNesting has been declared 'global'.
*              3) You MUST still call OSIntExit() even though you increment OSIntNesting directly.
*              4) You MUST invoke OSIntEnter() and OSIntExit() in pair.  In other words, for every call
*                 to OSIntEnter() at the beginning of the ISR you MUST have a call to OSIntExit() at the
*                 end of the ISR.
*              5) You are allowed to nest interrupts up to 255 levels deep.
*              6) I removed the OS_ENTER_CRITICAL() and OS_EXIT_CRITICAL() around the increment because
*                 OSIntEnter() is always called with interrupts disabled.
*********************************************************************************************************
*/

void  OSIntEnter (void)
{
    if (OSRunning == OS_TRUE) {
        if (OSIntNesting < 255u) {
            OSIntNesting++;                      /* Increment ISR nesting level                        */
        }
    }
}
/*$PAGE*/
/*
*********************************************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品在线播放免费| 亚洲欧美日韩久久| 91精品福利在线一区二区三区 | 99久久精品国产网站| 另类调教123区| 免费在线看成人av| 亚洲成人黄色小说| 视频一区二区三区中文字幕| 香港成人在线视频| 奇米色777欧美一区二区| 日韩在线卡一卡二| 日韩精品欧美成人高清一区二区| 亚洲成人动漫av| 午夜精品福利一区二区三区蜜桃| 亚洲一区二区中文在线| 亚洲国产精品久久艾草纯爱| 一区二区三区中文字幕精品精品| 一区二区三区四区五区视频在线观看 | 成人免费视频视频在线观看免费| 国产suv精品一区二区883| 福利91精品一区二区三区| 国产成人久久精品77777最新版本| 福利91精品一区二区三区| 91麻豆自制传媒国产之光| 欧美视频在线观看一区二区| 正在播放一区二区| 久久精品网站免费观看| 亚洲视频在线观看三级| 亚洲一区电影777| 麻豆精品视频在线观看| 丁香激情综合国产| 色婷婷综合久久久中文字幕| 欧美高清你懂得| 欧美videossexotv100| 中文字幕不卡在线播放| 亚洲电影第三页| 亚洲天堂久久久久久久| 日韩黄色免费网站| 成人小视频在线| 884aa四虎影成人精品一区| 久久综合给合久久狠狠狠97色69| 亚洲欧洲成人自拍| 日本午夜精品视频在线观看| av中文字幕在线不卡| 91精品国产综合久久婷婷香蕉 | 国产精品一品二品| 欧美午夜电影一区| 久久精品人人做人人爽人人| 亚洲国产另类精品专区| 国产91精品一区二区| 欧美精品视频www在线观看 | 亚洲国产裸拍裸体视频在线观看乱了| 久久黄色级2电影| 一本色道久久综合精品竹菊| 久久先锋影音av鲁色资源| 伊人婷婷欧美激情| 成人激情图片网| 日韩欧美第一区| 性做久久久久久| 欧洲精品视频在线观看| 国产精品久久久久9999吃药| 精品一区二区三区在线播放视频 | 欧美精品久久久久久久久老牛影院| 久久精品夜色噜噜亚洲aⅴ| 日本系列欧美系列| 777奇米成人网| 亚洲曰韩产成在线| 在线亚洲高清视频| 亚洲欧洲日本在线| 成人激情图片网| 国产精品欧美经典| 国产成人综合自拍| 久久久久高清精品| 国产一区二区三区四区在线观看| 日韩一级视频免费观看在线| 午夜欧美电影在线观看| 欧美日韩精品一区视频| 午夜日韩在线观看| 69p69国产精品| 日韩高清不卡一区二区三区| 欧美日韩三级一区二区| 亚洲国产wwwccc36天堂| 欧美片在线播放| 日本伊人色综合网| 欧美精品一区二区精品网| 激情久久五月天| 欧美国产视频在线| k8久久久一区二区三区| 中文字幕在线免费不卡| 94-欧美-setu| 亚洲国产va精品久久久不卡综合| 欧美日精品一区视频| 日本最新不卡在线| 亚洲国产精品ⅴa在线观看| 粉嫩久久99精品久久久久久夜| 中文一区在线播放| 日本大香伊一区二区三区| 亚洲妇熟xx妇色黄| 2020国产精品自拍| 色婷婷综合久久久久中文一区二区 | 捆绑变态av一区二区三区| 日韩精品一区在线| 国产99久久久国产精品潘金| 综合网在线视频| 欧美精品日韩精品| 国产精一区二区三区| 亚洲激情自拍偷拍| 精品日韩在线一区| 懂色av一区二区三区免费观看| 亚洲美女偷拍久久| 欧美大肚乱孕交hd孕妇| 99精品国产一区二区三区不卡| 亚洲国产欧美一区二区三区丁香婷| 精品人在线二区三区| 成人精品视频.| 日韩高清在线一区| 亚洲色图视频免费播放| 欧美一区二区三区视频| av中文字幕在线不卡| 日本欧美韩国一区三区| 中文字幕欧美日韩一区| 日韩一区二区免费高清| 色网综合在线观看| 国产精品一区二区无线| 偷偷要91色婷婷| 国产精品国产三级国产| 精品国产精品一区二区夜夜嗨| 91亚洲精华国产精华精华液| 久久激五月天综合精品| 亚洲妇熟xx妇色黄| 亚洲男女毛片无遮挡| 国产午夜精品一区二区三区视频 | 久久99久久久欧美国产| 亚洲婷婷在线视频| 久久久美女毛片| 日韩欧美一二三区| 欧美日韩三级一区| 欧美亚洲国产一卡| 99久久国产综合精品女不卡| 精品一区二区三区在线观看| 亚洲gay无套男同| 一区二区视频在线看| 国产精品高潮呻吟久久| 国产亚洲一区二区在线观看| 日韩久久精品一区| 91精品国产欧美一区二区| 欧美性感一类影片在线播放| 91一区二区在线观看| www.亚洲激情.com| 成人影视亚洲图片在线| 国产精品夜夜爽| 国产精品综合二区| 黑人巨大精品欧美一区| 久久电影国产免费久久电影| 日韩不卡手机在线v区| 日韩成人dvd| 蜜桃传媒麻豆第一区在线观看| 国模无码大尺度一区二区三区| 亚洲高清视频在线| 亚洲国产视频一区| 香蕉久久夜色精品国产使用方法 | 韩国av一区二区三区| 久久99精品久久久久久| 国产河南妇女毛片精品久久久| 国产一区二区三区久久久| 国产精品一区二区三区网站| 国产精品一卡二卡| av一区二区三区四区| 色综合 综合色| 欧美日韩久久不卡| 欧美成人伊人久久综合网| 精品国产91亚洲一区二区三区婷婷 | 欧美日韩国产欧美日美国产精品| 欧美日韩美女一区二区| 日韩欧美激情一区| 国产精品免费网站在线观看| 亚洲女爱视频在线| 日韩电影在线观看一区| 国产乱对白刺激视频不卡| 91亚洲国产成人精品一区二区三| 在线亚洲免费视频| 欧美一级欧美一级在线播放| 26uuu色噜噜精品一区| 亚洲女爱视频在线| 久久国产人妖系列| 日本韩国欧美三级| 日韩免费电影一区| 亚洲欧洲日韩一区二区三区| 日韩av在线发布| 成人在线综合网站| 666欧美在线视频| 国产精品久久久久久久久动漫| 香蕉久久夜色精品国产使用方法 | 精品盗摄一区二区三区| 国产精品久久毛片| 琪琪久久久久日韩精品| 成人黄色一级视频| 精品日韩av一区二区| 久久影院视频免费| 亚洲综合清纯丝袜自拍|