VirtualBox

vbox的更動 18598 路徑 trunk/src/recompiler_new


忽略:
時間撮記:
2009-4-1 下午02:38:44 (16 年 以前)
作者:
vboxsync
訊息:

REM: Spelled out the level 0 map in phys_page_find_alloc to avoid confusion. (The original source would add another level 1 map if TARGET_PHYS_ADDR_SPACE_BITS > 32.) Made the L0 a static array like l0_map.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/recompiler_new/exec.c

    r18597 r18598  
    185185#endif
    186186#ifdef VBOX
    187 /* Note: Not for PhysPageDesc, only to speed up page_flush_tb. */
    188187#define L0_BITS (TARGET_PHYS_ADDR_SPACE_BITS - 32)
    189188#endif
     
    205204#ifndef VBOX
    206205static PageDesc *l1_map[L1_SIZE];
    207 #else
    208 static l0_map_max_used = 0;
     206static PhysPageDesc **l1_phys_map;
     207#else
     208static unsigned l0_map_max_used = 0;
    209209static PageDesc **l0_map[L0_SIZE];
    210 #endif
    211 static PhysPageDesc **l1_phys_map;
     210static void **l0_phys_map[L0_SIZE];
     211#endif
    212212
    213213#if !defined(CONFIG_USER_ONLY)
     
    320320        qemu_host_page_bits++;
    321321    qemu_host_page_mask = ~(qemu_host_page_size - 1);
     322#ifndef VBOX
    322323    l1_phys_map = qemu_vmalloc(L1_SIZE * sizeof(void *));
    323324    memset(l1_phys_map, 0, L1_SIZE * sizeof(void *));
     325#endif
    324326#ifdef VBOX
    325327    /* We use other means to set reserved bit on our pages */
     
    446448    PhysPageDesc *pd;
    447449
     450#ifndef VBOX
    448451    p = (void **)l1_phys_map;
    449452#if TARGET_PHYS_ADDR_SPACE_BITS > 32
     
    463466    }
    464467#endif
     468#else  /* VBOX */
     469    /* level 0 lookup and lazy allocation. */
     470    if (RT_UNLIKELY(index >= (target_ulong)L2_SIZE * L1_SIZE * L0_SIZE))
     471        return NULL;
     472    p = l0_phys_map[index >> (L1_BITS + L2_BITS)];
     473    if (RT_UNLIKELY(!p)) {
     474        if (!alloc)
     475            return NULL;
     476        p = qemu_vmalloc(sizeof(PhysPageDesc **) * L0_SIZE);
     477        memset(p, 0, sizeof(PhysPageDesc **) * L0_SIZE);
     478        l0_phys_map[index >> (L1_BITS + L2_BITS)] = (PhysPageDesc **)p;
     479    }
     480
     481    /* level 1 lookup and lazy allocation. */
     482#endif /* VBOX */
    465483    lp = p + ((index >> L2_BITS) & (L1_SIZE - 1));
    466484    pd = *lp;
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette