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

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

?? os_core.c

?? 自已寫的lwip+ucos程序已調(diào)通
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             CORE FUNCTIONS
*
*                          (c) Copyright 1992-2001, 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,
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
};
/*$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)
{
    INT16U     i;
    INT8U     *prdytbl;
    OS_TCB    *ptcb1;
    OS_TCB    *ptcb2;
#if (OS_EVENT_EN > 0) && (OS_MAX_EVENTS > 1)
    OS_EVENT  *pevent1;
    OS_EVENT  *pevent2;
#endif


#if OS_VERSION >= 204
    OSInitHookBegin();                                           /* Call port specific initialization code   */
#endif

#if OS_TIME_GET_SET_EN > 0   
    OSTime        = 0L;                                          /* Clear the 32-bit system clock            */
#endif
    OSIntNesting  = 0;                                           /* Clear the interrupt nesting counter      */
    OSLockNesting = 0;                                           /* Clear the scheduling lock counter        */
    OSTaskCtr     = 0;                                           /* Clear the number of tasks                */
    OSRunning     = FALSE;                                       /* Indicate that multitasking not started   */
    OSIdleCtr     = 0L;                                          /* Clear the 32-bit idle counter            */
#if (OS_TASK_STAT_EN > 0) && (OS_TASK_CREATE_EXT_EN > 0)
    OSIdleCtrRun  = 0L;
    OSIdleCtrMax  = 0L;
    OSStatRdy     = FALSE;                                       /* Statistic task is not ready              */
#endif
    OSCtxSwCtr    = 0;                                           /* Clear the context switch counter         */
    OSRdyGrp      = 0x00;                                        /* Clear the ready list                     */
    prdytbl       = &OSRdyTbl[0];
    for (i = 0; i < OS_RDY_TBL_SIZE; i++) {
        *prdytbl++ = 0x00;
    }

    OSPrioCur     = 0;
    OSPrioHighRdy = 0;
    OSTCBHighRdy  = (OS_TCB *)0;                                 /* TCB Initialization                       */
    OSTCBCur      = (OS_TCB *)0;
    OSTCBList     = (OS_TCB *)0;
    for (i = 0; i < (OS_LOWEST_PRIO + 1); i++) {                 /* Clear the priority table                 */
        OSTCBPrioTbl[i] = (OS_TCB *)0;
    }
    ptcb1 = &OSTCBTbl[0];
    ptcb2 = &OSTCBTbl[1];
    for (i = 0; i < (OS_MAX_TASKS + OS_N_SYS_TASKS - 1); i++) {  /* Init. list of free TCBs                  */
        ptcb1->OSTCBNext = ptcb2;
        ptcb1++;
        ptcb2++;
    }
    ptcb1->OSTCBNext = (OS_TCB *)0;                              /* Last OS_TCB                              */
    OSTCBFreeList    = &OSTCBTbl[0];

#if (OS_EVENT_EN > 0) && (OS_MAX_EVENTS > 0)
    #if OS_MAX_EVENTS == 1                                       
    OSEventFreeList              = &OSEventTbl[0];               /* Only have ONE event control block        */
    OSEventFreeList->OSEventType = OS_EVENT_TYPE_UNUSED;
    OSEventFreeList->OSEventPtr  = (OS_EVENT *)0;
    #else
    pevent1 = &OSEventTbl[0];
    pevent2 = &OSEventTbl[1];
    for (i = 0; i < (OS_MAX_EVENTS - 1); i++) {                  /* Init. list of free EVENT control blocks  */
        pevent1->OSEventType = OS_EVENT_TYPE_UNUSED;
        pevent1->OSEventPtr  = pevent2;
        pevent1++;
        pevent2++;
    }
    pevent1->OSEventType = OS_EVENT_TYPE_UNUSED;
    pevent1->OSEventPtr  = (OS_EVENT *)0;
    OSEventFreeList      = &OSEventTbl[0];
    #endif
#endif

#if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
    OS_FlagInit();                                               /* Initialize the event flag structures     */
