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

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

?? os_task.c

?? 移植到三星ARM S3c44b0 上的 ucosII源代碼
?? 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.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线视频国内自拍亚洲视频| 亚洲午夜免费电影| 久久66热re国产| 91国产视频在线观看| 国产精品传媒视频| 成人毛片视频在线观看| 久久理论电影网| 国产在线播精品第三| 欧美成人在线直播| 麻豆精品视频在线观看免费 | 亚洲人精品一区| av一本久道久久综合久久鬼色| 日韩欧美亚洲国产精品字幕久久久| 亚洲成精国产精品女| 不卡视频一二三四| 亚洲另类春色国产| 99视频精品免费视频| 亚洲精品一卡二卡| 欧美在线免费播放| 亚洲国产成人精品视频| 777欧美精品| 激情都市一区二区| 亚洲一区二区三区不卡国产欧美| 国产一区二区在线视频| 久久久亚洲国产美女国产盗摄| 国产又黄又大久久| 国产精品免费久久久久| 日本黄色一区二区| 日韩综合小视频| 日韩欧美不卡一区| 成人涩涩免费视频| 夜夜嗨av一区二区三区| 欧美日韩成人在线| 国产一区美女在线| 亚洲欧洲成人自拍| 51久久夜色精品国产麻豆| 九色porny丨国产精品| 国产精品久久三| 欧美色国产精品| 国产综合色产在线精品| 亚洲欧洲三级电影| 欧美综合一区二区| 国产在线视频一区二区三区| 国产精品久久久久久久第一福利 | 亚洲毛片av在线| 欧美麻豆精品久久久久久| 韩国成人在线视频| 国产午夜精品福利| 欧美日韩精品久久久| 国产一区二区美女| 曰韩精品一区二区| 久久精品在线免费观看| 91精品福利视频| 五月婷婷另类国产| 18欧美乱大交hd1984| 欧美成人性战久久| 欧美在线观看视频在线| 高清不卡在线观看av| 午夜精品久久久久久久99樱桃| 国产午夜精品美女毛片视频| 97aⅴ精品视频一二三区| 蜜桃视频在线一区| 亚洲欧美日韩国产成人精品影院 | 亚洲一区二区三区四区不卡| 精品久久久久久最新网址| 一本一道久久a久久精品综合蜜臀| 美女免费视频一区| 亚洲午夜免费视频| 亚洲欧洲另类国产综合| 久久男人中文字幕资源站| 欧美三级欧美一级| 99久久婷婷国产综合精品电影| 午夜精彩视频在线观看不卡| 中文字幕日本乱码精品影院| 精品福利一区二区三区| 欧美老女人在线| 99精品视频中文字幕| 国产呦精品一区二区三区网站| 午夜伊人狠狠久久| 一区二区三区国产精华| 国产精品成人一区二区三区夜夜夜| 日韩限制级电影在线观看| 欧美日韩综合一区| 色久综合一二码| 日韩欧美视频一区| 欧美日韩的一区二区| 日本乱码高清不卡字幕| 99久久婷婷国产综合精品| 激情综合一区二区三区| 毛片一区二区三区| 蜜臀91精品一区二区三区| 婷婷综合五月天| 久久国产精品无码网站| 国产精品18久久久久| 成人免费观看视频| 欧美亚洲禁片免费| 日韩一区二区三区电影在线观看| 欧美成人免费网站| 亚洲国产成人一区二区三区| 亚洲手机成人高清视频| 亚洲成人激情av| 精品一区二区三区在线视频| 国产不卡在线一区| 91国偷自产一区二区三区成为亚洲经典| 欧美性生活大片视频| 欧美电影免费观看高清完整版在线| 久久毛片高清国产| 一区二区三区四区在线播放 | 国产精品欧美一区喷水| 一区二区视频在线| 免费在线欧美视频| 成人av在线网站| 69久久99精品久久久久婷婷| 久久久精品国产免费观看同学| 亚洲人成人一区二区在线观看 | 日韩国产欧美在线播放| 国产一区福利在线| 在线观看一区不卡| 久久久久久97三级| 亚洲图片一区二区| 国产成人午夜电影网| 欧美日韩精品一区二区三区蜜桃 | va亚洲va日韩不卡在线观看| 欧美日韩一级片网站| 国产婷婷一区二区| 天天av天天翘天天综合网 | 成人免费观看av| 69堂亚洲精品首页| 自拍偷拍欧美精品| 国产制服丝袜一区| 欧美日韩高清一区二区不卡| 亚洲国产精品国自产拍av| 日韩二区三区四区| 在线观看亚洲精品| 日本一区二区久久| 紧缚奴在线一区二区三区| 欧美性大战久久久久久久蜜臀| 久久久精品影视| 免费在线视频一区| 欧美日韩中字一区| 亚洲人妖av一区二区| 国产激情一区二区三区四区 | 精品理论电影在线| 一区二区三区四区中文字幕| 成人一二三区视频| 久久久久久久久伊人| 久久国产精品99久久人人澡| 欧美日韩在线电影| 亚洲三级电影网站| www.av亚洲| 欧美国产成人精品| 国产成人av网站| 久久久国产精华| 精品系列免费在线观看| 日韩一区二区三免费高清| 手机精品视频在线观看| 欧美在线999| 亚洲综合在线电影| 色噜噜久久综合| 亚洲欧洲美洲综合色网| www.av亚洲| 亚洲日本成人在线观看| 99久久免费国产| 国产精品对白交换视频| 成人黄色软件下载| 国产精品青草久久| av在线不卡免费看| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 成人综合在线视频| 国产欧美日韩视频在线观看| 国产精品1024久久| 国产精品久久久久久久久久久免费看 | 欧美一区二区三区系列电影| 日韩国产精品久久| 日韩午夜在线观看视频| 久草在线在线精品观看| 日韩欧美专区在线| 激情综合色播激情啊| 久久精品视频一区二区| 国产高清亚洲一区| 国产精品欧美经典| 91丝袜美腿高跟国产极品老师| 一区二区三区四区高清精品免费观看| 91美女在线看| 性做久久久久久免费观看欧美| 在线不卡中文字幕播放| 久久成人免费网| 国产亚洲欧美日韩在线一区| 99精品视频在线观看免费| 亚洲一区二区三区四区在线观看| 欧美日韩久久久一区| 美国欧美日韩国产在线播放| 国产嫩草影院久久久久| 日本韩国欧美在线| 免费欧美日韩国产三级电影| 国产日产欧美一区二区三区| 色婷婷综合久久久久中文一区二区 | 日本一区二区高清| 精品视频一区二区不卡| 精品午夜一区二区三区在线观看|