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

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

?? smc.c

?? 基于OMAP1510的Nucleus移植代碼
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*                                                                       */
/* 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, resulting in                           */
/*                      version 1.1                                      */
/*                                                                       */
/*      03-18-1994      Verified version 1.1                             */
/*                                                                       */
/*************************************************************************/
STATUS  SMC_Delete_Semaphore(NU_SEMAPHORE *semaphore_ptr)
{

R1 SM_SCB      *semaphore;                  /* Semaphore control blk ptr */
SM_SUSPEND     *suspend_ptr;                /* Suspend block pointer     */
SM_SUSPEND     *next_ptr;                   /* Next suspend block        */
STATUS          preempt;                    /* Status for resume call    */
NU_SUPERV_USER_VARIABLES

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

    /* Move input semaphore pointer into internal pointer.  */
    semaphore =  (SM_SCB *) semaphore_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_DELETE_SEMAPHORE_ID, (UNSIGNED) semaphore,
                                        (UNSIGNED) 0, (UNSIGNED) 0);

#endif

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

#ifdef INCLUDE_PROVIEW
    _RTProf_DumpSema(RT_PROF_DELETE_SEMAPHORE,semaphore, RT_PROF_OK);
#endif

    /* Clear the semaphore ID.  */
    semaphore -> sm_id =  0;

    /* Release protection.  */
    TCT_Unprotect();

    /* Protect against access to the list of created semaphores.  */
    TCT_Protect(&SMD_List_Protect);

    /* Remove the semaphore from the list of created semaphores.  */
    CSC_Remove_From_List(&SMD_Created_Semaphores_List,
                                        &(semaphore -> sm_created));

    /* Decrement the total number of created semaphores.  */
    SMD_Total_Semaphores--;

    /* Pickup the suspended task pointer list.  */
    suspend_ptr =  semaphore -> sm_suspension_list;

    /* Walk the chain task(s) currently suspended on the semaphore.  */
    preempt =  0;
    while (suspend_ptr)
    {

        /* Protect against system access.  */
        TCT_System_Protect();

        /* Resume the suspended task.  Insure that the status returned is
           NU_SEMAPHORE_DELETED.  */
        suspend_ptr -> sm_return_status =  NU_SEMAPHORE_DELETED;

        /* Point to the next suspend structure in the link.  */
        next_ptr =  (SM_SUSPEND *) (suspend_ptr -> sm_suspend_link.cs_next);

        /* Resume the specified task.  */
        preempt =  preempt |
            TCC_Resume_Task((NU_TASK *) suspend_ptr -> sm_suspended_task,
                                                NU_SEMAPHORE_SUSPEND);

        /* Determine if the next is the same as the current pointer.  */
        if (next_ptr == semaphore -> sm_suspension_list)

            /* Clear the suspension pointer to signal the end of the list
               traversal.  */
            suspend_ptr =  NU_NULL;
        else

            /* Move the next pointer into the suspend block pointer.  */
            suspend_ptr =  next_ptr;

        /* Modify current protection.  */
        TCT_Set_Current_Protect(&SMD_List_Protect);

        /* Clear the system protection.  */
        TCT_System_Unprotect();
    }

    /* Determine if preemption needs to occur.  */
    if (preempt)

        /* Transfer control to system to facilitate preemption.  */
        TCT_Control_To_System();

    /* Release protection against access to the list of created semaphores. */
    TCT_Unprotect();

    /* Return to user mode */
    NU_USER_MODE();

    /* Return a successful completion.  */
    return(NU_SUCCESS);
}


