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

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

?? os_task.c

?? UCOS 在ARM9_S3c2410上的移植
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                            TASK MANAGEMENT
*
*                          (c) Copyright 1992-2001, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File : OS_TASK.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

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

/*
*********************************************************************************************************
*                                        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 > 0
INT8U  OSTaskChangePrio (INT8U oldprio, INT8U newprio)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR    cpu_sr;
#endif

#if OS_EVENT_EN > 0
    OS_EVENT    *pevent;
#endif

    OS_TCB      *ptcb;
    INT8U        x;
    INT8U        y;
    INT8U        bitx;
    INT8U        bity;



#if OS_ARG_CHK_EN > 0
    if ((oldprio >= OS_LOWEST_PRIO && oldprio != OS_PRIO_SELF)  ||
         newprio >= OS_LOWEST_PRIO) {
        return (OS_PRIO_INVALID);
    }
#endif
    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) != 0x00) {  /* If task is ready make it not */
                if ((OSRdyTbl[ptcb->OSTCBY] &= ~ptcb->OSTCBBitX) == 0x00) {
                    OSRdyGrp &= ~ptcb->OSTCBBitY;
                }
                OSRdyGrp    |= bity;                            /* Make new priority ready to run      */
                OSRdyTbl[y] |= bitx;
#if OS_EVENT_EN > 0
            } 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;
                }
#endif
            }
            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();
            OS_Sched();                                         /* 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 > 0
INT8U  OSTaskCreate (void (*task)(void *pd), void *pdata, OS_STK *ptos, INT8U prio)
{
#if OS_CRITICAL_METHOD == 3                  /* Allocate storage for CPU status register               */
    OS_CPU_SR  cpu_sr;
#endif
    OS_STK    *psp;
    INT8U      err;


#if OS_ARG_CHK_EN > 0
    if (prio > OS_LOWEST_PRIO) {             /* Make sure priority is within allowable range           */
        return (OS_PRIO_INVALID);
    }
#endif
    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 = (OS_STK *)OSTaskStkInit(task, pdata, ptos, 0);    /* Initialize the task's stack         */
        err = OS_TCBInit(prio, psp, (OS_STK *)0, 0, 0, (void *)0, 0);
        if (err == OS_NO_ERR) {
            OS_ENTER_CRITICAL();
            OSTaskCtr++;                                        /* Increment the #tasks counter        */
            OS_EXIT_CRITICAL();
            if (OSRunning == TRUE) {         /* Find highest priority task if multitasking has started */
                OS_Sched();
            }
        } else {
            OS_ENTER_CRITICAL();
            OSTCBPrioTbl[prio] = (OS_TCB *)0;/* Make this priority available to others                 */
            OS_EXIT_CRITICAL();
        }
        return (err);
    }
    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.
