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

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

?? os_mbox.c

?? UCOS II V2.80 移植到freescale的qe128上面的源代碼。并且包含UCOS II V2.80的源代碼
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                       MESSAGE MAILBOX MANAGEMENT
*
*                          (c) Copyright 1992-2005, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_MBOX.C
* By      : Jean J. Labrosse
* Version : V2.80
*********************************************************************************************************
*/

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

#if OS_MBOX_EN > 0
/*
*********************************************************************************************************
*                                     ACCEPT MESSAGE FROM MAILBOX
*
* Description: This function checks the mailbox to see if a message is available.  Unlike OSMboxPend(),
*              OSMboxAccept() does not suspend the calling task if a message is not available.
*
* Arguments  : pevent        is a pointer to the event control block
*
* Returns    : != (void *)0  is the message in the mailbox if one is available.  The mailbox is cleared
*                            so the next time OSMboxAccept() is called, the mailbox will be empty.
*              == (void *)0  if the mailbox is empty or,
*                            if 'pevent' is a NULL pointer or,
*                            if you didn't pass the proper event pointer.
*********************************************************************************************************
*/

#if OS_MBOX_ACCEPT_EN > 0
void  *OSMboxAccept (OS_EVENT *pevent)
{
    void      *msg;
#if OS_CRITICAL_METHOD == 3                               /* Allocate storage for CPU status register  */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                        /* Validate 'pevent'                         */
        return ((void *)0);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {      /* Validate event block type                 */
        return ((void *)0);
    }
    OS_ENTER_CRITICAL();
    msg                = pevent->OSEventPtr;
    pevent->OSEventPtr = (void *)0;                       /* Clear the mailbox                         */
    OS_EXIT_CRITICAL();
    return (msg);                                         /* Return the message received (or NULL)     */
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                        CREATE A MESSAGE MAILBOX
*
* Description: This function creates a message mailbox if free event control blocks are available.
*
* Arguments  : msg           is a pointer to a message that you wish to deposit in the mailbox.  If
*                            you set this value to the NULL pointer (i.e. (void *)0) then the mailbox
*                            will be considered empty.
*
* Returns    : != (OS_EVENT *)0  is a pointer to the event control clock (OS_EVENT) associated with the
*                                created mailbox
*              == (OS_EVENT *)0  if no event control blocks were available
*********************************************************************************************************
*/

OS_EVENT  *OSMboxCreate (void *msg)
{
    OS_EVENT  *pevent;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    if (OSIntNesting > 0) {                      /* See if called from ISR ...                         */
        return ((OS_EVENT *)0);                  /* ... can't CREATE from an ISR                       */
    }
    OS_ENTER_CRITICAL();
    pevent = OSEventFreeList;                    /* Get next free event control block                  */
    if (OSEventFreeList != (OS_EVENT *)0) {      /* See if pool of free ECB pool was empty             */
        OSEventFreeList = (OS_EVENT *)OSEventFreeList->OSEventPtr;
    }
    OS_EXIT_CRITICAL();
    if (pevent != (OS_EVENT *)0) {
        pevent->OSEventType    = OS_EVENT_TYPE_MBOX;
        pevent->OSEventCnt     = 0;
        pevent->OSEventPtr     = msg;            /* Deposit message in event control block             */
#if OS_EVENT_NAME_SIZE > 1
        pevent->OSEventName[0] = '?';
        pevent->OSEventName[1] = OS_ASCII_NUL;
#endif
        OS_EventWaitListInit(pevent);
    }
    return (pevent);                             /* Return pointer to event control block              */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                         DELETE A MAIBOX
*
* Description: This function deletes a mailbox and readies all tasks pending on the mailbox.
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired
*                            mailbox.
*
*              opt           determines delete options as follows:
*                            opt == OS_DEL_NO_PEND   Delete the mailbox ONLY if no task pending
*                            opt == OS_DEL_ALWAYS    Deletes the mailbox even if tasks are waiting.
*                                                    In this case, all the tasks pending will be readied.
*
*              err           is a pointer to an error code that can contain one of the following values:
*                            OS_NO_ERR               The call was successful and the mailbox was deleted
*                            OS_ERR_DEL_ISR          If you attempted to delete the mailbox from an ISR
*                            OS_ERR_INVALID_OPT      An invalid option was specified
*                            OS_ERR_TASK_WAITING     One or more tasks were waiting on the mailbox
*                            OS_ERR_EVENT_TYPE       If you didn't pass a pointer to a mailbox
*                            OS_ERR_PEVENT_NULL      If 'pevent' is a NULL pointer.
*
* Returns    : pevent        upon error
*              (OS_EVENT *)0 if the mailbox was successfully deleted.
*
* Note(s)    : 1) This function must be used with care.  Tasks that would normally expect the presence of
*                 the mailbox MUST check the return code of OSMboxPend().
*              2) OSMboxAccept() callers will not know that the intended mailbox has been deleted!
*              3) This call can potentially disable interrupts for a long time.  The interrupt disable
*                 time is directly proportional to the number of tasks waiting on the mailbox.
*              4) Because ALL tasks pending on the mailbox will be readied, you MUST be careful in
*                 applications where the mailbox is used for mutual exclusion because the resource(s)
*                 will no longer be guarded by the mailbox.
*********************************************************************************************************
*/

