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

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

?? os_core.c

?? Samsung ARM7 s3c44b0 + uC-OSii + uC-GUI 完美的綜合到了一起
?? 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()

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人一级视频在线观看| 亚洲一本大道在线| 国产精品911| 中文字幕欧美激情一区| 成人一级黄色片| 亚洲视频资源在线| 欧美午夜精品久久久久久孕妇| 亚洲国产色一区| 欧美一级日韩不卡播放免费| 日韩**一区毛片| 精品国产成人系列| 成人app在线观看| 午夜伦理一区二区| 久久综合九色欧美综合狠狠| 成人一区二区视频| 亚洲成人免费电影| 欧美精品一区二区三区视频| 成人免费视频app| 亚洲福利视频一区| 久久综合给合久久狠狠狠97色69| 国产高清一区日本| 亚洲午夜久久久久久久久电影网| 日韩一区二区不卡| aa级大片欧美| 视频一区免费在线观看| 国产视频一区二区三区在线观看| 91亚洲精华国产精华精华液| 视频在线观看91| 国产精品色婷婷久久58| 538prom精品视频线放| 国产福利一区二区| 亚洲福利电影网| 亚洲国产精品av| 9191久久久久久久久久久| 粉嫩av亚洲一区二区图片| 婷婷综合五月天| 国产精品久久一卡二卡| 日韩一区二区在线观看视频播放 | 夜夜嗨av一区二区三区中文字幕| 91精品福利在线一区二区三区| 国产成人精品亚洲日本在线桃色| 亚洲电影一区二区三区| 国产精品久久久久久久第一福利| 欧美一级理论片| 91网址在线看| 国产在线一区二区综合免费视频| 亚洲精品国产无套在线观| 26uuu亚洲| 91精品国产一区二区三区蜜臀| 91首页免费视频| 国产成人一区在线| 久草在线在线精品观看| 天堂va蜜桃一区二区三区漫画版 | 欧美日韩第一区日日骚| bt欧美亚洲午夜电影天堂| 激情综合网天天干| 日韩中文字幕麻豆| 亚洲无人区一区| 亚洲同性gay激情无套| 中文字幕不卡在线播放| 久久综合国产精品| 亚洲精品一线二线三线| 日韩欧美成人午夜| 在线综合亚洲欧美在线视频| 欧美在线观看你懂的| 99re亚洲国产精品| www.成人在线| 成人性视频网站| 国产99精品视频| 国产99一区视频免费| 国产福利一区二区三区视频 | 一本在线高清不卡dvd| 大胆亚洲人体视频| 国产成人av影院| 成人午夜免费电影| 成人av电影免费观看| 成人国产精品免费| 成人黄色片在线观看| 不卡区在线中文字幕| 99国产精品一区| 色av一区二区| 欧美日精品一区视频| 欧美男生操女生| 91精品婷婷国产综合久久性色| 欧美精选午夜久久久乱码6080| 欧美日韩黄色一区二区| 69p69国产精品| 精品久久久久久最新网址| 久久久综合九色合综国产精品| 精品成人一区二区| 欧美激情在线观看视频免费| 国产精品入口麻豆原神| 亚洲日本一区二区三区| 一区二区国产视频| 日本中文字幕不卡| 国内精品视频666| 成人性生交大片免费 | 91视频一区二区| 在线欧美日韩国产| 欧美一级久久久久久久大片| 久久夜色精品一区| 国产精品第五页| 亚洲大片一区二区三区| 精品在线一区二区三区| 成人av在线一区二区三区| 色婷婷综合久久久久中文一区二区| 欧美无乱码久久久免费午夜一区| 制服丝袜亚洲播放| 欧美激情一区二区三区全黄 | 欧美午夜片在线观看| 欧美一级精品大片| 中文字幕av一区二区三区免费看| 亚洲精品少妇30p| 麻豆成人久久精品二区三区红 | 大桥未久av一区二区三区中文| av电影一区二区| 欧美日韩国产片| 久久日韩粉嫩一区二区三区| 亚洲免费电影在线| 日本不卡视频一二三区| 国产成人在线视频网址| 欧美日韩一区视频| 日本一区二区三区在线观看| 亚洲午夜成aⅴ人片| 国产一区二区三区四区五区美女 | 欧美精品一区二区三区视频| 亚洲欧美日韩国产综合| 国产在线视频一区二区三区| 色国产综合视频| 久久久久久99久久久精品网站| 亚洲午夜精品在线| 成人动漫av在线| 精品日产卡一卡二卡麻豆| 一区二区三区欧美视频| 国产风韵犹存在线视精品| 欧美精品在线一区二区三区| 中文字幕色av一区二区三区| 久久99精品一区二区三区 | 成人一区在线观看| 欧美大片在线观看一区| 亚洲成av人综合在线观看| av在线播放一区二区三区| 2017欧美狠狠色| 蜜桃一区二区三区四区| 欧美日韩成人一区二区| 亚洲人成网站色在线观看| 丰满少妇在线播放bd日韩电影| 欧美一区二区大片| 亚洲大型综合色站| 欧洲精品一区二区三区在线观看| 欧美激情一区不卡| 国产一区二区在线视频| 日韩亚洲欧美综合| 日韩精品一二三区| 在线欧美日韩国产| 一区二区三区四区视频精品免费 | 国内精品免费**视频| 欧美久久一二三四区| 亚洲亚洲人成综合网络| 色嗨嗨av一区二区三区| 亚洲欧美激情在线| av不卡一区二区三区| 国产精品久久久久久久久快鸭| 国产一区二区0| 久久伊99综合婷婷久久伊| 久久精工是国产品牌吗| 日韩欧美一二区| 久久成人免费网站| 精品国产一区二区三区忘忧草| 蜜臀精品久久久久久蜜臀 | 一区二区三区四区乱视频| 99久久国产综合精品色伊| 中文字幕亚洲精品在线观看| 不卡视频免费播放| 亚洲精品国产一区二区精华液| 91香蕉视频黄| 亚洲香肠在线观看| 91精品欧美久久久久久动漫| 日韩高清不卡一区二区三区| 欧美一级片在线看| 国产在线麻豆精品观看| 国产亚洲成年网址在线观看| 成人性色生活片免费看爆迷你毛片| 国产精品伦一区| 在线一区二区视频| 日本亚洲一区二区| 精品成人一区二区| av中文字幕亚洲| 亚洲一区二区三区免费视频| 91精品国产欧美日韩| 国产一区欧美日韩| 国产精品久久久久久一区二区三区| 91在线观看一区二区| 婷婷综合另类小说色区| 精品粉嫩aⅴ一区二区三区四区| 国产很黄免费观看久久| 亚洲免费av在线| 欧美一区二区二区| 日韩免费性生活视频播放| 国产一区在线不卡|