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

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

?? pis.c

?? nucleas source code
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*      PISE_Send_To_Front_Of_Pipe          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 pipe                 */
/*      TCT_Unprotect                       Release protection           */
/*                                                                       */
/* INPUTS                                                                */
/*                                                                       */
/*      pipe_ptr                            Pipe 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_PIPE_FULL                        If pipe is currently full    */
/*      NU_TIMEOUT                          If timeout on service expires*/
/*      NU_PIPE_DELETED                     If pipe was deleted during   */
/*                                            suspension                 */
/*      NU_PIPE_RESET                       If pipe 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  PIS_Send_To_Front_Of_Pipe(NU_PIPE *pipe_ptr, VOID *message,
                                        UNSIGNED size, UNSIGNED suspend)
{

R1 PI_PCB      *pipe;                       /* Pipe control block ptr    */
PI_SUSPEND      suspend_block;              /* Allocate suspension block */
PI_SUSPEND     *suspend_ptr;                /* Pointer to suspend block  */
R2 BYTE_PTR     source;                     /* Pointer to source         */
R3 BYTE_PTR     destination;                /* Pointer to destination    */
UNSIGNED        copy_size;                  /* Partial copy size         */
R4 INT          i;                          /* Working counter           */
UNSIGNED        pad = 0;                    /* Number of pad bytes       */
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 pipe pointer into internal pointer.  */
    pipe =  (PI_PCB *) pipe_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_PIPE_ID, (UNSIGNED) pipe,
                                        (UNSIGNED) message, (UNSIGNED) size);

