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

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

?? pic.c

?? nucleas source code
?? C
?? 第 1 頁 / 共 5 頁
字號(hào):
    /* 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_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 make 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_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;

            /* Determine if priority or FIFO suspension is associated with the
               pipe.  */
            if (pipe -> pi_fifo_suspend)
            {

                /* FIFO suspension is required.  Link the suspend block into
                   the list of suspended tasks on this pipe.  */
                CSC_Place_On_List((CS_NODE **) &(pipe -> pi_suspension_list),
                                        &(suspend_ptr -> pi_suspend_link));
            }
            else
            {

                /* Get the priority of the current thread so the suspend block
                   can be placed in the appropriate place.  */
                suspend_ptr -> pi_suspend_link.cs_priority =
                                                    TCC_Task_Priority(task);

                CSC_Priority_Place_On_List((CS_NODE **)
                                &(pipe -> pi_suspension_list),
                                        &(suspend_ptr -> pi_suspend_link));
            }

            /* 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_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_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_write;

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

                /* Fixed-size messages are supported by this pipe.  */

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

                /* Variable-size messages are supported.  Processing must
                   check for pipe wrap-around conditions.  */

                /* Place message size in first location.  */
                *((UNSIGNED *) destination) =  size;
                destination =  destination + sizeof(UNSIGNED);

                /* Check for a wrap-around condition on the pipe.  */
                if (destination >= pipe -> pi_end)

                    /* Wrap the write pointer back to the top of the pipe
                       area.  */
                    destination =  pipe -> pi_start;

                /* Decrement the number of bytes remaining for this
                   extra word of overhead.  */
                pipe -> pi_available =  pipe -> pi_available -
                                                        sizeof(UNSIGNED);

                /* Calculate the number of bytes remaining from the write
                   pointer to the bottom of the pipe.  */
                copy_size =  pipe -> pi_end - destination;

                /* Determine if the message needs to be wrapped around the
                   edge of the pipe area.  */
                if (copy_size >= size)
                {

                    /* Copy the whole message at once.  */
                    i =  (INT) size;
                    do
                    {
                        *(destination++) =  *(source);
                        if ((--i) == 0)
                            break;
                        source++;
                    } while (1);
                }
                else
                {

                    /* Copy the first half of the message.  */
                    i =  (INT) copy_size;
                    do
                    {
                        *(destination) =  *(source++);
                        if ((--i) == 0)
                            break;
                        destination++;
                    } while (1);

                    /* Copy the second half of the message.  */
                    destination =  pipe -> pi_start;
                    i =  (INT) (size - copy_size);
                    do
                    {
                        *(destination++) =  *(source);
                        if ((--i) ==  0)
                            break;
                        source++;
                    } while (1);
                }
            }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一级精品视频在线观看宜春院| 精品成a人在线观看| 中文字幕欧美区| 国产91精品在线观看| 91精品国产色综合久久不卡蜜臀| 精品久久免费看| 精品一区二区三区免费视频| 日韩欧美黄色影院| 久久er精品视频| 国产精品毛片无遮挡高清| 成人av小说网| 一区二区三区四区乱视频| 91美女片黄在线| 婷婷久久综合九色综合绿巨人 | 欧美色精品天天在线观看视频| 欧美酷刑日本凌虐凌虐| 亚洲h动漫在线| 日韩美女主播在线视频一区二区三区| 国产精品美女久久久久久久久| 性欧美疯狂xxxxbbbb| 欧美大片免费久久精品三p| 国产麻豆午夜三级精品| 尤物av一区二区| 7777精品伊人久久久大香线蕉的 | 国产精品免费网站在线观看| 成人18视频在线播放| 亚洲精品高清视频在线观看| 欧美日韩国产综合视频在线观看| 国产精品久99| 欧美老人xxxx18| 国产精品亚洲一区二区三区在线| 欧美日韩成人激情| 国产精品一区久久久久| 亚洲精品日韩一| 欧美不卡在线视频| 在线日韩一区二区| 国产精品一区二区视频| 亚洲国产aⅴ成人精品无吗| 久久午夜免费电影| 欧美日韩免费一区二区三区 | 亚洲va国产天堂va久久en| 日韩亚洲欧美在线| 91蝌蚪porny九色| 老司机免费视频一区二区| 亚洲同性gay激情无套| 日韩欧美色电影| 色999日韩国产欧美一区二区| 亚洲丝袜美腿综合| 日韩一区二区三区电影 | 一区二区中文字幕在线| 7799精品视频| 欧日韩精品视频| 91在线视频免费观看| 国产一区久久久| 日韩黄色免费网站| 亚洲午夜电影在线观看| 综合中文字幕亚洲| 中文字幕+乱码+中文字幕一区| 国产精品影视网| 精品一区二区久久| 日日摸夜夜添夜夜添亚洲女人| 欧美酷刑日本凌虐凌虐| 91小视频免费看| 成人午夜激情视频| 国产成人免费视频一区| 另类小说欧美激情| 日本欧美肥老太交大片| 亚洲精品网站在线观看| 最新久久zyz资源站| 国产亚洲一区二区三区在线观看| 懂色av一区二区三区蜜臀| 免费一级片91| 日韩一区精品字幕| 天天影视色香欲综合网老头| 亚洲自拍偷拍麻豆| 亚洲一区在线电影| 亚洲午夜电影在线观看| 一区二区三区免费| 亚洲国产wwwccc36天堂| 一区二区三区不卡在线观看 | 欧美精品tushy高清| 在线观看视频一区二区| 色88888久久久久久影院野外 | 亚洲国产aⅴ成人精品无吗| 亚洲男帅同性gay1069| 国产精品色眯眯| 国产精品视频麻豆| 亚洲欧洲在线观看av| 亚洲欧美另类小说| 亚洲黄网站在线观看| 香港成人在线视频| 免费精品视频最新在线| 国产一区二区三区观看| 成人午夜av在线| 色综合色狠狠天天综合色| 色久综合一二码| 欧美久久一二三四区| 日韩精品中文字幕一区二区三区 | 午夜精品久久久久久久久| 一区二区三区免费网站| 午夜久久久影院| 人人狠狠综合久久亚洲| 国产一区二区三区四| 国v精品久久久网| 欧美性感一类影片在线播放| 日韩视频免费观看高清完整版 | 亚洲bt欧美bt精品| 日韩精品久久久久久| 国产乱码精品一品二品| 99久久99久久久精品齐齐 | 韩国三级在线一区| 国产成a人无v码亚洲福利| 成人在线视频首页| 在线免费不卡电影| 欧美白人最猛性xxxxx69交| 国产精品成人一区二区三区夜夜夜| 日韩欧美一卡二卡| 中文字幕精品综合| 亚洲精品第一国产综合野| 免费欧美在线视频| 91丝袜美女网| www国产亚洲精品久久麻豆| 亚洲欧美另类图片小说| 麻豆91精品91久久久的内涵| 成人午夜在线视频| 91精品婷婷国产综合久久性色| 91老师国产黑色丝袜在线| 日韩欧美中文字幕公布| 亚洲欧洲www| 精品在线观看免费| 91美女视频网站| 精品国产三级a在线观看| 亚洲三级在线观看| 国产一区二区三区在线观看免费视频| 日韩精品久久久久久| 国产成人免费视频精品含羞草妖精| 久久99热99| 在线欧美小视频| 久久久国产精品午夜一区ai换脸| 欧美一区二区二区| 国产精品福利一区| 久久成人麻豆午夜电影| 欧美日韩国产在线播放网站| 国产精品另类一区| 国产一区二区三区不卡在线观看| 韩国视频一区二区| 欧美视频一区二区| 成人免费一区二区三区视频| 美国精品在线观看| 欧美精品在线观看播放| 一区二区三区四区国产精品| 成人午夜短视频| 国产三级精品三级| 国产一区二区免费看| 日韩一区二区电影| 日日夜夜精品免费视频| 在线日韩国产精品| 一区二区三区四区av| 99精品视频免费在线观看| 国产三级精品三级在线专区| 国产一区二区三区免费播放| 欧美不卡一区二区| 经典一区二区三区| 欧美成人乱码一区二区三区| 日韩综合小视频| 欧美猛男超大videosgay| 亚洲午夜影视影院在线观看| 欧洲另类一二三四区| 亚洲美女少妇撒尿| 91福利视频久久久久| 亚洲一区二区四区蜜桃| 欧美性色欧美a在线播放| 夜夜操天天操亚洲| 欧美曰成人黄网| 水野朝阳av一区二区三区| 欧美高清一级片在线| 日日摸夜夜添夜夜添国产精品| 国产专区欧美精品| 久久久国产精品麻豆| 懂色av噜噜一区二区三区av| 日本一区二区视频在线观看| 岛国精品在线播放| 亚洲丝袜美腿综合| 欧美日韩免费电影| 麻豆精品在线观看| 久久久久久免费网| 99久久精品国产麻豆演员表| 亚洲激情自拍偷拍| 在线综合+亚洲+欧美中文字幕| 久久久天堂av| 99精品国产91久久久久久| 亚洲黄色免费网站| 91精品久久久久久久久99蜜臂| 国产清纯白嫩初高生在线观看91 | 日韩亚洲欧美高清| 国产精品456露脸| 亚洲欧洲av在线| 91精品在线观看入口| 国产精品456露脸| 亚洲高清视频中文字幕|