#endif

#if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
    OS_QInit();                                                  /* Initialize the message queue structures  */
#endif

#if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
    OS_MemInit();                                                /* Initialize the memory manager            */
#endif

    /* ------------------------------------- CREATION OF 'IDLE' TASK --------------------------------------- */
#if OS_TASK_CREATE_EXT_EN > 0
    #if OS_STK_GROWTH == 1
    (void)OSTaskCreateExt(OS_TaskIdle,
                          (void *)0,                                 /* No arguments passed to OS_TaskIdle() */
                          &OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE - 1], /* Set Top-Of-Stack                     */
                          OS_IDLE_PRIO,                              /* Lowest priority level                */
                          OS_TASK_IDLE_ID,
                          &OSTaskIdleStk[0],                         /* Set Bottom-Of-Stack                  */
                          OS_TASK_IDLE_STK_SIZE,
                          (void *)0,                                 /* No TCB extension                     */
                          OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);/* Enable stack checking + clear stack  */
    #else
    (void)OSTaskCreateExt(OS_TaskIdle,
                          (void *)0,                                 /* No arguments passed to OS_TaskIdle() */
                          &OSTaskIdleStk[0],                         /* Set Top-Of-Stack                     */
                          OS_IDLE_PRIO,                              /* Lowest priority level                */
                          OS_TASK_IDLE_ID,
                          &OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE - 1], /* Set Bottom-Of-Stack                  */
                          OS_TASK_IDLE_STK_SIZE,
                          (void *)0,                                 /* No TCB extension                     */
                          OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);/* Enable stack checking + clear stack  */
    #endif
#else
    #if OS_STK_GROWTH == 1
    (void)OSTaskCreate(OS_TaskIdle,
                       (void *)0,
                       &OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE - 1],
                       OS_IDLE_PRIO);
    #else
    (void)OSTaskCreate(OS_TaskIdle,
                       (void *)0,
                       &OSTaskIdleStk[0],
                       OS_IDLE_PRIO);
    #endif
#endif

    /* ------------------------------- CREATION OF 'STATISTIC' TASK ---------------------------------- */
#if OS_TASK_STAT_EN > 0
    #if OS_TASK_CREATE_EXT_EN > 0
        #if OS_STK_GROWTH == 1
        (void)OSTaskCreateExt(OS_TaskStat,
                              (void *)0,                                   /* No args passed to OS_TaskStat()*/
                              &OSTaskStatStk[OS_TASK_STAT_STK_SIZE - 1],   /* Set Top-Of-Stack               */
                              OS_STAT_PRIO,                                /* One higher than the idle task  */
                              OS_TASK_STAT_ID,
                              &OSTaskStatStk[0],                           /* Set Bottom-Of-Stack            */
                              OS_TASK_STAT_STK_SIZE,
                              (void *)0,                                   /* No TCB extension               */
                              OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);  /* Enable stack checking + clear  */
        #else
        (void)OSTaskCreateExt(OS_TaskStat,
                              (void *)0,                                   /* No args passed to OS_TaskStat()*/
                              &OSTaskStatStk[0],                           /* Set Top-Of-Stack               */
                              OS_STAT_PRIO,                                /* One higher than the idle task  */
                              OS_TASK_STAT_ID,
                              &OSTaskStatStk[OS_TASK_STAT_STK_SIZE - 1],   /* Set Bottom-Of-Stack            */
                              OS_TASK_STAT_STK_SIZE,
                              (void *)0,                                   /* No TCB extension               */
                              OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);  /* Enable stack checking + clear  */
        #endif
    #else
        #if OS_STK_GROWTH == 1
        (void)OSTaskCreate(OS_TaskStat,
                           (void *)0,                                      /* No args passed to OS_TaskStat()*/
                           &OSTaskStatStk[OS_TASK_STAT_STK_SIZE - 1],      /* Set Top-Of-Stack               */
                           OS_STAT_PRIO);                                  /* One higher than the idle task  */
        #else
        (void)OSTaskCreate(OS_TaskStat,
                           (void *)0,                                      /* No args passed to OS_TaskStat()*/
                           &OSTaskStatStk[0],                              /* Set Top-Of-Stack               */
                           OS_STAT_PRIO);                                  /* One higher than the idle task  */
        #endif
    #endif
