Changeset 18598 in vbox for trunk/src/recompiler_new
- Timestamp:
- Apr 1, 2009 2:38:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler_new/exec.c
r18597 r18598 185 185 #endif 186 186 #ifdef VBOX 187 /* Note: Not for PhysPageDesc, only to speed up page_flush_tb. */188 187 #define L0_BITS (TARGET_PHYS_ADDR_SPACE_BITS - 32) 189 188 #endif … … 205 204 #ifndef VBOX 206 205 static PageDesc *l1_map[L1_SIZE]; 207 #else 208 static l0_map_max_used = 0; 206 static PhysPageDesc **l1_phys_map; 207 #else 208 static unsigned l0_map_max_used = 0; 209 209 static PageDesc **l0_map[L0_SIZE]; 210 #endif 211 static PhysPageDesc **l1_phys_map; 210 static void **l0_phys_map[L0_SIZE]; 211 #endif 212 212 213 213 #if !defined(CONFIG_USER_ONLY) … … 320 320 qemu_host_page_bits++; 321 321 qemu_host_page_mask = ~(qemu_host_page_size - 1); 322 #ifndef VBOX 322 323 l1_phys_map = qemu_vmalloc(L1_SIZE * sizeof(void *)); 323 324 memset(l1_phys_map, 0, L1_SIZE * sizeof(void *)); 325 #endif 324 326 #ifdef VBOX 325 327 /* We use other means to set reserved bit on our pages */ … … 446 448 PhysPageDesc *pd; 447 449 450 #ifndef VBOX 448 451 p = (void **)l1_phys_map; 449 452 #if TARGET_PHYS_ADDR_SPACE_BITS > 32 … … 463 466 } 464 467 #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 */ 465 483 lp = p + ((index >> L2_BITS) & (L1_SIZE - 1)); 466 484 pd = *lp;
Note:
See TracChangeset
for help on using the changeset viewer.