#endif

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

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

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

        /* No overhead.  */
        i =  0;
    else
    {

        /* Variable messages have one additional word of overhead.  */
        i =  sizeof(UNSIGNED);

        /* Calculate the number of pad bytes necessary to keep the pipe
           write pointer on an UNSIGNED data element alignment.  */
        pad =  (((size + sizeof(UNSIGNED) - 1)/sizeof(UNSIGNED)) *
                        sizeof(UNSIGNED)) - size;

        /* Insure that padding is included in the overhead.  */
        i =  i + ((INT) pad);

        /* Make special check to see if a suspension needs to be
           forced for a variable length message.  */
        if ((pipe -> pi_suspension_list) && (pipe -> pi_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 ((pipe -> pi_fifo_suspend) ||
                (suspend == NU_NO_SUSPEND) ||
                ((pipe -> pi_suspension_list) -> pi_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) pipe -> pi_available;
        }
    }

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

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

            /* Suspension is requested.   */

            /* Increment the number of tasks waiting.  */
            pipe -> pi_tasks_waiting++;

#ifdef INCLUDE_PROVIEW
            _RTProf_DumpPipe(RT_PROF_SEND_TO_FRONT_OF_PIPE,pipe,RT_PROF_WAIT);
#endif /* INCLUDE_PROVIEW */

            /* Setup the suspend block and suspend the calling task.  */
            suspend_ptr =  &suspend_block;
            suspend_ptr -> pi_pipe =                     pipe;
            suspend_ptr -> pi_suspend_link.cs_next =     NU_NULL;
            suspend_ptr -> pi_suspend_link.cs_previous = NU_NULL;
            suspend_ptr -> pi_message_area =       (BYTE_PTR) message;
            suspend_ptr -> pi_message_size =             size;
            task =                            (TC_TCB *) TCT_Current_Thread();
            suspend_ptr -> pi_suspended_task =           task;

            /* Place the task on the urgent message suspension list.  */
            CSC_Place_On_List((CS_NODE **) &(pipe -> pi_urgent_list),
                                        &(suspend_ptr -> pi_suspend_link));

            /* Move the head pointer of the list to make this suspension the
               first in the list.  */
            pipe -> pi_urgent_list =  (PI_SUSPEND *)
                (pipe -> pi_urgent_list) -> pi_suspend_link.cs_previous;

            /* Finally, suspend the calling task. Note that the suspension call
               automatically clears the protection on the pipe.  */
            TCC_Suspend_Task((NU_TASK *) task, NU_PIPE_SUSPEND,
                                        PIC_Cleanup, suspend_ptr, suspend);

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

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

#ifdef INCLUDE_PROVIEW
            _RTProf_DumpPipe(RT_PROF_SEND_TO_FRONT_OF_PIPE,pipe,RT_PROF_FAIL);
#endif /* INCLUDE_PROVIEW */

        }
    }
    else
    {

        /* Determine if a task is waiting on an empty pipe.  */
        if ((pipe -> pi_suspension_list) && (pipe -> pi_messages == 0))
        {

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

            /* Decrement the number of tasks waiting on pipe.  */
            pipe -> pi_tasks_waiting--;

#ifdef INCLUDE_PROVIEW
        _RTProf_DumpPipe(RT_PROF_SEND_TO_FRONT_OF_PIPE,pipe,RT_PROF_OK);
#endif /* INCLUDE_PROVIEW */

            /* Remove the first suspended block from the list.  */
            suspend_ptr =  pipe -> pi_suspension_list;
            CSC_Remove_From_List((CS_NODE **) &(pipe -> pi_suspension_list),
                                          &(suspend_ptr -> pi_suspend_link));

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

            /* Initialize the return status.  */
            suspend_ptr -> pi_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 -> pi_actual_size =  size;

            /* Wakeup the waiting task and check for preemption.  */
            preempt =
                TCC_Resume_Task((NU_TASK *) suspend_ptr -> pi_suspended_task,
                                                     NU_PIPE_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 pipe and no task is waiting.  */

            /* Setup the source pointer.  */
            source =       (BYTE_PTR) message;
            destination =  pipe -> pi_read;

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

                /* Fixed-size message pipe.  */

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

                    /* Prepare to place the message in the lower part of the
                       pipe area.  */
                    destination =  pipe -> pi_end - size;
                else

                    /* Backup the length of the message from the current
                       read pointer.  */
                    destination =  destination - size;

                /* Adjust the actual read pointer before the copy is done.  */
                pipe -> pi_read =  destination;

                /* Copy the message into the pipe area.  */
                i =  (INT) size;
                do
                {
                    *(destination++) =  *(source);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美国产毛片在线| 日韩一区二区三区电影| 欧美日韩成人综合在线一区二区| 精品久久久久久亚洲综合网| 国产精品久久久久久久久晋中| 丝袜国产日韩另类美女| 色综合天天综合网天天狠天天| 日韩欧美一二三四区| 亚洲综合精品自拍| 9久草视频在线视频精品| 欧美成人r级一区二区三区| 亚洲在线一区二区三区| 94-欧美-setu| 国产欧美日韩三区| 激情国产一区二区| 911精品国产一区二区在线| 亚洲欧洲日产国码二区| 国产91丝袜在线播放九色| 91精品国产欧美日韩| 亚洲综合无码一区二区| 99国产精品国产精品久久| 国产喂奶挤奶一区二区三区| 日韩精品一级中文字幕精品视频免费观看| 亚洲一区二区不卡免费| 91视频免费播放| 《视频一区视频二区| 成人深夜福利app| 中文字幕不卡在线观看| 色天使久久综合网天天| 国产欧美精品在线观看| 国产一区二区在线观看视频| 日韩女优av电影在线观看| 蜜臀国产一区二区三区在线播放| 宅男在线国产精品| 老司机精品视频一区二区三区| 欧美日韩和欧美的一区二区| 午夜影院久久久| 欧美精品v日韩精品v韩国精品v| 亚洲成av人影院| 7777女厕盗摄久久久| 麻豆久久一区二区| 日韩三级视频在线观看| 国产一区二区三区在线观看精品| 久久久久国产精品麻豆| 国产1区2区3区精品美女| 国产精品高清亚洲| 在线观看一区日韩| 日本少妇一区二区| 国产欧美日韩在线视频| 91麻豆国产在线观看| 亚洲成人精品影院| 精品久久国产老人久久综合| 国产成人高清视频| 亚洲黄网站在线观看| 欧美性色综合网| 日韩精品乱码av一区二区| 亚洲精品在线三区| 99re这里只有精品视频首页| 亚洲午夜在线视频| 精品欧美一区二区三区精品久久 | 日韩欧美中文字幕一区| 国产一区美女在线| 一区视频在线播放| 3atv一区二区三区| 成人综合婷婷国产精品久久 | 午夜电影一区二区| xnxx国产精品| 色播五月激情综合网| 久久精品国产亚洲a| 国产精品成人免费在线| 欧美美女直播网站| 懂色av一区二区夜夜嗨| 丝袜亚洲另类欧美| 国产精品国产三级国产专播品爱网| 色av综合在线| 国产成人午夜高潮毛片| 亚洲午夜久久久久| 中文字幕免费不卡| 91精品国产欧美一区二区18| 99久久99久久久精品齐齐| 理论片日本一区| 亚洲成av人片www| 中文字幕一区二区三区四区不卡| 在线不卡欧美精品一区二区三区| 成人动漫视频在线| 激情成人午夜视频| 免费高清视频精品| 亚洲成人高清在线| 亚洲欧美日韩在线| 国产精品视频你懂的| 日韩欧美亚洲国产精品字幕久久久| 99久久精品国产毛片| 国产一区视频网站| 日本成人在线不卡视频| 亚洲一区二区在线播放相泽 | 欧美成人午夜电影| 欧美亚洲另类激情小说| 波多野结衣的一区二区三区| 精品一区免费av| 老色鬼精品视频在线观看播放| 亚洲在线视频网站| 一个色综合av| 亚洲精品日韩综合观看成人91| 欧美国产激情二区三区 | 国产资源在线一区| 精品一区二区三区在线观看| 日韩高清电影一区| 天堂久久一区二区三区| 亚洲国产日韩在线一区模特| 亚洲美女免费在线| 亚洲六月丁香色婷婷综合久久| 国产精品久久久久久妇女6080| 国产欧美一二三区| 久久色.com| 中文字幕二三区不卡| 国产欧美日韩久久| 中文字幕中文乱码欧美一区二区| 国产网红主播福利一区二区| 日本一二三不卡| 国产精品久久福利| 亚洲精品免费视频| 亚洲国产视频直播| 免费三级欧美电影| 狠狠色丁香婷婷综合| 国产aⅴ综合色| 99久久婷婷国产综合精品电影| 91女神在线视频| 欧洲av一区二区嗯嗯嗯啊| 欧美性受xxxx黑人xyx| 欧美性高清videossexo| 4438x成人网最大色成网站| 欧美一区二区免费| 国产午夜精品美女毛片视频| 中文一区二区完整视频在线观看| 1000精品久久久久久久久| 亚洲激情男女视频| 午夜亚洲国产au精品一区二区| 免费观看在线色综合| 欧美在线视频日韩| 日韩欧美在线1卡| 欧美国产一区视频在线观看| 亚洲美女免费视频| 麻豆极品一区二区三区| 国产成人精品免费一区二区| 91麻豆免费在线观看| 在线观看亚洲精品| 日韩欧美www| 国产精品久久久久久久第一福利| 一区二区免费在线播放| 捆绑调教美女网站视频一区| www.99精品| 欧美一区二区三区在线看| 欧美激情一区二区三区不卡| 亚洲午夜羞羞片| 国产成人日日夜夜| 欧美日韩日本视频| 国产欧美综合在线观看第十页| 亚洲地区一二三色| 成人免费高清视频| 69成人精品免费视频| 最新不卡av在线| 久久成人羞羞网站| 在线观看一区二区精品视频| 久久久久97国产精华液好用吗| 夜夜爽夜夜爽精品视频| 国产美女视频一区| 欧美高清激情brazzers| 国产精品久久久久久久久快鸭| 美女性感视频久久| 欧美亚洲一区三区| 中文字幕一区二区三区视频| 精品一区二区三区av| 欧美三级视频在线观看| 国产精品拍天天在线| 精品一区二区三区视频在线观看 | 国产精品亚洲综合一区在线观看| 色999日韩国产欧美一区二区| 26uuu亚洲综合色欧美 | 夜夜亚洲天天久久| av一二三不卡影片| 久久久高清一区二区三区| 亚洲成人av资源| 91黄色免费观看| 亚洲欧美在线视频| 成人在线综合网| 久久蜜桃av一区二区天堂| 免费人成精品欧美精品 | 国产91在线看| 国产欧美综合在线| 国产成人亚洲综合a∨婷婷| 日韩精品中文字幕在线不卡尤物| 亚洲丝袜自拍清纯另类| 不卡一区二区中文字幕| 日本一区二区三区国色天香| 国产米奇在线777精品观看| 久久先锋影音av鲁色资源| 精品在线一区二区| 国产日韩欧美综合在线| 国产高清精品网站| 国产清纯白嫩初高生在线观看91|