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

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

?? dms.c

?? nucleas source code
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*************************************************************************/
/*                                                                       */
/*               Copyright Mentor Graphics Corporation 2002              */
/*                         All Rights Reserved.                          */
/*                                                                       */
/* THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS  */
/* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS   */
/* SUBJECT TO LICENSE TERMS.                                             */
/*                                                                       */
/*************************************************************************/

/*************************************************************************/
/*                                                                       */
/* FILE NAME                                               VERSION       */
/*                                                                       */
/*      dms.c                                          Nucleus PLUS 1.14 */
/*                                                                       */
/* COMPONENT                                                             */
/*                                                                       */
/*      DM - Dynamic Memory Management                                   */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This file contains the supplemental routines for the Dynamic     */
/*      Memory Management component.                                     */
/*                                                                       */
/* DATA STRUCTURES                                                       */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* FUNCTIONS                                                             */
/*                                                                       */
/*      DMS_Allocate_Aligned_Memory         Allocate an aligned memory   */
/*                                            block from  a dynamic      */
/*                                            memory pool                */
/* DEPENDENCIES                                                          */
/*                                                                       */
/*      cs_extr.h                           Common Service functions     */
/*      tc_extr.h                           Thread Control functions     */
/*      dm_extr.h                           Partition functions          */
/*      hi_extr.h                           History functions            */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         DATE                    REMARKS                               */
/*                                                                       */
/*      01-15-1999      Created initial revision                         */
/*      03-26-1999      Released 1.11m (new release                      */
/*                        numbering scheme)                              */
/*      04-17-2002      Released version 1.13m                           */
/*      11-07-2002      Released version 1.14                            */
/*************************************************************************/
#define         NU_SOURCE_FILE

#include        "cs_extr.h"                 /* Common service functions  */
#include        "tc_extr.h"                 /* Thread control functions  */
#include        "dm_extr.h"                 /* Dynamic memory functions  */
#include        "hi_extr.h"                 /* History functions         */
#include        "profiler.h"                /* ProView interface         */


/* Define external inner-component global data references.  */


/* Define internal component function prototypes.  */
VOID    DMC_Cleanup(VOID *information);


/*************************************************************************/
/*                                                                       */
/* FUNCTION                                                              */
/*                                                                       */
/*      DMS_Allocate_Aligned_Memory                                      */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This function allocates memory from the specified dynamic memory */
/*      pool.  If dynamic memory is currently available, this function   */
/*      is completed immediately.  Otherwise, if there is not enough     */
/*      memory currently available, task suspension is possible.         */
/*                                                                       */
/* CALLED BY                                                             */
/*                                                                       */
/*      Application                                                      */
/*                                                                       */
/* CALLS                                                                 */
/*                                                                       */
/*      CSC_Place_On_List                   Place on suspend list        */
/*      [HIC_Make_History_Entry]            Make entry in history log    */
/*      TCC_Suspend_Task                    Suspend calling task         */
/*      TCC_Task_Priority                   Pickup task priority         */
/*      [TCT_Check_Stack]                   Stack checking function      */
/*      TCT_Current_Thread                  Pickup current thread pointer*/
/*      TCT_Protect                         Protect memory pool          */
/*      TCT_Set_Suspend_Protect             Save suspend protection      */
/*      TCT_System_Protect                  Protect system structures    */
/*      TCT_Unprotect                       Release protection           */
/*      TCT_Unprotect_Specific              Release specific protection  */
/*                                                                       */
/* INPUTS                                                                */
/*                                                                       */
/*      pool_ptr                            Memory pool pointer          */
/*      return_pointer                      Pointer to the destination   */
/*                                            memory pointer             */
/*      size                                Number of bytes requested    */
/*      alignment                           Required alignment of        */
/*                                            destination memory pointer */
/*      suspend                             Suspension option if full    */
/*                                                                       */
/* OUTPUTS                                                               */
/*                                                                       */
/*      NU_SUCCESS                          If service is successful     */
/*      NU_NO_MEMORY                        Memory not available         */
/*      NU_TIMEOUT                          If timeout on service        */
/*      NU_POOL_DELETED                     If memory pool deleted       */
/*                                            during suspension          */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         NAME            DATE                    REMARKS               */
/*                                                                       */
/*      T. Larsen       01-15-1999      Created initial revision         */
/*      R. Baum         06-06-2002      Fixed problem with DM_OVERHEAD   */
/*                                        allocation.  Added Proview     */
/*                                        support.                       */
/*                                                                       */
/*************************************************************************/
STATUS  DMS_Allocate_Aligned_Memory(NU_MEMORY_POOL *pool_ptr,
                                    VOID **return_pointer, UNSIGNED size,
                                    UNSIGNED alignment, UNSIGNED suspend)
{
R1 DM_PCB      *pool;                       /* Pool control block ptr    */
R2 DM_SUSPEND  *suspend_ptr;                /* Pointer to suspend block  */
DM_SUSPEND      suspend_block;              /* Allocate suspension block */
R4 DM_HEADER   *memory_ptr;                 /* Pointer to memory         */
R3 DM_HEADER   *new_ptr;                    /* New split block pointer   */
UNSIGNED        free_size;                  /* Size of block found       */
TC_TCB         *task;                       /* Task pointer              */
STATUS          status;                     /* Completion status         */
UNSIGNED        address;                    /* Address of start of block */
UNSIGNED        split_size;                 /* Bytes for front split     */
UNSIGNED        next_aligned;               /* Next aligned block addr   */
NU_SUPERV_USER_VARIABLES

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

    /* Move input pool pointer into internal pointer.  */
    pool =  (DM_PCB *) pool_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_ALLOCATE_ALIGNED_ID, (UNSIGNED) pool,
                        (UNSIGNED) return_pointer, (UNSIGNED) size);

