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

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

?? os_task.c

?? ucos操作系統在s3c44b0上的移植
?? 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一区二区三区免费野_久草精品视频
亚洲一二三专区| 欧美午夜寂寞影院| 久久综合狠狠综合久久综合88 | 亚洲日本在线a| 成人av在线看| 亚洲女女做受ⅹxx高潮| 欧美做爰猛烈大尺度电影无法无天| 一区二区免费视频| 51精品视频一区二区三区| 久久av中文字幕片| 欧美激情一区二区| 精品视频在线免费| 韩国精品在线观看| 国产精品久久久久久福利一牛影视 | 91麻豆精品国产91久久久久| 麻豆成人免费电影| 日本一区二区视频在线| 在线一区二区视频| 久久国产日韩欧美精品| 亚洲欧洲性图库| 欧美高清视频一二三区| 国产精品99久久久久久似苏梦涵 | 国产精品黄色在线观看| 欧美体内she精视频| 人禽交欧美网站| 国产精品二区一区二区aⅴ污介绍| 欧美日韩在线三级| 久久9热精品视频| 亚洲欧美电影一区二区| 欧美r级电影在线观看| 99久久精品免费看国产免费软件| 视频一区欧美日韩| 最好看的中文字幕久久| 日韩欧美久久久| 在线观看亚洲一区| 国产成人日日夜夜| 日韩成人午夜精品| 成人欧美一区二区三区黑人麻豆| 4438x亚洲最大成人网| 91农村精品一区二区在线| 看国产成人h片视频| 狠狠狠色丁香婷婷综合久久五月| 51精品国自产在线| aaa国产一区| 日本aⅴ免费视频一区二区三区| 国产精品国产三级国产普通话99| 日韩三级中文字幕| 欧美性猛交一区二区三区精品| 国产不卡免费视频| 蜜桃一区二区三区在线观看| 亚洲色欲色欲www| 欧美国产乱子伦 | 欧美二区乱c少妇| www.日韩精品| 国产成人欧美日韩在线电影| 日本v片在线高清不卡在线观看| 综合精品久久久| 国产精品美女久久久久久| 久久天天做天天爱综合色| 欧美人与性动xxxx| 在线看国产一区| 99久久精品费精品国产一区二区| 国产成人精品在线看| 久久99精品久久久久久动态图 | 裸体健美xxxx欧美裸体表演| 亚洲国产一区二区在线播放| 一区二区三区四区亚洲| 成人欧美一区二区三区白人 | 在线观看视频一区二区欧美日韩| www.99精品| 91在线porny国产在线看| 成人av在线播放网址| 国产不卡视频在线播放| 粉嫩欧美一区二区三区高清影视| 国产一区二区三区在线观看免费| 美女久久久精品| 美女视频黄频大全不卡视频在线播放 | 日韩高清不卡在线| 亚洲国产精品嫩草影院| 天堂va蜜桃一区二区三区 | 麻豆专区一区二区三区四区五区| 日本欧美韩国一区三区| 久久99久久精品| 国产原创一区二区| 国产91精品在线观看| 成人在线视频首页| 91免费版在线| 欧美精品在欧美一区二区少妇 | 久久夜色精品国产噜噜av | 色婷婷综合视频在线观看| 日本高清无吗v一区| 欧美性淫爽ww久久久久无| 91精品国产91久久综合桃花| 日韩欧美专区在线| 国产亚洲精品福利| 亚洲男人天堂av网| 亚洲va天堂va国产va久| 男女男精品网站| 国产成人精品三级| 91蜜桃网址入口| 欧美另类videos死尸| 日韩精品中文字幕一区二区三区| 欧美国产精品v| 亚洲高清在线精品| 精品一区二区影视| 99久久伊人精品| 日韩欧美综合在线| 亚洲欧美在线观看| 三级成人在线视频| 国产一区在线精品| 94色蜜桃网一区二区三区| 欧美一区日韩一区| 中文字幕欧美日韩一区| 亚洲午夜精品久久久久久久久| 另类小说一区二区三区| av成人免费在线观看| 欧美精品色一区二区三区| 国产欧美一区二区三区沐欲| 亚洲综合一二三区| 国产99久久久精品| 欧美日韩亚洲综合在线 | 久久九九99视频| 亚洲国产综合视频在线观看| 国产成人免费视频一区| 欧美日韩免费不卡视频一区二区三区| 欧美xxx久久| 一级中文字幕一区二区| 国产成人av福利| 67194成人在线观看| 亚洲日本成人在线观看| 国模一区二区三区白浆| 欧美日本在线一区| 亚洲精品午夜久久久| 国产精品一区二区三区乱码| 这里只有精品电影| 亚洲欧美日韩小说| 国产.精品.日韩.另类.中文.在线.播放| 欧美中文字幕不卡| 亚洲图片激情小说| 国产91精品一区二区麻豆亚洲| 7777女厕盗摄久久久| 亚洲已满18点击进入久久| 成人国产一区二区三区精品| 久久综合网色—综合色88| 午夜久久福利影院| 91国产视频在线观看| 亚洲婷婷在线视频| 成+人+亚洲+综合天堂| 久久精品日韩一区二区三区| 美女视频免费一区| 欧美一区二区三区免费大片| 亚洲福利一二三区| 在线观看中文字幕不卡| 亚洲人成亚洲人成在线观看图片 | 色婷婷综合五月| 中文字幕一区二区三区四区不卡| 国产999精品久久久久久绿帽| 精品久久久影院| 精品一区二区三区在线播放| 日韩三级视频在线观看| 免费成人在线视频观看| 欧美一二三区在线| 日本欧美一区二区在线观看| 欧美精品视频www在线观看 | 亚洲成国产人片在线观看| 91福利区一区二区三区| 亚洲精品免费电影| 欧美综合欧美视频| 麻豆成人在线观看| 欧美电视剧在线看免费| 国产自产2019最新不卡| 亚洲精品一线二线三线无人区| 另类中文字幕网| 久久蜜桃香蕉精品一区二区三区| 国产激情偷乱视频一区二区三区| 欧美国产精品v| 色婷婷精品久久二区二区蜜臂av| 亚洲精品国产高清久久伦理二区| 色婷婷av一区二区三区gif| 一区二区高清免费观看影视大全| 欧亚洲嫩模精品一区三区| 日韩福利视频网| 久久美女艺术照精彩视频福利播放| 大胆欧美人体老妇| 亚洲摸摸操操av| 日韩视频免费直播| 国产xxx精品视频大全| 亚洲欧美电影一区二区| 欧美日韩国产在线观看| 韩国欧美一区二区| 亚洲欧美视频在线观看视频| 欧美日韩一区 二区 三区 久久精品| 六月丁香婷婷色狠狠久久| 久久精子c满五个校花| 日本道免费精品一区二区三区| 丝袜诱惑亚洲看片| 国产日本欧美一区二区| 在线亚洲免费视频| 精久久久久久久久久久| 又紧又大又爽精品一区二区|