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

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

?? os_core.c

?? 在別處找到的一些uc/os-ii的一些資料
?? 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) reentrant
{
#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) reentrant
{
    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) reentrant
{

    
    
    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) reentrant
{

    
    
    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) reentrant
{

    
    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()
*              and you MUST have created at least one task.
*

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美日韩黄色大片| 五月天激情小说综合| 欧美日韩精品久久久| 国产在线精品免费| 亚洲电影一区二区三区| 欧美国产激情一区二区三区蜜月| 欧美日韩在线三区| 国产成人av电影免费在线观看| 偷拍一区二区三区四区| 国产精品久久久久久久裸模| 欧美一级生活片| 欧美在线三级电影| 99视频国产精品| 国产精品白丝av| 精品一区二区免费| 视频一区视频二区中文字幕| 亚洲黄色免费网站| 国产精品欧美一区二区三区| 久久综合久久综合亚洲| 在线综合+亚洲+欧美中文字幕| 91福利视频在线| 97精品久久久午夜一区二区三区 | 午夜视频在线观看一区| 中文字幕av在线一区二区三区| 欧美成人精品二区三区99精品| 欧美性受xxxx黑人xyx性爽| 91首页免费视频| 成人动漫一区二区三区| 国产精品一品二品| 国产福利一区在线| 国产成人在线视频播放| 国产在线一区二区| 国产一区二区成人久久免费影院| 麻豆国产精品官网| 全国精品久久少妇| 麻豆精品视频在线| 另类小说一区二区三区| 老司机免费视频一区二区| 日韩和欧美一区二区| 午夜精品一区二区三区三上悠亚| 亚洲最新视频在线观看| 亚洲欧美日韩国产中文在线| 亚洲精品中文在线影院| 亚洲老妇xxxxxx| 一区二区三区中文免费| 亚洲综合免费观看高清完整版| 亚洲综合男人的天堂| 天天亚洲美女在线视频| 麻豆成人免费电影| 国产一区二区三区黄视频 | 久久66热偷产精品| 国产精品一区二区三区乱码| 国产成a人无v码亚洲福利| 粉嫩久久99精品久久久久久夜| 播五月开心婷婷综合| 91偷拍与自偷拍精品| 欧美视频一区在线| 91精品国产综合久久香蕉麻豆| 欧美一区午夜精品| www欧美成人18+| 国产精品久久久久精k8| 亚洲国产精品自拍| 精品一区二区三区在线观看国产| 成人丝袜高跟foot| 在线视频你懂得一区二区三区| 精品视频全国免费看| 日韩一区二区三区电影在线观看 | 精品视频1区2区3区| 欧美成人伊人久久综合网| 国产亚洲女人久久久久毛片| 亚洲同性gay激情无套| 亚洲国产wwwccc36天堂| 麻豆成人久久精品二区三区红| 国产成人精品免费网站| 色香蕉久久蜜桃| 日韩欧美成人午夜| 国产精品乱码一区二三区小蝌蚪| 亚洲国产毛片aaaaa无费看| 精品写真视频在线观看| 在线亚洲欧美专区二区| 日韩欧美在线一区二区三区| 国产精品欧美精品| 五月天久久比比资源色| 不卡视频一二三四| 日韩一二在线观看| 亚洲人亚洲人成电影网站色| 男人的j进女人的j一区| 播五月开心婷婷综合| 日韩小视频在线观看专区| 1000精品久久久久久久久| 青娱乐精品在线视频| 色播五月激情综合网| 精品少妇一区二区| 一个色妞综合视频在线观看| 国产伦精一区二区三区| 欧美亚洲一区二区三区四区| 欧美激情综合在线| 欧美aa在线视频| 91美女片黄在线观看91美女| 久久综合五月天婷婷伊人| 亚洲bdsm女犯bdsm网站| 一本色道久久综合亚洲91| 国产农村妇女精品| 日韩国产成人精品| 色88888久久久久久影院野外| 久久久不卡网国产精品一区| 日韩国产欧美在线视频| 色国产综合视频| 国产精品人妖ts系列视频| 久久91精品国产91久久小草| 欧美日韩国产成人在线免费| 亚洲欧美日韩一区二区 | 久久久亚洲精品一区二区三区| 亚洲国产精品尤物yw在线观看| 99久久久久久| 国产女同互慰高潮91漫画| 久久国产生活片100| 欧美一区二区网站| 亚洲成人免费视| 在线观看视频91| 亚洲欧美国产77777| 成人avav影音| 国产精品美女久久久久久久久 | 在线观看欧美黄色| 亚洲男同性恋视频| 色综合久久综合网| 亚洲视频图片小说| 99国产麻豆精品| 亚洲品质自拍视频网站| 91麻豆福利精品推荐| 成人欧美一区二区三区1314| 成人动漫一区二区在线| 中文字幕在线一区免费| a亚洲天堂av| 17c精品麻豆一区二区免费| av在线免费不卡| 中文字幕中文字幕中文字幕亚洲无线| 成人爱爱电影网址| 中文字幕一区二区三区在线不卡| 成人精品亚洲人成在线| 中日韩av电影| 91视频在线观看| 亚洲电影一区二区三区| 欧美精品九九99久久| 日韩av一区二区在线影视| 欧美一区二区视频在线观看| 免费成人在线观看| 精品久久久久久久久久久院品网 | 北条麻妃一区二区三区| 国产精品伦理在线| 色综合天天天天做夜夜夜夜做| 亚洲综合视频网| 欧美日韩久久不卡| 日韩在线播放一区二区| 欧美成人一区二区三区片免费| 色婷婷国产精品久久包臀| 一区二区三区欧美在线观看| 欧美日韩一区二区三区在线| 亚洲va在线va天堂| 日韩一区二区在线看| 国产成a人无v码亚洲福利| 亚洲欧洲制服丝袜| 91精品中文字幕一区二区三区| 精品亚洲免费视频| 中日韩免费视频中文字幕| 欧美性受xxxx黑人xyx性爽| 麻豆国产91在线播放| 中文无字幕一区二区三区| 色哟哟一区二区| 久草热8精品视频在线观看| 中文字幕精品—区二区四季| 91福利国产精品| 国产一区二区三区在线看麻豆| 中文字幕中文在线不卡住| 欧美日韩国产在线观看| 国产在线观看免费一区| 亚洲精品老司机| 欧美电视剧免费观看| 99精品久久只有精品| 蜜臀精品一区二区三区在线观看| 久久综合精品国产一区二区三区| 99久久精品一区二区| 日本美女一区二区| 亚洲欧美综合另类在线卡通| 欧美男男青年gay1069videost| 国产高清在线精品| 午夜精品久久久久久久99水蜜桃| 久久精品人人做人人综合| 在线观看91视频| 国产米奇在线777精品观看| 一区二区三区中文在线| 久久精品亚洲乱码伦伦中文| 精品视频一区 二区 三区| 国产福利电影一区二区三区| 天使萌一区二区三区免费观看| 国产精品你懂的| 日韩一本二本av| 欧美性猛片aaaaaaa做受| 国产一区二区三区视频在线播放 | 国产露脸91国语对白|