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

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

?? os_task.c

?? ucos-II在S3C44BO下的移植
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                            TASK MANAGEMENT
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                           All Rights Reserved
*
*                                                  V2.00
*
* File : OS_TASK.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "includes.h"
#endif

/*
*********************************************************************************************************
*                                        LOCAL FUNCTION PROTOTYPES
*********************************************************************************************************
*/


static  void  OSDummy(void);

/*
*********************************************************************************************************
*                                            DUMMY FUNCTION
*
* Description: This function doesn't do anything.  It is called by OSTaskDel() to ensure that interrupts
*              are disabled immediately after they are enabled.
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

static void  OSDummy (void)
{
}

/*$PAGE*/
/*
*********************************************************************************************************
*                                        CHANGE PRIORITY OF A TASK
*
* Description: This function allows you to change the priority of a task dynamically.  Note that the new
*              priority MUST be available.
*
* Arguments  : oldp     is the old priority
*
*              newp     is the new priority
*
* Returns    : OS_NO_ERR        is the call was successful
*              OS_PRIO_INVALID  if the priority you specify is higher that the maximum allowed 
*                               (i.e. >= OS_LOWEST_PRIO)
*              OS_PRIO_EXIST    if the new priority already exist.
*              OS_PRIO_ERR      there is no task with the specified OLD priority (i.e. the OLD task does
*                               not exist.
*********************************************************************************************************
*/

