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

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

?? os_core.c

?? 基于Verilog HDL的電梯系統設計
?? 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一区二区三区免费野_久草精品视频
日本成人在线电影网| 日本不卡一二三区黄网| 久久精品亚洲一区二区三区浴池| 欧美日本在线观看| 欧美精品第1页| 欧美成人三级在线| 久久久激情视频| 国产精品日韩成人| 亚洲精品久久久蜜桃| 亚洲国产色一区| 久久精品99国产精品日本| 狠狠久久亚洲欧美| 国产成+人+日韩+欧美+亚洲| www.在线成人| 欧美丝袜丝交足nylons图片| 91精品国产色综合久久ai换脸| 日韩免费在线观看| 日本一区二区不卡视频| 亚洲你懂的在线视频| 日韩精品一区第一页| 国精产品一区一区三区mba桃花| 国产精品羞羞答答xxdd| 91在线一区二区三区| 欧美吞精做爰啪啪高潮| 久久综合久久99| 亚洲精品中文字幕在线观看| 美腿丝袜亚洲综合| 9人人澡人人爽人人精品| 在线不卡一区二区| 中文字幕第一区二区| 亚洲成人动漫在线观看| 韩国一区二区视频| 欧美在线观看视频一区二区| 日韩网站在线看片你懂的| 亚洲国产精品二十页| 日本女人一区二区三区| 99久久国产综合精品麻豆| 欧美一区二区三区思思人| 国产精品国产精品国产专区不蜜 | 久久久久久亚洲综合影院红桃 | 欧美一区二区三区四区高清| 国产欧美日韩中文久久| 偷拍与自拍一区| 成人app下载| 欧美岛国在线观看| 夜夜嗨av一区二区三区中文字幕 | 亚洲免费资源在线播放| 韩国在线一区二区| 欧美猛男gaygay网站| 欧美极品少妇xxxxⅹ高跟鞋| 免费观看在线综合色| 色94色欧美sute亚洲线路一久 | 日韩三级在线观看| 自拍偷在线精品自拍偷无码专区| 日韩精品乱码免费| 91麻豆精品视频| 欧美精品一区二区久久久| 亚洲国产精品久久人人爱| 成人性色生活片| 久久久久久久综合| 老司机午夜精品| 欧美顶级少妇做爰| 亚洲高清在线视频| 欧美视频日韩视频| 亚洲摸摸操操av| 99精品视频免费在线观看| 久久精品一区二区三区不卡| 久久福利资源站| 精品裸体舞一区二区三区| 午夜成人在线视频| 9191久久久久久久久久久| 亚洲一区二区三区国产| 在线观看亚洲专区| 一区二区三区免费网站| av网站免费线看精品| 一区二区中文视频| 99麻豆久久久国产精品免费优播| 国产精品美女久久久久av爽李琼 | 精品日韩在线一区| 日本在线不卡视频一二三区| 欧美一区二区精品久久911| 奇米一区二区三区| 精品久久久久久久久久久久久久久| 日韩国产在线观看| 欧美本精品男人aⅴ天堂| 黄色日韩网站视频| 国产欧美一区二区精品性色超碰| 成人免费av在线| 亚洲免费高清视频在线| 欧美区视频在线观看| 日韩不卡一二三区| 久久嫩草精品久久久精品一| 成人av网站免费| 亚洲人成影院在线观看| 精品视频一区二区三区免费| 蜜臀久久久99精品久久久久久| 欧美一卡在线观看| 成人手机电影网| 亚洲一区av在线| 日韩欧美不卡一区| www.日韩大片| 日本欧美肥老太交大片| 国产视频一区二区在线| 欧美中文字幕一区二区三区| 免费不卡在线视频| 国产女人18毛片水真多成人如厕 | 亚洲午夜精品在线| 337p日本欧洲亚洲大胆精品| 91在线免费播放| 日本大胆欧美人术艺术动态| 综合久久国产九一剧情麻豆| 在线播放亚洲一区| 波多野结衣中文字幕一区二区三区 | 麻豆视频一区二区| 国产精品第五页| 欧美v亚洲v综合ⅴ国产v| 色8久久人人97超碰香蕉987| 久久99久久精品| 亚洲激情综合网| 国产亚洲欧美一区在线观看| 欧美日韩国产片| 91麻豆精品一区二区三区| 狠狠狠色丁香婷婷综合久久五月| 一区二区三区免费网站| 国产视频亚洲色图| 欧美成人官网二区| 欧美日本一区二区| 在线看不卡av| 成人精品一区二区三区中文字幕| 免费观看在线综合色| 亚洲电影你懂得| 中文字幕一区二区5566日韩| 精品黑人一区二区三区久久| 欧美精品乱人伦久久久久久| 色婷婷综合视频在线观看| 懂色一区二区三区免费观看| 精品一区二区三区在线观看国产 | 中文字幕不卡在线观看| 欧美电影免费观看高清完整版在线| 欧美亚洲尤物久久| 色综合久久久久综合| 成人手机电影网| 成人视屏免费看| 国产成人精品1024| 国产精品一二三| 国产成人在线视频免费播放| 另类人妖一区二区av| 美女在线一区二区| 精品一区在线看| 黄页视频在线91| 国产999精品久久久久久绿帽| 精品一区二区三区免费视频| 日日夜夜免费精品视频| 午夜精品久久久久久久| 奇米888四色在线精品| 日韩高清欧美激情| 美女视频第一区二区三区免费观看网站| 亚洲午夜久久久久久久久电影院 | 欧美电视剧免费观看| 欧美变态tickling挠脚心| 精品999久久久| 中文字幕欧美区| 中文字幕制服丝袜一区二区三区| 国产精品久久久久久亚洲伦| **欧美大码日韩| 亚洲综合色丁香婷婷六月图片| 亚洲午夜电影在线| 青青国产91久久久久久| 国产一区中文字幕| 不卡电影免费在线播放一区| 91网站视频在线观看| 欧美日韩中文国产| 日韩欧美色综合网站| 欧美国产日韩精品免费观看| 日韩美女久久久| 日韩精品乱码av一区二区| 国产伦精品一区二区三区免费| 成人毛片视频在线观看| 91国偷自产一区二区开放时间| 欧美一级午夜免费电影| 国产视频一区在线播放| 一区二区三区在线视频播放| 美国毛片一区二区三区| 99久久精品国产观看| 91麻豆精品国产自产在线观看一区| 精品黑人一区二区三区久久| 中文字幕日韩av资源站| 日韩av网站免费在线| 成人国产精品免费观看视频| 8x8x8国产精品| 国产精品久久三| 美女网站视频久久| 色综合天天综合| 久久综合九色综合欧美就去吻| √…a在线天堂一区| 日本不卡一区二区三区| 色婷婷激情综合| 久久久久久久久久久久久久久99| 亚洲综合无码一区二区| 丰满白嫩尤物一区二区|