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

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

?? os_core.c

?? ucosII_2.8源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             CORE FUNCTIONS
*
*                          (c) Copyright 1992-2005, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_CORE.C
* By      : Jean J. Labrosse
* Version : V2.80
*********************************************************************************************************
*/

#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_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 == TRUE) {
        if (OSIntNesting < 255u) {
            OSIntNesting++;                      /* Increment ISR nesting level                        */
        }
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                               EXIT ISR
*
* Description: This function is used to notify uC/OS-II that you have completed serviving an ISR.  When
*              the last nested ISR has completed, uC/OS-II will call the scheduler to determine whether
*              a new, high-priority task, is ready to run.
*
* Arguments  : none

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费观看男女羞羞视频| 不卡一区二区三区四区| 青青青爽久久午夜综合久久午夜| 日韩影院精彩在线| 午夜久久电影网| 美女网站一区二区| 免费久久精品视频| 捆绑调教一区二区三区| 麻豆视频观看网址久久| 激情深爱一区二区| 成人免费黄色在线| 一本色道久久综合亚洲精品按摩| 色综合欧美在线| 欧美视频一区二区三区四区| 欧美日韩一级二级| 欧美xingq一区二区| 久久综合网色—综合色88| 欧美国产丝袜视频| 亚洲精品午夜久久久| 婷婷夜色潮精品综合在线| 久久精品理论片| 成人精品国产福利| 欧美偷拍一区二区| 欧美精品一区二区在线观看| 国产精品午夜在线| 日韩中文字幕不卡| 成人午夜激情片| 欧美日韩另类国产亚洲欧美一级| 日韩精品综合一本久道在线视频| 欧美极品另类videosde| 一区二区三区在线免费视频 | 亚洲高清视频在线| 免费成人在线观看视频| 成人免费观看视频| 日韩视频免费直播| 婷婷国产在线综合| 国产精品99久久久久久似苏梦涵| 日本道色综合久久| 久久青草国产手机看片福利盒子| 成人欧美一区二区三区在线播放| 日日摸夜夜添夜夜添精品视频 | 91在线免费视频观看| 69精品人人人人| 中文字幕视频一区| 老司机精品视频线观看86| 91女人视频在线观看| 欧美第一区第二区| 亚洲一区二区三区四区在线| 国产一区福利在线| 4438x成人网最大色成网站| 综合久久久久久| 国产电影一区二区三区| 欧美一区二区三区日韩视频| 亚洲日本在线a| 国产精品99久久久久| 91精品国产色综合久久久蜜香臀| 亚洲桃色在线一区| 粉嫩嫩av羞羞动漫久久久| 欧美一区二区三区啪啪| 亚洲国产成人精品视频| 99久久99久久精品免费看蜜桃| 欧美精品一区二| 男人的天堂亚洲一区| 欧美绝品在线观看成人午夜影视| 亚洲色图丝袜美腿| 97精品久久久久中文字幕 | 亚洲在线视频免费观看| 成人免费福利片| 国产三级欧美三级| 国产一区不卡在线| 久久午夜老司机| 国产一二精品视频| 久久久不卡网国产精品二区| 久久av资源站| 精品国产成人系列| 国产在线播放一区| 国产亚洲精久久久久久| 国产成人精品免费一区二区| 久久综合色婷婷| 韩国精品在线观看| 国产色一区二区| 成人h动漫精品一区二区| 中文字幕av一区二区三区高| 成人av先锋影音| 日韩美女视频一区| 在线视频你懂得一区| 亚洲午夜激情av| 91精品国模一区二区三区| 免费的成人av| 国产女主播一区| 91网站在线观看视频| 亚洲午夜久久久久久久久电影院| 欧美午夜视频网站| 久久99精品久久久久久国产越南| 久久先锋影音av鲁色资源网| 国产成人免费9x9x人网站视频| 中文字幕av资源一区| 在线影院国内精品| 免费xxxx性欧美18vr| 久久久久88色偷偷免费| 91在线观看下载| 午夜欧美在线一二页| 久久综合久久综合久久综合| 粉嫩aⅴ一区二区三区四区| 亚洲另类在线一区| 日韩欧美高清一区| av不卡在线观看| 大桥未久av一区二区三区中文| 国产精品家庭影院| 欧美精品日日鲁夜夜添| 国产·精品毛片| 亚洲成人精品在线观看| 久久久精品2019中文字幕之3| 99v久久综合狠狠综合久久| 日韩av网站在线观看| 国产精品欧美久久久久无广告| 欧美三级电影网| 国产v综合v亚洲欧| 日韩精品91亚洲二区在线观看| 久久精品一区二区| 56国语精品自产拍在线观看| av资源站一区| 国产在线不卡视频| 五月天婷婷综合| 中文字幕综合网| 国产欧美一区二区精品性色| 欧美欧美欧美欧美首页| 99国产精品视频免费观看| 激情图区综合网| 日韩av在线发布| 亚洲图片欧美视频| 国产精品久久久久一区二区三区| 欧美一区二区视频免费观看| 在线视频观看一区| aaa国产一区| 从欧美一区二区三区| 美女精品自拍一二三四| 亚洲成人www| 亚洲最快最全在线视频| 综合分类小说区另类春色亚洲小说欧美 | 久久亚洲精品小早川怜子| 91精品国产欧美一区二区成人 | 久久精品一区二区| 欧美成人激情免费网| 91精品在线免费观看| 欧美日韩国产一级片| 日韩欧美中文字幕精品| 91黄色激情网站| 色先锋资源久久综合| zzijzzij亚洲日本少妇熟睡| 成人一区二区视频| 国产99久久精品| 成人激情黄色小说| av成人老司机| 91福利视频网站| 欧美精品三级日韩久久| 6080日韩午夜伦伦午夜伦| 51精品国自产在线| 精品国产1区二区| 欧美不卡一二三| 国产调教视频一区| 国产日韩一级二级三级| 国产欧美日韩在线| 中文字幕中文字幕一区| 中文字幕一区二区三区色视频| 国产精品福利一区| 亚洲综合清纯丝袜自拍| 夜夜操天天操亚洲| 奇米精品一区二区三区四区| 蜜桃av一区二区| 国产成人综合视频| av爱爱亚洲一区| 欧美高清一级片在线| 日韩欧美区一区二| 中文字幕一区二区三区视频| 一区二区三区在线观看欧美| 日本亚洲免费观看| 国产aⅴ精品一区二区三区色成熟| 91视频精品在这里| 欧美一级片在线| 国产精品久久久久久久久免费丝袜 | 成人免费高清在线观看| 欧美三电影在线| 精品福利一区二区三区| 亚洲天堂久久久久久久| 天堂一区二区在线| 国产高清一区日本| 欧美日韩在线一区二区| 日韩一区二区视频在线观看| 精品一区二区精品| 色婷婷综合久久久久中文一区二区| 在线观看不卡一区| 欧美国产国产综合| av电影在线观看一区| 91麻豆国产香蕉久久精品| 欧美剧情片在线观看| 亚洲啪啪综合av一区二区三区| 日本sm残虐另类| 欧美伊人精品成人久久综合97| 久久久久国产一区二区三区四区|