Changeset 6546 in vbox
- Timestamp:
- Jan 28, 2008 9:58:59 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/mm.h
r6528 r6546 114 114 /** @} */ 115 115 116 #ifndef VBOX_WITH_NEW_PHYS_CODE 116 117 /** @name MMR3PhysRegisterEx registration type 117 118 * @{ … … 127 128 } MMPHYSREG; 128 129 /** @} */ 130 #endif 129 131 130 132 /** … … 881 883 * @param pszDesc Description of the memory. 882 884 * @thread The Emulation Thread. 885 * 886 * @todo This will only be used for registering MMIO2 memory from devices. So, rename it. 883 887 */ 884 888 MMR3DECL(int) MMR3PhysRegister(PVM pVM, void *pvRam, RTGCPHYS GCPhys, unsigned cb, unsigned fFlags, const char *pszDesc); 885 889 890 #ifndef VBOX_WITH_NEW_PHYS_CODE 886 891 /** 887 892 * Register externally allocated RAM for the virtual machine. … … 900 905 * @thread The Emulation Thread. 901 906 * @todo update this description. 907 * @deprecated For the old dynamic allocation code only. Will be removed with VBOX_WITH_NEW_PHYS_CODE. 902 908 */ 903 909 MMR3DECL(int) MMR3PhysRegisterEx(PVM pVM, void *pvRam, RTGCPHYS GCPhys, unsigned cb, unsigned fFlags, MMPHYSREG enmType, const char *pszDesc); 910 #endif /* !VBOX_WITH_NEW_PHYS_CODE */ 904 911 905 912 /** -
trunk/include/VBox/pgm.h
r6532 r6546 1414 1414 PGMR3DECL(int) PGMR3ChangeShwPDMappings(PVM pVM, bool fEnable); 1415 1415 1416 #ifndef VBOX_WITH_NEW_PHYS_CODE 1416 1417 /** 1417 1418 * Allocate missing physical pages for an existing guest RAM range. … … 1422 1423 */ 1423 1424 PGMR3DECL(int) PGM3PhysGrowRange(PVM pVM, RTGCPHYS GCPhys); 1425 #endif /* !VBOX_WITH_NEW_PHYS_CODE */ 1424 1426 1425 1427 /** … … 1442 1444 PGMR3DECL(int) PGMR3PhysRegister(PVM pVM, void *pvRam, RTGCPHYS GCPhys, size_t cb, unsigned fFlags, const SUPPAGE *paPages, const char *pszDesc); 1443 1445 1446 #ifndef VBOX_WITH_NEW_PHYS_CODE 1444 1447 /** 1445 1448 * Register a chunk of a the physical memory range with PGM. MM is responsible … … 1457 1460 */ 1458 1461 PGMR3DECL(int) PGMR3PhysRegisterChunk(PVM pVM, void *pvRam, RTGCPHYS GCPhys, size_t cb, unsigned fFlags, const SUPPAGE *paPages, const char *pszDesc); 1462 #endif /* !VBOX_WITH_NEW_PHYS_CODE */ 1459 1463 1460 1464 /** -
trunk/include/VBox/rem.h
r5999 r6546 284 284 * @param cb Size of the memory. 285 285 * @param fFlags Flags of the MM_RAM_FLAGS_* defines. 286 * @param pvRam The HC address of the RAM.287 */ 288 REMR3DECL(void) REMR3NotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, void *pvRam, unsigned fFlags); 289 286 */ 287 REMR3DECL(void) REMR3NotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, unsigned fFlags); 288 289 #ifndef VBOX_WITH_NEW_PHYS_CODE 290 290 /** 291 291 * Notification about a successful PGMR3PhysRegisterChunk() call. … … 298 298 */ 299 299 REMR3DECL(void) REMR3NotifyPhysRamChunkRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, RTHCUINTPTR pvRam, unsigned fFlags); 300 #endif 300 301 301 302 /** … … 307 308 * @param pvCopy Pointer to the ROM copy. 308 309 * @param fShadow Whether it's currently writable shadow ROM or normal readonly ROM. 309 * This function will be called when ever the protection of the 310 * This function will be called when ever the protection of the 310 311 * shadow ROM changes (at reset and end of POST). 311 312 */ -
trunk/src/VBox/VMM/MM.cpp
r6535 r6546 216 216 Log(("MM: %llu bytes of RAM%s\n", cbRam, fPreAlloc ? " (PreAlloc)" : "")); 217 217 pVM->mm.s.cbRamBase = cbRam & X86_PTE_PAE_PG_MASK; 218 rc = MMR3PhysRegister (pVM, NULL, 0, pVM->mm.s.cbRamBase, MM_RAM_FLAGS_DYNAMIC_ALLOC, "Main Memory");218 rc = MMR3PhysRegisterEx(pVM, NULL, 0, pVM->mm.s.cbRamBase, MM_RAM_FLAGS_DYNAMIC_ALLOC, MM_PHYS_TYPE_NORMAL, "Main Memory"); 219 219 if (RT_SUCCESS(rc)) 220 220 { -
trunk/src/VBox/VMM/MMPhys.cpp
r6535 r6546 70 70 * @param pszDesc Description of the memory. 71 71 * @thread The Emulation Thread. 72 * 73 * @deprecated For the old dynamic allocation code only. Will be removed with VBOX_WITH_NEW_PHYS_CODE. 72 74 */ 73 75 /** @todo this function description is not longer up-to-date */ … … 134 136 pVM->mm.s.cbRamRegistered += cb; 135 137 136 REMR3NotifyPhysRamRegister(pVM, GCPhys, cb, pvRam,fFlags);138 REMR3NotifyPhysRamRegister(pVM, GCPhys, cb, fFlags); 137 139 return rc; 138 140 } … … 167 169 pVM->mm.s.cbRamRegistered += cb; 168 170 169 REMR3NotifyPhysRamRegister(pVM, GCPhys, cb, pvRam,fFlags);171 REMR3NotifyPhysRamRegister(pVM, GCPhys, cb, fFlags); 170 172 return rc; 171 173 } … … 253 255 /// @todo one day provide a proper MMIO relocation operation 254 256 REMR3NotifyPhysReserve(pVM, GCPhysOld, cb); 255 REMR3NotifyPhysRamRegister(pVM, GCPhysNew, cb, pCur->pv,256 pCur->aPhysPages[0].Phys & (MM_RAM_FLAGS_RESERVED | MM_RAM_FLAGS_ROM | MM_RAM_FLAGS_MMIO | MM_RAM_FLAGS_MMIO2));257 REMR3NotifyPhysRamRegister(pVM, GCPhysNew, cb, 258 pCur->aPhysPages[0].Phys & (MM_RAM_FLAGS_RESERVED | MM_RAM_FLAGS_ROM | MM_RAM_FLAGS_MMIO | MM_RAM_FLAGS_MMIO2)); 257 259 } 258 260 -
trunk/src/VBox/VMM/PGMPhys.cpp
r6544 r6546 252 252 } 253 253 254 #ifndef VBOX_WITH_NEW_PHYS_CODE 254 255 255 256 /** … … 369 370 } 370 371 371 #ifndef VBOX_WITH_NEW_PHYS_CODE372 372 373 373 /** -
trunk/src/VBox/VMM/REMInternal.h
r5999 r6546 251 251 252 252 #ifdef REM_INCLUDE_CPU_H 253 bool remR3CanExecuteRaw(CPUState *env, RTGCPTR eip, unsigned fFlags, uint32_t *pExceptionIndex);253 bool remR3CanExecuteRaw(CPUState *env, RTGCPTR eip, unsigned fFlags, int *piException); 254 254 void remR3CSAMCheckEIP(CPUState *env, RTGCPTR GCPtrCode); 255 255 bool remR3GetOpcode(CPUState *env, RTGCPTR GCPtrInstr, uint8_t *pu8Byte); -
trunk/src/recompiler/VBoxREMWrapper.cpp
r5999 r6546 335 335 static DECLCALLBACKPTR(void, pfnREMR3ReplayInvalidatedPages)(PVM); 336 336 static DECLCALLBACKPTR(void, pfnREMR3ReplayHandlerNotifications)(PVM pVM); 337 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamRegister)(PVM, RTGCPHYS, RTUINT, void *,unsigned);337 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamRegister)(PVM, RTGCPHYS, RTUINT, unsigned); 338 338 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamChunkRegister)(PVM, RTGCPHYS, RTUINT, RTHCUINTPTR, unsigned); 339 339 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysReserve)(PVM, RTGCPHYS, RTUINT); … … 1034 1034 { "PGMPhysGCPhys2HCPtr", (void *)(uintptr_t)&PGMPhysGCPhys2HCPtr, &g_aArgsPGMPhysGCPhys2HCPtr[0], ELEMENTS(g_aArgsPGMPhysGCPhys2HCPtr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1035 1035 { "PGMPhysGCPtr2HCPtrByGstCR3", (void *)(uintptr_t)&PGMPhysGCPtr2HCPtrByGstCR3, &g_aArgsPGMPhysGCPtr2HCPtrByGstCR3[0], ELEMENTS(g_aArgsPGMPhysGCPtr2HCPtrByGstCR3), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1036 #ifndef VBOX_WITH_NEW_PHYS_CODE 1036 1037 { "PGM3PhysGrowRange", (void *)(uintptr_t)&PGM3PhysGrowRange, &g_aArgsPGM3PhysGrowRange[0], ELEMENTS(g_aArgsPGM3PhysGrowRange), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1038 #endif 1037 1039 { "PGMPhysIsGCPhysValid", (void *)(uintptr_t)&PGMPhysIsGCPhysValid, &g_aArgsPGMPhysIsGCPhysValid[0], ELEMENTS(g_aArgsPGMPhysIsGCPhysValid), REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL }, 1038 1040 { "PGMPhysIsA20Enabled", (void *)(uintptr_t)&PGMPhysIsA20Enabled, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL }, … … 1981 1983 } 1982 1984 1983 REMR3DECL(void) REMR3NotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, void *pvRam,unsigned fFlags)1985 REMR3DECL(void) REMR3NotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, unsigned fFlags) 1984 1986 { 1985 1987 #ifndef USE_REM_STUBS 1986 1988 Assert(VALID_PTR(pfnREMR3NotifyPhysRamRegister)); 1987 pfnREMR3NotifyPhysRamRegister(pVM, GCPhys, cb, pvRam, fFlags); 1988 #endif 1989 } 1990 1989 pfnREMR3NotifyPhysRamRegister(pVM, GCPhys, cb, fFlags); 1990 #endif 1991 } 1992 1993 #ifndef VBOX_WITH_NEW_PHYS_CODE 1991 1994 REMR3DECL(void) REMR3NotifyPhysRamChunkRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, RTHCUINTPTR pvRam, unsigned fFlags) 1992 1995 { … … 1996 1999 #endif 1997 2000 } 2001 #endif 1998 2002 1999 2003 REMR3DECL(void) REMR3NotifyPhysRomRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, void *pvCopy, bool fShadow) -
trunk/src/recompiler/VBoxRecompiler.c
r5999 r6546 1096 1096 * @param eip The EIP to check this for (might differ from env->eip). 1097 1097 * @param fFlags hflags OR'ed with IOPL, TF and VM from eflags. 1098 * @param p ExceptionIndexStores EXCP_EXECUTE_RAW/HWACC in case raw mode is supported in this context1098 * @param piException Stores EXCP_EXECUTE_RAW/HWACC in case raw mode is supported in this context 1099 1099 * 1100 1100 * @remark This function must be kept in perfect sync with the scheduler in EM.cpp! 1101 1101 */ 1102 bool remR3CanExecuteRaw(CPUState *env, RTGCPTR eip, unsigned fFlags, uint32_t *pExceptionIndex)1102 bool remR3CanExecuteRaw(CPUState *env, RTGCPTR eip, unsigned fFlags, int *piException) 1103 1103 { 1104 1104 /* !!! THIS MUST BE IN SYNC WITH emR3Reschedule !!! */ … … 1147 1147 if (HWACCMR3CanExecuteGuest(env->pVM, &Ctx) == true) 1148 1148 { 1149 *p ExceptionIndex= EXCP_EXECUTE_HWACC;1149 *piException = EXCP_EXECUTE_HWACC; 1150 1150 return true; 1151 1151 } … … 1259 1259 { 1260 1260 Log2(("raw r0 mode forced: patch code\n")); 1261 *p ExceptionIndex= EXCP_EXECUTE_RAW;1261 *piException = EXCP_EXECUTE_RAW; 1262 1262 return true; 1263 1263 } … … 1288 1288 1289 1289 Assert(PGMPhysIsA20Enabled(env->pVM)); 1290 *p ExceptionIndex= EXCP_EXECUTE_RAW;1290 *piException = EXCP_EXECUTE_RAW; 1291 1291 return true; 1292 1292 } … … 1352 1352 //RAWEx_ProfileStart(env, STATS_QEMU_TOTAL); 1353 1353 } 1354 1354 1355 1355 1356 /** … … 1369 1370 CSAMR3MonitorPage(env->pVM, GCPtr, CSAM_TAG_REM); 1370 1371 } 1372 1371 1373 1372 1374 /** … … 1462 1464 } 1463 1465 1466 1464 1467 /** 1465 1468 * Called from compiled code to schedule pending timers in VMM … … 1476 1479 } 1477 1480 1481 1478 1482 /** 1479 1483 * Record trap occurance … … 1489 1493 PVM pVM = env->pVM; 1490 1494 #ifdef VBOX_WITH_STATISTICS 1491 static STAMCOUNTER aStatTrap[255];1492 static bool aRegisters[ELEMENTS(aStatTrap)];1495 static STAMCOUNTER s_aStatTrap[255]; 1496 static bool s_aRegisters[RT_ELEMENTS(s_aStatTrap)]; 1493 1497 #endif 1494 1498 … … 1496 1500 if (uTrap < 255) 1497 1501 { 1498 if (! aRegisters[uTrap])1502 if (!s_aRegisters[uTrap]) 1499 1503 { 1500 aRegisters[uTrap] = true;1504 s_aRegisters[uTrap] = true; 1501 1505 char szStatName[64]; 1502 1506 RTStrPrintf(szStatName, sizeof(szStatName), "/REM/Trap/0x%02X", uTrap); 1503 STAM_REG(env->pVM, & aStatTrap[uTrap], STAMTYPE_COUNTER, szStatName, STAMUNIT_OCCURENCES, "Trap stats.");1507 STAM_REG(env->pVM, &s_aStatTrap[uTrap], STAMTYPE_COUNTER, szStatName, STAMUNIT_OCCURENCES, "Trap stats."); 1504 1508 } 1505 STAM_COUNTER_INC(& aStatTrap[uTrap]);1509 STAM_COUNTER_INC(&s_aStatTrap[uTrap]); 1506 1510 } 1507 1511 #endif … … 1536 1540 } 1537 1541 1542 1538 1543 /* 1539 1544 * Clear current active trap … … 1549 1554 } 1550 1555 1556 1551 1557 /* 1552 1558 * Record previous call instruction addresses … … 1558 1564 CSAMR3RecordCallAddress(env->pVM, env->eip); 1559 1565 } 1566 1560 1567 1561 1568 /** … … 1861 1868 if (VBOX_SUCCESS(rc)) 1862 1869 { 1863 1870 #ifdef DEBUG 1864 1871 if (u8TrapNo == 0x80) 1865 1872 { … … 1867 1874 remR3DumpOBsdSyscall(pVM); 1868 1875 } 1869 1876 #endif 1870 1877 1871 1878 pVM->rem.s.Env.exception_index = u8TrapNo; … … 2437 2444 } 2438 2445 2446 2439 2447 /** 2440 2448 * Notification about a successful MMR3PhysRegister() call. … … 2443 2451 * @param GCPhys The physical address the RAM. 2444 2452 * @param cb Size of the memory. 2445 * @param pvRam The HC address of the RAM.2446 2453 * @param fFlags Flags of the MM_RAM_FLAGS_* defines. 2447 2454 */ 2448 REMR3DECL(void) REMR3NotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, void *pvRam,unsigned fFlags)2449 { 2450 Log(("REMR3NotifyPhysRamRegister: GCPhys=%VGp cb=%d pvRam=%p fFlags=%d\n", GCPhys, cb, pvRam, fFlags));2455 REMR3DECL(void) REMR3NotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, unsigned fFlags) 2456 { 2457 Log(("REMR3NotifyPhysRamRegister: GCPhys=%VGp cb=%d fFlags=%d\n", GCPhys, cb, fFlags)); 2451 2458 VM_ASSERT_EMT(pVM); 2452 2459 … … 2454 2461 * Validate input - we trust the caller. 2455 2462 */ 2456 Assert(!GCPhys || pvRam);2457 Assert(RT_ALIGN_P(pvRam, PAGE_SIZE) == pvRam);2458 2463 Assert(RT_ALIGN_T(GCPhys, PAGE_SIZE, RTGCPHYS) == GCPhys); 2459 2464 Assert(cb); … … 2487 2492 pVM->rem.s.fIgnoreAll = true; 2488 2493 2494 #ifdef VBOX_WITH_NEW_PHYS_CODE 2495 if (fFlags & MM_RAM_FLAGS_RESERVED) 2496 cpu_register_physical_memory(GCPhys, cb, IO_MEM_UNASSIGNED); 2497 else 2498 cpu_register_physical_memory(GCPhys, cb, GCPhys); 2499 #else 2489 2500 if (!GCPhys) 2490 2501 cpu_register_physical_memory(GCPhys, cb, GCPhys | IO_MEM_RAM_MISSING); … … 2496 2507 cpu_register_physical_memory(GCPhys, cb, GCPhys); 2497 2508 } 2509 #endif 2498 2510 Assert(pVM->rem.s.fIgnoreAll); 2499 2511 pVM->rem.s.fIgnoreAll = false; 2500 2512 } 2501 2513 2514 #ifndef VBOX_WITH_NEW_PHYS_CODE 2502 2515 2503 2516 /** … … 2554 2567 } 2555 2568 2569 #endif /* !VBOX_WITH_NEW_PHYS_CODE */ 2556 2570 2557 2571 /** … … 3445 3459 #else 3446 3460 Cpu.mode = CPUMODE_64BIT; 3447 #endif 3461 #endif 3448 3462 3449 3463 RTLogPrintf("Recompiled Code: %p %#lx (%ld) bytes\n", pvCode, cb, cb); … … 3459 3473 #ifdef RT_ARCH_AMD64 /** @todo remove when DISInstr starts supporing 64-bit code. */ 3460 3474 break; 3461 #endif 3475 #endif 3462 3476 } 3463 3477 off += cbInstr; -
trunk/src/recompiler/cpu-all.h
r6532 r6546 196 196 void remR3PhysWriteU64(RTGCPHYS DstGCPhys, uint64_t val); 197 197 198 #ifndef VBOX_WITH_NEW_PHYS_CODE 198 199 void remR3GrowDynRange(unsigned long physaddr); 200 #endif 199 201 #if 0 /*defined(RT_ARCH_AMD64) && defined(VBOX_STRICT)*/ 200 202 # define VBOX_CHECK_ADDR(ptr) do { if ((uintptr_t)(ptr) >= _4G) __asm__("int3"); } while (0) … … 997 999 #define IO_MEM_UNASSIGNED (2 << IO_MEM_SHIFT) 998 1000 #define IO_MEM_NOTDIRTY (4 << IO_MEM_SHIFT) /* used internally, never use directly */ 999 #if defined(VBOX) 1001 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE) 1000 1002 #define IO_MEM_RAM_MISSING (5 << IO_MEM_SHIFT) /* used internally, never use directly */ 1001 1003 #endif -
trunk/src/recompiler/cpu-exec.c
r3024 r6546 1 1 /* 2 2 * i386 emulator main execution loop 3 * 3 * 4 4 * Copyright (c) 2003-2005 Fabrice Bellard 5 5 * … … 55 55 restored in a state compatible with the CPU emulator 56 56 */ 57 void cpu_resume_from_signal(CPUState *env1, void *puc) 57 void cpu_resume_from_signal(CPUState *env1, void *puc) 58 58 { 59 59 #if !defined(CONFIG_SOFTMMU) … … 84 84 target_ulong phys_pc, phys_page1, phys_page2, virt_page2; 85 85 uint8_t *tc_ptr; 86 86 87 87 spin_lock(&tb_lock); 88 88 89 89 tb_invalidated_flag = 0; 90 90 91 91 regs_to_env(); /* XXX: do it just before cpu_gen_code() */ 92 92 93 93 /* find translated block using physical mappings */ 94 94 phys_pc = get_phys_addr_code(env, pc); … … 101 101 if (!tb) 102 102 goto not_found; 103 if (tb->pc == pc && 103 if (tb->pc == pc && 104 104 tb->page_addr[0] == phys_page1 && 105 tb->cs_base == cs_base && 105 tb->cs_base == cs_base && 106 106 tb->flags == flags) { 107 107 /* check next page if needed */ 108 108 if (tb->page_addr[1] != -1) { 109 virt_page2 = (pc & TARGET_PAGE_MASK) + 109 virt_page2 = (pc & TARGET_PAGE_MASK) + 110 110 TARGET_PAGE_SIZE; 111 111 phys_page2 = get_phys_addr_code(env, virt_page2); … … 135 135 cpu_gen_code(env, tb, CODE_GEN_MAX_SIZE, &code_gen_size); 136 136 code_gen_ptr = (void *)(((unsigned long)code_gen_ptr + code_gen_size + CODE_GEN_ALIGN - 1) & ~(CODE_GEN_ALIGN - 1)); 137 137 138 138 /* check next page if needed */ 139 139 virt_page2 = (pc + tb->size - 1) & TARGET_PAGE_MASK; … … 143 143 } 144 144 tb_link_phys(tb, phys_pc, phys_page2); 145 145 146 146 found: 147 147 /* we add the TB in the virtual pc hash table */ … … 249 249 #elif defined(TARGET_PPC) 250 250 if (env1->halted) { 251 if (env1->msr[MSR_EE] && 252 (env1->interrupt_request & 251 if (env1->msr[MSR_EE] && 252 (env1->interrupt_request & 253 253 (CPU_INTERRUPT_HARD | CPU_INTERRUPT_TIMER))) { 254 254 env1->halted = 0; … … 288 288 #endif 289 289 290 cpu_single_env = env1; 290 cpu_single_env = env1; 291 291 292 292 /* first we save global registers */ … … 321 321 #ifndef VBOX /* VBOX: We need to raise traps and suchlike from the outside. */ 322 322 env->exception_index = -1; 323 #endif 323 #endif 324 324 325 325 /* prepare setjmp context for exception handling */ 326 326 for(;;) { 327 if (setjmp(env->jmp_env) == 0) 327 if (setjmp(env->jmp_env) == 0) 328 328 { 329 329 env->current_tb = NULL; … … 354 354 RAWEx_ProfileStart(env, STATS_IRQ_HANDLING); 355 355 Log(("do_interrupt %d %d %08x\n", env->exception_index, env->exception_is_int, env->exception_next_eip)); 356 do_interrupt(env->exception_index, 357 env->exception_is_int, 358 env->error_code, 356 do_interrupt(env->exception_index, 357 env->exception_is_int, 358 env->error_code, 359 359 env->exception_next_eip, 0); 360 360 RAWEx_ProfileStop(env, STATS_IRQ_HANDLING); … … 405 405 do_smm_enter(); 406 406 T0 = 0; 407 } 407 } 408 408 else if ((interrupt_request & CPU_INTERRUPT_HARD) && 409 (env->eflags & IF_MASK) && 410 !(env->hflags & HF_INHIBIT_IRQ_MASK)) 409 (env->eflags & IF_MASK) && 410 !(env->hflags & HF_INHIBIT_IRQ_MASK)) 411 411 { 412 412 /* if hardware interrupt pending, we execute it */ … … 431 431 } 432 432 RAWEx_ProfileStop(env, STATS_IRQ_HANDLING); 433 if (interrupt_request & CPU_INTERRUPT_EXIT) 433 if (interrupt_request & CPU_INTERRUPT_EXIT) 434 434 { 435 435 env->exception_index = EXCP_INTERRUPT; … … 438 438 cpu_loop_exit(); 439 439 } 440 if (interrupt_request & CPU_INTERRUPT_RC) 440 if (interrupt_request & CPU_INTERRUPT_RC) 441 441 { 442 442 env->exception_index = EXCP_RC; … … 451 451 */ 452 452 RAWEx_ProfileStart(env, STATS_RAW_CHECK); 453 if (remR3CanExecuteRaw(env, 454 env->eip + env->segs[R_CS].base, 453 if (remR3CanExecuteRaw(env, 454 env->eip + env->segs[R_CS].base, 455 455 env->hflags | (env->eflags & (IOPL_MASK | TF_MASK | VM_MASK)), 456 456 &env->exception_index)) … … 469 469 jump. */ 470 470 if (T0 != 0 471 && !(tb->cflags & CF_RAW_MODE) 472 && tb->page_addr[1] == -1) 471 && !(tb->cflags & CF_RAW_MODE) 472 && tb->page_addr[1] == -1) 473 473 { 474 474 spin_lock(&tb_lock); … … 484 484 #if defined(DEBUG) && defined(VBOX) && !defined(DEBUG_dmik) 485 485 #if !defined(DEBUG_bird) 486 if (((env->hflags >> HF_CPL_SHIFT) & 3) == 0 && (env->hflags & HF_PE_MASK) && (env->cr[0] & CR0_PG_MASK)) 486 if (((env->hflags >> HF_CPL_SHIFT) & 3) == 0 && (env->hflags & HF_PE_MASK) && (env->cr[0] & CR0_PG_MASK)) 487 487 { 488 488 if(!(env->state & CPU_EMULATE_SINGLE_STEP)) … … 492 492 } 493 493 else 494 if (((env->hflags >> HF_CPL_SHIFT) & 3) == 3 && (env->hflags & HF_PE_MASK) && (env->cr[0] & CR0_PG_MASK)) 494 if (((env->hflags >> HF_CPL_SHIFT) & 3) == 3 && (env->hflags & HF_PE_MASK) && (env->cr[0] & CR0_PG_MASK)) 495 495 { 496 496 if(!(env->state & CPU_EMULATE_SINGLE_STEP)) … … 506 506 } 507 507 } 508 else 508 else 509 509 { 510 510 Log(("EMRM: %04X:%08X SS:ESP=%04X:%08X IF=%d TF=%d CPL=%d PE=%d PG=%d\n", env->segs[R_CS].selector, env->eip, env->segs[R_SS].selector, ESP, (env->eflags & IF_MASK) ? 1 : 0, (env->eflags & TF_MASK) ? 1 : 0, (env->hflags >> HF_CPL_SHIFT) & 3, env->cr[0] & X86_CR0_PE, env->cr[0] & X86_CR0_PG)); … … 524 524 #else 525 525 env->state &= ~CPU_EMULATE_SINGLE_STEP; 526 #endif 526 #endif 527 527 } 528 528 #endif … … 535 535 } 536 536 } 537 else 537 else 538 538 { 539 539 RAWEx_ProfileStart(env, STATS_QEMU_RUN_EMULATED_CODE); … … 563 563 } 564 564 #ifdef VBOX_HIGH_RES_TIMERS_HACK 565 /* NULL the current_tb here so cpu_interrupt() doesn't do 565 /* NULL the current_tb here so cpu_interrupt() doesn't do 566 566 anything unnecessary (like crashing during emulate single instruction). */ 567 567 env->current_tb = NULL; … … 610 610 #elif defined(TARGET_PPC) 611 611 if (env1->halted) { 612 if (env1->msr[MSR_EE] && 613 (env1->interrupt_request & 612 if (env1->msr[MSR_EE] && 613 (env1->interrupt_request & 614 614 (CPU_INTERRUPT_HARD | CPU_INTERRUPT_TIMER))) { 615 615 env1->halted = 0; … … 649 649 #endif 650 650 651 cpu_single_env = env1; 651 cpu_single_env = env1; 652 652 653 653 /* first we save global registers */ … … 685 685 #ifndef VBOX /* VBOX: We need to raise traps and suchlike from the outside. */ 686 686 env->exception_index = -1; 687 #endif 687 #endif 688 688 689 689 /* prepare setjmp context for exception handling */ … … 691 691 if (setjmp(env->jmp_env) == 0) { 692 692 env->current_tb = NULL; 693 #ifdef VBOX 693 #ifdef VBOX 694 694 VMMR3Unlock(env->pVM); 695 695 VMMR3Lock(env->pVM); 696 696 697 /* Check for high priority requests first (like fatal 697 /* Check for high priority requests first (like fatal 698 698 errors). */ 699 699 if (env->interrupt_request & CPU_INTERRUPT_RC) { … … 717 717 loop */ 718 718 #if defined(TARGET_I386) 719 do_interrupt_user(env->exception_index, 720 env->exception_is_int, 721 env->error_code, 719 do_interrupt_user(env->exception_index, 720 env->exception_is_int, 721 env->error_code, 722 722 env->exception_next_eip); 723 723 #endif … … 729 729 trigger new exceptions, but we do not handle 730 730 double or triple faults yet. */ 731 do_interrupt(env->exception_index, 732 env->exception_is_int, 733 env->error_code, 731 do_interrupt(env->exception_index, 732 env->exception_is_int, 733 env->error_code, 734 734 env->exception_next_eip, 0); 735 735 #elif defined(TARGET_PPC) … … 746 746 } 747 747 env->exception_index = -1; 748 } 748 } 749 749 #ifdef USE_KQEMU 750 750 if (kqemu_is_ok(env) && env->interrupt_request == 0) { … … 776 776 for(;;) { 777 777 #if defined(__sparc__) && !defined(HOST_SOLARIS) 778 /* g1 can be modified by some libc? functions */ 778 /* g1 can be modified by some libc? functions */ 779 779 tmp_T0 = T0; 780 #endif 780 #endif 781 781 interrupt_request = env->interrupt_request; 782 782 if (__builtin_expect(interrupt_request, 0)) { … … 784 784 /* Single instruction exec request, we execute it and return (one way or the other). 785 785 The caller will always reschedule after doing this operation! */ 786 if (interrupt_request & CPU_INTERRUPT_SINGLE_INSTR) 786 if (interrupt_request & CPU_INTERRUPT_SINGLE_INSTR) 787 787 { 788 788 /* not in flight are we? */ 789 if (!(env->interrupt_request & CPU_INTERRUPT_SINGLE_INSTR_IN_FLIGHT)) 789 if (!(env->interrupt_request & CPU_INTERRUPT_SINGLE_INSTR_IN_FLIGHT)) 790 790 { 791 791 ASMAtomicOrS32(&env->interrupt_request, CPU_INTERRUPT_SINGLE_INSTR_IN_FLIGHT); … … 801 801 || !(env->eflags & IF_MASK) 802 802 || (env->hflags & HF_INHIBIT_IRQ_MASK) 803 ) 803 ) 804 804 { 805 805 env->exception_index = ret = EXCP_SINGLE_INSTR; … … 824 824 #endif 825 825 } else if ((interrupt_request & CPU_INTERRUPT_HARD) && 826 (env->eflags & IF_MASK) && 826 (env->eflags & IF_MASK) && 827 827 !(env->hflags & HF_INHIBIT_IRQ_MASK)) { 828 828 int intno; … … 831 831 #else 832 832 env->interrupt_request &= ~CPU_INTERRUPT_HARD; 833 #endif 833 #endif 834 834 intno = cpu_get_pic_interrupt(env); 835 835 if (loglevel & CPU_LOG_TB_IN_ASM) { … … 944 944 #else 945 945 env->interrupt_request &= ~CPU_INTERRUPT_EXITTB; 946 #endif 946 #endif 947 947 /* ensure that no TB jump will be modified as 948 948 the program flow was changed */ … … 955 955 #ifdef VBOX 956 956 RAWEx_ProfileStop(env, STATS_IRQ_HANDLING); 957 #endif 957 #endif 958 958 if (interrupt_request & CPU_INTERRUPT_EXIT) { 959 959 #if defined(VBOX) … … 963 963 env->interrupt_request &= ~CPU_INTERRUPT_EXIT; 964 964 env->exception_index = EXCP_INTERRUPT; 965 #endif 965 #endif 966 966 cpu_loop_exit(); 967 967 } … … 1024 1024 cpu_dump_state(env, logfile, fprintf, 0); 1025 1025 #else 1026 #error unsupported target CPU 1026 #error unsupported target CPU 1027 1027 #endif 1028 1028 } … … 1033 1033 */ 1034 1034 RAWEx_ProfileStart(env, STATS_RAW_CHECK); 1035 if (remR3CanExecuteRaw(env, 1036 env->eip + env->segs[R_CS].base, 1035 if (remR3CanExecuteRaw(env, 1036 env->eip + env->segs[R_CS].base, 1037 1037 env->hflags | (env->eflags & (IOPL_MASK | TF_MASK | VM_MASK)) 1038 1038 flags, &env->exception_index)) … … 1054 1054 #if defined(__sparc__) && !defined(HOST_SOLARIS) 1055 1055 T0 = tmp_T0; 1056 #endif 1056 #endif 1057 1057 /* see if we can patch the calling TB. When the TB 1058 1058 spans two pages, we cannot safely do a direct … … 1068 1068 tb->page_addr[1] == -1 1069 1069 #if defined(TARGET_I386) && defined(USE_CODE_COPY) 1070 && (tb->cflags & CF_CODE_COPY) == 1070 && (tb->cflags & CF_CODE_COPY) == 1071 1071 (((TranslationBlock *)(T0 & ~3))->cflags & CF_CODE_COPY) 1072 1072 #endif … … 1076 1076 #if defined(USE_CODE_COPY) 1077 1077 /* propagates the FP use info */ 1078 ((TranslationBlock *)(T0 & ~3))->cflags |= 1078 ((TranslationBlock *)(T0 & ~3))->cflags |= 1079 1079 (tb->cflags & CF_FP_USED); 1080 1080 #endif … … 1090 1090 "mov %%o7,%%i0" 1091 1091 : /* no outputs */ 1092 : "r" (gen_func) 1092 : "r" (gen_func) 1093 1093 : "i0", "i1", "i2", "i3", "i4", "i5", 1094 1094 "l0", "l1", "l2", "l3", "l4", "l5", … … 1187 1187 #if defined(DEBUG) && defined(VBOX) && !defined(DEBUG_dmik) 1188 1188 #if !defined(DEBUG_bird) 1189 if (((env->hflags >> HF_CPL_SHIFT) & 3) == 0 && (env->hflags & HF_PE_MASK) && (env->cr[0] & CR0_PG_MASK)) 1189 if (((env->hflags >> HF_CPL_SHIFT) & 3) == 0 && (env->hflags & HF_PE_MASK) && (env->cr[0] & CR0_PG_MASK)) 1190 1190 { 1191 1191 if(!(env->state & CPU_EMULATE_SINGLE_STEP)) … … 1195 1195 } 1196 1196 else 1197 if (((env->hflags >> HF_CPL_SHIFT) & 3) == 3 && (env->hflags & HF_PE_MASK) && (env->cr[0] & CR0_PG_MASK)) 1197 if (((env->hflags >> HF_CPL_SHIFT) & 3) == 3 && (env->hflags & HF_PE_MASK) && (env->cr[0] & CR0_PG_MASK)) 1198 1198 { 1199 1199 if(!(env->state & CPU_EMULATE_SINGLE_STEP)) … … 1222 1222 #else 1223 1223 env->state &= ~CPU_EMULATE_SINGLE_STEP; 1224 #endif 1225 } 1226 #endif 1224 #endif 1225 } 1226 #endif 1227 1227 TMCpuTickPause(env->pVM); 1228 1228 remR3DisasInstr(env, -1, NULL); … … 1233 1233 } 1234 1234 } 1235 else 1235 else 1236 1236 { 1237 1237 RAWEx_ProfileStart(env, STATS_QEMU_RUN_EMULATED_CODE); … … 1307 1307 1308 1308 /* fail safe : never use cpu_single_env outside cpu_exec() */ 1309 cpu_single_env = NULL; 1309 cpu_single_env = NULL; 1310 1310 return ret; 1311 1311 } … … 1336 1336 if (!(env->cr[0] & CR0_PE_MASK) || (env->eflags & VM_MASK)) { 1337 1337 selector &= 0xffff; 1338 cpu_x86_load_seg_cache(env, seg_reg, selector, 1338 cpu_x86_load_seg_cache(env, seg_reg, selector, 1339 1339 (selector << 4), 0xffff, 0); 1340 1340 } else { … … 1350 1350 saved_env = env; 1351 1351 env = s; 1352 1352 1353 1353 helper_fsave((target_ulong)ptr, data32); 1354 1354 … … 1362 1362 saved_env = env; 1363 1363 env = s; 1364 1364 1365 1365 helper_frstor((target_ulong)ptr, data32); 1366 1366 … … 1379 1379 signal set which should be restored */ 1380 1380 static inline int handle_cpu_signal(unsigned long pc, unsigned long address, 1381 int is_write, sigset_t *old_set, 1381 int is_write, sigset_t *old_set, 1382 1382 void *puc) 1383 1383 { … … 1388 1388 env = cpu_single_env; /* XXX: find a correct solution for multithread */ 1389 1389 #if defined(DEBUG_SIGNAL) 1390 qemu_printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1390 qemu_printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1391 1391 pc, address, is_write, *(unsigned long *)old_set); 1392 1392 #endif … … 1397 1397 1398 1398 /* see if it is an MMU fault */ 1399 ret = cpu_x86_handle_mmu_fault(env, address, is_write, 1399 ret = cpu_x86_handle_mmu_fault(env, address, is_write, 1400 1400 ((env->hflags & HF_CPL_MASK) == 3), 0); 1401 1401 if (ret < 0) … … 1412 1412 if (ret == 1) { 1413 1413 #if 0 1414 printf("PF exception: EIP=0x%08x CR2=0x%08x error=0x%x\n", 1414 printf("PF exception: EIP=0x%08x CR2=0x%08x error=0x%x\n", 1415 1415 env->eip, env->cr[2], env->error_code); 1416 1416 #endif … … 1439 1439 env = cpu_single_env; /* XXX: find a correct solution for multithread */ 1440 1440 #if defined(DEBUG_SIGNAL) 1441 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1441 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1442 1442 pc, address, is_write, *(unsigned long *)old_set); 1443 1443 #endif … … 1475 1475 env = cpu_single_env; /* XXX: find a correct solution for multithread */ 1476 1476 #if defined(DEBUG_SIGNAL) 1477 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1477 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1478 1478 pc, address, is_write, *(unsigned long *)old_set); 1479 1479 #endif … … 1507 1507 TranslationBlock *tb; 1508 1508 int ret; 1509 1509 1510 1510 if (cpu_single_env) 1511 1511 env = cpu_single_env; /* XXX: find a correct solution for multithread */ 1512 1512 #if defined(DEBUG_SIGNAL) 1513 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1513 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1514 1514 pc, address, is_write, *(unsigned long *)old_set); 1515 1515 #endif … … 1535 1535 if (ret == 1) { 1536 1536 #if 0 1537 printf("PF exception: NIP=0x%08x error=0x%x %p\n", 1537 printf("PF exception: NIP=0x%08x error=0x%x %p\n", 1538 1538 env->nip, env->error_code, tb); 1539 1539 #endif … … 1561 1561 env = cpu_single_env; /* XXX: find a correct solution for multithread */ 1562 1562 #if defined(DEBUG_SIGNAL) 1563 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1563 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1564 1564 pc, address, is_write, *(unsigned long *)old_set); 1565 1565 #endif … … 1596 1596 TranslationBlock *tb; 1597 1597 int ret; 1598 1598 1599 1599 if (cpu_single_env) 1600 1600 env = cpu_single_env; /* XXX: find a correct solution for multithread */ 1601 1601 #if defined(DEBUG_SIGNAL) 1602 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1602 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1603 1603 pc, address, is_write, *(unsigned long *)old_set); 1604 1604 #endif … … 1624 1624 if (ret == 1) { 1625 1625 #if 0 1626 printf("PF exception: NIP=0x%08x error=0x%x %p\n", 1626 printf("PF exception: NIP=0x%08x error=0x%x %p\n", 1627 1627 env->nip, env->error_code, tb); 1628 1628 #endif … … 1646 1646 TranslationBlock *tb; 1647 1647 int ret; 1648 1648 1649 1649 if (cpu_single_env) 1650 1650 env = cpu_single_env; /* XXX: find a correct solution for multithread */ 1651 1651 #if defined(DEBUG_SIGNAL) 1652 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1652 printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", 1653 1653 pc, address, is_write, *(unsigned long *)old_set); 1654 1654 #endif … … 1673 1673 } 1674 1674 #if 0 1675 printf("PF exception: NIP=0x%08x error=0x%x %p\n", 1675 printf("PF exception: NIP=0x%08x error=0x%x %p\n", 1676 1676 env->nip, env->error_code, tb); 1677 1677 #endif … … 1690 1690 1691 1691 #if defined(USE_CODE_COPY) 1692 static void cpu_send_trap(unsigned long pc, int trap, 1692 static void cpu_send_trap(unsigned long pc, int trap, 1693 1693 struct ucontext *uc) 1694 1694 { … … 1709 1709 #endif 1710 1710 1711 int cpu_signal_handler(int host_signum, void *pinfo, 1711 int cpu_signal_handler(int host_signum, void *pinfo, 1712 1712 void *puc) 1713 1713 { … … 1732 1732 } else 1733 1733 #endif 1734 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1735 trapno == 0xe ? 1734 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1735 trapno == 0xe ? 1736 1736 (uc->uc_mcontext.gregs[REG_ERR] >> 1) & 1 : 0, 1737 1737 &uc->uc_sigmask, puc); … … 1748 1748 1749 1749 pc = uc->uc_mcontext.gregs[REG_RIP]; 1750 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1751 uc->uc_mcontext.gregs[REG_TRAPNO] == 0xe ? 1750 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1751 uc->uc_mcontext.gregs[REG_TRAPNO] == 0xe ? 1752 1752 (uc->uc_mcontext.gregs[REG_ERR] >> 1) & 1 : 0, 1753 1753 &uc->uc_sigmask, puc); … … 1805 1805 #endif /* __APPLE__ */ 1806 1806 1807 int cpu_signal_handler(int host_signum, void *pinfo, 1807 int cpu_signal_handler(int host_signum, void *pinfo, 1808 1808 void *puc) 1809 1809 { … … 1823 1823 is_write = 1; 1824 1824 #endif 1825 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1825 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1826 1826 is_write, &uc->uc_sigmask, puc); 1827 1827 } … … 1829 1829 #elif defined(__alpha__) 1830 1830 1831 int cpu_signal_handler(int host_signum, void *pinfo, 1831 int cpu_signal_handler(int host_signum, void *pinfo, 1832 1832 void *puc) 1833 1833 { … … 1854 1854 } 1855 1855 1856 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1856 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1857 1857 is_write, &uc->uc_sigmask, puc); 1858 1858 } 1859 1859 #elif defined(__sparc__) 1860 1860 1861 int cpu_signal_handler(int host_signum, void *pinfo, 1861 int cpu_signal_handler(int host_signum, void *pinfo, 1862 1862 void *puc) 1863 1863 { … … 1868 1868 int is_write; 1869 1869 uint32_t insn; 1870 1870 1871 1871 /* XXX: is there a standard glibc define ? */ 1872 1872 pc = regs[1]; … … 1887 1887 } 1888 1888 } 1889 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1889 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1890 1890 is_write, sigmask, NULL); 1891 1891 } … … 1893 1893 #elif defined(__arm__) 1894 1894 1895 int cpu_signal_handler(int host_signum, void *pinfo, 1895 int cpu_signal_handler(int host_signum, void *pinfo, 1896 1896 void *puc) 1897 1897 { … … 1900 1900 unsigned long pc; 1901 1901 int is_write; 1902 1902 1903 1903 pc = uc->uc_mcontext.gregs[R15]; 1904 1904 /* XXX: compute is_write */ 1905 1905 is_write = 0; 1906 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1906 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1907 1907 is_write, 1908 1908 &uc->uc_sigmask, puc); … … 1911 1911 #elif defined(__mc68000) 1912 1912 1913 int cpu_signal_handler(int host_signum, void *pinfo, 1913 int cpu_signal_handler(int host_signum, void *pinfo, 1914 1914 void *puc) 1915 1915 { … … 1918 1918 unsigned long pc; 1919 1919 int is_write; 1920 1920 1921 1921 pc = uc->uc_mcontext.gregs[16]; 1922 1922 /* XXX: compute is_write */ 1923 1923 is_write = 0; 1924 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1924 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1925 1925 is_write, 1926 1926 &uc->uc_sigmask, puc); … … 1963 1963 #elif defined(__s390__) 1964 1964 1965 int cpu_signal_handler(int host_signum, void *pinfo, 1965 int cpu_signal_handler(int host_signum, void *pinfo, 1966 1966 void *puc) 1967 1967 { … … 1970 1970 unsigned long pc; 1971 1971 int is_write; 1972 1972 1973 1973 pc = uc->uc_mcontext.psw.addr; 1974 1974 /* XXX: compute is_write */ 1975 1975 is_write = 0; 1976 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1976 return handle_cpu_signal(pc, (unsigned long)info->si_addr, 1977 1977 is_write, 1978 1978 &uc->uc_sigmask, puc); -
trunk/src/recompiler/exec.c
r6532 r6546 277 277 pd[i].phys_offset = IO_MEM_UNASSIGNED; 278 278 } 279 #if defined(VBOX) 279 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE) 280 280 pd = ((PhysPageDesc *)pd) + (index & (L2_SIZE - 1)); 281 281 if (RT_UNLIKELY((pd->phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM_MISSING)) … … 1953 1953 p = phys_page_find_alloc(addr >> TARGET_PAGE_BITS, 1); 1954 1954 p->phys_offset = phys_offset; 1955 #if !defined(VBOX) 1955 #if !defined(VBOX) || defined(VBOX_WITH_NEW_PHYS_CODE) 1956 1956 if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM || 1957 1957 (phys_offset & IO_MEM_ROMD)) … … 2163 2163 cpu_register_io_memory(IO_MEM_UNASSIGNED >> IO_MEM_SHIFT, unassigned_mem_read, unassigned_mem_write, NULL); 2164 2164 cpu_register_io_memory(IO_MEM_NOTDIRTY >> IO_MEM_SHIFT, error_mem_read, notdirty_mem_write, NULL); 2165 #if defined(VBOX) 2165 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE) 2166 2166 cpu_register_io_memory(IO_MEM_RAM_MISSING >> IO_MEM_SHIFT, unassigned_mem_read, unassigned_mem_write, NULL); 2167 2167 io_mem_nb = 6;
Note:
See TracChangeset
for help on using the changeset viewer.