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

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

?? os_core.c

?? 能夠直接在hf44b0板子上跑的uCOS,已經(jīng)測(cè)試通過(guò),在板子上跑的很流暢.
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):


    (void)memset(&OSTCBTbl[0],     0, sizeof(OSTCBTbl));         /* Clear all the TCBs                  */
    (void)memset(&OSTCBPrioTbl[0], 0, sizeof(OSTCBPrioTbl));     /* Clear the priority table            */
    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;
#if OS_TASK_NAME_SIZE > 0
        (void)strcpy(ptcb1->OSTCBTaskName, "?");                 /* Unknown name                        */
#endif
        ptcb1++;
        ptcb2++;
    }
    ptcb1->OSTCBNext = (OS_TCB *)0;                              /* Last OS_TCB                         */
#if OS_TASK_NAME_SIZE > 0
    (void)strcpy(ptcb1->OSTCBTaskName, "?");
#endif
    OSTCBList     = (OS_TCB *)0;                                 /* TCB lists initializations           */
    OSTCBFreeList = &OSTCBTbl[0];
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                              SCHEDULER
*
* Description: This function is called by other uC/OS-II services to determine whether a new, high
*              priority task has been made ready to run.  This function is invoked by TASK level code
*              and is not used to reschedule tasks from ISRs (see OSIntExit() for ISR rescheduling).
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) This function is INTERNAL to uC/OS-II and your application should not call it.
*              2) Rescheduling is prevented when the scheduler is locked (see OS_SchedLock())
*********************************************************************************************************
*/

void  OS_Sched (void)
{
#if OS_CRITICAL_METHOD == 3                            /* Allocate storage for CPU status register     */
    OS_CPU_SR  cpu_sr;
#endif    
    INT8U      y;


    OS_ENTER_CRITICAL();
    if (OSIntNesting == 0) {                           /* Schedule only if all ISRs done and ...       */
        if (OSLockNesting == 0) {                      /* ... scheduler is not locked                  */
            y             = OSUnMapTbl[OSRdyGrp];      /* Get pointer to HPT ready to run              */
            OSPrioHighRdy = (INT8U)((y << 3) + OSUnMapTbl[OSRdyTbl[y]]);
            if (OSPrioHighRdy != OSPrioCur) {          /* No Ctx Sw if current task is highest rdy     */
                OSTCBHighRdy = OSTCBPrioTbl[OSPrioHighRdy];
#if OS_TASK_PROFILE_EN > 0
                OSTCBHighRdy->OSTCBCtxSwCtr++;         /* Inc. # of context switches to this task      */
#endif
                OSCtxSwCtr++;                          /* Increment context switch counter             */
                OS_TASK_SW();                          /* Perform a context switch                     */
            }
        }
    }
    OS_EXIT_CRITICAL();
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                              IDLE TASK
*
* Description: This task is internal to uC/OS-II and executes whenever no other higher priority tasks
*              executes because they are ALL waiting for event(s) to occur.
*
* Arguments  : none
*
* Returns    : none
*
* Note(s)    : 1) OSTaskIdleHook() is called after the critical section to ensure that interrupts will be
*                 enabled for at least a few instructions.  On some processors (ex. Philips XA), enabling
*                 and then disabling interrupts didn't allow the processor enough time to have interrupts
*                 enabled before they were disabled again.  uC/OS-II would thus never recognize
*                 interrupts.
*              2) This hook has been added to allow you to do such things as STOP the CPU to conserve 
*                 power.
*********************************************************************************************************
*/

void  OS_TaskIdle (void *pdata)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    
    
    pdata = pdata;                               /* Prevent compiler warning for not using 'pdata'     */
    for (;;) {
        OS_ENTER_CRITICAL();
        OSIdleCtr++;
        OS_EXIT_CRITICAL();
        OSTaskIdleHook();                        /* Call user definable HOOK                           */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                            STATISTICS TASK
*
* Description: This task is internal to uC/OS-II and is used to compute some statistics about the
*              multitasking environment.  Specifically, OS_TaskStat() computes the CPU usage.
*              CPU usage is determined by:
*
*                                          OSIdleCtr
*                 OSCPUUsage = 100 * (1 - ------------)     (units are in %)
*                                         OSIdleCtrMax
*
* Arguments  : pdata     this pointer is not used at this time.
*
* Returns    : none
*
* Notes      : 1) This task runs at a priority level higher than the idle task.  In fact, it runs at the
*                 next higher priority, OS_IDLE_PRIO-1.
*              2) You can disable this task by setting the configuration #define OS_TASK_STAT_EN to 0.
*              3) We delay for 5 seconds in the beginning to allow the system to reach steady state and
*                 have all other tasks created before we do statistics.  You MUST have at least a delay
*                 of 2 seconds to allow for the system to establish the maximum value for the idle
*                 counter.
*********************************************************************************************************
*/

