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

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

?? os_core.c

?? arm與ucos的經典仿真
?? 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网站在线| 日本va欧美va瓶| 香蕉成人伊视频在线观看| 亚洲高清不卡在线观看| 日韩综合小视频| 国产精品一线二线三线精华| 国产米奇在线777精品观看| 成人免费毛片嘿嘿连载视频| 成人国产精品免费观看| 一本大道av一区二区在线播放| 一本色道久久加勒比精品| 欧美三级在线播放| 久久久精品综合| 亚洲一区二区中文在线| 久久国产视频网| 91在线高清观看| 在线成人免费观看| 精品不卡在线视频| 国产精品久久三| 首页国产欧美久久| 成人午夜激情影院| 欧美日韩精品免费| 国产精品全国免费观看高清| 亚洲综合激情小说| 不卡影院免费观看| 精品少妇一区二区三区| 亚洲一区二区精品视频| 国产成人av一区二区| 337p亚洲精品色噜噜| 亚洲视频在线一区观看| 国产成人免费在线观看不卡| 日韩免费性生活视频播放| 亚洲理论在线观看| 国产suv精品一区二区三区| 91免费观看国产| 中文字幕的久久| 成人黄色一级视频| 欧美激情一区二区在线| 国内精品免费在线观看| 日韩精品一区二区在线观看| 麻豆成人在线观看| 日韩久久久精品| 另类小说视频一区二区| 日韩三级在线免费观看| 久久国产精品免费| 2021久久国产精品不只是精品| 老司机免费视频一区二区| 2023国产精品自拍| 成人一区在线观看| 亚洲美女区一区| 欧美日韩免费观看一区三区| 亚洲国产综合视频在线观看| 26uuu色噜噜精品一区二区| 久久精品一区八戒影视| 亚洲午夜三级在线| 日韩欧美中文字幕精品| 国产九色sp调教91| 中文字幕视频一区| 欧美色男人天堂| 激情亚洲综合在线| 亚洲天堂成人在线观看| 日韩午夜在线观看| 国内精品免费在线观看| 精品国产在天天线2019| 色婷婷精品久久二区二区蜜臀av| 亚洲成人av福利| 亚洲视频免费在线观看| 久久综合久色欧美综合狠狠| 99久久综合国产精品| 久久精品72免费观看| 亚洲欧美日本韩国| 国产视频一区在线观看| 91精品国产手机| a级高清视频欧美日韩| 精品在线播放免费| 日日骚欧美日韩| 一区二区三区在线看| 国产精品久久久久久久岛一牛影视 | 久久亚洲综合av| 欧美性一区二区| 不卡一区二区三区四区| 成人免费视频国产在线观看| 免费观看在线色综合| 亚洲国产精品一区二区尤物区| 亚洲欧美在线另类| 中文字幕一区二区不卡| 久久久夜色精品亚洲| 精品日韩在线观看| 欧美zozo另类异族| 久久精品日韩一区二区三区| 精品国产乱码久久久久久图片| 在线观看亚洲专区| 欧美日韩国产一二三| 日韩欧美一卡二卡| 久久久噜噜噜久久中文字幕色伊伊 | av不卡一区二区三区| 色琪琪一区二区三区亚洲区| 在线观看成人免费视频| 欧美综合亚洲图片综合区| 欧美日韩精品免费| 精品少妇一区二区三区| 国产精品三级视频| 夜夜精品浪潮av一区二区三区| 日韩av网站免费在线| 国产大片一区二区| 欧美三级韩国三级日本一级| 久久久青草青青国产亚洲免观| 国产日韩欧美精品在线| 午夜视频在线观看一区二区| 美女视频一区在线观看| 一本色道综合亚洲| 精品国产凹凸成av人网站| 国产精品乱码人人做人人爱| 蜜桃一区二区三区在线| 色综合久久精品| 久久久久久久久岛国免费| 亚洲综合小说图片| 97久久久精品综合88久久| 欧美一级专区免费大片| 亚洲午夜久久久| 在线看日韩精品电影| 国产精品卡一卡二| 国产成人精品一区二区三区四区| 欧美精品一二三| 天天综合色天天| 欧美日韩情趣电影| 天涯成人国产亚洲精品一区av| 色妞www精品视频| 亚洲欧美另类久久久精品| 成人动漫一区二区| 亚洲欧洲av一区二区三区久久| 日韩精品一二区| 在线不卡a资源高清| 日本最新不卡在线| 日韩午夜精品电影| 狠狠v欧美v日韩v亚洲ⅴ| 久久伊人中文字幕| a亚洲天堂av| 亚洲成人精品影院| 欧美电视剧在线看免费| 国产一区二区主播在线| 国产农村妇女毛片精品久久麻豆| 久久91精品久久久久久秒播| 精品久久久久久久久久久久久久久久久| 免费欧美在线视频| 国产偷国产偷亚洲高清人白洁| 99免费精品在线| 三级精品在线观看| 国产精品久久久久久户外露出| 欧美亚洲一区三区| 国产一区视频网站| 亚洲三级在线看| www激情久久| 国产一区二区三区久久久| 国产午夜精品久久久久久免费视| 日本久久电影网| www.日韩大片| 欧美丝袜第三区| 国产精品免费免费| 成人激情校园春色| 午夜电影一区二区三区| 国产精品色婷婷| 欧美一区二区三区男人的天堂| 成人小视频在线| 国产高清久久久| 麻豆久久久久久久| 亚欧色一区w666天堂| 一区二区三区成人| www亚洲一区| 久久久精品黄色| 精品久久99ma| 精品国精品自拍自在线| 精品免费视频.| 久久人人超碰精品| 欧美一区二区三区在线视频 | 99re视频精品| 成人国产精品免费观看动漫| 粉嫩13p一区二区三区| 国产精品一区久久久久| 精品一区二区成人精品| 精品系列免费在线观看| 国内精品视频666| 国产一区二区精品久久99| 国产精品小仙女| 成人激情午夜影院| 91福利在线导航| 欧美一区二区三区在线| 欧美v日韩v国产v| 国产精品免费视频观看| 亚洲一区在线免费观看| 麻豆91在线播放| 国产精品一二三四| 在线观看一区二区精品视频| 制服丝袜亚洲网站| 中文字幕制服丝袜成人av| 亚洲在线一区二区三区| 国产一区二区三区四| 欧美亚洲自拍偷拍| 国产亚洲va综合人人澡精品|