#if OS_MBOX_DEL_EN > 0
OS_EVENT  *OSMboxDel (OS_EVENT *pevent, INT8U opt, INT8U *err)
{
    BOOLEAN    tasks_waiting;
    OS_EVENT  *pevent_return;
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_ARG_CHK_EN > 0
    if (err == (INT8U *)0) {                               /* Validate 'err'                           */
        return (pevent);
    }
    if (pevent == (OS_EVENT *)0) {                         /* Validate 'pevent'                        */
        *err = OS_ERR_PEVENT_NULL;
        return (pevent);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {       /* Validate event block type                */
        *err = OS_ERR_EVENT_TYPE;
        return (pevent);
    }
    if (OSIntNesting > 0) {                                /* See if called from ISR ...               */
        *err = OS_ERR_DEL_ISR;                             /* ... can't DELETE from an ISR             */
        return (pevent);
    }
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0) {                         /* See if any tasks waiting on mailbox      */
        tasks_waiting = TRUE;                              /* Yes                                      */
    } else {
        tasks_waiting = FALSE;                             /* No                                       */
    }
    switch (opt) {
        case OS_DEL_NO_PEND:                               /* Delete mailbox only if no task waiting   */
             if (tasks_waiting == FALSE) {
#if OS_EVENT_NAME_SIZE > 1
                 pevent->OSEventName[0] = '?';             /* Unknown name                             */
                 pevent->OSEventName[1] = OS_ASCII_NUL;
#endif
                 pevent->OSEventType = OS_EVENT_TYPE_UNUSED;
                 pevent->OSEventPtr  = OSEventFreeList;    /* Return Event Control Block to free list  */
                 pevent->OSEventCnt  = 0;
                 OSEventFreeList     = pevent;             /* Get next free event control block        */
                 OS_EXIT_CRITICAL();
                 *err                = OS_NO_ERR;
                 pevent_return       = (OS_EVENT *)0;      /* Mailbox has been deleted                 */
             } else {
                 OS_EXIT_CRITICAL();
                 *err                = OS_ERR_TASK_WAITING;
                 pevent_return       = pevent;
             }
             break;

        case OS_DEL_ALWAYS:                                /* Always delete the mailbox                */
             while (pevent->OSEventGrp != 0) {             /* Ready ALL tasks waiting for mailbox      */
                 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_MBOX);
             }
#if OS_EVENT_NAME_SIZE > 1
             pevent->OSEventName[0] = '?';                 /* Unknown name                             */
             pevent->OSEventName[1] = OS_ASCII_NUL;
#endif
             pevent->OSEventType    = OS_EVENT_TYPE_UNUSED;
             pevent->OSEventPtr     = OSEventFreeList;     /* Return Event Control Block to free list  */
             pevent->OSEventCnt     = 0;
             OSEventFreeList        = pevent;              /* Get next free event control block        */
             OS_EXIT_CRITICAL();
             if (tasks_waiting == TRUE) {                  /* Reschedule only if task(s) were waiting  */
                 OS_Sched();                               /* Find highest priority task ready to run  */
             }
             *err          = OS_NO_ERR;
             pevent_return = (OS_EVENT *)0;                /* Mailbox has been deleted                 */
             break;

        default:
             OS_EXIT_CRITICAL();
             *err          = OS_ERR_INVALID_OPT;
             pevent_return = pevent;
             break;
    }
    return (pevent_return);
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                      PEND ON MAILBOX FOR A MESSAGE
*
* Description: This function waits for a message to be sent to a mailbox
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired mailbox
*
*              timeout       is an optional timeout period (in clock ticks).  If non-zero, your task will
*                            wait for a message to arrive at the mailbox up to the amount of time
*                            specified by this argument.  If you specify 0, however, your task will wait
*                            forever at the specified mailbox or, until a message arrives.
*
*              err           is a pointer to where an error message will be deposited.  Possible error
*                            messages are:
*
*                            OS_NO_ERR           The call was successful and your task received a
*                                                message.
*                            OS_TIMEOUT          A message was not received within the specified timeout
*                            OS_ERR_EVENT_TYPE   Invalid event type
*                            OS_ERR_PEND_ISR     If you called this function from an ISR and the result
*                                                would lead to a suspension.
*                            OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer
*
* Returns    : != (void *)0  is a pointer to the message received

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩高清欧美激情| 91精品国产综合久久精品麻豆| 国产一区二区三区四| 麻豆91在线观看| 另类小说图片综合网| 久久99热狠狠色一区二区| 蜜臀精品久久久久久蜜臀| 日本欧美一区二区三区乱码| 日本成人在线网站| 久久电影网站中文字幕| 久久精品国产秦先生| 精品一区二区三区在线播放| 九色|91porny| 国产精品一区二区久激情瑜伽| 国产成人av电影在线观看| 国产一区二区三区四| 粉嫩一区二区三区在线看| av激情亚洲男人天堂| 91丨porny丨户外露出| 91福利资源站| 欧美顶级少妇做爰| 欧美va在线播放| 国产性做久久久久久| 亚洲欧美综合在线精品| 一区二区三区中文字幕电影 | 国产性色一区二区| 国产欧美一区二区精品仙草咪 | 日韩高清欧美激情| 美女看a上一区| 成年人国产精品| 在线免费观看成人短视频| 欧美日韩精品一区二区三区四区 | 综合色中文字幕| 亚洲福利一区二区三区| 免费在线视频一区| 国产精品中文字幕一区二区三区| 成人动漫精品一区二区| 色婷婷亚洲一区二区三区| 欧美高清视频在线高清观看mv色露露十八| 日韩亚洲国产中文字幕欧美| 国产欧美精品一区| 亚洲成人av中文| 国产精品白丝av| 欧美日韩国产美女| 国产欧美日韩一区二区三区在线观看| 亚洲狼人国产精品| 激情伊人五月天久久综合| jvid福利写真一区二区三区| 欧美精选午夜久久久乱码6080| 精品国产凹凸成av人网站| 日韩理论电影院| 麻豆精品久久久| 日本高清不卡一区| 久久综合一区二区| 亚洲图片欧美综合| 国产.欧美.日韩| 欧美电影一区二区| 亚洲欧美成aⅴ人在线观看| 寂寞少妇一区二区三区| 欧美在线免费观看亚洲| 国产亚洲成aⅴ人片在线观看| 亚洲 欧美综合在线网络| 高清国产午夜精品久久久久久| 欧美人成免费网站| 成人免费在线观看入口| 久久99精品久久久久久动态图 | 国产成人亚洲精品青草天美| 欧美日韩国产综合一区二区| 欧美高清在线精品一区| 青青草成人在线观看| 91丨porny丨最新| 久久久久久久av麻豆果冻| 日韩福利电影在线观看| 色综合久久久久久久久久久| 精品国免费一区二区三区| 亚洲综合色区另类av| 成人综合婷婷国产精品久久蜜臀| 91精品麻豆日日躁夜夜躁| 亚洲欧洲制服丝袜| 国产99久久久国产精品潘金 | 欧美日韩高清一区二区三区| 国产精品理论在线观看| 精彩视频一区二区| 日韩欧美在线一区二区三区| 亚洲国产日韩av| 91小视频在线| 国产精品久久久久久久久免费相片 | 亚洲乱码中文字幕| 成人一区二区三区| 久久免费午夜影院| 免费看日韩精品| 这里是久久伊人| 日本不卡一区二区| 欧美精品视频www在线观看| 亚洲一区在线观看视频| 91美女视频网站| 亚洲三级免费观看| 91影院在线观看| 中文字幕一区二区三区不卡 | 亚洲精品在线免费观看视频| 秋霞午夜av一区二区三区| 欧美日韩国产影片| 日韩国产一区二| 日韩一区和二区| 日本va欧美va精品| 日韩欧美一区二区久久婷婷| 日本人妖一区二区| 日韩欧美成人午夜| 韩国成人福利片在线播放| 精品少妇一区二区三区| 久久精品国产**网站演员| 日韩女优av电影| 国产一区二区三区视频在线播放| 精品日韩成人av| 国产自产视频一区二区三区| 久久综合五月天婷婷伊人| 国产麻豆欧美日韩一区| 欧美激情一区二区三区不卡| 国产成人av一区二区三区在线| 国产免费久久精品| 97久久人人超碰| 一区二区三区在线视频免费 | 日韩欧美精品三级| 国产精品中文字幕日韩精品 | 2020日本不卡一区二区视频| 国产成人亚洲综合色影视| 国产精品美女久久久久久久网站| 粉嫩一区二区三区在线看| 国产精品国产三级国产aⅴ原创| 不卡在线观看av| 亚洲精品日韩一| 91麻豆精品国产91久久久 | 久久99精品国产麻豆不卡| 久久日韩粉嫩一区二区三区| 国产麻豆视频一区二区| 国产精品美女久久久久久2018| 色综合视频一区二区三区高清| 亚洲综合清纯丝袜自拍| 日韩一区二区在线观看视频播放| 国产高清亚洲一区| 亚洲最新在线观看| 欧美一区二区三区白人| 国产成人精品亚洲777人妖 | 国产高清成人在线| 一区二区三区精品| 日韩欧美一区在线观看| 成人福利在线看| 亚洲成在人线在线播放| 久久精品亚洲一区二区三区浴池| 色综合天天天天做夜夜夜夜做| 免费看精品久久片| 亚洲婷婷在线视频| 精品对白一区国产伦| 91行情网站电视在线观看高清版| 日产国产欧美视频一区精品| 欧美国产精品劲爆| 欧美精品成人一区二区三区四区| 国产一区不卡视频| 亚洲一区二区三区美女| 欧美大黄免费观看| 91美女精品福利| 国产在线日韩欧美| 亚洲精品菠萝久久久久久久| 日韩女优毛片在线| 色噜噜狠狠色综合欧洲selulu| 麻豆91在线看| 亚洲地区一二三色| 亚洲欧洲在线观看av| 精品久久久影院| 欧美亚洲动漫精品| 波多野结衣91| 六月丁香婷婷久久| 亚洲亚洲精品在线观看| 国产人久久人人人人爽| 欧美一区二区视频免费观看| av在线一区二区三区| 久久国产麻豆精品| 亚洲妇熟xx妇色黄| 亚洲天堂福利av| 国产日韩欧美高清在线| 91精品国产手机| 在线日韩一区二区| 成人黄色777网| 国产成a人亚洲| 久久爱www久久做| 午夜不卡在线视频| 亚洲午夜视频在线| 亚洲男人天堂一区| 中文字幕一区二区在线观看| 国产三级欧美三级| 日韩欧美中文字幕精品| 欧美日韩视频在线观看一区二区三区| 成人激情综合网站| 国产精品白丝av| 国产综合久久久久久久久久久久| 日日夜夜精品视频天天综合网| 亚洲精品视频在线观看免费| 中文字幕一区二区三区不卡| 国产精品日产欧美久久久久| 国产欧美综合在线|