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

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

?? os_core.c

?? uc/os2.52源代碼 基于ARM7實驗箱平臺
?? 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 "..\APP\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一区二区三区免费野_久草精品视频
一区二区三区在线视频播放 | 亚洲国产精品影院| 日韩国产成人精品| 成人激情文学综合网| 91精品国产综合久久国产大片| 国产精品区一区二区三区| 日韩高清一区二区| 欧美三级日韩三级| 最新不卡av在线| 国产精品一区久久久久| 欧美一区二区免费视频| 一区二区三区在线观看欧美 | 美国av一区二区| 在线观看视频一区| 亚洲手机成人高清视频| 国产麻豆成人传媒免费观看| 欧美一区二区三区播放老司机| 伊人夜夜躁av伊人久久| 91蝌蚪porny| 亚洲欧洲成人精品av97| 成人视屏免费看| 中文字幕乱码一区二区免费| 国产成人午夜精品5599| 久久久久久久久免费| 美脚の诱脚舐め脚责91| 日韩一区二区精品在线观看| 五月婷婷激情综合网| 欧美丝袜第三区| 亚洲综合色噜噜狠狠| 欧美影院一区二区| 亚洲成人tv网| 欧美放荡的少妇| 日本午夜一区二区| 欧美一区二区三区视频在线观看| 日韩av高清在线观看| 日韩免费视频一区| 久久精品99国产精品| 精品国产成人在线影院| 国产精品91xxx| 国产精品麻豆一区二区| 99精品久久免费看蜜臀剧情介绍| 亚洲色图丝袜美腿| 欧美日韩美女一区二区| 蜜桃视频免费观看一区| 久久亚洲二区三区| 成人福利视频网站| 亚洲男人的天堂网| 欧美丰满美乳xxx高潮www| 日本中文一区二区三区| 久久久久久久综合日本| 色综合中文综合网| 亚洲精品国产视频| 91国偷自产一区二区开放时间| 亚洲一区成人在线| 日韩亚洲欧美综合| 国产福利一区二区| 一区二区在线观看免费视频播放| 欧美日韩在线三级| 精品亚洲国产成人av制服丝袜| 欧美国产成人在线| 欧美性大战久久久久久久| 麻豆一区二区三| 国产精品乱人伦一区二区| 欧美吻胸吃奶大尺度电影| 精品一区免费av| 综合久久综合久久| 欧美日韩1234| 国产精品 日产精品 欧美精品| 亚洲柠檬福利资源导航| 欧美一区二区三区男人的天堂| 成人久久视频在线观看| 亚洲第一激情av| 日本一区二区三区视频视频| 欧美日韩一区不卡| 成人黄色小视频| 蜜臀91精品一区二区三区| **欧美大码日韩| 久久久久久综合| 欧美日韩久久一区| www.欧美日韩国产在线| 极品少妇xxxx偷拍精品少妇| 一区二区三区四区精品在线视频| 欧美成人a∨高清免费观看| 欧美性大战久久久久久久蜜臀| 精品一区二区免费在线观看| 亚洲自拍偷拍av| 国产精品天天看| 久久―日本道色综合久久| 欧美图片一区二区三区| av不卡免费电影| 国产成人精品影院| 麻豆精品一区二区| 日韩av午夜在线观看| 亚洲欧美偷拍另类a∨色屁股| 亚洲欧美偷拍三级| 久久久久国产精品免费免费搜索| 欧美一区三区二区| 欧美私模裸体表演在线观看| 99麻豆久久久国产精品免费优播| 韩国成人在线视频| 经典一区二区三区| 免费成人av在线播放| 日日噜噜夜夜狠狠视频欧美人| 亚洲激情网站免费观看| 中文字幕欧美一| 一区二区中文视频| 国产精品女上位| 中文av一区特黄| 国产精品网站导航| 国产精品国产自产拍高清av王其| 久久精品在线观看| 久久久影院官网| 久久久欧美精品sm网站| 久久综合九色综合97婷婷女人 | 国产精品欧美久久久久一区二区| 国产亚洲综合在线| 久久久久久久久久久久久夜| 国产亚洲自拍一区| 国产精品欧美经典| 亚洲男人都懂的| 午夜日韩在线观看| 蜜臀av亚洲一区中文字幕| 久久99九九99精品| 国产精品亚洲专一区二区三区| 国产精品一区二区91| 国产经典欧美精品| 91香蕉视频mp4| 欧美探花视频资源| 欧美电影免费观看高清完整版在线观看 | 日韩一区二区三区观看| 精品国产91久久久久久久妲己| 久久精品一区四区| 综合激情网...| 午夜精品123| 国内精品在线播放| av成人免费在线| 欧美午夜在线一二页| 日韩女同互慰一区二区| 久久理论电影网| 亚洲欧美一区二区三区国产精品| 亚洲大片在线观看| 韩国欧美一区二区| 色婷婷综合中文久久一本| 宅男在线国产精品| 国产精品日韩成人| 日日摸夜夜添夜夜添国产精品| 国产精品18久久久久| 色狠狠色狠狠综合| 日韩精品一区在线观看| 一区二区中文视频| 久久99国产精品成人| 成人一区二区在线观看| 欧美日韩三级在线| 国产视频一区二区三区在线观看| 亚洲视频网在线直播| 免费成人在线网站| 91丨porny丨国产| 日韩欧美色综合| 亚洲综合在线第一页| 国产不卡在线一区| 777精品伊人久久久久大香线蕉| 日本一区二区不卡视频| 日韩高清中文字幕一区| 91小宝寻花一区二区三区| 欧美videos中文字幕| 亚洲国产精品一区二区久久 | 欧美精品粉嫩高潮一区二区| 26uuu欧美日本| 亚洲国产综合91精品麻豆| 国产99久久久国产精品| 日韩欧美国产综合| 一区二区三区精品视频| 成人理论电影网| 精品国产第一区二区三区观看体验| 亚洲综合区在线| 成人h动漫精品| 国产午夜精品在线观看| 美日韩黄色大片| 欧美日本国产视频| 一区二区三区高清在线| 91在线看国产| 国产精品视频一二三| 国产一区二区三区免费| 91精品国产色综合久久| 性欧美疯狂xxxxbbbb| 欧日韩精品视频| 一区二区成人在线| 色婷婷av一区二区三区之一色屋| 国产精品网站在线播放| 国产99精品国产| 国产精品美女一区二区| 国产米奇在线777精品观看| 精品国偷自产国产一区| 日本亚洲三级在线| 欧美精品久久一区二区三区| 亚洲成人自拍一区| 欧美丰满一区二区免费视频| 日韩av在线播放中文字幕| 日韩一级成人av| 九一久久久久久|