/*************************************************************************/
/*                                                                       */
/* FUNCTION                                                              */
/*                                                                       */
/*      SMC_Obtain_Semaphore                                             */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This function obtains an instance of the semaphore.  An instance */
/*      corresponds to decrementing the counter by 1.  If the counter is */
/*      greater than zero at the time of this call, this function can be */
/*      completed immediately.  Otherwise, suspension is possible.       */
/*                                                                       */
/* CALLED BY                                                             */
/*                                                                       */
/*      Application                                                      */
/*      SMCE_Obtain_Semaphore               Error checking shell         */
/*                                                                       */
/* CALLS                                                                 */
/*                                                                       */
/*      CSC_Place_On_List                   Place on suspend list        */
/*      CSC_Priority_Place_On_List          Place on priority list       */
/*      [HIC_Make_History_Entry]            Make entry in history log    */
/*      TCC_Suspend_Task                    Suspend calling task         */
/*      TCC_Task_Priority                   Obtain task's priority       */
/*      [TCT_Check_Stack]                   Stack checking function      */
/*      TCT_Current_Thread                  Pickup current thread pointer*/
/*      TCT_System_Protect                  Protect semaphore            */
/*      TCT_Unprotect                       Release protection           */
/*                                                                       */
/* INPUTS                                                                */
/*                                                                       */
/*      semaphore_ptr                       Semaphore control block ptr  */
/*      suspend                             Suspension option if full    */
/*                                                                       */
/* OUTPUTS                                                               */
/*                                                                       */
/*      NU_SUCCESS                          If service is successful     */
/*      NU_UNAVAILABLE                      If an instance of the        */
/*                                            semaphore is not available */
/*      NU_TIMEOUT                          If timeout on service        */
/*      NU_SEMAPHORE_DELETED                If semaphore deleted during  */
/*                                            suspension                 */
/*      NU_SEMAPHORE_RESET                  If semaphore 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, resulting in                           */
/*                      version 1.1                                      */
/*                                                                       */
/*      03-18-1994      Verified version 1.1                             */
/*                                                                       */
/*************************************************************************/
STATUS  SMC_Obtain_Semaphore(NU_SEMAPHORE *semaphore_ptr,  UNSIGNED suspend)
{

R1 SM_SCB      *semaphore;                  /* Semaphore control blk ptr */
R2 SM_SUSPEND  *suspend_ptr;                /* Suspend block pointer     */
SM_SUSPEND      suspend_block;              /* Allocate suspension block */
TC_TCB         *task;                       /* Task pointer              */
STATUS          status;                     /* Completion status         */
NU_SUPERV_USER_VARIABLES

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

    /* Move input semaphore pointer into internal pointer.  */
    semaphore =  (SM_SCB *) semaphore_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_OBTAIN_SEMAPHORE_ID, (UNSIGNED) semaphore,
                                        (UNSIGNED) suspend, (UNSIGNED) 0);

