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

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

?? os_task.c

?? ucos2.52多處理器平臺移植源代碼
?? 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一区二区三区免费野_久草精品视频
在线免费视频一区二区| 色综合久久久久久久久| 精品国产凹凸成av人网站| 日韩精品三区四区| 精品国产伦一区二区三区观看方式| www.欧美.com| 午夜欧美视频在线观看| 日韩亚洲电影在线| 99久久免费视频.com| 图片区日韩欧美亚洲| 亚洲一区二区三区四区中文字幕| 久久久综合视频| 欧美日韩成人激情| av爱爱亚洲一区| 岛国一区二区三区| 久久疯狂做爰流白浆xx| 亚洲午夜在线观看视频在线| 久久这里只有精品首页| 69p69国产精品| 波多野结衣中文字幕一区二区三区| 五月婷婷综合激情| 免费成人在线播放| 亚洲综合精品久久| 免费久久99精品国产| 久久国产福利国产秒拍| 成人一区在线看| 色噜噜夜夜夜综合网| 国产麻豆成人精品| 久久 天天综合| 免费一区二区视频| 成人av在线播放网址| 欧美视频中文一区二区三区在线观看 | 经典三级一区二区| 成人免费观看视频| 日韩欧美中文字幕制服| 国产精品视频yy9299一区| 欧美一区二区观看视频| 欧美四级电影在线观看| 欧美大片一区二区| 日韩欧美激情四射| 自拍偷拍亚洲欧美日韩| 中文字幕中文字幕在线一区| 国产午夜精品一区二区三区嫩草| 精品国产一二三| 亚洲欧洲综合另类| 亚洲一区在线播放| 福利一区福利二区| 国产精品一区二区三区乱码| 强制捆绑调教一区二区| 成人国产电影网| 日韩午夜电影av| 亚洲一本大道在线| 99久久国产综合精品麻豆| 欧美一级二级在线观看| 一区二区三区中文在线| 婷婷六月综合亚洲| 色综合视频一区二区三区高清| 日韩一区二区三区四区| 亚洲综合在线电影| 不卡av电影在线播放| 久久精品日产第一区二区三区高清版 | 欧美制服丝袜第一页| 久久这里只有精品首页| 日本大胆欧美人术艺术动态| 午夜亚洲国产au精品一区二区| 成人一区在线观看| 久久九九久精品国产免费直播| 丝袜诱惑亚洲看片| 色一情一伦一子一伦一区| 国产精品久久久99| 成人激情动漫在线观看| 国产欧美一区二区精品性色超碰| 亚洲欧洲成人精品av97| 亚洲一区二区三区在线看| 色综合天天综合在线视频| 欧美蜜桃一区二区三区 | 在线免费av一区| 日韩一区中文字幕| 91在线观看成人| 欧美美女直播网站| 亚洲精品在线三区| 久久aⅴ国产欧美74aaa| 精品久久久久久久一区二区蜜臀| 中文字幕五月欧美| 91麻豆123| 亚洲综合色在线| 69p69国产精品| 国产一区二区中文字幕| 欧美国产欧美综合| 日韩不卡一二三区| 精品免费视频一区二区| 国产精品一品二品| 国产精品免费av| 色猫猫国产区一区二在线视频| 亚洲国产另类av| 欧美一区二区福利视频| 狠狠色综合日日| 制服丝袜亚洲色图| 久久国产精品99久久久久久老狼| 国产三级久久久| 99久久伊人精品| 午夜精品福利一区二区三区av| 欧美群妇大交群中文字幕| 久久福利资源站| 亚洲视频每日更新| 91精品啪在线观看国产60岁| 国产一区二区91| 亚洲欧洲国产日韩| 日韩欧美国产1| 日本高清无吗v一区| 看电视剧不卡顿的网站| 欧美激情中文字幕| 一本大道久久a久久综合| 秋霞午夜av一区二区三区| 国产日韩精品一区二区浪潮av| 色婷婷综合久久久中文字幕| 久久丁香综合五月国产三级网站| 成人免费在线观看入口| 日韩欧美精品在线| 在线看日本不卡| 国产精选一区二区三区| 亚洲一区在线免费观看| 国产精品国产三级国产普通话三级| 欧美男人的天堂一二区| 91小视频免费观看| 国产精品18久久久久久久久 | 久久亚洲影视婷婷| 欧美三级乱人伦电影| 亚洲国产另类av| 国产精品乱码妇女bbbb| 欧美大片免费久久精品三p | 日本三级韩国三级欧美三级| 国产精品传媒在线| 26uuu亚洲| 欧美一区二区在线免费观看| 欧洲一区二区av| 91在线播放网址| 91女厕偷拍女厕偷拍高清| 丰满亚洲少妇av| 国产精品中文字幕一区二区三区| 亚洲h在线观看| 久久综合色婷婷| 91麻豆精品国产91久久久久久久久| 91免费在线播放| 成人激情图片网| 国产精品亚洲综合一区在线观看| 五月激情综合婷婷| 日韩精品一二三四| 日韩电影在线看| 肉丝袜脚交视频一区二区| 亚洲一卡二卡三卡四卡| 一区二区三区四区激情| 亚洲激情图片小说视频| 精品噜噜噜噜久久久久久久久试看| 欧美日韩高清不卡| 欧美人与性动xxxx| 欧美一区二区三区在线看| 欧美欧美欧美欧美| 日韩一区二区三区免费看| 在线成人av影院| 7777精品伊人久久久大香线蕉完整版 | 久久久电影一区二区三区| 精品福利av导航| 久久久777精品电影网影网| 久久精品视频免费观看| 国产精品国产三级国产普通话99| 中文字幕综合网| 亚洲福利一区二区三区| 日韩av一区二区三区四区| 日本色综合中文字幕| 国产精品综合在线视频| 波多野结衣视频一区| 色8久久精品久久久久久蜜| 日本韩国一区二区| 7777精品伊人久久久大香线蕉| 欧美xingq一区二区| 国产欧美精品一区| 亚洲另类色综合网站| 日韩不卡一区二区三区| 国产精品66部| 欧洲av一区二区嗯嗯嗯啊| 欧美日韩国产首页| 久久久亚洲午夜电影| 亚洲人成网站影音先锋播放| 亚洲一区二区三区激情| 极品少妇xxxx偷拍精品少妇| 成人网男人的天堂| 欧美老女人在线| 国产亚洲欧美中文| 亚洲韩国一区二区三区| 久久精品99久久久| 91免费观看视频| 日韩欧美专区在线| 一区二区免费在线| 精品一区二区三区在线观看| 91性感美女视频| 精品乱码亚洲一区二区不卡| 一个色在线综合| 国产精品原创巨作av| 欧美日韩国产首页在线观看|