#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) Your ISR can directly increment OSIntNesting without calling this function because
*                 OSIntNesting has been declared 'global'.  You MUST, however, be sure that the increment
*                 is performed 'indivisibly' by your processor to ensure proper access to this critical
*                 resource.
*              2) You MUST still call OSIntExit() even though you increment OSIntNesting directly.
*              3) 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.
*********************************************************************************************************
*/

void  OSIntEnter (void)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    
    
    OS_ENTER_CRITICAL();
    if (OSIntNesting < 255) {
        OSIntNesting++;                          /* Increment ISR nesting level                        */
    }
    OS_EXIT_CRITICAL();
}
/*$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 OSSchedLock())
*********************************************************************************************************
*/

void  OSIntExit (void)
{
#if OS_CRITICAL_METHOD == 3                            /* Allocate storage for CPU status register     */
    OS_CPU_SR  cpu_sr;
#endif
    
    
    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 context switches */
            OSIntCtxSw();                              /* Perform interrupt level context 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产喷白浆一区二区三区| 欧美视频你懂的| 亚洲一级二级三级在线免费观看| 91精品国产综合久久香蕉的特点| 国产 欧美在线| 免费一级片91| 亚洲国产欧美日韩另类综合| 国产欧美一区二区在线观看| 69av一区二区三区| 91黄色激情网站| 高清不卡在线观看| 精品一区二区成人精品| 亚洲国产一区视频| 中文字幕一区二区在线播放| 日韩欧美第一区| 欧美日韩一区视频| 91麻豆高清视频| 国产成人av网站| 激情综合亚洲精品| 日韩av不卡在线观看| 亚洲一区二区欧美日韩| 亚洲免费观看高清完整| 中文一区二区在线观看| 精品国产一区二区国模嫣然| 777xxx欧美| 欧美视频中文一区二区三区在线观看| 成人黄色国产精品网站大全在线免费观看| 99国产精品久久| 成人综合在线观看| 国产精品综合二区| 国产一区二区三区最好精华液| 日韩一区精品视频| 午夜欧美2019年伦理| 亚洲小说欧美激情另类| 亚洲欧美日韩中文播放| 亚洲人吸女人奶水| 亚洲欧美另类久久久精品2019| 国产精品美女久久久久久久久| 久久免费美女视频| 久久精品夜色噜噜亚洲aⅴ| 精品国产a毛片| 精品国产一区二区国模嫣然| 精品国产乱码久久久久久1区2区 | 99riav久久精品riav| 国产精品一级片在线观看| 国产一区二区精品在线观看| 经典三级视频一区| 国产精品69久久久久水密桃| 国产精品中文字幕日韩精品| 国产乱人伦精品一区二区在线观看 | 在线不卡一区二区| 欧美一区二区视频在线观看2022| 欧美一区二区三区视频免费| 欧美一级搡bbbb搡bbbb| 欧美xxxxx裸体时装秀| 精品国产第一区二区三区观看体验| 精品入口麻豆88视频| 久久一留热品黄| 国产精品区一区二区三| 亚洲欧美日韩国产综合| 亚洲二区在线视频| 美女精品一区二区| 大胆亚洲人体视频| 日本高清成人免费播放| 91精品免费在线| 国产午夜亚洲精品理论片色戒| 国产精品久久久久久久久图文区| 最新成人av在线| 日日骚欧美日韩| 国产精品一区二区你懂的| 91在线观看地址| 91精品国产综合久久久蜜臀图片| 26uuu色噜噜精品一区| 国产精品久线观看视频| 亚洲第一狼人社区| 国产在线一区二区| 91丨porny丨在线| 日韩一区二区视频在线观看| 久久精品男人的天堂| 亚洲综合一区在线| 在线播放中文一区| 久久久久久久综合日本| 亚洲精品乱码久久久久久黑人| 日产欧产美韩系列久久99| 成人精品一区二区三区四区| 欧美三级韩国三级日本一级| www国产成人| 夜夜操天天操亚洲| 狠狠狠色丁香婷婷综合激情| 91麻豆文化传媒在线观看| 日韩一区二区免费电影| 中文字幕中文乱码欧美一区二区| 首页国产丝袜综合| 99久久免费精品高清特色大片| 69p69国产精品| 综合激情成人伊人| 国产一区二区三区精品视频| 欧美综合欧美视频| 亚洲国产精华液网站w| 欧美a级一区二区| 色综合激情久久| 国产三级精品视频| 毛片av中文字幕一区二区| 色av一区二区| 中日韩免费视频中文字幕| 青青草97国产精品免费观看| 在线看日韩精品电影| 国产欧美va欧美不卡在线| 日本美女一区二区三区| 色女孩综合影院| 国产精品久久久久影院亚瑟 | 91网页版在线| 国产日产欧产精品推荐色| 免费成人av在线播放| 欧美日韩一区视频| 亚洲精品国产无天堂网2021| 成人一区二区三区| 久久久久国产精品厨房| 麻豆精品视频在线| 国产精品超碰97尤物18| 国产在线播放一区| 精品国产乱码久久久久久蜜臀 | 成人av电影在线| 久久免费视频色| 国产一区啦啦啦在线观看| 日韩欧美你懂的| 日本 国产 欧美色综合| 欧美精品在线观看播放| 性做久久久久久免费观看| 欧美在线一区二区三区| 亚洲精品免费看| 在线精品视频小说1| 亚洲久草在线视频| 欧美午夜理伦三级在线观看| 亚洲精品国久久99热| 91视频com| 一区二区三区在线观看网站| 色老综合老女人久久久| 一区二区免费在线播放| 在线观看国产日韩| 亚洲大片免费看| 欧美高清hd18日本| 日本成人超碰在线观看| 日韩欧美在线网站| 精品一区二区久久| 国产欧美一区二区在线| 成人精品一区二区三区四区 | 色综合久久综合网97色综合 | 亚洲伦理在线免费看| 欧美影视一区二区三区| 亚洲风情在线资源站| 欧美一卡二卡在线| 国模娜娜一区二区三区| 国产欧美日韩在线看| 成人视屏免费看| 亚洲精品福利视频网站| 欧美日韩国产一二三| 麻豆成人综合网| 久久综合狠狠综合久久综合88 | 国产精品一二三在| 最新久久zyz资源站| 欧美亚洲动漫另类| 免费精品视频在线| 国产欧美精品在线观看| 色综合久久久久综合体| 午夜精品123| 久久久久久久久免费| 97久久精品人人做人人爽| 亚洲成人自拍网| xnxx国产精品| www.成人在线| 石原莉奈在线亚洲三区| 国产情人综合久久777777| 欧洲视频一区二区| 激情综合色综合久久| 国产精品久久久久一区二区三区共| 欧美影院一区二区三区| 看电视剧不卡顿的网站| 国产精品久久国产精麻豆99网站 | 中文字幕欧美激情| 欧美日高清视频| 国产91精品一区二区麻豆亚洲| 一级日本不卡的影视| wwwwww.欧美系列| 欧美性色欧美a在线播放| 国产中文字幕精品| 香蕉av福利精品导航| 中文无字幕一区二区三区| 欧美日韩亚洲综合一区二区三区| 国产高清亚洲一区| 日韩国产精品91| 亚洲人成网站色在线观看| 欧美va亚洲va在线观看蝴蝶网| 一本大道久久精品懂色aⅴ| 久久精品国产亚洲高清剧情介绍| 亚洲男人的天堂在线观看| 久久久亚洲精品一区二区三区| 欧美性猛交一区二区三区精品| 国产成人夜色高潮福利影视| 日韩av中文字幕一区二区|