#endif

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

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

    /* Determine if the semaphore has an instance (can be decremented).  */
    if (semaphore -> sm_semaphore_count)
    {

        /* Semaphore available.  Decrement and return to the caller.  */
        semaphore -> sm_semaphore_count--;
#ifdef INCLUDE_PROVIEW
        _RTProf_DumpSema(RT_PROF_OBTAIN_SEMAPHORE,semaphore, RT_PROF_OK);
#endif

    }
    else
    {

        /* Semaphore is not available.  Determine if suspension is required. */
        if (suspend)
        {

            /* Suspension is selected.  */

            /* Increment the number of tasks waiting.  */
            semaphore -> sm_tasks_waiting++;

#ifdef INCLUDE_PROVIEW
            _RTProf_DumpSema(RT_PROF_OBTAIN_SEMAPHORE,semaphore , RT_PROF_WAIT);
#endif

            /* Setup the suspend block and suspend the calling task.  */
            suspend_ptr =  &suspend_block;
            suspend_ptr -> sm_semaphore =                semaphore;
            suspend_ptr -> sm_suspend_link.cs_next =     NU_NULL;
            suspend_ptr -> sm_suspend_link.cs_previous = NU_NULL;
            task =                            (TC_TCB *) TCT_Current_Thread();
            suspend_ptr -> sm_suspended_task =           task;

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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产精品露脸对白| 国产经典欧美精品| 亚洲精品五月天| 国产偷国产偷精品高清尤物| 5858s免费视频成人| 欧美性一二三区| 欧美三级蜜桃2在线观看| 一本到高清视频免费精品| 91亚洲永久精品| 盗摄精品av一区二区三区| 成人黄色av电影| voyeur盗摄精品| 欧美中文字幕一区二区三区| 欧美色中文字幕| 在线综合亚洲欧美在线视频| 欧美一级专区免费大片| 亚洲精品一区二区三区影院| 久久久久久久久久久99999| 国产日韩欧美不卡| 亚洲天堂成人网| 亚洲第一成人在线| 极品少妇xxxx精品少妇| 成人精品免费看| 色婷婷综合久色| 欧美一级片在线观看| 国产欧美一区二区精品仙草咪| 专区另类欧美日韩| 日韩精品色哟哟| 韩国精品一区二区| 色婷婷激情一区二区三区| 欧美色图激情小说| 国产午夜精品一区二区三区四区| 久久婷婷综合激情| 成人免费在线播放视频| 日韩和欧美一区二区三区| 琪琪一区二区三区| 97久久人人超碰| 亚洲精品在线观| 亚洲成人一区二区在线观看| 国产精品自在欧美一区| 欧美色成人综合| 中文字幕日韩一区| 激情综合五月天| 欧美日韩在线播放三区四区| 国产亚洲欧美日韩日本| 香蕉加勒比综合久久| 粉嫩在线一区二区三区视频| 欧美精品视频www在线观看| 国产精品久久久久久亚洲毛片| 午夜国产不卡在线观看视频| 成人午夜电影久久影院| 欧美一区二区高清| 亚洲一二三四区不卡| 菠萝蜜视频在线观看一区| 欧美一区二区三区的| 亚洲精品一二三| jlzzjlzz亚洲女人18| 久久久久久亚洲综合| 日本美女视频一区二区| 欧美丝袜丝交足nylons图片| 中文字幕+乱码+中文字幕一区| 日本不卡的三区四区五区| 色噜噜狠狠成人网p站| 国产精品国产三级国产普通话蜜臀| 麻豆国产精品777777在线| 欧美日韩视频专区在线播放| 亚洲欧美日韩国产综合在线| 成人午夜在线免费| 精品国产精品一区二区夜夜嗨| 午夜精品福利在线| 在线不卡欧美精品一区二区三区| 亚洲综合丝袜美腿| 在线亚洲精品福利网址导航| 国产精品国产三级国产| 不卡av电影在线播放| 亚洲欧洲成人精品av97| www.视频一区| 亚洲免费在线视频| 欧美最猛黑人xxxxx猛交| 一区二区三区蜜桃网| 色欧美日韩亚洲| 一区二区三区四区不卡视频| 色呦呦国产精品| 亚洲电影激情视频网站| 337p亚洲精品色噜噜噜| 久久福利资源站| 久久九九久精品国产免费直播| 国产精品影视在线| 欧美国产精品久久| 91高清在线观看| 视频一区视频二区中文| 亚洲精品一区二区在线观看| 国产福利不卡视频| 亚洲美女淫视频| 91超碰这里只有精品国产| 久久69国产一区二区蜜臀| 久久精品亚洲麻豆av一区二区| gogo大胆日本视频一区| 亚洲综合小说图片| 精品区一区二区| 91性感美女视频| 日韩和的一区二区| 国产午夜精品在线观看| 日本电影亚洲天堂一区| 日本中文在线一区| 国产精品午夜春色av| 精品视频在线看| 国产综合久久久久久久久久久久| 国产精品久线在线观看| 在线成人午夜影院| 福利91精品一区二区三区| 亚洲一区影音先锋| 国产调教视频一区| 欧美日韩激情一区二区| 国产激情一区二区三区四区| 夜夜精品浪潮av一区二区三区| www激情久久| 欧美日韩一区二区三区四区 | 亚洲成在线观看| wwww国产精品欧美| 在线免费av一区| 国产成人99久久亚洲综合精品| 亚洲成人福利片| 国产精品久久久久三级| 欧美精品一区二区精品网| 色综合久久99| 成人动漫一区二区| 九九精品视频在线看| 亚洲第一在线综合网站| 日韩理论电影院| 欧美激情一区二区三区在线| 91精品国产黑色紧身裤美女| 色综合网站在线| 波多野结衣91| 懂色av中文字幕一区二区三区 | 亚洲第一在线综合网站| 国产精品不卡在线| 国产色一区二区| 久久精品夜夜夜夜久久| 久久综合久久鬼色中文字| 欧美日韩成人一区二区| 欧洲中文字幕精品| 91蜜桃在线观看| 91日韩一区二区三区| 东方aⅴ免费观看久久av| 精品一区二区三区av| 日本亚洲天堂网| 欧美aⅴ一区二区三区视频| 亚洲成人你懂的| 日韩中文字幕91| 男人的天堂亚洲一区| 日本欧美在线观看| 免费国产亚洲视频| 免费观看在线综合色| 久久99久久99精品免视看婷婷| 欧美aaa在线| 韩国视频一区二区| 国产精品亚洲视频| 不卡的av网站| 一本一道久久a久久精品综合蜜臀| caoporn国产一区二区| 99精品久久99久久久久| 色综合久久六月婷婷中文字幕| 日本国产一区二区| 欧美精品 日韩| 精品国产伦一区二区三区免费| 精品国产一区二区三区不卡| 26uuu亚洲| 成人欧美一区二区三区1314| 一区二区不卡在线播放 | 欧美一级在线免费| 久久一区二区三区四区| 亚洲国产精品二十页| 亚洲欧美日韩在线| 首页欧美精品中文字幕| 国产精品一区二区果冻传媒| 成人精品亚洲人成在线| 欧美日韩mp4| 国产欧美日韩在线视频| 一区二区三区不卡在线观看| 日韩黄色片在线观看| 国产不卡视频在线观看| 在线观看一区二区精品视频| 777欧美精品| 国产精品久久久久久久久快鸭| 夜夜嗨av一区二区三区网页 | 在线91免费看| 久久久久亚洲综合| 亚洲国产精品影院| 国产在线精品一区二区夜色| 99re66热这里只有精品3直播| 欧美美女网站色| 国产精品乱码一区二区三区软件 | 日韩欧美综合在线| 中文字幕在线不卡一区| 日产欧产美韩系列久久99| 99久久久国产精品| www久久精品| 日本午夜一区二区| 99国产精品久久久久久久久久|