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

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

?? os_core.c

?? ucosII操作系統移植源代碼(包括詳細的移植步驟和心得)。
?? 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) 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.
*

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区视频| 国产美女在线观看一区| 97超碰欧美中文字幕| 欧美国产激情二区三区| 成人综合在线观看| 国产午夜亚洲精品午夜鲁丝片| 老司机免费视频一区二区| 欧美人伦禁忌dvd放荡欲情| 亚洲成人av资源| 欧美日韩国产经典色站一区二区三区 | av中文一区二区三区| 国产视频一区在线观看| 春色校园综合激情亚洲| 国产精品亲子伦对白| 成人h精品动漫一区二区三区| 中文字幕不卡在线观看| 99国产精品久久| 一区二区三区欧美视频| 欧美三区免费完整视频在线观看| 亚洲成年人影院| 欧美一区二区三级| 另类小说一区二区三区| 久久久亚洲国产美女国产盗摄| 国产成人啪免费观看软件 | 色婷婷av一区二区三区之一色屋| 一区二区视频在线看| 欧美色大人视频| 蜜桃av一区二区三区电影| 精品国产免费一区二区三区四区| 国产成人高清视频| 亚洲精品少妇30p| 欧美一级欧美一级在线播放| 狠狠色丁香婷婷综合| ...av二区三区久久精品| 欧美综合天天夜夜久久| 麻豆精品新av中文字幕| 中文字幕欧美激情一区| 欧美午夜精品一区二区蜜桃| 美腿丝袜亚洲一区| 欧美国产日本视频| 欧美日韩一区二区三区不卡| 韩国理伦片一区二区三区在线播放| 欧美国产综合一区二区| 欧美午夜精品久久久| 九九精品一区二区| 一区二区三区小说| 久久久久综合网| 欧美丝袜丝交足nylons图片| 国产一区二区三区免费观看| 亚洲伦理在线精品| 久久无码av三级| 欧美午夜在线一二页| 国产乱人伦偷精品视频免下载 | 91麻豆精东视频| 美女mm1313爽爽久久久蜜臀| 日韩美女视频一区| 欧美大片在线观看一区二区| 在线看国产一区| 国产精品88av| 久久精品国内一区二区三区| 一级日本不卡的影视| 久久一区二区视频| 欧美三级欧美一级| 99久久久国产精品| 国产一区二区三区电影在线观看| 亚洲五码中文字幕| 亚洲三级在线播放| 久久久久久久综合色一本| 欧美精品九九99久久| 在线免费不卡电影| 99精品一区二区三区| 国产精一区二区三区| 久久国产精品72免费观看| 亚洲一区二区三区四区五区黄| 日本一区二区三区国色天香| 精品奇米国产一区二区三区| 欧美日韩精品一区二区三区四区| 色综合中文字幕国产 | 国产在线精品免费av| 美女被吸乳得到大胸91| 午夜不卡av在线| 亚洲电影在线播放| 亚洲综合免费观看高清完整版在线| 国产精品另类一区| 中文字幕免费观看一区| 久久九九影视网| 国产亚洲成aⅴ人片在线观看| 久久久久久久久99精品| 久久久久免费观看| 国产日韩欧美精品电影三级在线| 久久嫩草精品久久久久| 久久精品人人做人人爽人人| 久久麻豆一区二区| 国产清纯白嫩初高生在线观看91 | 亚洲高清免费视频| 午夜激情一区二区| 午夜一区二区三区在线观看| 日韩精品一二三四| 日韩国产成人精品| 日本在线不卡一区| 麻豆免费精品视频| 国产精品一区二区视频| 成人动漫中文字幕| 色噜噜狠狠色综合欧洲selulu| 色婷婷综合久久久中文字幕| 色94色欧美sute亚洲线路一ni | 亚洲六月丁香色婷婷综合久久| 亚洲乱码国产乱码精品精可以看| 一区二区三区影院| 日本欧美一区二区三区| 久久国产综合精品| 成人性生交大片免费看中文| 色悠久久久久综合欧美99| 欧美日韩免费一区二区三区| 欧美成人r级一区二区三区| 久久久精品黄色| 亚洲久本草在线中文字幕| 天天色综合天天| 国产一区二区免费视频| 成人av电影观看| 欧美精品一二三| 久久精品人人做人人综合| 亚洲日本一区二区| 日韩国产一区二| 国产二区国产一区在线观看| 日本久久电影网| 欧美va日韩va| 日韩理论电影院| 麻豆精品新av中文字幕| av欧美精品.com| 欧美一区二区三区视频在线观看| 国产欧美视频在线观看| 亚洲成人激情社区| 成人国产精品免费观看动漫| 欧美色综合久久| 国产香蕉久久精品综合网| 亚洲成人www| www.激情成人| 精品日韩在线观看| 亚洲一区国产视频| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 欧美美女喷水视频| 国产欧美日韩亚州综合| 婷婷成人激情在线网| 成人一区二区三区中文字幕| 欧美日韩国产美| 中文字幕五月欧美| 韩国v欧美v日本v亚洲v| 欧美日韩国产小视频| 亚洲天堂福利av| 国产一区二区免费在线| 欧美美女一区二区在线观看| 中文字幕日韩精品一区| 精品一区二区成人精品| 欧美人牲a欧美精品| 亚洲欧美日韩国产手机在线| 国产99一区视频免费| 日韩欧美成人午夜| 五月天一区二区三区| 91视视频在线观看入口直接观看www| 日韩精品一区二区在线| 五月天婷婷综合| 色噜噜狠狠成人网p站| 1024国产精品| 成人高清视频免费观看| 国产午夜精品福利| 国产在线看一区| 日韩一级片在线播放| 天堂成人免费av电影一区| 91行情网站电视在线观看高清版| 中文字幕五月欧美| 成人免费视频播放| 中文字幕成人在线观看| 国产凹凸在线观看一区二区| 久久久亚洲国产美女国产盗摄 | 亚洲国产一区二区在线播放| 91麻豆123| 亚洲欧美成人一区二区三区| 一道本成人在线| 亚洲欧美日韩一区| 91在线云播放| 一区二区三区丝袜| 欧美中文一区二区三区| 一区二区三区日韩精品视频| 色av成人天堂桃色av| 一区二区高清视频在线观看| 91麻豆文化传媒在线观看| 亚洲另类色综合网站| 91国产丝袜在线播放| 亚洲精品国产精品乱码不99 | 麻豆精品一区二区| 精品99999| 成人免费电影视频| 亚洲欧美日韩国产中文在线| 91国内精品野花午夜精品| 亚洲风情在线资源站| 日韩三级中文字幕| 国产精品亚洲第一区在线暖暖韩国| 国产日本亚洲高清| 成人av在线播放网站|