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

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

?? os_mbox.c

?? 基于GE00 實(shí)驗(yàn)系統(tǒng)開發(fā)板的實(shí)驗(yàn)指導(dǎo)用途
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
    void      *msg;


    if (OSIntNesting > 0) {                           /* See if called from ISR ...                    */
        *err = OS_ERR_PEND_ISR;                       /* ... can't PEND from an ISR                    */
        return ((void *)0);
    }
#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                    /* Validate 'pevent'                             */
        *err = OS_ERR_PEVENT_NULL;
        return ((void *)0);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {  /* Validate event block type                     */
        *err = OS_ERR_EVENT_TYPE;
        return ((void *)0);
    }
    OS_ENTER_CRITICAL();
    msg = pevent->OSEventPtr;
    if (msg != (void *)0) {                           /* See if there is already a message             */
        pevent->OSEventPtr = (void *)0;               /* Clear the mailbox                             */
        OS_EXIT_CRITICAL();
        *err = OS_NO_ERR;
        return (msg);                                 /* Return the message received (or NULL)         */
    }
    OSTCBCur->OSTCBStat |= OS_STAT_MBOX;              /* Message not available, task will pend         */
    OSTCBCur->OSTCBDly   = timeout;                   /* Load timeout in TCB                           */
    OS_EventTaskWait(pevent);                         /* Suspend task until event or timeout occurs    */
    OS_EXIT_CRITICAL();
    OS_Sched();                                       /* Find next highest priority task ready to run  */
    OS_ENTER_CRITICAL();
    msg = OSTCBCur->OSTCBMsg;
    if (msg != (void *)0) {                           /* See if we were given the message              */
        OSTCBCur->OSTCBMsg      = (void *)0;          /* Yes, clear message received                   */
        OSTCBCur->OSTCBStat     = OS_STAT_RDY;
        OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0;      /* No longer waiting for event                   */
        OS_EXIT_CRITICAL();
        *err                    = OS_NO_ERR;
        return (msg);                                 /* Return the message received                   */
    }
    OS_EventTO(pevent);                               /* Timed out, Make task ready                    */
    OS_EXIT_CRITICAL();
    *err = OS_TIMEOUT;                                /* Indicate that a timeout occured               */
    return ((void *)0);                               /* Return a NULL message                         */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                       POST MESSAGE TO A MAILBOX
*
* Description: This function sends a message to a mailbox
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired mailbox
*
*              msg           is a pointer to the message to send.  You MUST NOT send a NULL pointer.
*
* Returns    : OS_NO_ERR            The call was successful and the message was sent
*              OS_MBOX_FULL         If the mailbox already contains a message.  You can can only send one
*                                   message at a time and thus, the message MUST be consumed before you
*                                   are allowed to send another one.
*              OS_ERR_EVENT_TYPE    If you are attempting to post to a non mailbox.
*              OS_ERR_PEVENT_NULL   If 'pevent' is a NULL pointer
*              OS_ERR_POST_NULL_PTR If you are attempting to post a NULL pointer
*********************************************************************************************************
*/

#if OS_MBOX_POST_EN > 0
INT8U  OSMboxPost (OS_EVENT *pevent, void *msg)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    
    
