亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区在线影视| 成人精品国产一区二区4080| 日韩欧美另类在线| 性做久久久久久免费观看欧美| 成人午夜免费av| 2021国产精品久久精品| 日本中文一区二区三区| 欧美日韩三级一区二区| 椎名由奈av一区二区三区| 国产一区二区三区久久悠悠色av| 欧美精品在线一区二区三区| 一区二区三区在线视频观看58| 成人开心网精品视频| 久久久精品综合| 九九精品一区二区| 欧美一区二区在线播放| 午夜国产不卡在线观看视频| 欧日韩精品视频| 亚洲欧美韩国综合色| 91丨九色丨国产丨porny| 国产丝袜美腿一区二区三区| 国产精品69毛片高清亚洲| 精品国精品自拍自在线| 久久99久久99精品免视看婷婷| 欧美一区欧美二区| 久久99久久99| 69久久99精品久久久久婷婷| 午夜免费久久看| 欧美高清hd18日本| 青娱乐精品视频在线| 日韩精品自拍偷拍| 久久9热精品视频| 久久色.com| 99视频精品全部免费在线| 亚洲欧洲在线观看av| 色香蕉久久蜜桃| 视频一区视频二区中文| 这里只有精品99re| 国产麻豆精品久久一二三| 国产片一区二区| 91视频国产资源| 午夜影视日本亚洲欧洲精品| 91麻豆精品国产91久久久久久 | 在线免费观看日本欧美| 一卡二卡欧美日韩| 欧美电影一区二区三区| 久久国产精品露脸对白| 久久综合一区二区| 9久草视频在线视频精品| 亚洲综合色丁香婷婷六月图片| 欧美日韩精品一区视频| 九九在线精品视频| 日韩美女精品在线| 宅男在线国产精品| 成人免费毛片a| 无吗不卡中文字幕| 欧美经典一区二区| 欧美三级在线播放| 国产精品996| 偷拍日韩校园综合在线| 久久夜色精品国产欧美乱极品| 成人精品视频一区| 视频一区二区三区中文字幕| 国产日韩一级二级三级| 91福利小视频| 国产成人aaa| 日韩专区欧美专区| 中文在线资源观看网站视频免费不卡 | 精品久久久久久久一区二区蜜臀| 9人人澡人人爽人人精品| 免费人成在线不卡| 亚洲欧美激情视频在线观看一区二区三区 | 久久久久久久精| 欧美日本在线观看| 成人国产精品免费观看| 奇米888四色在线精品| 最新国产の精品合集bt伙计| 欧美不卡一二三| 91高清在线观看| 成人伦理片在线| 韩国女主播成人在线观看| 亚洲一区二区三区四区中文字幕| 久久一夜天堂av一区二区三区| 欧美综合亚洲图片综合区| 国产一区二区三区国产| 日本sm残虐另类| 亚洲第一成年网| 中文字幕永久在线不卡| 久久久综合精品| 欧美一级二级三级蜜桃| 欧美图片一区二区三区| 91在线视频免费观看| 国产成人免费9x9x人网站视频| 免费成人结看片| 无吗不卡中文字幕| 亚洲成人精品在线观看| 亚洲靠逼com| 亚洲婷婷在线视频| 国产精品久久精品日日| 日本一区二区视频在线| 久久久国产精品午夜一区ai换脸| 精品毛片乱码1区2区3区| 欧美高清一级片在线| 欧美另类videos死尸| 欧美三级三级三级| 欧美视频精品在线| 欧美日韩中字一区| 精品视频999| 欧美美女bb生活片| 日韩欧美国产一区二区在线播放| 欧美精品一二三| 欧美一区二区久久久| 3atv在线一区二区三区| 在线播放/欧美激情| 欧美一级久久久| 欧美成人一区二区| 久久久99精品久久| 欧美激情综合在线| 中文字幕日本不卡| 亚洲综合激情网| 日韩高清不卡一区二区三区| 免费看日韩精品| 国产在线一区二区| 成人爱爱电影网址| 91国产成人在线| 日韩一级大片在线| 日本一区二区三区免费乱视频| 国产精品久久久久一区二区三区共 | 99久久精品免费精品国产| 日本福利一区二区| 91精品中文字幕一区二区三区| 日韩一区二区免费在线电影| 久久综合色婷婷| 成人免费在线视频观看| 亚洲一区二区高清| 久久99国内精品| av成人免费在线| 欧美日本一区二区在线观看| 久久蜜桃av一区精品变态类天堂 | 亚洲不卡在线观看| 久久国产精品一区二区| 顶级嫩模精品视频在线看| 日本韩国精品在线| 亚洲精品一线二线三线无人区| 欧美国产日韩a欧美在线观看| 一区二区三区日韩欧美精品| 奇米综合一区二区三区精品视频| 成人精品免费看| 制服丝袜激情欧洲亚洲| 国产精品欧美一区喷水| 偷拍自拍另类欧美| 国产福利91精品| 欧美电影一区二区| 亚洲欧美视频一区| 国内外成人在线视频| 在线亚洲免费视频| 日本一二三不卡| 蜜臀av在线播放一区二区三区| 99精品黄色片免费大全| 日韩欧美中文字幕精品| 亚洲摸摸操操av| 国产精品12区| 精品区一区二区| 日韩在线一区二区| 91蜜桃视频在线| 久久精品视频一区二区| 日韩在线a电影| 日本电影亚洲天堂一区| 国产欧美日韩麻豆91| 麻豆91精品视频| 9191久久久久久久久久久| 亚洲欧美日韩精品久久久久| 国产精品99久久久久久有的能看| 日韩一区二区三区电影在线观看 | 91精品午夜视频| 亚洲激情综合网| av午夜精品一区二区三区| 国产亚洲欧美色| 国内成+人亚洲+欧美+综合在线| 欧美精品在线观看播放| 亚洲电影激情视频网站| www.日韩精品| 中文字幕在线观看一区| 国产iv一区二区三区| 精品999久久久| 精品在线亚洲视频| 精品日韩在线观看| 老司机免费视频一区二区 | 天天操天天色综合| 欧美性猛交xxxx黑人交| 一区二区三区精密机械公司| 99精品偷自拍| 亚洲你懂的在线视频| 一本久久a久久精品亚洲| 尤物在线观看一区|