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

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

?? os_core.c

?? 基于ARM7的SD卡的驅動成熟 完全可用
?? 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一区二区三区免费野_久草精品视频
91视频xxxx| 蜜臀国产一区二区三区在线播放| 欧美三级蜜桃2在线观看| 丝袜美腿亚洲色图| 国产欧美精品一区aⅴ影院 | 3atv在线一区二区三区| 黄色日韩网站视频| 午夜视频在线观看一区| 精品成人一区二区| 欧美手机在线视频| 成人av在线资源网| 久久国内精品视频| 亚洲一区二区av电影| 亚洲国产精品精华液2区45| 91麻豆精品国产91久久久使用方法| 在线视频观看一区| 麻豆免费看一区二区三区| 一区二区三区精品在线| 久久精品亚洲精品国产欧美| 欧美另类z0zxhd电影| 91激情在线视频| 91丨porny丨最新| 处破女av一区二区| 国产成人亚洲综合a∨婷婷图片 | 亚洲国产精华液网站w| 精品国产乱码久久久久久1区2区 | 久久久高清一区二区三区| 欧美猛男gaygay网站| 色琪琪一区二区三区亚洲区| 粉嫩av一区二区三区粉嫩| 激情图区综合网| 久久99精品网久久| 蜜臀99久久精品久久久久久软件| 午夜日韩在线电影| 亚洲第一综合色| 亚洲国产成人av| 午夜视频一区二区| 国产精品视频看| 久久亚洲欧美国产精品乐播| 精品国内片67194| 日韩午夜激情av| 精品成人一区二区三区四区| 精品国产1区2区3区| 日韩一级大片在线| 精品国产三级电影在线观看| 欧美成人一区二区| 久久婷婷成人综合色| 久久久噜噜噜久噜久久综合| 国产偷国产偷亚洲高清人白洁| 久久九九影视网| 国产精品大尺度| 亚洲伦在线观看| 亚洲一区二区三区在线| 亚洲成人av一区| 美女性感视频久久| 国产成都精品91一区二区三| 粉嫩欧美一区二区三区高清影视| 国产成人午夜精品5599| 99久久婷婷国产综合精品电影 | 色婷婷av一区二区三区软件 | 国产精品久久久久永久免费观看 | 91网站视频在线观看| 99精品热视频| 欧美在线一区二区| 欧美一级久久久久久久大片| 久久久久久免费毛片精品| 国产精品免费观看视频| 伊人一区二区三区| 蜜臀久久99精品久久久画质超高清| 国产一区二区伦理片| av日韩在线网站| 欧美日韩电影一区| 国产午夜精品理论片a级大结局| 亚洲欧洲一区二区三区| 天堂一区二区在线| 国产九九视频一区二区三区| 99国产精品国产精品毛片| 欧美在线短视频| 日韩精品一区二区三区四区视频 | 午夜视黄欧洲亚洲| 国产激情偷乱视频一区二区三区| 91免费在线播放| 欧美一区二区黄色| 综合激情成人伊人| 免费在线观看日韩欧美| 99re这里只有精品6| 欧美一区二区三区啪啪| 中文字幕精品一区| 日产国产欧美视频一区精品| 成人av中文字幕| 欧美成人综合网站| 亚洲一区二区三区四区在线免费观看| 卡一卡二国产精品| 一本到一区二区三区| 欧美电影免费观看高清完整版在| 亚洲图片你懂的| 久久国产福利国产秒拍| 91高清在线观看| 欧美激情综合在线| 免费亚洲电影在线| 欧美在线看片a免费观看| 久久久青草青青国产亚洲免观| 亚洲va欧美va人人爽| 成人激情黄色小说| 精品三级在线观看| 三级成人在线视频| 91小视频在线观看| 国产亚洲精久久久久久| 蜜臀91精品一区二区三区| 欧美亚洲高清一区二区三区不卡| 日本一区免费视频| 狠狠色狠狠色综合| 欧美一区二区视频在线观看2020| 亚洲精品乱码久久久久久| 国产成人自拍网| 精品国产网站在线观看| 日日摸夜夜添夜夜添精品视频| 色www精品视频在线观看| 日本一区二区三区高清不卡| 国产又黄又大久久| 欧美成人video| 免费观看一级特黄欧美大片| 欧美日韩dvd在线观看| 亚洲综合成人网| 色综合天天狠狠| 亚洲日韩欧美一区二区在线| 成人a级免费电影| 欧美国产国产综合| 国产成人精品免费视频网站| 久久先锋资源网| 国产精品亚洲第一| 久久尤物电影视频在线观看| 国产综合一区二区| 久久免费电影网| 国产高清久久久久| 欧美激情在线观看视频免费| 国产成人综合自拍| 国产精品欧美极品| 波多野结衣精品在线| 国产精品久久久久毛片软件| 99re这里只有精品首页| 亚洲卡通欧美制服中文| 一本色道亚洲精品aⅴ| 一区二区三区日韩精品视频| 色激情天天射综合网| 亚洲一区二区三区美女| 欧美日韩视频在线观看一区二区三区| 一区二区三区产品免费精品久久75 | 亚洲精品中文在线观看| 91麻豆国产在线观看| 亚洲一区二区三区精品在线| 4438x亚洲最大成人网| 捆绑紧缚一区二区三区视频| 久久女同精品一区二区| 99免费精品在线| 亚洲成人一区二区| 精品国产一区二区三区久久影院 | 免费在线视频一区| 久久综合九色欧美综合狠狠| 国产99久久久国产精品免费看| 亚洲欧美一区二区三区国产精品 | 日韩制服丝袜先锋影音| 日韩精品一区二区在线观看| 国产传媒欧美日韩成人| 亚洲精品国产一区二区精华液| 欧美夫妻性生活| 激情偷乱视频一区二区三区| 国产精品色在线观看| 欧美视频在线播放| 美女在线视频一区| 中文字幕亚洲视频| 欧美一区二区视频在线观看2022 | 夫妻av一区二区| 亚洲最大的成人av| 26uuu国产一区二区三区| 91在线视频播放地址| 日韩 欧美一区二区三区| 欧美国产亚洲另类动漫| 欧美午夜精品一区二区三区| 国内一区二区视频| 亚洲小说欧美激情另类| 精品国产乱码久久久久久浪潮| 91亚洲精品久久久蜜桃网站| 蜜桃av一区二区三区电影| 国产精品美女一区二区| 69堂亚洲精品首页| 9i看片成人免费高清| 另类小说图片综合网| 亚洲视频一区在线| 26uuu国产日韩综合| 欧美视频一区在线观看| 成人毛片老司机大片| 免费不卡在线观看| 亚洲精品videosex极品| 久久免费精品国产久精品久久久久| 欧美色涩在线第一页| www.在线成人| 国产剧情一区二区三区| 免费成人在线影院| 亚洲成人午夜电影|