#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                    /* Validate 'pevent'                             */
        return (OS_ERR_PEVENT_NULL);
    }
    if (msg == (void *)0) {                           /* Make sure we are not posting a NULL pointer   */
        return (OS_ERR_POST_NULL_PTR);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {  /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0x00) {                 /* See if any task pending on mailbox            */
        OS_EventTaskRdy(pevent, msg, OS_STAT_MBOX);   /* Ready highest priority task waiting on event  */
        OS_EXIT_CRITICAL();
        OS_Sched();                                   /* Find highest priority task ready to run       */
        return (OS_NO_ERR);
    }
    if (pevent->OSEventPtr != (void *)0) {            /* Make sure mailbox doesn't already have a msg  */
        OS_EXIT_CRITICAL();
        return (OS_MBOX_FULL);
    }
    pevent->OSEventPtr = msg;                         /* Place message in mailbox                      */
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                       POST MESSAGE TO A MAILBOX
*
* Description: This function sends a message to a mailbox
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired mailbox
*
*              msg           is a pointer to the message to send.  You MUST NOT send a NULL pointer.
*
*              opt           determines the type of POST performed:
*                            OS_POST_OPT_NONE         POST to a single waiting task 
*                                                     (Identical to OSMboxPost())
*                            OS_POST_OPT_BROADCAST    POST to ALL tasks that are waiting on the mailbox
*
* Returns    : OS_NO_ERR            The call was successful and the message was sent
*              OS_MBOX_FULL         If the mailbox already contains a message.  You can can only send one
*                                   message at a time and thus, the message MUST be consumed before you
*                                   are allowed to send another one.
*              OS_ERR_EVENT_TYPE    If you are attempting to post to a non mailbox.
*              OS_ERR_PEVENT_NULL   If 'pevent' is a NULL pointer
*              OS_ERR_POST_NULL_PTR If you are attempting to post a NULL pointer
*
* Warning    : Interrupts can be disabled for a long time if you do a 'broadcast'.  In fact, the 
*              interrupt disable time is proportional to the number of tasks waiting on the mailbox.
*********************************************************************************************************
*/

#if OS_MBOX_POST_OPT_EN > 0
INT8U  OSMboxPostOpt (OS_EVENT *pevent, void *msg, INT8U opt)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    
    
#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                    /* Validate 'pevent'                             */
        return (OS_ERR_PEVENT_NULL);
    }
    if (msg == (void *)0) {                           /* Make sure we are not posting a NULL pointer   */
        return (OS_ERR_POST_NULL_PTR);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {  /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0x00) {                 /* See if any task pending on mailbox            */
        if ((opt & OS_POST_OPT_BROADCAST) != 0x00) {  /* Do we need to post msg to ALL waiting tasks ? */
            while (pevent->OSEventGrp != 0x00) {      /* Yes, Post to ALL tasks waiting on mailbox     */           
                OS_EventTaskRdy(pevent, msg, OS_STAT_MBOX);    
            }
        } else {
            OS_EventTaskRdy(pevent, msg, OS_STAT_MBOX);    /* No,  Post to HPT waiting on mbox         */
        }
        OS_EXIT_CRITICAL();
        OS_Sched();                                        /* Find highest priority task ready to run  */
        return (OS_NO_ERR);
    }
    if (pevent->OSEventPtr != (void *)0) {            /* Make sure mailbox doesn't already have a msg  */
        OS_EXIT_CRITICAL();
        return (OS_MBOX_FULL);
    }
    pevent->OSEventPtr = msg;                         /* Place message in mailbox                      */
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                        QUERY A MESSAGE MAILBOX
*
* Description: This function obtains information about a message mailbox.
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired mailbox
*
*              pdata         is a pointer to a structure that will contain information about the message
*                            mailbox.
*
* Returns    : OS_NO_ERR           The call was successful and the message was sent
*              OS_ERR_EVENT_TYPE   If you are attempting to obtain data from a non mailbox.
*              OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer
*********************************************************************************************************
*/

#if OS_MBOX_QUERY_EN > 0
INT8U  OSMboxQuery (OS_EVENT *pevent, OS_MBOX_DATA *pdata)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT8U     *psrc;
    INT8U     *pdest;


#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                         /* Validate 'pevent'                        */
        return (OS_ERR_PEVENT_NULL);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {       /* Validate event block type                */
        return (OS_ERR_EVENT_TYPE);
    }
    OS_ENTER_CRITICAL();
    pdata->OSEventGrp = pevent->OSEventGrp;                /* Copy message mailbox wait list           */
    psrc              = &pevent->OSEventTbl[0];
    pdest             = &pdata->OSEventTbl[0];

#if OS_EVENT_TBL_SIZE > 0
    *pdest++          = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 1
    *pdest++          = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 2
    *pdest++          = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 3
    *pdest++          = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 4
    *pdest++          = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 5
    *pdest++          = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 6
    *pdest++          = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 7
    *pdest            = *psrc;
#endif
    pdata->OSMsg = pevent->OSEventPtr;                     /* Get message from mailbox                 */
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif                                                     /* OS_MBOX_QUERY_EN                         */
#endif                                                     /* OS_MBOX_EN                               */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美喷水一区二区| 日一区二区三区| 日韩精品一级中文字幕精品视频免费观看| 性久久久久久久久久久久| 日精品一区二区| 国产精品一区二区久激情瑜伽| 成人激情综合网站| 欧美男同性恋视频网站| 久久久久久久久久看片| 国产精品久久毛片av大全日韩| 99久久婷婷国产综合精品电影 | 欧美日韩激情一区二区三区| 欧美成人三级电影在线| 亚洲欧洲制服丝袜| 国产成人精品免费网站| 欧美区在线观看| 中文字幕中文字幕在线一区| 免费观看一级特黄欧美大片| 94-欧美-setu| 国产午夜精品一区二区| 日韩av中文在线观看| 91免费在线视频观看| 久久色.com| 久久电影网电视剧免费观看| 色婷婷亚洲婷婷| 亚洲激情在线激情| 91亚洲国产成人精品一区二区三 | 色综合天天综合在线视频| 精品成人一区二区三区| 免费不卡在线观看| 制服.丝袜.亚洲.另类.中文| 亚洲国产婷婷综合在线精品| 色嗨嗨av一区二区三区| 亚洲欧洲成人自拍| 99精品国产视频| 国产精品视频免费| 粉嫩av一区二区三区在线播放| 日韩一级欧美一级| 国内精品久久久久影院色| 欧美www视频| 国产精品影视在线观看| 国产亚洲婷婷免费| 国产成人一区在线| 国产欧美一区二区精品仙草咪| 国产风韵犹存在线视精品| 日本一区二区在线不卡| 99热这里都是精品| 亚州成人在线电影| 日韩一本二本av| 国产美女av一区二区三区| 欧美经典三级视频一区二区三区| 成人美女在线观看| 亚洲综合免费观看高清完整版 | 亚洲视频在线观看三级| 色综合色综合色综合色综合色综合| 一区二区三区在线播| 91精品国产一区二区三区 | 亚洲国产高清在线| 在线免费不卡视频| 精品一区二区三区欧美| 亚洲日本在线视频观看| 欧美高清激情brazzers| 成人激情图片网| 婷婷综合五月天| 国产精品萝li| 91精品国产91久久综合桃花| 成人久久18免费网站麻豆| 青青草国产精品97视觉盛宴 | 色菇凉天天综合网| 国产高清一区日本| 丝袜国产日韩另类美女| 日韩美女久久久| 久久久久久久久伊人| 日韩欧美在线网站| 欧美日韩成人在线一区| 丁香激情综合五月| 国产在线精品一区二区| 日本午夜一本久久久综合| 亚洲欧美另类图片小说| 精品日本一线二线三线不卡 | 国产精品色一区二区三区| 日韩一区国产二区欧美三区| 91福利精品视频| 91视频观看视频| 一本色道综合亚洲| 99久久久免费精品国产一区二区| 韩日精品视频一区| 精品一区二区三区免费毛片爱 | 欧美成人一区二区三区片免费 | 成人av资源网站| 国产成人综合精品三级| 国产成人av自拍| 丁香另类激情小说| a级精品国产片在线观看| 国产成人一级电影| av激情成人网| 色8久久人人97超碰香蕉987| 在线观看网站黄不卡| 欧洲精品一区二区| 91精品国模一区二区三区| 日韩一级片在线播放| 欧美一区二区高清| 久久在线免费观看| 国产精品色哟哟网站| 亚洲欧美在线视频| 偷拍亚洲欧洲综合| 激情综合网av| av一二三不卡影片| 欧美日韩一级视频| 久久夜色精品国产欧美乱极品| 26uuu久久天堂性欧美| 国产精品久久久久永久免费观看 | 91福利资源站| 久久综合久久综合久久综合| 亚洲视频免费看| 免费欧美高清视频| 丁香六月久久综合狠狠色| 在线视频国内自拍亚洲视频| 日韩三级在线观看| 亚洲女与黑人做爰| 韩国成人精品a∨在线观看| av成人免费在线观看| 日韩视频一区在线观看| 亚洲欧美激情在线| 激情欧美日韩一区二区| 在线一区二区三区做爰视频网站| 91精品综合久久久久久| 亚洲欧美视频一区| 国产盗摄视频一区二区三区| 欧美日韩高清在线播放| 亚洲欧洲成人精品av97| 国内成人免费视频| 日韩午夜精品视频| 亚洲国产精品嫩草影院| 成人伦理片在线| 久久综合九色综合欧美98| 日韩高清电影一区| 欧美高清视频www夜色资源网| 亚洲欧洲精品一区二区三区不卡| 精品一区二区免费视频| 欧美电影影音先锋| 亚洲第一会所有码转帖| 91视频一区二区| 日韩一区中文字幕| 99精品视频一区二区三区| 国产精品每日更新在线播放网址| 国产精品2024| 国产日韩成人精品| 成人久久18免费网站麻豆| 欧美国产一区视频在线观看| 国产精品综合视频| 国产亚洲短视频| 国产高清视频一区| 中文字幕一区日韩精品欧美| 972aa.com艺术欧美| 亚洲三级视频在线观看| 色老汉一区二区三区| 亚洲成人动漫在线观看| 日韩一区和二区| 日韩欧美电影在线| 波多野结衣在线一区| 亚洲人一二三区| 欧美丰满少妇xxxxx高潮对白| 久久99精品久久只有精品| 久久精品视频免费| 在线观看成人小视频| 国产一区二区三区四区五区美女| 久久99精品久久久久久久久久久久| 日韩精品一区二区三区视频播放 | 亚洲一区二区三区美女| 精品欧美一区二区久久| 成人污污视频在线观看| 天天影视网天天综合色在线播放 | 91蝌蚪porny| 激情综合五月天| 亚洲精品成a人| 久久久蜜臀国产一区二区| 色欧美片视频在线观看| 国产麻豆精品在线| 午夜久久久影院| 中文字幕成人在线观看| 欧美一区二区二区| 色综合av在线| 国产成人免费在线视频| 青青草国产成人av片免费| 一区二区三区色| 国产精品高潮久久久久无| 欧美高清性hdvideosex| 91黄色免费看| www.欧美日韩国产在线| 国产白丝网站精品污在线入口| 午夜私人影院久久久久| 亚洲丝袜精品丝袜在线| 国产日韩欧美精品电影三级在线 | 精品一区二区综合| 日本不卡视频在线观看| 日日嗨av一区二区三区四区| 亚洲成a人片在线观看中文| 亚洲欧美乱综合| 亚洲老妇xxxxxx|