#endif

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

    /* Adjust the request to a size evenly divisible by the number of bytes
       in an UNSIGNED data element.  Also, check to make sure it is of the
       minimum size.  */
    if (size < pool -> dm_min_allocation)

        /* Change size to the minimum allocation.  */
        size =  pool -> dm_min_allocation;
    else

        /* Insure that size is a multiple of the UNSIGNED size.  */
        size =
           ((size + sizeof(UNSIGNED) - 1)/sizeof(UNSIGNED)) * sizeof(UNSIGNED);

    /* Adjust the requested alignment to one evenly divisible by the number of
       bytes in an UNSIGNED data element. */
    alignment =
        ((alignment + sizeof(UNSIGNED) - 1)/sizeof(UNSIGNED)) * sizeof(UNSIGNED);

    /* Protect against simultaneous access to the memory pool.  */
    TCT_Protect(&(pool -> dm_protect));

    /* Search the memory list for the first available block of memory that
       satisfies the request.  Note that blocks are merged during the
       deallocation function.  */
    memory_ptr =  pool -> dm_search_ptr;
    do
    {

        /* Determine if the block is free and if it can satisfy the request. */
        if (memory_ptr -> dm_memory_free)

            /* Calculate the free block size.  */
            free_size =  (((BYTE_PTR) (memory_ptr -> dm_next_memory)) -
                           ((BYTE_PTR) memory_ptr)) - DM_OVERHEAD;
        else

            /* There are no free bytes available.  */
            free_size =  0;

        /* Free block may be large enough, now check alignment */
        if (free_size >= size)
        {
            address = ((UNSIGNED)(memory_ptr)) + DM_OVERHEAD;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看91视频| 91久久香蕉国产日韩欧美9色| 美国毛片一区二区三区| 国产在线国偷精品免费看| 91福利精品第一导航| 日韩手机在线导航| 亚洲国产综合色| 成人丝袜高跟foot| 9191国产精品| 亚洲影视在线观看| av成人动漫在线观看| 久久婷婷成人综合色| 亚洲福利视频一区二区| av网站免费线看精品| 2024国产精品| 免费在线观看一区| 欧美精品乱码久久久久久按摩 | 欧美性一二三区| 中文字幕免费不卡| 国产高清视频一区| 精品久久久久久久一区二区蜜臀| 亚洲宅男天堂在线观看无病毒| www.亚洲国产| 欧美激情一区在线观看| 国产美女主播视频一区| 日韩欧美电影一区| 蜜臀av一区二区三区| 7799精品视频| 石原莉奈一区二区三区在线观看| 色婷婷综合久久| 亚洲激情成人在线| 91精品福利视频| 亚洲精品视频免费看| 91精品国产免费| 日韩一区二区在线观看视频 | 亚洲一级二级三级| 日本电影亚洲天堂一区| 国产精品久久综合| 91在线观看视频| 亚洲天堂a在线| 色诱视频网站一区| 一区二区三区精品在线观看| 91麻豆精东视频| 亚洲综合一区二区三区| 欧美日韩三级一区| 成人性生交大片| 欧美韩国日本一区| av中文字幕不卡| 亚洲一级二级三级| 日韩欧美专区在线| 国产精品亚洲人在线观看| 欧美激情一区二区三区| 99久久免费视频.com| 一区二区三区欧美亚洲| 欧美视频在线不卡| 蜜臀a∨国产成人精品| 26uuu亚洲综合色| 国产91对白在线观看九色| ㊣最新国产の精品bt伙计久久| 欧美在线观看视频一区二区| 奇米一区二区三区av| 国产亚洲欧美一级| 色婷婷精品大在线视频| 日韩精品亚洲一区| 欧美韩国日本综合| 欧美性三三影院| 国产制服丝袜一区| 一区二区三区鲁丝不卡| 精品国精品国产尤物美女| 菠萝蜜视频在线观看一区| 亚洲男人天堂一区| 亚洲精品在线免费播放| 97精品超碰一区二区三区| 免费看黄色91| 亚洲三级在线观看| 欧美va天堂va视频va在线| 91影院在线免费观看| 麻豆久久久久久久| 成人欧美一区二区三区| 日韩一级高清毛片| 色拍拍在线精品视频8848| 激情文学综合网| 亚洲一区中文日韩| 亚洲国产精品传媒在线观看| 9191国产精品| 在线观看日韩一区| 成人性视频网站| 另类调教123区 | 精品理论电影在线观看 | www.亚洲免费av| 青青草91视频| 亚洲天天做日日做天天谢日日欢 | 国产精品成人免费在线| 精品美女在线播放| 欧美日韩一区二区三区四区五区 | 久久精品视频一区二区三区| 欧美日韩一区二区三区免费看 | 亚洲色图欧洲色图| 国产欧美视频一区二区三区| 欧美一区欧美二区| 欧美日本一道本在线视频| 色综合久久天天| 成av人片一区二区| 国产成人一区二区精品非洲| 麻豆精品视频在线观看免费| 亚洲成av人影院在线观看网| 亚洲三级电影全部在线观看高清| 国产丝袜欧美中文另类| 精品理论电影在线| 337p粉嫩大胆色噜噜噜噜亚洲 | 在线观看区一区二| 91丨porny丨户外露出| 不卡一区二区在线| 99热精品国产| 色婷婷一区二区三区四区| 99精品视频在线播放观看| av亚洲精华国产精华精| 成人av动漫网站| 91视频com| 在线视频欧美精品| 欧美午夜精品一区| 欧美人与z0zoxxxx视频| 欧美图区在线视频| 欧美一级在线观看| 精品久久久久久综合日本欧美| 精品少妇一区二区三区在线播放| 精品少妇一区二区三区日产乱码| 精品久久久久久综合日本欧美| 精品国产a毛片| 国产精品人妖ts系列视频| 最好看的中文字幕久久| 一区二区三区欧美日韩| 亚洲高清免费视频| 久久精品国产在热久久| 国产美女在线观看一区| 99在线热播精品免费| 在线亚洲一区观看| 欧美一级久久久| 欧美国产成人精品| 亚洲人成精品久久久久久| 国产精品伦一区| 精品区一区二区| 精品国产免费人成在线观看| 久久伊人蜜桃av一区二区| 亚洲国产精品ⅴa在线观看| **性色生活片久久毛片| 亚洲成人手机在线| 国产麻豆精品视频| 色国产综合视频| 日韩视频123| 中文字幕日韩一区二区| 亚洲国产欧美另类丝袜| 狠狠色丁香久久婷婷综合_中 | 国产一区二区三区视频在线播放| 丰满亚洲少妇av| 91国偷自产一区二区三区观看| 欧美一级日韩不卡播放免费| 国产精品网站一区| 免费成人小视频| 91视视频在线观看入口直接观看www| 色国产综合视频| 欧美精品一区二区三区一线天视频| 中文字幕一区免费在线观看| 午夜精品免费在线| 成人美女在线观看| 中文字幕亚洲成人| 免费欧美在线视频| 色婷婷亚洲综合| 久久免费电影网| 视频精品一区二区| 91免费精品国自产拍在线不卡| 日韩欧美成人一区二区| 亚洲综合在线第一页| 国产一区二区美女诱惑| 337p亚洲精品色噜噜狠狠| 国产精品激情偷乱一区二区∴| 天天操天天色综合| 91精品1区2区| 国产精品家庭影院| 国产98色在线|日韩| 精品久久久久一区| 免费美女久久99| 欧美日韩美少妇| 亚洲乱码日产精品bd| 成人蜜臀av电影| 国产亚洲欧美日韩俺去了| 麻豆精品国产91久久久久久| 欧美无砖砖区免费| 亚洲激情网站免费观看| 99热在这里有精品免费| 中文字幕第一区第二区| 国产精品99久久久久久似苏梦涵| 欧美日韩成人综合天天影院| 亚洲国产精品欧美一二99| 色哟哟精品一区| 亚洲男人的天堂一区二区 | 久久精品一区二区三区av| 麻豆91精品视频| 日韩免费电影网站| 免费成人在线播放|