VirtualBox

Changeset 18598 in vbox for trunk/src/recompiler_new


Ignore:
Timestamp:
Apr 1, 2009 2:38:44 PM (16 years ago)
Author:
vboxsync
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.

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