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

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

?? qus.c

?? 基于OMAP1510的Nucleus移植代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*      message is copied into the message area of the first waiting     */
/*      task and that task is resumed.  If there is enough room in the   */
/*      queue, the message is copied in front of all other messages.     */
/*      If there is not enough room in the queue, suspension of the      */
/*      caller is possible.                                              */
/*                                                                       */
/* CALLED BY                                                             */
/*                                                                       */
/*      Application                                                      */
/*      QUSE_Send_To_Front_Of_Queue         Error checking shell         */
/*                                                                       */
/* CALLS                                                                 */
/*                                                                       */
/*      CSC_Place_On_List                   Place on suspend list        */
/*      CSC_Remove_From_List                Remove from suspend list     */
/*      [HIC_Make_History_Entry]            Make entry in history log    */
/*      TCC_Resume_Task                     Resume a suspended task      */
/*      TCC_Suspend_Task                    Suspend calling task         */
/*      [TCT_Check_Stack]                   Stack checking function      */
/*      TCT_Control_To_System               Transfer control to system   */
/*      TCT_Current_Thread                  Pickup current thread pointer*/
/*      TCT_System_Protect                  Protect queue                */
/*      TCT_Unprotect                       Release protection           */
/*                                                                       */
/* INPUTS                                                                */
/*                                                                       */
/*      queue_ptr                           Queue control block pointer  */
/*      message                             Pointer to message to send   */
/*      size                                Size of message to send      */
/*      suspend                             Suspension option if full    */
/*                                                                       */
/* OUTPUTS                                                               */
/*                                                                       */
/*      NU_SUCCESS                          If service is successful     */
/*      NU_QUEUE_FULL                       If queue is currently full   */
/*      NU_TIMEOUT                          If timeout on service expires*/
/*      NU_QUEUE_DELETED                    If queue was deleted during  */
/*                                            suspension                 */
/*      NU_QUEUE_RESET                      If queue was reset during    */
/*                                            suspension                 */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         DATE                    REMARKS                               */
/*                                                                       */
/*      03-01-1993      Created initial version 1.0                      */
/*      04-19-1993      Verified version 1.0                             */
/*      03-01-1994      Changed function interfaces to                   */
/*                      match those in prototype,                        */
/*                      added register options, changed                  */
/*                      protection logic to reduce                       */
/*                      overhead, optimized copy loop,                   */
/*                      resulting in version 1.1                         */
/*                                                                       */
/*      03-18-1994      Verified version 1.1                             */
/*                                                                       */
/*************************************************************************/
STATUS  QUS_Send_To_Front_Of_Queue(NU_QUEUE *queue_ptr, VOID *message,
                                        UNSIGNED size, UNSIGNED suspend)
{

R1 QU_QCB      *queue;                      /* Queue control block ptr   */
QU_SUSPEND      suspend_block;              /* Allocate suspension block */
QU_SUSPEND     *suspend_ptr;                /* Pointer to suspend block  */
R3 UNSIGNED_PTR source;                     /* Pointer to source         */
R4 UNSIGNED_PTR destination;                /* Pointer to destination    */
UNSIGNED        copy_size;                  /* Partial copy size         */
R2 INT          i;                          /* Working counter           */
TC_TCB         *task;                       /* Task pointer              */
STATUS          preempt;                    /* Preempt flag              */
STATUS          status;                     /* Completion status         */
NU_SUPERV_USER_VARIABLES

    /* Switch to supervisor mode */
    NU_SUPERVISOR_MODE();

    /* Move input queue pointer into internal pointer.  */
    queue =  (QU_QCB *) queue_ptr;


#ifdef  NU_ENABLE_STACK_CHECK

    /* Call stack checking function to check for an overflow condition.  */
    TCT_Check_Stack();

#endif

#ifdef  NU_ENABLE_HISTORY

    /* Make an entry that corresponds to this function in the system history
       log.  */
    HIC_Make_History_Entry(NU_SEND_TO_FRONT_OF_QUEUE_ID, (UNSIGNED) queue,
                                        (UNSIGNED) message, (UNSIGNED) size);

#endif

    /* Initialize the status as successful.  */
    status =  NU_SUCCESS;

    /* Protect against simultaneous access to the queue.  */
    TCT_System_Protect();

    /* Determine if an extra word of overhead needs to be added to the
       calculation.  */
    if (queue -> qu_fixed_size)

        /* No overhead.  */
        i =  0;
    else
    {
        /* Variable messages have one additional word of overhead.  */
        i =  1;

        /* Make special check to see if a suspension needs to be
           forced for a variable length message.  */
        if ((queue -> qu_suspension_list) && (queue -> qu_messages))
        {

            /* Pickup task control block pointer.  */
            task =  (TC_TCB *) TCT_Current_Thread();

            /* Now we know that there are other task(s) are suspended trying
               to send a variable length message.  Determine whether or not
               a suspension should be forced.  */
            if ((queue -> qu_fifo_suspend) ||
                (suspend == NU_NO_SUSPEND) ||
                ((queue -> qu_suspension_list) -> qu_suspend_link.cs_priority <=
                                                    TCC_Task_Priority(task)))

                /* Bump the computed size to avoid placing the new variable
                   length message ahead of the suspended tasks.  */
                i =  (INT) queue -> qu_available;
        }
    }

    /* Determine if there is enough room in the queue for the message.  */
    if (queue -> qu_available < (size + i))
    {

        /* Queue does not have room for the message.  Determine if
           suspension is required.  */
        if (suspend)
        {

            /* Suspension is requested.   */

            /* Increment the number of tasks waiting.  */
            queue -> qu_tasks_waiting++;

#ifdef INCLUDE_PROVIEW
            _RTProf_DumpQueue(RT_PROF_SEND_TO_FRONT_OF_QUEUE,queue,RT_PROF_WAIT);
#endif

            /* Setup the suspend block and suspend the calling task.  */
            suspend_ptr =  &suspend_block;
            suspend_ptr -> qu_queue =                    queue;
            suspend_ptr -> qu_suspend_link.cs_next =     NU_NULL;
            suspend_ptr -> qu_suspend_link.cs_previous = NU_NULL;
            suspend_ptr -> qu_message_area =             (UNSIGNED_PTR) message;
            suspend_ptr -> qu_message_size =             size;
            task =                            (TC_TCB *) TCT_Current_Thread();
            suspend_ptr -> qu_suspended_task =           task;

            /* Place the task on the urgent message suspension list.  */
            CSC_Place_On_List((CS_NODE **) &(queue -> qu_urgent_list),
                                        &(suspend_ptr -> qu_suspend_link));

            /* Move the head pointer of the list to make this suspension the
               first in the list.  */
            queue -> qu_urgent_list =  (QU_SUSPEND *)
                (queue -> qu_urgent_list) -> qu_suspend_link.cs_previous;

            /* Finally, suspend the calling task. Note that the suspension call
               automatically clears the protection on the queue.  */
            TCC_Suspend_Task((NU_TASK *) task, NU_QUEUE_SUSPEND,
                                        QUC_Cleanup, suspend_ptr, suspend);

            /* Pickup the return status.  */
            status =  suspend_ptr -> qu_return_status;
        }
        else
        {

            /* Return a status of NU_QUEUE_FULL because there is no
               room in the queue for the message.  */
            status =  NU_QUEUE_FULL;

#ifdef INCLUDE_PROVIEW
            _RTProf_DumpQueue(RT_PROF_SEND_TO_FRONT_OF_QUEUE,queue,RT_PROF_FAIL);
#endif
        }
    }
    else
    {

        /* Determine if a task is waiting on an empty queue.  */
        if ((queue -> qu_suspension_list) && (queue -> qu_messages == 0))
        {

            /* Task is waiting on queue for a message.  */

            /* Decrement the number of tasks waiting on queue.  */
            queue -> qu_tasks_waiting--;

#ifdef INCLUDE_PROVIEW
            _RTProf_DumpQueue(RT_PROF_SEND_TO_FRONT_OF_QUEUE,queue,RT_PROF_OK);
#endif

            /* Remove the first suspended block from the list.  */
            suspend_ptr =  queue -> qu_suspension_list;
            CSC_Remove_From_List((CS_NODE **) &(queue -> qu_suspension_list),
                                          &(suspend_ptr -> qu_suspend_link));

            /* Setup the source and destination pointers.  */
            source =       (UNSIGNED_PTR) message;
            destination =  suspend_ptr -> qu_message_area;

            /* Initialize the return status.  */
            suspend_ptr -> qu_return_status =  NU_SUCCESS;

            /* Loop to actually copy the message.  */
            i =  (INT) size;
            do
            {
                *(destination++) =  *(source);
                if ((--i) == 0)
                    break;
                source++;
            } while (1);

            /* Return the size of the message copied.  */
            suspend_ptr -> qu_actual_size =  size;

            /* Wakeup the waiting task and check for preemption.  */
            preempt =
                TCC_Resume_Task((NU_TASK *) suspend_ptr -> qu_suspended_task,
                                                           NU_QUEUE_SUSPEND);

            /* Determine if preemption needs to take place. */
            if (preempt)

                 /* Transfer control to the system if the resumed task function
                   detects a preemption condition.  */
                TCT_Control_To_System();
        }
        else
        {

            /* There is enough room in the queue and no task is waiting.  */

            /* Setup the source pointer.  */
            source =       (UNSIGNED_PTR) message;
            destination =  queue -> qu_read;

            /* Process according to the type of message supported.  */
            if (queue -> qu_fixed_size)
            {

                /* Fixed-size message queue.  */

                /* Determine if the read pointer is at the top of the queue
                   area.  */
                if (destination == queue -> qu_start)

                    /* Prepare to place the message in the lower part
                       of the queue area.  */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲bt欧美bt精品| 欧美日韩一区二区三区免费看 | 中文字幕乱码久久午夜不卡| 中文字幕在线不卡| 日本成人在线网站| 99re66热这里只有精品3直播| 精品视频123区在线观看| 亚洲欧美电影院| 成人爽a毛片一区二区免费| 亚洲精品一区二区三区在线观看 | 日韩精品专区在线影院重磅| 亚洲一区二区五区| 9191久久久久久久久久久| 一区二区三区不卡视频| 一本高清dvd不卡在线观看| 亚洲九九爱视频| 欧美日韩国产在线观看| 久久精品国产免费| 亚洲免费在线播放| 一区二区三区欧美日韩| 国产精品系列在线观看| 欧美性猛交xxxxxx富婆| 亚洲精品自拍动漫在线| 国产91丝袜在线观看| 日韩一区二区免费电影| 国产91在线观看| 天堂va蜜桃一区二区三区漫画版| 精品免费99久久| 欧美伊人久久久久久久久影院 | 国产成人av在线影院| 99国产精品久| 精品国产免费人成在线观看| 国产精品久久久久9999吃药| 国产精选一区二区三区| 亚洲美腿欧美偷拍| 久久久精品天堂| 成人国产视频在线观看| 性久久久久久久久久久久| 日韩一区二区三区精品视频| 宅男在线国产精品| 久久影院电视剧免费观看| 欧美刺激午夜性久久久久久久| 粉嫩在线一区二区三区视频| 26uuu精品一区二区在线观看| 天使萌一区二区三区免费观看| 在线观看国产一区二区| 一区二区三区四区av| 色婷婷国产精品| 亚洲在线视频一区| 在线观看日产精品| 亚洲国产精品视频| 欧美猛男gaygay网站| 日韩av一区二区在线影视| 欧美人伦禁忌dvd放荡欲情| 亚洲a一区二区| 日韩精品中文字幕在线不卡尤物| 美女一区二区三区| 欧美成人官网二区| 国产一区二区不卡在线| 国产欧美精品一区| 五月婷婷久久丁香| 亚洲精品在线免费观看视频| 国产精品久久久久久久裸模| av成人免费在线观看| 一区二区三区视频在线看| 欧美美女一区二区在线观看| 琪琪久久久久日韩精品| 欧美xxx久久| 成人免费看片app下载| 亚洲天堂2014| 欧美日韩高清一区二区不卡 | 欧美三级在线看| 午夜精品久久一牛影视| 欧美一区二区精品在线| 国产精品一区在线观看你懂的| 国产精品免费观看视频| 欧美性videosxxxxx| 青草国产精品久久久久久| 国产亚洲精品7777| 色婷婷av一区二区| 男人的j进女人的j一区| 久久精品一区二区三区不卡牛牛| 99在线精品免费| 亚洲一区二区影院| 欧美精品一区男女天堂| 91亚洲国产成人精品一区二区三| 亚洲国产一区在线观看| 日韩精品一区二区三区四区| 懂色中文一区二区在线播放| 一区二区三区日韩| www国产精品av| 色哟哟国产精品| 麻豆精品在线播放| 国产精品福利一区二区三区| 欧美精品在线视频| 不卡一区二区中文字幕| 日韩电影在线免费看| 中文字幕日韩一区| 日韩欧美亚洲一区二区| 99精品欧美一区| 久久99国产精品麻豆| 亚洲欧美日韩久久精品| 26uuu久久天堂性欧美| 欧美在线观看一二区| 国产一区二区女| 性做久久久久久免费观看欧美| 久久精品一区二区三区不卡| 欧美高清一级片在线| 成人影视亚洲图片在线| 日韩av二区在线播放| 亚洲天堂av老司机| 久久九九国产精品| 91麻豆精品国产91久久久久久| 成人一区在线看| 久久99国产精品麻豆| 亚洲综合激情网| 国产精品美女久久久久aⅴ| 91精品国产入口| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 717成人午夜免费福利电影| 成人av在线资源网| 久久 天天综合| 午夜精品久久久久| 日韩一区在线看| 久久精品免费在线观看| 日韩欧美高清一区| 欧美三级乱人伦电影| 99视频精品在线| 国产成人av电影在线观看| 日本不卡的三区四区五区| 一区二区三区国产| 国产精品福利在线播放| 国产色产综合色产在线视频| 日韩欧美在线123| 亚洲伊人色欲综合网| 韩国欧美国产一区| 欧美大黄免费观看| 天天色综合成人网| 色一区在线观看| 亚洲免费av高清| 欧美日韩一二三| 丁香网亚洲国际| 懂色av噜噜一区二区三区av| 国产福利一区二区| 国产99精品在线观看| 国产99精品视频| 丰满白嫩尤物一区二区| 91免费观看视频在线| 一本色道久久综合精品竹菊| 51午夜精品国产| 欧美日韩精品综合在线| 在线播放中文一区| 久久综合九色综合久久久精品综合 | 国产精品久久久久久久久免费丝袜 | 亚洲一区二区三区爽爽爽爽爽| 狠狠久久亚洲欧美| 中文字幕在线不卡一区| 国产精品九色蝌蚪自拍| 亚洲综合激情另类小说区| 免费观看一级特黄欧美大片| 三级不卡在线观看| 三级一区在线视频先锋| 国产精品亚洲视频| 色999日韩国产欧美一区二区| 7777精品伊人久久久大香线蕉最新版| 欧美亚洲高清一区| 不卡视频免费播放| 国产精品免费av| 欧美日韩精品一二三区| 色综合久久久久久久久| 日韩欧美在线综合网| 国产精品不卡视频| 日本大胆欧美人术艺术动态| 精品午夜一区二区三区在线观看| 日韩黄色免费电影| 国产精品久久久久久久久果冻传媒 | 青娱乐精品在线视频| 久久精品亚洲精品国产欧美 | 日日骚欧美日韩| 日韩一区日韩二区| 精品免费一区二区三区| 26uuu精品一区二区| 日韩精品自拍偷拍| 91精品国产色综合久久久蜜香臀| 欧美亚洲一区二区在线| aaa亚洲精品一二三区| 亚洲一区二三区| 综合电影一区二区三区 | 欧美一区2区视频在线观看| 99久久婷婷国产| 欧美色综合影院| 欧美日韩免费一区二区三区视频 | 成人白浆超碰人人人人| 免费久久99精品国产| 日韩电影免费在线观看网站| 亚洲444eee在线观看| 日韩中文字幕区一区有砖一区| 亚洲高清三级视频| 最新久久zyz资源站| 欧美高清在线精品一区|