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

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

?? os_core.c

?? ucos2的代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             CORE FUNCTIONS
*
*                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File : OS_CORE.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#define  OS_GLOBALS
#include "includes.h"
#endif

/*
*********************************************************************************************************
*                              MAPPING TABLE TO MAP BIT POSITION TO BIT MASK
*
* Note: Index into table is desired bit position, 0..7
*       Indexed value corresponds to bit mask
*********************************************************************************************************
*/

INT8U  const  OSMapTbl[]   = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};

/*
*********************************************************************************************************
*                                       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[] = {
    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                             */
};

/*
*********************************************************************************************************
*                                       FUNCTION PROTOTYPES
*********************************************************************************************************
*/
static  void  OS_InitEventList(void);
static  void  OS_InitMisc(void);
static  void  OS_InitRdyList(void);
static  void  OS_InitTaskIdle(void);
static  void  OS_InitTaskStat(void);
static  void  OS_InitTCBList(void);

/*$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) reentrant
{
#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
}
/*$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) reentrant
{
    if (OSRunning == TRUE) {
        if (OSIntNesting < 255) {
            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
*
* Returns    : none
*
* Notes      : 1) 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.
*              2) Rescheduling is prevented when the scheduler is locked (see OS_SchedLock())
*********************************************************************************************************
*/

