Changeset 18662 in vbox for trunk/src/recompiler_new
- Timestamp:
- Apr 2, 2009 6:35:32 PM (16 years ago)
- Location:
- trunk/src/recompiler_new
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler_new/Makefile.kmk
r17897 r18662 284 284 285 285 $$(PATH_VBoxREMImp)/VBoxREMWin.def: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(MAKEFILE_CURRENT) | $$(dir $$@) 286 ifdef VBOX_WITH_NEW_PHYS_CODE287 $(SED) -e '/REMR3NotifyPhysRamChunkRegister/d' --output $@ $<288 else289 286 $(CP) -f $< $@ 290 endif291 287 292 288 … … 305 301 306 302 include $(KBUILD_PATH)/subfooter.kmk 303 -
trunk/src/recompiler_new/VBoxREM.def
r17537 r18662 40 40 REMR3ReplayHandlerNotifications 41 41 REMR3NotifyPhysRamRegister 42 REMR3NotifyPhysRamChunkRegister43 42 REMR3NotifyPhysRamDeregister 44 43 REMR3NotifyPhysRomRegister -
trunk/src/recompiler_new/VBoxREMWrapper.cpp
r17537 r18662 348 348 static DECLCALLBACKPTR(void, pfnREMR3ReplayHandlerNotifications)(PVM pVM); 349 349 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamRegister)(PVM, RTGCPHYS, RTGCPHYS, unsigned); 350 #ifndef VBOX_WITH_NEW_PHYS_CODE351 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamChunkRegister)(PVM, RTGCPHYS, RTUINT, RTHCUINTPTR, unsigned);352 #endif353 350 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamDeregister)(PVM, RTGCPHYS, RTUINT); 354 351 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRomRegister)(PVM, RTGCPHYS, RTUINT, void *, bool); … … 1035 1032 { "REMR3ReplayHandlerNotifications", (void *)&pfnREMR3ReplayHandlerNotifications, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1036 1033 { "REMR3NotifyPhysRamRegister", (void *)&pfnREMR3NotifyPhysRamRegister, &g_aArgsNotifyPhysRamRegister[0], RT_ELEMENTS(g_aArgsNotifyPhysRamRegister), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1037 #ifndef VBOX_WITH_NEW_PHYS_CODE1038 { "REMR3NotifyPhysRamChunkRegister", (void *)&pfnREMR3NotifyPhysRamChunkRegister, &g_aArgsNotifyPhysRamChunkRegister[0], RT_ELEMENTS(g_aArgsNotifyPhysRamChunkRegister), REMFNDESC_FLAGS_RET_VOID, 0, NULL },1039 #endif1040 1034 { "REMR3NotifyPhysRamDeregister", (void *)&pfnREMR3NotifyPhysRamDeregister, &g_aArgsNotifyPhysRamDeregister[0], RT_ELEMENTS(g_aArgsNotifyPhysRamDeregister), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1041 1035 { "REMR3NotifyPhysRomRegister", (void *)&pfnREMR3NotifyPhysRomRegister, &g_aArgsNotifyPhysRomRegister[0], RT_ELEMENTS(g_aArgsNotifyPhysRomRegister), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, … … 1121 1115 { "PGMGstGetPage", (void *)(uintptr_t)&PGMGstGetPage, &g_aArgsPGMGstGetPage[0], RT_ELEMENTS(g_aArgsPGMGstGetPage), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1122 1116 { "PGMInvalidatePage", (void *)(uintptr_t)&PGMInvalidatePage, &g_aArgsPGMInvalidatePage[0], RT_ELEMENTS(g_aArgsPGMInvalidatePage), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1123 #ifndef VBOX_WITH_NEW_PHYS_CODE1124 { "PGM3PhysGrowRange", (void *)(uintptr_t)&PGM3PhysGrowRange, &g_aArgsPGM3PhysGrowRange[0], RT_ELEMENTS(g_aArgsPGM3PhysGrowRange), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },1125 #endif1126 1117 { "PGMPhysIsGCPhysValid", (void *)(uintptr_t)&PGMPhysIsGCPhysValid, &g_aArgsPGMPhysIsGCPhysValid[0], RT_ELEMENTS(g_aArgsPGMPhysIsGCPhysValid), REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL }, 1127 1118 { "PGMPhysIsA20Enabled", (void *)(uintptr_t)&PGMPhysIsA20Enabled, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL }, … … 2175 2166 } 2176 2167 2177 #ifndef VBOX_WITH_NEW_PHYS_CODE2178 REMR3DECL(void) REMR3NotifyPhysRamChunkRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, RTHCUINTPTR pvRam, unsigned fFlags)2179 {2180 #ifndef USE_REM_STUBS2181 Assert(VALID_PTR(pfnREMR3NotifyPhysRamChunkRegister));2182 pfnREMR3NotifyPhysRamChunkRegister(pVM, GCPhys, cb, pvRam, fFlags);2183 #endif2184 }2185 #endif2186 2187 2168 REMR3DECL(void) REMR3NotifyPhysRomRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, void *pvCopy, bool fShadow) 2188 2169 { -
trunk/src/recompiler_new/VBoxRecompiler.c
r18650 r18662 2755 2755 Assert(cb); 2756 2756 Assert(RT_ALIGN_Z(cb, PAGE_SIZE) == cb); 2757 #ifdef VBOX_WITH_NEW_PHYS_CODE2758 2757 AssertMsg(fFlags == REM_NOTIFY_PHYS_RAM_FLAGS_RAM || fFlags == REM_NOTIFY_PHYS_RAM_FLAGS_MMIO2, ("#x\n", fFlags)); 2759 #endif2760 2758 2761 2759 /* 2762 2760 * Base ram? Update GCPhysLastRam. 2763 2761 */ 2764 #ifdef VBOX_WITH_NEW_PHYS_CODE2765 2762 if (fFlags & REM_NOTIFY_PHYS_RAM_FLAGS_RAM) 2766 #else2767 if (!GCPhys)2768 #endif2769 2763 { 2770 2764 if (GCPhys + (cb - 1) > pVM->rem.s.GCPhysLastRam) … … 2781 2775 pVM->rem.s.fIgnoreAll = true; 2782 2776 2783 #ifdef VBOX_WITH_NEW_PHYS_CODE2784 cpu_register_physical_memory(GCPhys, cb, GCPhys);2785 #else2786 if (!GCPhys)2787 cpu_register_physical_memory(GCPhys, cb, GCPhys | IO_MEM_RAM_MISSING);2788 else2789 {2790 if (fFlags & MM_RAM_FLAGS_RESERVED)2791 cpu_register_physical_memory(GCPhys, cb, IO_MEM_UNASSIGNED);2792 else2793 cpu_register_physical_memory(GCPhys, cb, GCPhys);2794 }2795 #endif2796 Assert(pVM->rem.s.fIgnoreAll);2797 pVM->rem.s.fIgnoreAll = false;2798 }2799 2800 #ifndef VBOX_WITH_NEW_PHYS_CODE2801 2802 /**2803 * Notification about a successful PGMR3PhysRegisterChunk() call.2804 *2805 * @param pVM VM handle.2806 * @param GCPhys The physical address the RAM.2807 * @param cb Size of the memory.2808 * @param pvRam The HC address of the RAM.2809 * @param fFlags Flags of the MM_RAM_FLAGS_* defines.2810 */2811 REMR3DECL(void) REMR3NotifyPhysRamChunkRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, RTHCUINTPTR pvRam, unsigned fFlags)2812 {2813 Log(("REMR3NotifyPhysRamChunkRegister: GCPhys=%RGp cb=%d pvRam=%p fFlags=%d\n", GCPhys, cb, pvRam, fFlags));2814 VM_ASSERT_EMT(pVM);2815 2816 /*2817 * Validate input - we trust the caller.2818 */2819 Assert(pvRam);2820 Assert(RT_ALIGN(pvRam, PAGE_SIZE) == pvRam);2821 Assert(RT_ALIGN_T(GCPhys, PAGE_SIZE, RTGCPHYS) == GCPhys);2822 Assert(cb == PGM_DYNAMIC_CHUNK_SIZE);2823 Assert(fFlags == 0 /* normal RAM */);2824 Assert(!pVM->rem.s.fIgnoreAll);2825 pVM->rem.s.fIgnoreAll = true;2826 2777 cpu_register_physical_memory(GCPhys, cb, GCPhys); 2827 2778 Assert(pVM->rem.s.fIgnoreAll); … … 2829 2780 } 2830 2781 2831 2832 /**2833 * Grows dynamically allocated guest RAM.2834 * Will raise a fatal error if the operation fails.2835 *2836 * @param physaddr The physical address.2837 */2838 void remR3GrowDynRange(unsigned long physaddr) /** @todo Needs fixing for MSC... */2839 {2840 int rc;2841 PVM pVM = cpu_single_env->pVM;2842 const RTGCPHYS GCPhys = physaddr;2843 2844 LogFlow(("remR3GrowDynRange %RGp\n", (RTGCPTR)physaddr));2845 rc = PGM3PhysGrowRange(pVM, &GCPhys);2846 if (RT_SUCCESS(rc))2847 return;2848 2849 LogRel(("\nUnable to allocate guest RAM chunk at %RGp\n", (RTGCPTR)physaddr));2850 cpu_abort(cpu_single_env, "Unable to allocate guest RAM chunk at %RGp\n", (RTGCPTR)physaddr);2851 AssertFatalFailed();2852 }2853 2854 #endif /* !VBOX_WITH_NEW_PHYS_CODE */2855 2782 2856 2783 /** -
trunk/src/recompiler_new/cpu-all.h
r17420 r18662 249 249 250 250 #ifdef VBOX 251 void remAbort(int rc, const char *pszTip) __attribute__((__noreturn__)); 252 253 #ifndef VBOX_WITH_NEW_PHYS_CODE 254 void remR3GrowDynRange(unsigned long physaddr); 255 #endif 251 void remAbort(int rc, const char *pszTip) __attribute__((__noreturn__)); 256 252 257 253 void remR3PhysRead(RTGCPHYS SrcGCPhys, void *pvDst, unsigned cb); … … 1206 1202 #define IO_MEM_UNASSIGNED (2 << IO_MEM_SHIFT) 1207 1203 #define IO_MEM_NOTDIRTY (3 << IO_MEM_SHIFT) 1208 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE)1209 #define IO_MEM_RAM_MISSING (5 << IO_MEM_SHIFT) /* used internally, never use directly */1210 #endif1211 1204 1212 1205 /* Acts like a ROM when read and like a device when written. */ -
trunk/src/recompiler_new/exec.c
r18611 r18662 493 493 pd[i].phys_offset = IO_MEM_UNASSIGNED; 494 494 } 495 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE)496 pd = ((PhysPageDesc *)pd) + (index & (L2_SIZE - 1));497 if (RT_UNLIKELY((pd->phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM_MISSING))498 remR3GrowDynRange(pd->phys_offset & TARGET_PAGE_MASK);499 return pd;500 #else501 495 return ((PhysPageDesc *)pd) + (index & (L2_SIZE - 1)); 502 #endif503 496 } 504 497 … … 2121 2114 start1 = start + (unsigned long)phys_ram_base; 2122 2115 #else 2123 start1 = (unsigned long)remR3TlbGCPhys2Ptr(first_cpu, start, 1 /*fWritable*/); /** @todo this can be harmful with VBOX_WITH_NEW_PHYS_CODE, fix interface/whatever. */2116 start1 = (unsigned long)remR3TlbGCPhys2Ptr(first_cpu, start, 1 /*fWritable*/); /** @todo page replacing (sharing or read only) may cause trouble, fix interface/whatever. */ 2124 2117 #endif 2125 2118 for(env = first_cpu; env != NULL; env = env->next_cpu) { … … 2709 2702 } else { 2710 2703 p->phys_offset = phys_offset; 2711 #if !defined(VBOX) || defined(VBOX_WITH_NEW_PHYS_CODE)2712 2704 if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM || 2713 2705 (phys_offset & IO_MEM_ROMD)) 2714 #else2715 if ( (phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM2716 || (phys_offset & IO_MEM_ROMD)2717 || (phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM_MISSING)2718 #endif2719 2706 phys_offset += TARGET_PAGE_SIZE; 2720 2707 } … … 2722 2709 p = phys_page_find_alloc(addr >> TARGET_PAGE_BITS, 1); 2723 2710 p->phys_offset = phys_offset; 2724 #if !defined(VBOX) || defined(VBOX_WITH_NEW_PHYS_CODE)2725 2711 if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM || 2726 2712 (phys_offset & IO_MEM_ROMD)) 2727 #else2728 if ( (phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM2729 || (phys_offset & IO_MEM_ROMD)2730 || (phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM_MISSING)2731 #endif2732 2713 phys_offset += TARGET_PAGE_SIZE; 2733 2714 else { … … 3237 3218 cpu_register_io_memory(IO_MEM_UNASSIGNED >> IO_MEM_SHIFT, unassigned_mem_read, unassigned_mem_write, NULL); 3238 3219 cpu_register_io_memory(IO_MEM_NOTDIRTY >> IO_MEM_SHIFT, error_mem_read, notdirty_mem_write, NULL); 3239 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE)3240 cpu_register_io_memory(IO_MEM_RAM_MISSING >> IO_MEM_SHIFT, unassigned_mem_read, unassigned_mem_write, NULL);3241 io_mem_nb = 6;3242 #else3243 3220 io_mem_nb = 5; 3244 #endif3245 3221 3246 3222 io_mem_watch = cpu_register_io_memory(0, watch_mem_read,
Note:
See TracChangeset
for help on using the changeset viewer.