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

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

?? os_core.c

?? 此壓縮包中包含了UCOS-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);
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()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩蜜臀av国产精品网站| 久久精品av麻豆的观看方式| 欧美成人一级视频| 欧美日韩激情一区二区| 色欧美日韩亚洲| 日本道在线观看一区二区| 91麻豆.com| 日本乱人伦一区| 亚洲综合一区二区三区| 在线播放亚洲一区| 欧美一级午夜免费电影| 国产成人免费在线视频| 91在线观看地址| 91亚洲大成网污www| 91麻豆免费视频| 欧美性色综合网| 六月丁香综合在线视频| 日韩美女视频一区二区| 一区二区激情小说| 免费成人小视频| 国产精品夜夜嗨| 91在线云播放| 日韩一级二级三级精品视频| 99久久婷婷国产综合精品 | 国产69精品久久久久毛片| 国产在线精品不卡| 成人精品免费看| 欧美系列一区二区| 精品动漫一区二区三区在线观看| av一区二区三区四区| 在线观看精品一区| 欧美大片在线观看一区二区| 亚洲国产成人午夜在线一区 | 日韩一区二区精品在线观看| 日韩午夜精品电影| 自拍偷在线精品自拍偷无码专区| 88在线观看91蜜桃国自产| 色94色欧美sute亚洲线路一久| 国产精品一区二区三区网站| 97超碰欧美中文字幕| 国产91丝袜在线18| 国内精品国产成人国产三级粉色 | 亚洲一区二区三区国产| 久久国产福利国产秒拍| 成人av在线网站| 欧美电影免费观看高清完整版在| 欧美人与禽zozo性伦| 欧美日韩专区在线| 欧美国产日韩精品免费观看| 首页亚洲欧美制服丝腿| proumb性欧美在线观看| 91视视频在线直接观看在线看网页在线看| 极品少妇xxxx精品少妇| 欧美在线制服丝袜| 欧美日韩一区不卡| 亚洲素人一区二区| 国产黑丝在线一区二区三区| 欧美精品第1页| 一区二区三区av电影| 成人午夜在线免费| 久久久一区二区三区| 免费成人在线观看| 777奇米四色成人影色区| 一区二区三区在线观看视频 | 捆绑调教一区二区三区| 欧美系列一区二区| 亚洲精品国产一区二区精华液 | 日韩网站在线看片你懂的| 亚洲黄色小视频| 97精品久久久午夜一区二区三区| 欧美中文字幕一区二区三区 | 日本特黄久久久高潮| 欧美综合久久久| 亚洲综合色噜噜狠狠| 99国产精品久久久久| 国产精品伦理在线| 成人免费视频视频| 欧美日韩一区成人| 日本一道高清亚洲日美韩| 6080yy午夜一二三区久久| 天堂资源在线中文精品| 欧美久久久久久久久中文字幕| 久久综合久久综合久久| 国产精品一区二区x88av| 中文字幕av在线一区二区三区| 亚洲男人天堂一区| 欧美中文字幕亚洲一区二区va在线 | 天天亚洲美女在线视频| 91精品国产91综合久久蜜臀| 久久99在线观看| 久久精品一区二区三区不卡牛牛 | 国产一二三精品| 在线视频国内自拍亚洲视频| 亚洲综合色噜噜狠狠| 欧美日韩免费电影| 国产精品三级电影| 蜜臀av性久久久久蜜臀aⅴ| 91色porny| 午夜久久福利影院| www久久精品| 色综合久久久久综合体桃花网| 欧美一二三区精品| 国产成人在线视频播放| 综合电影一区二区三区| 制服丝袜av成人在线看| 国产福利91精品一区二区三区| 欧美日韩精品是欧美日韩精品| 国产精品国产三级国产aⅴ无密码| 奇米888四色在线精品| 欧美综合亚洲图片综合区| 日本不卡视频一二三区| 国产女人18毛片水真多成人如厕 | 国产成a人亚洲| 一区二区三区在线高清| 26uuu国产一区二区三区| 色妹子一区二区| 国产美女av一区二区三区| 亚洲欧美偷拍卡通变态| 精品美女被调教视频大全网站| 日韩和欧美一区二区| 在线成人免费视频| 岛国av在线一区| 美美哒免费高清在线观看视频一区二区 | 欧洲精品中文字幕| 亚洲综合成人在线| 国产日产精品一区| 欧美妇女性影城| 91麻豆精品一区二区三区| 国产一本一道久久香蕉| 日韩1区2区3区| 一区二区不卡在线视频 午夜欧美不卡在| 91免费精品国自产拍在线不卡| 亚洲欧美一区二区三区国产精品 | 伊人开心综合网| 欧美色成人综合| 99久久婷婷国产精品综合| 国产美女av一区二区三区| 日韩成人av影视| 亚洲成人av中文| 亚洲香肠在线观看| 亚洲人成亚洲人成在线观看图片 | 日本特黄久久久高潮| 亚洲高清免费在线| 欧美岛国在线观看| 成人小视频免费在线观看| 亚洲精选视频免费看| 国产三级一区二区| 久久这里只有精品首页| 日韩一级片网址| 日韩一区二区免费在线电影| 欧美美女bb生活片| 欧美日韩成人综合在线一区二区| 久久99热99| 国产乱码精品1区2区3区| 国产另类ts人妖一区二区| 亚洲欧美二区三区| 亚洲人成人一区二区在线观看| 欧美一区二区私人影院日本| 成人亚洲一区二区一| 高清不卡在线观看| 日韩高清欧美激情| 欧美aaa在线| 国产麻豆视频一区二区| 国产一区二区三区四区五区美女| 中文字幕五月欧美| 亚洲精品免费一二三区| 午夜精品久久久久久| 国产精品午夜久久| 成人欧美一区二区三区小说| 成人免费在线视频观看| 一区二区在线观看av| 午夜精品在线看| 国产综合色在线视频区| 成人网在线免费视频| 色94色欧美sute亚洲线路二| 3d动漫精品啪啪一区二区竹菊| 91亚洲精品久久久蜜桃| 欧美色图激情小说| 日韩一级免费一区| 国产精品视频观看| 久久色.com| 亚洲免费毛片网站| 美女在线视频一区| 99久久综合精品| 日韩精品资源二区在线| 欧美日韩小视频| 国产亚洲欧美日韩日本| 亚洲激情欧美激情| 韩国一区二区视频| 91免费视频大全| 26uuu亚洲综合色| 亚洲在线观看免费| 国产精品一区在线观看乱码| 色94色欧美sute亚洲线路一ni| 99久久精品情趣| 成人性生交大片免费看中文| 欧美日韩精品免费观看视频| 久久久久综合网| 丁香天五香天堂综合| 91黄视频在线|