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

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

?? os_core.c

?? UCOS 源代碼
?? 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一区二区三区免费野_久草精品视频
久久久激情视频| 色天天综合色天天久久| 欧美aaa在线| 亚洲午夜电影在线观看| 五月激情丁香一区二区三区| 男女性色大片免费观看一区二区 | 天堂va蜜桃一区二区三区| 麻豆成人av在线| 99久久精品免费看| 日韩一区二区三区视频在线观看| 久久免费看少妇高潮| 亚洲成人一区在线| 国产成人精品一区二区三区四区| 欧美日韩中文字幕一区二区| 久久综合九色综合97婷婷| 亚洲a一区二区| 北条麻妃一区二区三区| 日韩欧美国产三级电影视频| 国产精品美女视频| 久久99精品久久久久久| 欧美色成人综合| 亚洲欧美国产77777| 国产一区二区不卡在线| 日韩欧美亚洲国产另类| 亚洲五月六月丁香激情| 99久久精品国产一区| 欧美国产一区二区在线观看| 久久 天天综合| 日韩丝袜情趣美女图片| 男女视频一区二区| 日韩一级二级三级| 久久69国产一区二区蜜臀| 日韩一区二区三区观看| 日韩二区在线观看| 日韩一区国产二区欧美三区| 日产国产欧美视频一区精品| 91精品国产高清一区二区三区 | 99天天综合性| 亚洲综合一区二区三区| 欧美三区在线观看| 国模无码大尺度一区二区三区| 日韩一区二区三区av| 久久黄色级2电影| 国产欧美精品区一区二区三区| 国产jizzjizz一区二区| 国产欧美日韩另类视频免费观看| 99久久免费精品| 亚洲午夜成aⅴ人片| 精品精品国产高清一毛片一天堂| 国产成人在线影院| 亚洲自拍与偷拍| 久久久久国产精品麻豆ai换脸| 成人精品免费看| 亚洲成人激情av| 久久久精品综合| 欧美男同性恋视频网站| 成人午夜看片网址| 日本不卡一区二区三区高清视频| 久久精品欧美日韩| 日韩欧美中文字幕制服| 色综合色狠狠综合色| 国产乱妇无码大片在线观看| 日韩中文字幕1| 亚洲精品中文在线| 亚洲r级在线视频| 日韩精品乱码av一区二区| 欧美一区二区在线不卡| 日本韩国一区二区三区| 国产福利一区二区三区在线视频| 石原莉奈在线亚洲二区| 亚洲精品乱码久久久久久久久| 精品国产凹凸成av人网站| 欧美日韩免费高清一区色橹橹| 成人sese在线| av在线这里只有精品| 成人av小说网| 成人性视频免费网站| 成人免费视频一区| 91性感美女视频| 色婷婷久久久久swag精品| 成人一区二区三区| 蜜桃一区二区三区在线观看| 国产精品网站在线观看| 日韩欧美成人激情| 久久久久久久久久久久久夜| 久久毛片高清国产| 欧美激情一区在线观看| 日本一区二区三区电影| 中文字幕制服丝袜成人av| 亚洲欧美日韩综合aⅴ视频| 手机精品视频在线观看| 青青草一区二区三区| 国产一区二区三区久久久| 成人精品gif动图一区| 欧美在线观看视频在线| 26uuu亚洲综合色| 亚洲男人都懂的| 日本女人一区二区三区| 成人中文字幕合集| 欧美一二三四在线| 亚洲欧美电影一区二区| 麻豆成人免费电影| 欧美午夜免费电影| 国产精品天美传媒沈樵| 日韩高清不卡在线| 91麻豆精品视频| 国产精品萝li| 精品一区二区免费| 欧美精品在欧美一区二区少妇| 日本一区免费视频| 狠狠网亚洲精品| 欧美日韩黄视频| 亚洲欧洲制服丝袜| 成人午夜精品在线| 国产日韩欧美电影| 国产精品资源在线看| 欧美一区二区三区的| 日韩国产欧美在线视频| 色婷婷久久久久swag精品| 亚洲欧美中日韩| 99在线精品观看| 亚洲另类春色校园小说| 99re热视频精品| 亚洲精选免费视频| 欧美丝袜自拍制服另类| 亚洲一区二区三区四区在线| 91在线视频观看| 亚洲男人天堂av| 欧美日韩高清一区二区| 日韩精品1区2区3区| 日韩一级二级三级精品视频| 麻豆成人av在线| 日本一二三四高清不卡| 99精品久久免费看蜜臀剧情介绍| 国产精品美女久久久久久久网站| 97se亚洲国产综合自在线观| 亚洲在线视频免费观看| 91精品视频网| 99国产精品99久久久久久| 亚洲国产精品久久一线不卡| 欧美一级久久久久久久大片| 国产专区欧美精品| 有坂深雪av一区二区精品| 91精品国产麻豆| 色激情天天射综合网| 免费的国产精品| 亚洲久草在线视频| 亚洲欧美日本韩国| 精品免费视频.| 欧美日韩精品欧美日韩精品一| 国产成人精品三级| 人人精品人人爱| 亚洲精选一二三| 亚洲国产激情av| 精品国产凹凸成av人导航| 欧美日韩一区高清| 一本久久综合亚洲鲁鲁五月天| 久久超碰97中文字幕| 一区二区三区四区不卡视频| 国产精品污网站| 久久久久久亚洲综合影院红桃| 在线不卡中文字幕播放| 色香蕉久久蜜桃| 日本道色综合久久| 91久久国产最好的精华液| kk眼镜猥琐国模调教系列一区二区| 捆绑调教一区二区三区| 日本中文字幕一区二区有限公司| 午夜在线成人av| 日韩中文字幕一区二区三区| 亚洲一区二区三区免费视频| 自拍偷自拍亚洲精品播放| 国产精品视频九色porn| 国产精品国产馆在线真实露脸 | 91麻豆精品国产综合久久久久久| 91小视频免费观看| 色狠狠色狠狠综合| 欧美日精品一区视频| 7878成人国产在线观看| 欧美va亚洲va在线观看蝴蝶网| 久久中文娱乐网| 亚洲欧美激情插| 日本一道高清亚洲日美韩| 国产一区二区在线看| a亚洲天堂av| 欧美电影一区二区| 国产精品国产a| 日韩在线a电影| 91在线看国产| 欧美电影免费观看高清完整版在 | 亚洲精品一区二区三区99| 国产网站一区二区| 亚洲综合激情另类小说区| 韩国三级在线一区| 欧美剧情电影在线观看完整版免费励志电影| 欧美日韩亚洲另类| 国产精品国模大尺度视频| 日韩黄色一级片| 欧美日韩国产一区二区三区地区| www久久精品|