void  OSIntExit (void) reentrant
{

    
    
    if (OSRunning == TRUE) {
        OS_ENTER_CRITICAL();
        if (OSIntNesting > 0) {                            /* Prevent OSIntNesting from wrapping       */
            OSIntNesting--;
        }
        if ((OSIntNesting == 0) && (OSLockNesting == 0)) { /* Reschedule only if all ISRs complete ... */
            OSIntExitY    = OSUnMapTbl[OSRdyGrp];          /* ... and not locked.                      */
            OSPrioHighRdy = (INT8U)((OSIntExitY << 3) + OSUnMapTbl[OSRdyTbl[OSIntExitY]]);
            if (OSPrioHighRdy != OSPrioCur) {              /* No Ctx Sw if current task is highest rdy */
                OSTCBHighRdy  = OSTCBPrioTbl[OSPrioHighRdy];
                OSCtxSwCtr++;                              /* Keep track of the number of ctx switches */
                OSIntCtxSw();                              /* Perform interrupt level ctx switch       */
            }
        }
        OS_EXIT_CRITICAL();
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                          PREVENT SCHEDULING
*
* Description: This function is used to prevent rescheduling to take place.  This allows your application
*              to prevent context switches until you are ready to permit context switching.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) You MUST invoke OSSchedLock() and OSSchedUnlock() in pair.  In other words, for every
*                 call to OSSchedLock() you MUST have a call to OSSchedUnlock().
*********************************************************************************************************
*/

#if OS_SCHED_LOCK_EN > 0
void  OSSchedLock (void) reentrant
{

    
    
    if (OSRunning == TRUE) {                     /* Make sure multitasking is running                  */
        OS_ENTER_CRITICAL();
        if (OSLockNesting < 255) {               /* Prevent OSLockNesting from wrapping back to 0      */
            OSLockNesting++;                     /* Increment lock nesting level                       */
        }
        OS_EXIT_CRITICAL();
    }
}
#endif    

/*$PAGE*/
/*
*********************************************************************************************************
*                                          ENABLE SCHEDULING
*
* Description: This function is used to re-allow rescheduling.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) You MUST invoke OSSchedLock() and OSSchedUnlock() in pair.  In other words, for every
*                 call to OSSchedLock() you MUST have a call to OSSchedUnlock().
*********************************************************************************************************
*/

#if OS_SCHED_LOCK_EN > 0
void  OSSchedUnlock (void) reentrant
{

    
    if (OSRunning == TRUE) {                                   /* Make sure multitasking is running    */
        OS_ENTER_CRITICAL();
        if (OSLockNesting > 0) {                               /* Do not decrement if already 0        */
            OSLockNesting--;                                   /* Decrement lock nesting level         */
            if ((OSLockNesting == 0) && (OSIntNesting == 0)) { /* See if sched. enabled and not an ISR */
                OS_EXIT_CRITICAL();
                OS_Sched();                                    /* See if a HPT is ready                */
            } else {
                OS_EXIT_CRITICAL();
            }
        } else {
            OS_EXIT_CRITICAL();
        }
    }
}
#endif    

/*$PAGE*/
/*
*********************************************************************************************************
*                                          START MULTITASKING
*
* Description: This function is used to start the multitasking process which lets uC/OS-II manages the
*              task that you have created.  Before you can call OSStart(), you MUST have called OSInit()
*              and you MUST have created at least one task.
*

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久久第一福利 | 日韩精品一区二区在线| 色吊一区二区三区| 91视频精品在这里| 色综合视频在线观看| 一本久久精品一区二区| 91网址在线看| 91成人免费网站| 欧美男生操女生| 欧美一区二区三区白人| 日韩精品一区二区三区swag | 一区二区在线看| 夜夜嗨av一区二区三区| 亚洲影视在线播放| 亚洲成人7777| 久久爱另类一区二区小说| 极品美女销魂一区二区三区| 国产一区二区三区不卡在线观看| 国产一区二区三区日韩| 成年人国产精品| 在线精品亚洲一区二区不卡| 欧美午夜寂寞影院| 欧美剧在线免费观看网站 | 国产精品国产三级国产aⅴ无密码| 中文字幕免费不卡| 一区二区三区毛片| 99国产精品久久久久| 欧美午夜宅男影院| 日韩一级精品视频在线观看| 久久久不卡网国产精品一区| 国产精品久久网站| 亚洲国产精品久久人人爱蜜臀| 日韩专区一卡二卡| 国产美女娇喘av呻吟久久| voyeur盗摄精品| 91精品国产综合久久精品| 久久视频一区二区| 亚洲人成电影网站色mp4| 午夜精品免费在线| 国产麻豆精品久久一二三| 91丝袜美腿高跟国产极品老师 | 波多野结衣亚洲| 欧美视频在线不卡| 久久久久国产精品麻豆ai换脸| 亚洲乱码一区二区三区在线观看| 日韩黄色免费网站| 成人免费毛片片v| 欧美精品乱人伦久久久久久| 久久久久久久综合日本| 一区二区三区四区在线播放| 久久国产精品无码网站| 91浏览器打开| 久久婷婷久久一区二区三区| 亚洲一级片在线观看| 国产高清久久久| 欧美色欧美亚洲另类二区| 国产欧美精品一区| 香蕉久久夜色精品国产使用方法| 国产精品一区二区三区网站| 欧美天堂一区二区三区| 中文字幕av不卡| 日韩高清一级片| 色狠狠色狠狠综合| 久久久久国产免费免费| 日韩国产欧美在线观看| 95精品视频在线| 国产午夜精品一区二区| 蜜臀精品久久久久久蜜臀| 91免费观看在线| 国产无一区二区| 乱中年女人伦av一区二区| 欧美色精品天天在线观看视频| 国产精品伦一区| 激情成人午夜视频| 91麻豆精品国产自产在线| 亚洲区小说区图片区qvod| 国产精品一区二区在线播放| 日韩一级视频免费观看在线| 亚洲影视资源网| 91在线观看一区二区| 国产日韩欧美综合在线| 麻豆成人免费电影| 欧美日韩大陆在线| 一区二区三区在线视频观看| 日本一区二区动态图| 久久99精品国产麻豆不卡| 欧美日韩久久一区| 一区二区三区日韩精品| 99视频精品免费视频| 国产色综合一区| 国产精品自拍一区| 久久综合999| 久久99热99| 精品国产乱码久久久久久闺蜜| 日日骚欧美日韩| 欧美三级视频在线| 午夜精品123| 欧美日韩国产一级| 日韩高清不卡一区| 欧美人与z0zoxxxx视频| 亚洲国产欧美在线| 欧美主播一区二区三区美女| 夜夜夜精品看看| 在线观看日韩一区| 亚洲第一搞黄网站| 欧美群妇大交群中文字幕| 亚洲一二三区在线观看| 欧美日韩一区小说| 日日夜夜免费精品视频| 日韩一区二区三区在线观看| 日本中文字幕一区二区有限公司| 91精品国产色综合久久不卡蜜臀| 日本亚洲电影天堂| 久久综合久久99| 成人网男人的天堂| 亚洲黄色在线视频| 欧美人与z0zoxxxx视频| 久久精品国产久精国产| 久久久久久一级片| 成人黄色网址在线观看| 亚洲男同性视频| 欧美久久一区二区| 激情国产一区二区| 国产精品国产三级国产aⅴ入口| 91蝌蚪国产九色| 午夜在线电影亚洲一区| 欧美xxxxx裸体时装秀| 国产成人免费xxxxxxxx| 亚洲欧美综合色| 欧美午夜一区二区三区免费大片| 免费在线成人网| 国产肉丝袜一区二区| 色综合中文字幕| 免费在线一区观看| 国产精品久久综合| 欧美在线看片a免费观看| 久久99精品国产麻豆不卡| 中文字幕二三区不卡| 欧美亚洲日本国产| 寂寞少妇一区二区三区| 最新日韩在线视频| 91精品国产综合久久国产大片| 国内精品免费在线观看| 亚洲柠檬福利资源导航| 日韩一级欧美一级| 97国产精品videossex| 免费在线看一区| 亚洲天堂2014| 精品国产免费一区二区三区四区| 99re这里只有精品6| 日韩av网站在线观看| 亚洲国产经典视频| 欧美一区二区视频观看视频| 成人激情av网| 六月丁香婷婷久久| 亚洲综合一区二区精品导航| 日韩二区三区四区| 亚洲国产精品传媒在线观看| 6080日韩午夜伦伦午夜伦| 成人免费三级在线| 麻豆精品国产传媒mv男同| 亚洲激情在线播放| 国产欧美一区二区精品忘忧草| 欧美亚男人的天堂| 国产91精品久久久久久久网曝门| 丝袜美腿一区二区三区| 国产精品久久久久久久岛一牛影视| 在线播放91灌醉迷j高跟美女| 99久久久久久| 国产一区三区三区| 奇米影视一区二区三区| 亚洲精品日日夜夜| 中文天堂在线一区| 日韩免费成人网| 欧美日韩小视频| 色综合视频在线观看| 国产99久久精品| 久久国产精品72免费观看| 午夜视频一区二区| 亚洲精选在线视频| 亚洲欧洲成人精品av97| 久久免费国产精品| 欧美电影免费观看完整版| 欧美色窝79yyyycom| 91丨国产丨九色丨pron| 国产美女一区二区| 久久99国产精品久久99 | 欧美亚洲免费在线一区| 成人av资源下载| 成人自拍视频在线观看| 国产另类ts人妖一区二区| 久久99国产精品久久| 麻豆一区二区在线| 蜜桃视频一区二区三区在线观看| 亚洲成av人片观看| 亚洲综合丁香婷婷六月香| 亚洲视频中文字幕| 亚洲欧美经典视频| 亚洲美女在线国产| 亚洲日本青草视频在线怡红院|