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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? os_core.c

?? LPC2104/5/6嵌入式系統(tǒng)程序?qū)嵗?帶有PROTUES7.1仿真文件,適合做入門(mén)指導(dǎo)
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/*
*********************************************************************************************************
*                                                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)
{
#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)
{
    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)
{
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr;
#endif
    
    
    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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    
    
    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)
{
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr;
#endif    
    
    
    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()

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久在线观看免费| 五月天激情综合| 国产精品影视在线观看| 欧美男人的天堂一二区| 国产精品灌醉下药二区| 成人精品高清在线| 国产日韩欧美电影| 国内成+人亚洲+欧美+综合在线 | 99精品视频在线观看| 亚洲婷婷综合久久一本伊一区| 国产成人综合在线| 国产精品国产精品国产专区不蜜| 99在线精品观看| 亚洲女女做受ⅹxx高潮| 在线视频欧美精品| 日日摸夜夜添夜夜添国产精品| 777午夜精品视频在线播放| 日韩二区三区四区| 精品国偷自产国产一区| 高清不卡一区二区| 亚洲精品视频免费观看| 欧美精品一卡两卡| 国内精品久久久久影院色| 久久久久久电影| 91免费看`日韩一区二区| 亚洲午夜电影在线观看| 日韩欧美国产三级电影视频| 国内精品免费**视频| 亚洲欧洲国产专区| 欧美无砖专区一中文字| 久久99久久久欧美国产| 亚洲国产成人午夜在线一区| 在线视频你懂得一区| 免费在线观看日韩欧美| 中文无字幕一区二区三区| 91黄色免费版| 国产又粗又猛又爽又黄91精品| 国产精品久久久久久久久快鸭| 欧美伊人精品成人久久综合97| 奇米777欧美一区二区| 国产精品视频麻豆| 欧美老肥妇做.爰bbww视频| 国产精品1区2区3区| 一区二区三区丝袜| 2023国产精品视频| 一本久道久久综合中文字幕| 青椒成人免费视频| 日韩美女视频一区二区| 日韩视频123| 91亚洲精品一区二区乱码| 蜜臀va亚洲va欧美va天堂| 国产精品乱子久久久久| 日韩视频免费观看高清完整版在线观看 | 欧美日韩高清不卡| 国产精品一品视频| 亚洲国产日韩在线一区模特 | 精品少妇一区二区三区在线播放 | 亚洲天堂精品视频| 欧美精品一二三| 成人精品视频一区二区三区| 午夜精品123| 亚洲日本免费电影| 国产日韩av一区二区| 欧美三级在线视频| 色综合久久综合网| 成人综合在线观看| 国产美女精品在线| 日本不卡123| 亚洲电影在线免费观看| 亚洲久草在线视频| 日韩一区在线免费观看| 国产亚洲精品aa午夜观看| 日韩视频123| 91精品国产日韩91久久久久久| 色欧美日韩亚洲| 成人av免费在线播放| 国产suv精品一区二区6| 国产在线麻豆精品观看| 久草在线在线精品观看| 日韩精品欧美精品| 午夜a成v人精品| 亚洲午夜在线视频| 亚洲欧美日韩精品久久久久| 亚洲免费视频成人| 亚洲综合在线免费观看| 亚洲欧美一区二区三区久本道91| 国产精品婷婷午夜在线观看| 欧美高清在线精品一区| 欧美韩国日本综合| 国产欧美精品一区二区色综合朱莉| 欧美精品一区二区三区四区| 欧美精品v国产精品v日韩精品 | 欧美一级片在线观看| 日韩一区二区在线看| 精品国产一区二区三区久久久蜜月 | 99精品桃花视频在线观看| 波多野洁衣一区| 99re免费视频精品全部| 欧洲视频一区二区| 欧美丰满嫩嫩电影| 精品电影一区二区三区| 久久精品一区二区三区不卡牛牛| 国产欧美日韩精品在线| 亚洲精品老司机| 五月婷婷综合网| 一区二区在线观看av| 亚洲欧美视频一区| caoporen国产精品视频| 成人网页在线观看| 国产精品91一区二区| 麻豆免费精品视频| 国产精品一级黄| 激情综合网av| 紧缚奴在线一区二区三区| 99精品一区二区| zzijzzij亚洲日本少妇熟睡| 国产·精品毛片| 精品影视av免费| 亚洲精品伦理在线| 麻豆久久一区二区| 蜜桃久久久久久| 日韩电影免费在线看| 久久久三级国产网站| 一区二区三区资源| 亚洲自拍偷拍综合| 一区二区三区在线观看视频| 国产精品亲子伦对白| 日韩精品色哟哟| 蜜臀91精品一区二区三区| 蜜桃久久精品一区二区| 麻豆精品精品国产自在97香蕉| 福利电影一区二区| 成av人片一区二区| 在线观看欧美日本| 欧美亚洲日本一区| 国产欧美一区二区精品仙草咪| 国产精品三级视频| 一区二区三区在线视频观看58 | 粉嫩av一区二区三区粉嫩| 岛国精品一区二区| 日本道在线观看一区二区| 欧美日韩在线播放一区| 国产精品欧美久久久久无广告 | 欧美亚洲日本国产| 成人免费毛片a| 91精品国产免费| 欧美肥胖老妇做爰| 精品美女在线观看| 久久这里只有精品视频网| 亚洲国产一区视频| 精品午夜一区二区三区在线观看| 国产成人av资源| 国产91丝袜在线18| 欧美亚洲一区三区| 日韩亚洲欧美综合| 国产精品久久久久久久久免费桃花 | 成人午夜视频免费看| 色成人在线视频| 91精品国产入口| 亚洲综合一区二区三区| 极品少妇xxxx精品少妇| 色呦呦国产精品| 欧美xxxxxxxx| 洋洋av久久久久久久一区| 久久国产欧美日韩精品| 99这里只有精品| 日韩午夜小视频| 亚洲高清一区二区三区| 国产风韵犹存在线视精品| 欧美色爱综合网| 欧美激情一区二区三区在线| 国产馆精品极品| 欧美午夜电影在线播放| 国产欧美日韩视频在线观看| 亚洲综合久久久久| 欧美四级电影在线观看| 亚洲国产精品传媒在线观看| 性欧美疯狂xxxxbbbb| 国产精品中文字幕日韩精品| 欧美成人三级在线| 亚洲综合丁香婷婷六月香| 国产精品正在播放| 日韩欧美一区二区不卡| 麻豆成人在线观看| 欧美日韩一区视频| 亚洲色图欧美偷拍| 久久狠狠亚洲综合| 亚洲精品一区二区三区福利 | 亚洲一区二区三区不卡国产欧美| 91免费看片在线观看| 亚洲精品在线观看网站| 五月综合激情日本mⅴ| 国产69精品久久99不卡| 日韩一区在线看| 久久99国内精品| 欧美一级黄色录像| 蜜桃一区二区三区四区| 韩国精品久久久| 欧美日韩国产综合一区二区| 亚洲人吸女人奶水|