#if OS_TASK_CHANGE_PRIO_EN
INT8U OSTaskChangePrio (INT8U oldprio, INT8U newprio)
{
    OS_TCB   *ptcb;
    OS_EVENT *pevent;
    INT8U     x;
    INT8U     y;
    INT8U     bitx;
    INT8U     bity;


    if ((oldprio >= OS_LOWEST_PRIO && oldprio != OS_PRIO_SELF)  || 
         newprio >= OS_LOWEST_PRIO) {
        return (OS_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    if (OSTCBPrioTbl[newprio] != (OS_TCB *)0) {                 /* New priority must not already exist */
        OS_EXIT_CRITICAL();
        return (OS_PRIO_EXIST);
    } else {
        OSTCBPrioTbl[newprio] = (OS_TCB *)1;                    /* Reserve the entry to prevent others */
        OS_EXIT_CRITICAL();
        y    = newprio >> 3;                                    /* Precompute to reduce INT. latency   */
        bity = OSMapTbl[y];
        x    = newprio & 0x07;
        bitx = OSMapTbl[x];
        OS_ENTER_CRITICAL();
        if (oldprio == OS_PRIO_SELF) {                          /* See if changing self                */
            oldprio = OSTCBCur->OSTCBPrio;                      /* Yes, get priority                   */
        }
        if ((ptcb = OSTCBPrioTbl[oldprio]) != (OS_TCB *)0) {    /* Task to change must exist           */
            OSTCBPrioTbl[oldprio] = (OS_TCB *)0;                /* Remove TCB from old priority        */
            if (OSRdyTbl[ptcb->OSTCBY] & ptcb->OSTCBBitX) {     /* If task is ready make it not ready  */
                if ((OSRdyTbl[ptcb->OSTCBY] &= ~ptcb->OSTCBBitX) == 0) {
                    OSRdyGrp &= ~ptcb->OSTCBBitY;
                }
                OSRdyGrp    |= bity;                            /* Make new priority ready to run      */
                OSRdyTbl[y] |= bitx;
            } else {
                if ((pevent = ptcb->OSTCBEventPtr) != (OS_EVENT *)0) { /* Remove from event wait list  */
                    if ((pevent->OSEventTbl[ptcb->OSTCBY] &= ~ptcb->OSTCBBitX) == 0) {
                        pevent->OSEventGrp &= ~ptcb->OSTCBBitY;
                    }
                    pevent->OSEventGrp    |= bity;              /* Add new priority to wait list       */
                    pevent->OSEventTbl[y] |= bitx;
                }
            }
            OSTCBPrioTbl[newprio] = ptcb;                       /* Place pointer to TCB @ new priority */
            ptcb->OSTCBPrio       = newprio;                    /* Set new task priority               */
            ptcb->OSTCBY          = y;
            ptcb->OSTCBX          = x;
            ptcb->OSTCBBitY       = bity;
            ptcb->OSTCBBitX       = bitx;
            OS_EXIT_CRITICAL();
            OSSched();                                          /* Run highest priority task ready     */
            return (OS_NO_ERR);
        } else {
            OSTCBPrioTbl[newprio] = (OS_TCB *)0;                /* Release the reserved prio.          */
            OS_EXIT_CRITICAL();
            return (OS_PRIO_ERR);                               /* Task to change didn't exist         */
        }
    }
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                            CREATE A TASK
*
* Description: This function is used to have uC/OS-II manage the execution of a task.  Tasks can either
*              be created prior to the start of multitasking or by a running task.  A task cannot be
*              created by an ISR.
*
* Arguments  : task     is a pointer to the task's code
*
*              pdata    is a pointer to an optional data area which can be used to pass parameters to
*                       the task when the task first executes.  Where the task is concerned it thinks
*                       it was invoked and passed the argument 'pdata' as follows:
*
*                           void Task (void *pdata)
*                           {
*                               for (;;) {
*                                   Task code;
*                               }
*                           }
*
*              ptos     is a pointer to the task's top of stack.  If the configuration constant 
*                       OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. from high
*                       memory to low memory).  'pstk' will thus point to the highest (valid) memory 
*                       location of the stack.  If OS_STK_GROWTH is set to 0, 'pstk' will point to the 
*                       lowest memory location of the stack and the stack will grow with increasing
*                       memory locations.
*
*              prio     is the task's priority.  A unique priority MUST be assigned to each task and the
*                       lower the number, the higher the priority.
*
* Returns    : OS_NO_ERR        if the function was successful.
*              OS_PRIO_EXIT     if the task priority already exist 
*                               (each task MUST have a unique priority).
*              OS_PRIO_INVALID  if the priority you specify is higher that the maximum allowed 
*                               (i.e. >= OS_LOWEST_PRIO)
*********************************************************************************************************
*/

#if OS_TASK_CREATE_EN
INT8U OSTaskCreate (void (*task)(void *pd), void *pdata, OS_STK *ptos, INT8U prio)
{
    void   *psp;
    INT8U   err;


    if (prio > OS_LOWEST_PRIO) {             /* Make sure priority is within allowable range           */
        return (OS_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    if (OSTCBPrioTbl[prio] == (OS_TCB *)0) { /* Make sure task doesn't already exist at this priority  */
        OSTCBPrioTbl[prio] = (OS_TCB *)1;    /* Reserve the priority to prevent others from doing ...  */
                                             /* ... the same thing until task is created.              */
        OS_EXIT_CRITICAL();
        psp = (void *)OSTaskStkInit(task, pdata, ptos, 0); /* Initialize the task's stack              */
        err = OSTCBInit(prio, psp, (void *)0, 0, 0, (void *)0, 0);         
        if (err == OS_NO_ERR) {
            OS_ENTER_CRITICAL();
            OSTaskCtr++;                                   /* Increment the #tasks counter             */
            OSTaskCreateHook(OSTCBPrioTbl[prio]);          /* Call user defined hook                   */
            OS_EXIT_CRITICAL();
            if (OSRunning) {                 /* Find highest priority task if multitasking has started */
                OSSched();
            }
        } else {
            OS_ENTER_CRITICAL();
            OSTCBPrioTbl[prio] = (OS_TCB *)0;/* Make this priority available to others                 */
            OS_EXIT_CRITICAL();
        }
        return (err);
    } else {
        OS_EXIT_CRITICAL();
        return (OS_PRIO_EXIST);
    }
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                     CREATE A TASK (Extended Version)
*
* Description: This function is used to have uC/OS-II manage the execution of a task.  Tasks can either
*              be created prior to the start of multitasking or by a running task.  A task cannot be
*              created by an ISR.  This function is similar to OSTaskCreate() except that it allows
*              additional information about a task to be specified.
*
* Arguments  : task     is a pointer to the task's code
*
*              pdata    is a pointer to an optional data area which can be used to pass parameters to
*                       the task when the task first executes.  Where the task is concerned it thinks
*                       it was invoked and passed the argument 'pdata' as follows:
*
*                           void Task (void *pdata)
*                           {
*                               for (;;) {
*                                   Task code;
*                               }
*                           }
*
*              ptos     is a pointer to the task's top of stack.  If the configuration constant 
*                       OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. from high
*                       memory to low memory).  'pstk' will thus point to the highest (valid) memory 
*                       location of the stack.  If OS_STK_GROWTH is set to 0, 'pstk' will point to the 
*                       lowest memory location of the stack and the stack will grow with increasing
*                       memory locations.  'pstk' MUST point to a valid 'free' data item.
*
*              prio     is the task's priority.  A unique priority MUST be assigned to each task and the
*                       lower the number, the higher the priority.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区系列电影| 欧美三级视频在线| 亚洲夂夂婷婷色拍ww47| 337p粉嫩大胆噜噜噜噜噜91av| 91在线你懂得| 国产精品一区二区在线观看不卡| 伊人色综合久久天天人手人婷| 久久久久99精品国产片| 777精品伊人久久久久大香线蕉| aaa亚洲精品一二三区| 蜜桃一区二区三区在线观看| 一区二区三区在线视频观看58| 久久久五月婷婷| 91精品国模一区二区三区| 99re免费视频精品全部| 国产一区二区三区在线观看免费| 婷婷成人激情在线网| 综合网在线视频| 中文字幕第一页久久| 精品欧美乱码久久久久久1区2区| 色噜噜久久综合| www.亚洲色图.com| 国产成人综合自拍| 激情图区综合网| 免费观看久久久4p| 日韩av一区二区在线影视| 亚洲免费观看视频| 亚洲人成网站色在线观看| 国产精品美女一区二区在线观看| 精品少妇一区二区三区免费观看 | 精品久久久久久久久久久久包黑料| 在线影院国内精品| 日本韩国欧美一区| 日本久久电影网| 91天堂素人约啪| 色久优优欧美色久优优| 一本大道久久a久久精品综合| 成人av网站免费观看| 国产精品66部| 国产**成人网毛片九色 | 亚洲成人免费观看| 亚洲视频精选在线| 国产精品久久久久久久久果冻传媒| 2021久久国产精品不只是精品| 日韩视频免费直播| 欧美岛国在线观看| 精品国产一区二区三区不卡 | 国产一区二区伦理片| 国内成人免费视频| 国产精品综合二区| 国产69精品久久777的优势| 成人av在线资源网| 色8久久精品久久久久久蜜| 在线免费观看视频一区| 欧美日韩在线播| 91精品国产色综合久久不卡电影| 91精品国产欧美日韩| 日韩欧美成人一区| 久久久久久久综合| 亚洲欧洲中文日韩久久av乱码| 一区二区欧美精品| 日韩av成人高清| 国产真实乱偷精品视频免| 成人高清免费在线播放| 日本高清视频一区二区| 欧美日韩一区二区电影| 欧美一区二区精品在线| 久久午夜老司机| 亚洲男人的天堂在线aⅴ视频| 亚洲一二三区在线观看| 裸体健美xxxx欧美裸体表演| 国产精品一品二品| 91美女在线观看| 5566中文字幕一区二区电影| 久久精品夜色噜噜亚洲aⅴ| 国产精品高清亚洲| 日韩精品电影在线观看| 国产美女在线精品| 欧美日精品一区视频| 久久奇米777| 亚洲尤物在线视频观看| 国产美女视频91| 91久久国产最好的精华液| 欧美二区乱c少妇| 国产人妖乱国产精品人妖| 亚洲一区二区三区在线| 国产一区二区久久| 欧美网站一区二区| 久久精品日韩一区二区三区| 亚洲午夜免费福利视频| 国产精品一区一区三区| 久久亚洲精精品中文字幕早川悠里| 国产精品第13页| 久久99精品国产.久久久久久| 91免费在线视频观看| 日韩美女在线视频| 亚洲韩国一区二区三区| 国产精品一区二区久久精品爱涩| 欧美综合天天夜夜久久| 欧美激情一区二区三区在线| 五月婷婷色综合| 色综合天天性综合| 久久久国产综合精品女国产盗摄| 香蕉加勒比综合久久| av男人天堂一区| 久久欧美中文字幕| 欧美aaaaaa午夜精品| 色婷婷久久久久swag精品| 久久精品夜色噜噜亚洲aⅴ| 日韩二区三区四区| 91极品美女在线| 日本一二三四高清不卡| 久久99精品国产| 欧美一区二区三区爱爱| 亚洲曰韩产成在线| 在线观看亚洲a| 亚洲婷婷综合久久一本伊一区 | 久久电影国产免费久久电影| 在线观看91精品国产入口| 一区免费观看视频| 国产成人亚洲综合a∨猫咪| 精品91自产拍在线观看一区| 日本特黄久久久高潮| 欧美日韩国产综合视频在线观看| 成人免费视频在线观看| 不卡高清视频专区| 国产精品私房写真福利视频| 国产精品一区二区在线看| 精品91自产拍在线观看一区| 久草这里只有精品视频| 欧美成人三级在线| 免费观看91视频大全| 日韩欧美激情一区| 青青青爽久久午夜综合久久午夜| 69成人精品免费视频| 天天免费综合色| 欧美精品日韩一本| 免费欧美高清视频| 欧美成人精品1314www| 另类成人小视频在线| 精品国产百合女同互慰| 国产一区二区三区电影在线观看| 久久久久亚洲综合| 本田岬高潮一区二区三区| 国产精品沙发午睡系列990531| 国产激情一区二区三区四区| 国产亚洲污的网站| 99久久精品99国产精品| 一级做a爱片久久| 欧美高清视频不卡网| 蜜臀91精品一区二区三区| wwwwww.欧美系列| k8久久久一区二区三区| 亚洲精品国产第一综合99久久 | 久久久久久免费| 懂色av中文一区二区三区| 亚洲欧洲国产日本综合| 在线视频国产一区| 免费高清不卡av| 久久精子c满五个校花| 91蜜桃免费观看视频| 午夜久久久久久久久| 2020国产精品自拍| 91浏览器在线视频| 日本不卡一二三| 久久久99精品久久| 在线观看国产一区二区| 久久精品免费观看| 中文字幕一区二区不卡| 欧美日韩国产免费| 国产成人久久精品77777最新版本| 国产精品乱子久久久久| 欧美色图天堂网| 国产精品夜夜爽| 亚洲一线二线三线视频| 精品福利av导航| 91久久精品一区二区二区| 蜜桃久久久久久久| 亚洲欧美日韩国产成人精品影院 | 亚洲欧美日韩在线播放| 日本一区二区三区在线不卡| 91黄色在线观看| 国产精品主播直播| 午夜成人免费电影| 国产精品乱码妇女bbbb| 欧美日本韩国一区二区三区视频| 国产一区二区三区免费在线观看| 亚洲欧美区自拍先锋| 精品久久五月天| 欧美色精品天天在线观看视频| 国产精选一区二区三区| 午夜av一区二区| 自拍av一区二区三区| www欧美成人18+| 欧美精品久久久久久久久老牛影院| 丁香网亚洲国际| 国内精品免费**视频| 天天影视色香欲综合网老头| 中文字幕一区二区在线播放| 日韩欧美的一区|