#if OS_TASK_STAT_EN > 0
void  OS_TaskStat (void *pdata)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT32U     run;
    INT32U     max;
    INT8S      usage;


    pdata = pdata;                               /* Prevent compiler warning for not using 'pdata'     */
    while (OSStatRdy == FALSE) {
        OSTimeDly(2 * OS_TICKS_PER_SEC);         /* Wait until statistic task is ready                 */
    }
    max = OSIdleCtrMax / 100L;
    for (;;) {
        OS_ENTER_CRITICAL();
        OSIdleCtrRun = OSIdleCtr;                /* Obtain the of the idle counter for the past second */
        run          = OSIdleCtr;
        OSIdleCtr    = 0L;                       /* Reset the idle counter for the next second         */
        OS_EXIT_CRITICAL();
        if (max > 0L) {
            usage = (INT8S)(100L - run / max);
            if (usage >= 0) {                    /* Make sure we don't have a negative percentage      */
                OSCPUUsage = usage;
            } else {
                OSCPUUsage = 0;
            }
        } else {
            OSCPUUsage = 0;
            max        = OSIdleCtrMax / 100L;
        }
        OSTaskStatHook();                        /* Invoke user definable hook                         */
#if OS_TASK_STAT_STK_CHK_EN > 0
        OS_TaskStatStkChk();                     /* Check the stacks for each task                     */
#endif
        OSTimeDly(OS_TICKS_PER_SEC);             /* Accumulate OSIdleCtr for the next second           */
    }
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                      CHECK ALL TASK STACKS
*
* Description: This function is called by OS_TaskStat() to check the stacks of each active task.
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

