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

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

?? os_core.c

?? uC/OS-II 在TI TMS320C240上的移植代碼
?? 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一区二区三区免费野_久草精品视频
在线免费观看成人短视频| 成人免费视频app| 樱桃视频在线观看一区| 国产精品国产三级国产| 亚洲精品成人悠悠色影视| 国产欧美精品在线观看| 久久久99精品久久| 国产日韩欧美综合在线| 国产欧美日韩视频一区二区| 日本一区二区三区高清不卡| 中文字幕av资源一区| 国产精品伦理一区二区| 综合色天天鬼久久鬼色| 一区二区三区.www| 性感美女极品91精品| 日韩av不卡一区二区| 秋霞电影一区二区| 国产一区不卡视频| 成人在线综合网站| 欧美色图免费看| 日韩一卡二卡三卡四卡| 久久综合色之久久综合| 国产精品家庭影院| 午夜成人免费电影| 国产精品一级二级三级| 午夜精品福利久久久| 精品不卡在线视频| 中文字幕一区在线| 日韩一区二区视频在线观看| 日韩美女视频在线| 国产精品视频免费| 亚洲综合区在线| 久久精品国产精品亚洲精品| 大陆成人av片| 国产视频911| 一级女性全黄久久生活片免费| 亚洲综合色噜噜狠狠| 久草中文综合在线| 欧美亚洲尤物久久| 久久午夜色播影院免费高清| 亚洲一区免费观看| 国产一区二区三区日韩| 色婷婷综合久久久中文一区二区 | 欧美亚洲高清一区二区三区不卡| 精品视频一区二区不卡| 亚洲国产成人自拍| 男女男精品网站| 色偷偷成人一区二区三区91| 久久精品无码一区二区三区| 亚洲永久精品国产| 成人aa视频在线观看| 日韩欧美中文字幕一区| 亚洲一区二区在线视频| 99免费精品视频| 久久亚洲精品小早川怜子| 日韩电影在线观看一区| 色妹子一区二区| 国产精品欧美一区二区三区| 毛片av一区二区三区| 欧美综合亚洲图片综合区| 中文字幕免费在线观看视频一区| 麻豆精品一区二区三区| 欧美日韩高清在线| 一区二区三区精密机械公司| 成人动漫在线一区| 亚洲国产成人一区二区三区| 国产一区二区调教| 欧美成人bangbros| 另类的小说在线视频另类成人小视频在线| 在线观看精品一区| 伊人色综合久久天天| 色综合久久中文综合久久牛| 欧美激情一区二区三区| 国产精品一卡二卡在线观看| 2020国产精品| 国产v综合v亚洲欧| 国产农村妇女毛片精品久久麻豆 | 在线播放91灌醉迷j高跟美女 | 久久久久久99精品| 国内欧美视频一区二区| 精品99999| 国产乱码字幕精品高清av| 久久在线观看免费| 国产成人午夜精品影院观看视频 | 亚洲欧美综合色| 91丨九色丨黑人外教| 亚洲日本一区二区| 欧日韩精品视频| 秋霞电影网一区二区| 久久免费电影网| 成人av电影在线网| 亚洲国产欧美在线人成| 91精品国产色综合久久 | wwww国产精品欧美| 国产不卡视频一区二区三区| 亚洲四区在线观看| 欧美美女网站色| 国产一区二区三区高清播放| 欧美国产丝袜视频| 欧洲亚洲精品在线| 久久精品国产精品青草| 国产欧美一区二区三区鸳鸯浴 | 欧美一区二区三区四区久久| 青青草视频一区| 国产精品无码永久免费888| 一本到不卡免费一区二区| 午夜视频一区在线观看| 久久午夜色播影院免费高清| 91小宝寻花一区二区三区| 日韩综合一区二区| 国产精品素人视频| 在线播放国产精品二区一二区四区 | 国产夫妻精品视频| 亚洲午夜在线视频| 久久九九99视频| 欧美日韩一区二区三区不卡 | 国产三级精品视频| 欧美日韩一区二区在线观看视频| 狠狠色丁香久久婷婷综| 亚洲一区二区三区美女| 久久久亚洲精华液精华液精华液| 91福利区一区二区三区| 国产福利精品导航| 日本视频中文字幕一区二区三区| 国产精品天天看| 欧美国产禁国产网站cc| 欧美视频一二三区| av中文字幕亚洲| 国产综合色视频| 婷婷成人激情在线网| 中文字幕在线观看一区二区| 日韩一区二区三区免费观看| 色欧美片视频在线观看在线视频| 黄色精品一二区| 免费亚洲电影在线| 天天综合网天天综合色| 亚洲免费av高清| 国产欧美日韩亚州综合| 精品不卡在线视频| 精品国产在天天线2019| 欧美精品日韩一本| 欧美日韩免费电影| 在线一区二区三区| 在线欧美日韩精品| 91视频91自| 91色porny在线视频| 成人在线视频一区| 国产69精品久久777的优势| 激情都市一区二区| 国产麻豆精品在线| 粉嫩aⅴ一区二区三区四区| 久久国产免费看| 国产在线播精品第三| 国产在线乱码一区二区三区| 久久99日本精品| 国产乱人伦偷精品视频免下载| 久久国产精品第一页| 久草热8精品视频在线观看| 精品一区二区三区的国产在线播放| 蜜臀av一区二区在线观看| 蜜臀av一区二区在线观看| 毛片av一区二区三区| 国内成人免费视频| 成人久久视频在线观看| 成人精品gif动图一区| 91啪在线观看| 欧美三级日韩在线| 欧美mv日韩mv国产网站| 国产欧美日韩在线看| 中文字幕一区二区三区四区不卡| 亚洲色图欧洲色图| 亚洲成人av电影| 美国一区二区三区在线播放| 国产裸体歌舞团一区二区| 不卡高清视频专区| 欧美日本乱大交xxxxx| 日韩三级电影网址| 国产人伦精品一区二区| 免费欧美日韩国产三级电影| 另类小说欧美激情| 成人av在线播放网址| 欧美午夜影院一区| 久久女同精品一区二区| 亚洲人快播电影网| 日本麻豆一区二区三区视频| 福利一区福利二区| 欧美私人免费视频| 久久久久成人黄色影片| 亚洲最色的网站| 国产精品一区二区三区99| 色婷婷久久久亚洲一区二区三区 | 蜜臀av性久久久久蜜臀aⅴ| 国产精品1区2区3区| 欧美日韩视频在线观看一区二区三区| 欧美va亚洲va在线观看蝴蝶网| 亚洲天天做日日做天天谢日日欢 | 亚洲女与黑人做爰| 国内外成人在线| 欧美剧情电影在线观看完整版免费励志电影| 日韩你懂的电影在线观看|