Changeset 14277
- Timestamp:
- 11/20/08 19:14:47 (2 months ago)
- Files:
-
- trunk/src/recompiler_new/Sun/config.h (modified) (1 diff)
- trunk/src/recompiler_new/VBoxRecompiler.c (modified) (3 diffs)
- trunk/src/recompiler_new/cpu-all.h (modified) (4 diffs)
- trunk/src/recompiler_new/exec.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/recompiler_new/Sun/config.h
r13968 r14277 38 38 /* Uncomment to see generated code */ 39 39 /* #define DEBUG_DISAS */ 40 41 #if 0 /*defined(RT_ARCH_AMD64) && defined(VBOX_STRICT)*/ 42 # define VBOX_CHECK_ADDR(ptr) do { if ((uintptr_t)(ptr) >= _4G) __asm__("int3"); } while (0) 43 #else 44 # define VBOX_CHECK_ADDR(ptr) do { } while (0) 45 #endif trunk/src/recompiler_new/VBoxRecompiler.c
r14241 r14277 29 29 #include "exec-all.h" 30 30 #include "config.h" 31 #include "cpu-all.h" 31 32 32 33 void cpu_exec_init_all(unsigned long tb_size); … … 2785 2786 Assert(!pVM->rem.s.fIgnoreAll); 2786 2787 pVM->rem.s.fIgnoreAll = true; 2787 #ifdef REM_PHYS_ADDR_IN_TLB2788 2788 cpu_register_physical_memory(GCPhys, cb, GCPhys); 2789 #else2790 cpu_register_physical_memory(GCPhys, cb, pvRam);2791 #endif2792 2793 2789 Assert(pVM->rem.s.fIgnoreAll); 2794 2790 pVM->rem.s.fIgnoreAll = false; … … 3087 3083 AssertFatalFailed(); 3088 3084 } 3089 3090 3091 /** Validate the physical address passed to the read functions.3092 * Useful for finding non-guest-ram reads/writes. */3093 #if 0 //1 /* disable if it becomes bothersome... */3094 # define VBOX_CHECK_ADDR(GCPhys) AssertMsg(PGMPhysIsGCPhysValid(cpu_single_env->pVM, (GCPhys)), ("%RGp\n", (GCPhys)))3095 #else3096 # define VBOX_CHECK_ADDR(GCPhys) do { } while (0)3097 #endif3098 3085 3099 3086 /** trunk/src/recompiler_new/cpu-all.h
r13839 r14277 247 247 * kernel : kernel mode access using soft MMU 248 248 */ 249 249 250 #ifdef VBOX 251 #ifndef VBOX_WITH_NEW_PHYS_CODE 252 void remR3GrowDynRange(unsigned long physaddr); 253 #endif 250 254 251 255 void remR3PhysRead(RTGCPHYS SrcGCPhys, void *pvDst, unsigned cb); … … 264 268 void remR3PhysWriteU64(RTGCPHYS DstGCPhys, uint64_t val); 265 269 266 #ifndef VBOX_WITH_NEW_PHYS_CODE267 void remR3GrowDynRange(unsigned long physaddr);268 #endif 269 # if 0 /*defined(RT_ARCH_AMD64) && defined(VBOX_STRICT)*/270 # define VBOX_CHECK_ADDR(ptr) do { if ((uintptr_t)(ptr) >= _4G) __asm__("int3"); } while (0) 271 #e lse272 # define VBOX_CHECK_ADDR(ptr) do { } while (0) 273 # endif270 #ifndef REM_PHYS_ADDR_IN_TLB 271 target_ulong remR3HCVirt2GCPhys(CPUState *env1, void *addr); 272 void* remR3GCPhys2HCVirt(CPUState *env1, target_ulong physAddr); 273 #endif 274 275 #endif /* VBOX */ 276 277 #if defined(VBOX) && defined(REM_PHYS_ADDR_IN_TLB) 274 278 275 279 DECLINLINE(int) ldub_p(void *ptr) … … 373 377 } 374 378 375 #else /* ! VBOX*/379 #else /* !(VBOX && REM_PHYS_ADDR_IN_TLB) */ 376 380 377 381 static inline int ldub_p(void *ptr) … … 909 913 #define g2h(x) ((void *)((unsigned long)(x) + GUEST_BASE)) 910 914 #define h2g(x) ((target_ulong)(x - GUEST_BASE)) 911 912 915 #define saddr(x) g2h(x) 913 916 #define laddr(x) g2h(x) trunk/src/recompiler_new/exec.c
r13731 r14277 2069 2069 tlb_entry->addend - (unsigned long)phys_ram_base; 2070 2070 #else 2071 ram_addr = remR3HCVirt2GCPhys(first_cpu, ( tlb_entry->addr_write & TARGET_PAGE_MASK) + tlb_entry->addend);2071 ram_addr = remR3HCVirt2GCPhys(first_cpu, (void*)((tlb_entry->addr_write & TARGET_PAGE_MASK) + tlb_entry->addend)); 2072 2072 #endif 2073 2073 if (!cpu_physical_memory_is_dirty(ram_addr)) { … … 2701 2701 unsigned long ram_addr; 2702 2702 int dirty_flags; 2703 #if defined(VBOX) && defined(REM_PHYS_ADDR_IN_TLB)2703 #if defined(VBOX) 2704 2704 ram_addr = addr; 2705 #elif !defined(VBOX)2705 #elif 2706 2706 ram_addr = addr - (unsigned long)phys_ram_base; 2707 #else2708 ram_addr = remR3HCVirt2GCPhys(first_cpu, (void *)addr);2709 2707 #endif 2710 2708 #ifdef VBOX … … 2725 2723 #endif 2726 2724 } 2725 #if defined(VBOX) && !defined(REM_PHYS_ADDR_IN_TLB) 2726 remR3PhysWriteU8(addr, val); 2727 #else 2727 2728 stb_p((uint8_t *)(long)addr, val); 2729 #endif 2728 2730 #ifdef USE_KQEMU 2729 2731 if (cpu_single_env->kqemu_enabled && … … 2746 2748 unsigned long ram_addr; 2747 2749 int dirty_flags; 2748 #if defined(VBOX) && defined(REM_PHYS_ADDR_IN_TLB)2750 #if defined(VBOX) 2749 2751 ram_addr = addr; 2750 #el if !defined(VBOX)2752 #else 2751 2753 ram_addr = addr - (unsigned long)phys_ram_base; 2752 #else2753 ram_addr = remR3HCVirt2GCPhys(first_cpu, (void *)addr);2754 2754 #endif 2755 2755 #ifdef VBOX … … 2770 2770 #endif 2771 2771 } 2772 #if defined(VBOX) && !defined(REM_PHYS_ADDR_IN_TLB) 2773 remR3PhysWriteU16(addr, val); 2774 #else 2772 2775 stw_p((uint8_t *)(long)addr, val); 2776 #endif 2777 2773 2778 #ifdef USE_KQEMU 2774 2779 if (cpu_single_env->kqemu_enabled && … … 2791 2796 unsigned long ram_addr; 2792 2797 int dirty_flags; 2793 #if defined(VBOX) && defined(REM_PHYS_ADDR_IN_TLB)2798 #if defined(VBOX) 2794 2799 ram_addr = addr; 2795 #el if !defined(VBOX)2800 #else 2796 2801 ram_addr = addr - (unsigned long)phys_ram_base; 2797 #else2798 ram_addr = remR3HCVirt2GCPhys(first_cpu, (void *)addr);2799 2802 #endif 2800 2803 #ifdef VBOX … … 2815 2818 #endif 2816 2819 } 2820 #if defined(VBOX) && !defined(REM_PHYS_ADDR_IN_TLB) 2821 remR3PhysWriteU32(addr, val); 2822 #else 2817 2823 stl_p((uint8_t *)(long)addr, val); 2824 #endif 2818 2825 #ifdef USE_KQEMU 2819 2826 if (cpu_single_env->kqemu_enabled &&