*
*              id       is the task's ID (0..65535)
*
*              pbos     is a pointer to the task's bottom 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).  'pbos' will thus point to the LOWEST (valid) memory
*                       location of the stack.  If OS_STK_GROWTH is set to 0, 'pbos' will point to the
*                       HIGHEST memory location of the stack and the stack will grow with increasing
*                       memory locations.  'pbos' MUST point to a valid 'free' data item.
*
*              stk_size is the size of the stack in number of elements.  If OS_STK is set to INT8U,
*                       'stk_size' corresponds to the number of bytes available.  If OS_STK is set to
*                       INT16U, 'stk_size' contains the number of 16-bit entries available.  Finally, if
*                       OS_STK is set to INT32U, 'stk_size' contains the number of 32-bit entries
*                       available on the stack.
*
*              pext     is a pointer to a user supplied memory location which is used as a TCB extension.
*                       For example, this user memory can hold the contents of floating-point registers
*                       during a context switch, the time each task takes to execute, the number of times
*                       the task has been switched-in, etc.
*
*              opt      contains additional information (or options) about the behavior of the task.  The
*                       LOWER 8-bits are reserved by uC/OS-II while the upper 8 bits can be application

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
777久久久精品| 亚洲视频中文字幕| 国产亚洲欧美一区在线观看| 久久久久国产免费免费| 欧美一区日本一区韩国一区| 国产欧美精品区一区二区三区| 中文字幕亚洲综合久久菠萝蜜| 亚洲国产综合色| 精品一区二区三区av| 成人免费精品视频| 色综合久久综合网97色综合| 欧美一级在线视频| 国产精品理论在线观看| 婷婷中文字幕综合| 麻豆精品视频在线| 色婷婷亚洲精品| 久久久久久久久蜜桃| 亚洲欧美日韩久久| 极品少妇一区二区三区精品视频 | 欧洲中文字幕精品| 日韩精品中文字幕在线一区| 亚洲人妖av一区二区| 综合久久国产九一剧情麻豆| 亚洲午夜精品在线| 不卡在线观看av| 欧美videossexotv100| 亚洲视频资源在线| 国产91精品精华液一区二区三区| 欧美色国产精品| 亚洲色图丝袜美腿| 国产91精品入口| 精品国产伦一区二区三区观看体验| 亚洲色图20p| 成人免费av资源| 久久伊人中文字幕| 久久精品国产网站| 在线不卡a资源高清| 亚洲综合激情另类小说区| 国产成人免费9x9x人网站视频| 91精品在线观看入口| 一区二区三区精品在线| jlzzjlzz欧美大全| 中文字幕在线观看一区| 日本成人中文字幕在线视频| 欧美主播一区二区三区| 亚洲欧洲日产国码二区| 粉嫩欧美一区二区三区高清影视| www国产成人| 国产一区二区免费在线| 欧美电影免费观看高清完整版 | 国产午夜精品久久久久久久| 久久精品国产免费| 欧美一级在线视频| 亚洲成av人片在线观看无码| 欧美三片在线视频观看| 婷婷丁香久久五月婷婷| 欧美日韩另类一区| 日韩精品一级中文字幕精品视频免费观看 | 日韩精品成人一区二区在线| 91国偷自产一区二区开放时间 | 在线视频观看一区| 日本色综合中文字幕| 久久久久99精品国产片| 日韩理论电影院| 日韩欧美精品三级| 国产在线精品不卡| 精品电影一区二区三区| 久久se精品一区二区| 久久奇米777| 91在线播放网址| 一区二区三区欧美激情| 欧美精品亚洲二区| 一区二区三区小说| 欧美三级在线看| 蜜臀av性久久久久蜜臀av麻豆| 日韩欧美国产三级| 国产精品综合av一区二区国产馆| 久久久www成人免费无遮挡大片| 国产精品亚洲人在线观看| 亚洲国产高清在线| 色国产综合视频| 日av在线不卡| 久久精品一区蜜桃臀影院| 大尺度一区二区| 亚洲妇熟xx妇色黄| 日韩欧美国产系列| 国产伦精品一区二区三区在线观看| 国产精品热久久久久夜色精品三区 | 亚洲欧美日韩一区二区| 欧美无乱码久久久免费午夜一区| 久色婷婷小香蕉久久| 国产精品国产三级国产aⅴ入口| 在线观看一区二区精品视频| 麻豆一区二区三| 亚洲欧美国产高清| 日韩欧美国产成人一区二区| 99视频一区二区三区| 免费日韩伦理电影| 中文字幕亚洲成人| 精品美女一区二区三区| 在线免费观看视频一区| 免费一区二区视频| 亚洲人成精品久久久久久| www成人在线观看| 欧美丰满高潮xxxx喷水动漫| 成人网在线免费视频| 亚洲国产毛片aaaaa无费看| 精品国产网站在线观看| 色呦呦国产精品| 成人美女视频在线观看| 久久精品国产澳门| 水野朝阳av一区二区三区| 中文字幕在线免费不卡| 日韩一区二区三区av| 91久久精品一区二区三区| 国产成人欧美日韩在线电影| 免费在线成人网| 午夜久久久久久久久久一区二区| 亚洲欧洲在线观看av| 久久精品人人做人人爽97| 日韩一区二区三区视频在线| 欧美美女黄视频| 欧美性受极品xxxx喷水| 粉嫩绯色av一区二区在线观看 | 91精品国产色综合久久久蜜香臀| 97久久久精品综合88久久| 国产高清不卡二三区| 国产麻豆精品久久一二三| 开心九九激情九九欧美日韩精美视频电影 | 成人国产亚洲欧美成人综合网| 黄色精品一二区| 一区二区在线免费| 亚洲国产人成综合网站| 亚洲成av人在线观看| 毛片基地黄久久久久久天堂| 国产精品亚洲一区二区三区在线 | 韩国女主播一区| 成熟亚洲日本毛茸茸凸凹| 9久草视频在线视频精品| 欧美亚洲日本一区| 日韩视频免费观看高清完整版在线观看 | 日韩免费观看2025年上映的电影| 欧美哺乳videos| 国产精品久久久久久久久久久免费看 | 国产精品一区二区三区四区| 99综合影院在线| 在线播放视频一区| 中文字幕av一区二区三区高| 亚洲一区二区三区不卡国产欧美| 麻豆高清免费国产一区| 成人综合日日夜夜| 欧美三级欧美一级| 国产性色一区二区| 亚洲r级在线视频| 丰满少妇久久久久久久| 欧美高清视频不卡网| 久久久久久久一区| 一区二区三区加勒比av| 国产在线精品一区二区| 欧美在线free| 国产日产欧产精品推荐色| 日韩精品一区第一页| www.欧美日韩| 精品国产乱码久久久久久老虎| 尤物视频一区二区| 国产成人精品亚洲日本在线桃色| 欧美性生交片4| 国产精品成人网| 国产一区欧美日韩| 在线精品视频免费播放| 国产欧美视频一区二区| 日韩国产欧美在线播放| av男人天堂一区| 国产视频一区不卡| 日本欧美在线观看| 欧洲亚洲国产日韩| 综合av第一页| 国产91精品在线观看| 欧美一级片在线| 婷婷中文字幕综合| 91麻豆国产自产在线观看| 久久婷婷色综合| 狂野欧美性猛交blacked| 9191精品国产综合久久久久久 | 日本成人中文字幕在线视频| 91天堂素人约啪| 国产精品传媒在线| 粉嫩aⅴ一区二区三区四区五区| 日韩精品一区二区三区三区免费| 午夜电影一区二区三区| 欧美在线free| 亚洲成人手机在线| 欧美亚洲国产一区二区三区va | 国产伦精品一区二区三区在线观看| 91精品综合久久久久久| 偷拍日韩校园综合在线| 欧美狂野另类xxxxoooo| 视频在线观看国产精品| 7777精品久久久大香线蕉| 婷婷丁香激情综合|