#if OS_TASK_STAT_STK_CHK_EN > 0
void  OS_TaskStatStkChk (void)
{
    OS_TCB      *ptcb;
    OS_STK_DATA  stk_data;
    INT8U        err;
    INT8U        prio;
    INT32U       stk_size;


    for (prio = 0; prio <= OS_IDLE_PRIO; prio++) {
        err = OSTaskStkChk(prio, &stk_data);
        if (err == OS_NO_ERR) {
            ptcb               = OSTCBPrioTbl[prio];
#if OS_TASK_CREATE_EXT_EN > 0
            stk_size           = ptcb->OSTCBStkSize * sizeof(OS_STK);
#endif

#if OS_TASK_PROFILE_EN > 0
            #if OS_STK_GROWTH == 1
            ptcb->OSTCBStkBase = ptcb->OSTCBStkBottom + stk_size;
            #else
            ptcb->OSTCBStkBase = ptcb->OSTCBStkBottom - stk_size;
            #endif
            ptcb->OSTCBStkUsed = (INT32U)stk_data.OSUsed;            /* Store the number of bytes used */
#endif
        }
    }
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                            INITIALIZE TCB
*
* Description: This function is internal to uC/OS-II and is used to initialize a Task Control Block when
*              a task is created (see OSTaskCreate() and OSTaskCreateExt()).
*
* Arguments  : prio          is the priority of the task being created
*
*              ptos          is a pointer to the task's top-of-stack assuming that the CPU registers
*                            have been placed on the stack.  Note that the top-of-stack corresponds to a
*                            'high' memory location is OS_STK_GROWTH is set to 1 and a 'low' memory
*                            location if OS_STK_GROWTH is set to 0.  Note that stack growth is CPU
*                            specific.
*
*              pbos          is a pointer to the bottom of stack.  A NULL pointer is passed if called by
*                            'OSTaskCreate()'.
*
*              id            is the task's ID (0..65535)
*
*              stk_size      is the size of the stack (in 'stack units').  If the stack units are INT8Us
*                            then, 'stk_size' contains the number of bytes for the stack.  If the stack
*                            units are INT32Us then, the stack contains '4 * stk_size' bytes.  The stack
*                            units are established by the #define constant OS_STK which is CPU
*                            specific.  'stk_size' is 0 if called by 'OSTaskCreate()'.
*
*              pext          is a pointer to a user supplied memory area that is used to extend the task
*                            control block.  This allows you to store the contents of floating-point
*                            registers, MMU registers or anything else you could find useful during a
*                            context switch.  You can even assign a name to each task and store this name
*                            in this TCB extension.  A NULL pointer is passed if called by OSTaskCreate().
*
*              opt           options as passed to 'OSTaskCreateExt()' or,
*                            0 if called from 'OSTaskCreate()'.
*
* Returns    : OS_NO_ERR         if the call was successful
*              OS_NO_MORE_TCB    if there are no more free TCBs to be allocated and thus, the task cannot
*                                be created.
*
* Note       : This function is INTERNAL to uC/OS-II and your application should not call it.
*********************************************************************************************************
*/

INT8U  OS_TCBInit (INT8U prio, OS_STK *ptos, OS_STK *pbos, INT16U id, INT32U stk_size, void *pext, INT16U opt)
{
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr;
#endif    
    OS_TCB    *ptcb;


    OS_ENTER_CRITICAL();
    ptcb = OSTCBFreeList;                                  /* Get a free TCB from the free TCB list    */
    if (ptcb != (OS_TCB *)0) {
        OSTCBFreeList        = ptcb->OSTCBNext;            /* Update pointer to free TCB list          */
        OS_EXIT_CRITICAL();
        ptcb->OSTCBStkPtr    = ptos;                       /* Load Stack pointer in TCB                */
        ptcb->OSTCBPrio      = (INT8U)prio;                /* Load task priority into TCB              */
        ptcb->OSTCBStat      = OS_STAT_RDY;                /* Task is ready to run                     */
        ptcb->OSTCBDly       = 0;                          /* Task is not delayed                      */

#if OS_TASK_CREATE_EXT_EN > 0
        ptcb->OSTCBExtPtr    = pext;                       /* Store pointer to TCB extension           */
        ptcb->OSTCBStkSize   = stk_size;                   /* Store stack size                         */
        ptcb->OSTCBStkBottom = pbos;                       /* Store pointer to bottom of stack         */
        ptcb->OSTCBOpt       = opt;                        /* Store task options                       */
        ptcb->OSTCBId        = id;                         /* Store task ID                            */
#else
        pext                 = pext;                       /* Prevent compiler warning if not used     */
        stk_size             = stk_size;
        pbos                 = pbos;
        opt                  = opt;
        id                   = id;
#endif

#if OS_TASK_DEL_EN > 0
        ptcb->OSTCBDelReq    = OS_NO_ERR;
#endif

        ptcb->OSTCBY         = prio >> 3;                  /* Pre-compute X, Y, BitX and BitY          */
        ptcb->OSTCBBitY      = OSMapTbl[ptcb->OSTCBY];
        ptcb->OSTCBX         = prio & 0x07;
        

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩性生活| 日韩免费观看高清完整版在线观看| 欧美日韩二区三区| 亚洲欧美激情一区二区| 高清成人在线观看| 久久日韩粉嫩一区二区三区| 精品亚洲porn| 欧美一级欧美一级在线播放| 视频一区二区欧美| 欧美日韩国产高清一区| 国产福利一区在线观看| 琪琪久久久久日韩精品| 欧美精品欧美精品系列| 美女视频黄频大全不卡视频在线播放| 欧美一卡二卡三卡四卡| 色久综合一二码| 亚洲福利视频导航| 欧美日韩国产影片| 9色porny自拍视频一区二区| 中文字幕在线一区免费| 色综合久久88色综合天天| 亚洲国产美国国产综合一区二区| 日本一区二区三区在线观看| 一本久久a久久免费精品不卡| 国产毛片一区二区| 亚洲视频网在线直播| 欧美乱妇15p| 色狠狠综合天天综合综合| 成人午夜大片免费观看| 亚洲mv在线观看| 久久久精品黄色| 日韩欧美你懂的| 91精品在线一区二区| 成人在线视频一区| 国产精品一区二区在线看| 亚洲夂夂婷婷色拍ww47 | 久草热8精品视频在线观看| 亚洲二区视频在线| 亚洲第四色夜色| 亚洲永久精品国产| 亚洲一区二区三区爽爽爽爽爽| 综合久久国产九一剧情麻豆| 一区在线播放视频| 欧美福利一区二区| 欧美丰满美乳xxx高潮www| 欧美裸体一区二区三区| 欧美老女人在线| 6080日韩午夜伦伦午夜伦| 亚洲男女一区二区三区| 18成人在线视频| 一区二区三区电影在线播| 久久久亚洲高清| 国产网站一区二区| 欧美一区二区久久久| 日韩视频不卡中文| 欧美日韩成人综合| 日韩一区二区三| 欧美精品一区二区三区视频| 欧美三级韩国三级日本三斤| 欧美精品1区2区| 日韩精品自拍偷拍| 国产欧美日韩不卡| 一区二区在线免费| 国产精品久久久爽爽爽麻豆色哟哟 | 国产精品99久久久久久有的能看| 高清beeg欧美| 日本久久精品电影| 日韩一二在线观看| 欧美国产成人精品| 久久精品一级爱片| 亚洲乱码中文字幕综合| 婷婷成人综合网| 性欧美大战久久久久久久久| 美女爽到高潮91| www.欧美.com| 这里只有精品电影| 国产精品亲子伦对白| 久久久久久久综合日本| 亚洲四区在线观看| 男人的天堂亚洲一区| 成人国产一区二区三区精品| 国产电影一区二区三区| 色婷婷久久久久swag精品| 亚洲国产欧美日韩另类综合| 免费高清在线一区| thepron国产精品| 91精品国产综合久久香蕉的特点 | 亚洲国产精品久久久男人的天堂| 欧美96一区二区免费视频| 成人精品一区二区三区中文字幕| 欧美曰成人黄网| 懂色av中文字幕一区二区三区| 欧美午夜精品久久久久久孕妇 | 一区二区三区四区视频精品免费| 日韩中文字幕1| av亚洲精华国产精华精华| 制服丝袜亚洲网站| 国产精品色婷婷| 久久精品国产久精国产爱| 日本va欧美va欧美va精品| 成人黄色一级视频| 日韩免费高清视频| 一区二区三区在线免费播放| 国产一区999| 欧美猛男超大videosgay| 国产精品乱码一区二三区小蝌蚪| 蜜臀精品一区二区三区在线观看 | 欧美日韩国产一级片| 久久久久国产精品人| 午夜精品在线看| 99综合电影在线视频| 日韩欧美国产麻豆| 亚洲国产综合色| 不卡的看片网站| 亚洲精品一区二区三区四区高清| 亚洲午夜免费视频| www.亚洲激情.com| 久久久久久亚洲综合影院红桃| 日韩av在线发布| 国产麻豆精品theporn| 91精品免费观看| 有坂深雪av一区二区精品| 波多野结衣亚洲| 国产欧美视频一区二区| 日韩 欧美一区二区三区| 欧美日韩中文字幕一区| 一区二区三区在线观看视频| caoporn国产精品| 日本一区二区三区四区在线视频 | 久久99精品国产.久久久久 | 色综合久久中文字幕| 中文子幕无线码一区tr| 国产91丝袜在线播放九色| 欧美精品一区二区三区高清aⅴ| 日韩成人免费在线| 欧美一级一区二区| 麻豆视频观看网址久久| 日韩一区二区三区高清免费看看 | 日本视频中文字幕一区二区三区| 欧美亚洲尤物久久| 亚洲成人黄色小说| 欧美日韩卡一卡二| 日日骚欧美日韩| 欧美丰满少妇xxxxx高潮对白| 午夜一区二区三区在线观看| 欧美日韩精品一区二区| 香港成人在线视频| 3d动漫精品啪啪一区二区竹菊| 日韩av电影天堂| 日韩三级在线观看| 久99久精品视频免费观看| 欧美成人video| 亚洲已满18点击进入久久| 一本一道综合狠狠老| 亚洲一区二区成人在线观看| 欧美日韩综合在线| 另类人妖一区二区av| 久久精品视频免费| 99久久久国产精品免费蜜臀| 7777精品伊人久久久大香线蕉完整版 | 久久精品视频网| 97久久超碰国产精品| 一区二区久久久久| 日韩欧美一级二级三级| 激情久久五月天| 欧美电影免费观看高清完整版在| 黄页视频在线91| 亚洲欧洲www| 欧美久久一二区| 国产资源精品在线观看| 国产人久久人人人人爽| 色诱亚洲精品久久久久久| 视频一区二区三区在线| 国产调教视频一区| 日本道在线观看一区二区| 首页国产丝袜综合| 国产视频一区二区三区在线观看| 91麻豆.com| 亚洲欧美一区二区不卡| 欧美绝品在线观看成人午夜影视| 国产一区二区三区久久久| 亚洲人一二三区| 欧美成人精品1314www| 91欧美一区二区| 久久精品国产亚洲一区二区三区| 中文字幕一区二区三区在线不卡| 欧美日本韩国一区| 国产a久久麻豆| 视频一区二区欧美| 中日韩免费视频中文字幕| 欧美日韩国产一级片| 国产99久久久精品| 视频精品一区二区| 亚洲欧美在线观看| 精品久久五月天| 日本国产一区二区| 成人在线视频一区| 另类小说图片综合网| 亚洲在线观看免费视频| 久久97超碰色|