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

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

?? os_core.c

?? uC/OS-II操作系統在ADS-ARMulator上的移植。uC/OS-II就不用我介紹了
?? 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);
#if OS_TASK_STAT_EN > 0
static  void  OS_InitTaskStat(void);
#endif
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
*

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美你懂的| 丝袜a∨在线一区二区三区不卡| 中文字幕精品—区二区四季| 亚洲综合在线观看视频| 激情综合色播激情啊| 色猫猫国产区一区二在线视频| 日韩精品专区在线| 亚洲一区二区三区四区在线| 国产成人亚洲综合a∨猫咪| 欧美高清视频不卡网| 亚洲欧美偷拍另类a∨色屁股| 韩国中文字幕2020精品| 欧美日韩国产bt| 亚洲免费观看高清完整| 成人午夜视频网站| 欧美精品一区二区三区在线播放| 午夜精品久久久久久久久| 91亚洲男人天堂| 国产精品高潮呻吟| 国产a区久久久| 久久久久久久综合狠狠综合| 美女一区二区三区| 9191成人精品久久| 亚洲一区二区三区不卡国产欧美| 本田岬高潮一区二区三区| 久久久精品综合| 韩国理伦片一区二区三区在线播放| 欧美一区二区三区免费观看视频| 亚洲福利视频导航| 欧美日韩一区二区三区高清| 亚洲综合一区二区三区| 欧洲视频一区二区| 夜夜精品视频一区二区| 日本道色综合久久| 亚洲一区二区不卡免费| 欧美网站大全在线观看| 亚洲大片在线观看| 欧美日本国产视频| 日本美女一区二区三区| 日韩欧美激情在线| 国产乱码精品一区二区三区忘忧草| 日韩视频免费观看高清完整版| 五月天中文字幕一区二区| 欧美精品在线一区二区三区| 免费观看30秒视频久久| 精品人在线二区三区| 国产在线精品一区二区| 国产精品美女久久久久久久久| 成人爽a毛片一区二区免费| 日韩一区日韩二区| 欧美日韩国产综合一区二区| 日本色综合中文字幕| 欧美videos大乳护士334| 国产精品一级在线| 亚洲日本中文字幕区| 欧美日韩小视频| 韩日av一区二区| 综合电影一区二区三区| 欧美午夜精品免费| 久久国产精品一区二区| 国产精品午夜电影| 欧美亚洲高清一区二区三区不卡| 免费亚洲电影在线| 国产精品妹子av| 欧美电影一区二区三区| 成人做爰69片免费看网站| 亚洲愉拍自拍另类高清精品| 日韩免费看的电影| 91美女福利视频| 日韩精品色哟哟| 一区二区中文字幕在线| 4hu四虎永久在线影院成人| 国产成人av电影在线播放| 亚洲精品v日韩精品| 亚洲精品在线一区二区| 91国偷自产一区二区三区成为亚洲经典 | 白白色亚洲国产精品| 亚洲一区二区三区中文字幕| 国产午夜精品一区二区三区四区| 在线观看日韩毛片| 国产91在线观看丝袜| 五月天精品一区二区三区| 中文在线资源观看网站视频免费不卡 | 另类小说一区二区三区| 亚洲天堂福利av| 久久久综合网站| 777午夜精品免费视频| va亚洲va日韩不卡在线观看| 久久99精品国产麻豆婷婷| 亚洲一二三区视频在线观看| 国产日韩三级在线| 日韩欧美成人午夜| 欧美日韩中文字幕精品| 69堂国产成人免费视频| aaa欧美大片| 国产精品小仙女| 九九国产精品视频| 五月激情丁香一区二区三区| 亚洲欧美日韩精品久久久久| 久久久蜜桃精品| 欧美r级电影在线观看| 在线不卡欧美精品一区二区三区| 日本高清免费不卡视频| www.色精品| 大桥未久av一区二区三区中文| 久久99国产精品久久| 青青草国产成人av片免费| 视频一区在线视频| 午夜精品123| 亚洲一区二区美女| 亚洲18影院在线观看| 亚洲国产精品影院| 亚洲国产精品人人做人人爽| 一区2区3区在线看| 亚洲宅男天堂在线观看无病毒| 亚洲视频每日更新| 一区二区三区欧美在线观看| 亚洲色图欧美在线| 一区二区三区日韩| 亚洲电影中文字幕在线观看| 亚洲成人一二三| 五月婷婷激情综合| 免费看欧美美女黄的网站| 另类综合日韩欧美亚洲| 久久国产精品99久久久久久老狼 | 欧美视频一区二区| 欧美日韩亚洲丝袜制服| 69成人精品免费视频| 日韩视频一区二区在线观看| 欧美精品一区二区三区蜜桃视频| 久久久久久一二三区| 国产精品久久久久久久久果冻传媒 | 国产成人在线色| proumb性欧美在线观看| 色欧美乱欧美15图片| 欧美影视一区在线| 在线综合亚洲欧美在线视频| 日韩欧美国产一区二区三区| 国产亚洲成年网址在线观看| 国产精品久久久久三级| 亚洲图片欧美色图| 久久99精品国产91久久来源| 成人午夜碰碰视频| 欧美嫩在线观看| 国产日产欧产精品推荐色 | 久久精品一区二区| 亚洲视频香蕉人妖| 美女www一区二区| 99精品黄色片免费大全| 欧美日韩高清一区二区不卡| 久久久久综合网| 一级女性全黄久久生活片免费| 裸体歌舞表演一区二区| 91小视频在线| 久久先锋资源网| 亚洲一级片在线观看| 国产成人精品免费在线| 欧美视频一区二区三区四区 | 亚洲精品国产a久久久久久 | 午夜精品久久久久久不卡8050| 久久99精品国产.久久久久| 色婷婷久久综合| 久久综合999| 婷婷国产在线综合| 不卡视频在线看| 精品国产髙清在线看国产毛片| 亚洲视频在线一区二区| 国产中文一区二区三区| 欧美日韩精品系列| ●精品国产综合乱码久久久久| 另类中文字幕网| 欧美精品三级日韩久久| 国产精品久久久久一区| 国产一区二区三区久久久| 欧美日韩激情一区二区| 亚洲日本一区二区三区| 粉嫩在线一区二区三区视频| 欧美久久久久久久久久| 一区二区三区中文字幕在线观看| 国产成人高清在线| 日韩欧美一级二级三级| 午夜久久久久久电影| 在线看不卡av| 亚洲欧美日韩中文播放| 成人午夜激情影院| 久久免费精品国产久精品久久久久 | 欧美日韩精品一区二区三区四区| 亚洲成人在线免费| 欧美午夜片在线看| 亚洲伦理在线免费看| 成人精品小蝌蚪| 国产人成亚洲第一网站在线播放 | 亚洲制服欧美中文字幕中文字幕| heyzo一本久久综合| 国产精品国产三级国产普通话三级 | 亚洲国产欧美日韩另类综合| 一本色道久久综合亚洲精品按摩| 国产精品久久久久影视| fc2成人免费人成在线观看播放| 日本一区免费视频|