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

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

?? os_core.c.bak

?? s3c44b0x上實(shí)現(xiàn)的ucos+tftp
?? BAK
?? 第 1 頁 / 共 4 頁
字號(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)
{
#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()

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品粉嫩超白一线天av| 91精品国产欧美一区二区成人| 一区二区视频免费在线观看| 欧美一区二区三区视频在线 | 欧美国产综合一区二区| 精品成人a区在线观看| 欧美日韩综合在线| 99久久婷婷国产综合精品| 国产在线麻豆精品观看| 五月婷婷久久综合| 国产精品私房写真福利视频| 精品久久久久久最新网址| 欧美日本在线看| 欧美性猛交xxxx黑人交| 99视频一区二区| 国产成人精品www牛牛影视| 日韩avvvv在线播放| 亚洲h动漫在线| 欧美经典一区二区| 国产午夜精品在线观看| 精品久久久久香蕉网| 欧美精品一区二区三区在线播放| 欧美一区三区四区| 精品久久久久99| 中文字幕乱码日本亚洲一区二区| 精品国产99国产精品| 久久精品免费在线观看| 中文字幕第一区二区| 亚洲欧美一区二区在线观看| 国产精品嫩草影院com| 亚洲欧洲精品成人久久奇米网| 国产精品免费视频一区| 一色屋精品亚洲香蕉网站| 亚洲天堂精品在线观看| 综合久久久久综合| 肉肉av福利一精品导航| 久久99精品国产.久久久久久 | 欧美三级视频在线观看| 欧美中文字幕一区二区三区亚洲| 在线观看区一区二| 欧美精品在欧美一区二区少妇| 日韩欧美国产一二三区| 日韩一区二区不卡| 欧美国产国产综合| 亚洲主播在线观看| 国产露脸91国语对白| 欧美三级日韩三级| 欧美zozozo| 国产精品国产精品国产专区不蜜 | av不卡在线播放| 欧美日韩一区不卡| 中文乱码免费一区二区| 亚洲国产综合人成综合网站| 国产精品18久久久久久久久| 91网址在线看| 日韩午夜激情电影| 亚洲天堂久久久久久久| 国产精品一区专区| 26uuu久久天堂性欧美| 免费看欧美女人艹b| 在线成人免费观看| 亚洲欧美日韩中文播放 | av在线播放一区二区三区| 国产日韩三级在线| 国产一区二区电影| 国产三级三级三级精品8ⅰ区| 免费成人在线网站| 日韩欧美一级片| 国内不卡的二区三区中文字幕| 67194成人在线观看| 亚洲综合精品久久| 色屁屁一区二区| 中文字幕色av一区二区三区| 99精品在线观看视频| 亚洲女同ⅹxx女同tv| 色哟哟日韩精品| 亚洲成人黄色小说| 欧美一二三区精品| 久久国产成人午夜av影院| 亚洲精品一线二线三线| 国产剧情av麻豆香蕉精品| 精品日本一线二线三线不卡| 日韩avvvv在线播放| 欧美成人一区二区三区| 国产精品一二三四| 中文字幕一区二区三区色视频 | 奇米亚洲午夜久久精品| 欧美高清www午色夜在线视频| 亚洲国产一二三| 天天综合网天天综合色| 国产欧美1区2区3区| 欧美三级乱人伦电影| 国产精品影视在线| 亚洲一二三区在线观看| 精品日韩在线观看| 91亚洲精品一区二区乱码| 亚洲va韩国va欧美va| 久久精品视频一区二区| 欧美亚洲禁片免费| 午夜不卡av免费| 久久久一区二区| 欧美在线色视频| 国内精品免费**视频| 国产精品久线在线观看| 欧美一区二区不卡视频| 97久久人人超碰| 国内精品在线播放| 日本视频在线一区| 亚洲一区二区综合| 中文字幕一区二区三区精华液 | 972aa.com艺术欧美| 国产精品66部| 高清国产一区二区三区| 精品一区二区久久| 极品瑜伽女神91| 免费观看91视频大全| 婷婷久久综合九色综合伊人色| 国产精品久久99| 久久久精品天堂| 久久天堂av综合合色蜜桃网| 欧美日韩国产影片| 欧洲av在线精品| 91看片淫黄大片一级在线观看| 国产乱对白刺激视频不卡| 岛国av在线一区| av不卡一区二区三区| 91激情在线视频| 欧美日韩黄色一区二区| 日韩三级免费观看| 精品区一区二区| 国产欧美一区二区三区在线老狼| 亚洲自拍偷拍图区| 丝袜美腿成人在线| 久久国产成人午夜av影院| 国产一区 二区 三区一级| 国产成人在线视频网址| 不卡在线观看av| 欧美日韩高清在线播放| 精品国产乱码久久| 国产精品久久午夜| 青青草国产精品亚洲专区无| 美国精品在线观看| 麻豆一区二区三区| 六月丁香综合在线视频| 成人av在线资源网| 欧美精品第1页| 久久久久99精品一区| 亚洲乱码国产乱码精品精可以看| 亚洲黄色免费电影| 国产一区免费电影| 精品视频一区三区九区| 久久这里都是精品| 一区二区三区成人| 黄网站免费久久| 91国在线观看| 日韩免费观看2025年上映的电影 | 色婷婷综合久久久久中文一区二区| 91麻豆精品国产91久久久久久久久 | 精品一区二区精品| 欧美日韩一区三区四区| 欧美国产乱子伦 | 在线观看欧美精品| 久久蜜桃一区二区| 欧美国产日韩亚洲一区| 亚洲成国产人片在线观看| 国产黑丝在线一区二区三区| 91精品国产品国语在线不卡| 亚洲高清免费观看高清完整版在线观看| 黄页网站大全一区二区| 日韩欧美亚洲国产精品字幕久久久| 亚洲在线免费播放| 91福利视频在线| 亚洲宅男天堂在线观看无病毒| 成人精品在线视频观看| 久久久精品天堂| 成人性视频网站| 中日韩av电影| 91福利资源站| 亚洲成av人片一区二区| 欧美精品丝袜中出| 午夜成人免费电影| 欧美一二区视频| 国产福利一区二区三区视频在线 | 99re免费视频精品全部| 最近中文字幕一区二区三区| 在线亚洲人成电影网站色www| 一区二区三区四区视频精品免费 | 精品粉嫩aⅴ一区二区三区四区| 免费一级片91| 中文字幕一区二区不卡| 成人av动漫在线| 天天影视涩香欲综合网| 精品国产91乱码一区二区三区 | 天天操天天综合网| 26uuu亚洲| 欧美群妇大交群中文字幕| 国产精品一区在线观看乱码| 一区二区高清在线| 色女孩综合影院| 成人动漫av在线|