Changeset 15009 in vbox
- Timestamp:
- Dec 4, 2008 11:27:46 PM (16 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/REMInternal.h
r13565 r15009 288 288 void remR3DmaRun(CPUState *env); 289 289 void remR3TimersRun(CPUState *env); 290 int remR3NotifyTrap(CPUState *env, uint32_t uTrap, uint32_t uErrorCode, uint32_tpvNextEIP);290 int remR3NotifyTrap(CPUState *env, uint32_t uTrap, uint32_t uErrorCode, RTGCPTR pvNextEIP); 291 291 void remR3TrapStat(CPUState *env, uint32_t uTrap); 292 292 void remR3CpuId(CPUState *env, unsigned uOperator, void *pvEAX, void *pvEBX, void *pvECX, void *pvEDX); -
trunk/src/recompiler_new/Makefile.kmk
r14980 r15009 33 33 endif 34 34 35 TEMPLATE_DUMMY = dummy template (move to kBuild) 35 36 ifeq ($(KBUILD_TARGET), win) 36 TEMPLATE_DUMMY = dummy template (move to kBuild)37 37 $(REM_MOD)_TOOL.win.x86 = MINGW32 38 38 $(REM_MOD)_TOOL.win.amd64 = XGCCAMD64LINUX … … 40 40 $(REM_MOD)_SDKS.win.x86 = W32API 41 41 $(REM_MOD)_ASFLAGS = -x assembler-with-cpp 42 $(REM_MOD)_CFLAGS = -Wall -g43 $(REM_MOD)_CFLAGS.debug = -O0 44 $(REM_MOD)_CFLAGS.release += -fno-gcse -O2 42 $(REM_MOD)_CFLAGS = -Wall 43 $(REM_MOD)_CFLAGS.debug = -O0 -g 44 $(REM_MOD)_CFLAGS.release += -fno-gcse -O2 45 45 $(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release) 46 46 $(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release) … … 55 55 USE_REM_IMP = 1 56 56 else 57 $(REM_MOD)_TEMPLATE = VBOXR3NP 57 58 # Unfortunately little pinguins tend to have default compilers no suitable 59 # for real compilation, so search better alternatives 60 if1of ($(KBUILD_TARGET), linux) 61 $(REM_MOD)_TOOL = GCC3V3 62 $(REM_MOD)_TEMPLATE = DUMMY 63 $(REM_MOD)_CFLAGS = -fPIC \ 64 -Wall -fno-strict-aliasing -Wno-unused \ 65 -Wno-long-long -Wno-sign-compare 66 $(REM_MOD)_CFLAGS.x86 = -m32 67 $(REM_MOD)_CFLAGS.amd64 = -m64 68 $(REM_MOD)_CFLAGS.debug = -g -O0 69 $(REM_MOD)_CFLAGS.release += -O2 70 else 71 $(REM_MOD)_TEMPLATE = VBOXR3N 72 endif 58 73 59 74 IMPORT_LIBS += VBoxREM -
trunk/src/recompiler_new/VBoxRecompiler.c
r14974 r15009 751 751 Assert(!(interrupt_request & ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXIT | CPU_INTERRUPT_EXITTB | CPU_INTERRUPT_TIMER | CPU_INTERRUPT_EXTERNAL_HARD | CPU_INTERRUPT_EXTERNAL_EXIT | CPU_INTERRUPT_EXTERNAL_TIMER))); 752 752 Assert(!pVM->rem.s.Env.singlestep_enabled); 753 #if 1754 755 753 /* 756 754 * Now we set the execute single instruction flag and enter the cpu_exec loop. … … 853 851 * Switch back the state. 854 852 */ 855 #else856 pVM->rem.s.Env.interrupt_request = 0;857 cpu_single_step(&pVM->rem.s.Env, 1);858 859 /*860 * Execute and handle the return code.861 * We execute without enabling the cpu tick, so on success we'll862 * just flip it on and off to make sure it moves.863 *864 * (We do not use emulate_single_instr() because that doesn't enter the865 * right way in will cause serious trouble if a longjmp was attempted.)866 */867 # ifdef DEBUG_bird868 remR3DisasInstr(&pVM->rem.s.Env, 1, "REMR3EmulateInstruction");869 # endif870 TMNotifyStartOfExecution(pVM);871 int cTimesMax = 16384;872 uint32_t eip = pVM->rem.s.Env.eip;873 do874 {875 rc = cpu_exec(&pVM->rem.s.Env);876 877 } while ( eip == pVM->rem.s.Env.eip878 && (rc == EXCP_DEBUG || rc == EXCP_EXECUTE_RAW)879 && --cTimesMax > 0);880 TMNotifyEndOfExecution(pVM);881 switch (rc)882 {883 /*884 * Single step, we assume!885 * If there was a breakpoint there we're fucked now.886 */887 case EXCP_DEBUG:888 {889 Log2(("REMR3EmulateInstruction: cpu_exec -> EXCP_DEBUG\n"));890 rc = VINF_EM_RESCHEDULE;891 break;892 }893 894 /*895 * We cannot be interrupted!896 */897 case EXCP_INTERRUPT:898 AssertMsgFailed(("Shouldn't happen! Everything was locked!\n"));899 rc = VERR_INTERNAL_ERROR;900 break;901 902 /*903 * hlt instruction.904 */905 case EXCP_HLT:906 Log2(("REMR3EmulateInstruction: cpu_exec -> EXCP_HLT\n"));907 rc = VINF_EM_HALT;908 break;909 910 /*911 * The VM has halted.912 */913 case EXCP_HALTED:914 Log2(("REMR3EmulateInstruction: cpu_exec -> EXCP_HALTED\n"));915 rc = VINF_EM_HALT;916 break;917 918 /*919 * Switch to RAW-mode.920 */921 case EXCP_EXECUTE_RAW:922 Log2(("REMR3EmulateInstruction: cpu_exec -> EXCP_EXECUTE_RAW\n"));923 rc = VINF_EM_RESCHEDULE_RAW;924 break;925 926 /*927 * Switch to hardware accelerated RAW-mode.928 */929 case EXCP_EXECUTE_HWACC:930 Log2(("REMR3EmulateInstruction: cpu_exec -> EXCP_EXECUTE_HWACC\n"));931 rc = VINF_EM_RESCHEDULE_HWACC;932 break;933 934 /*935 * An EM RC was raised (VMR3Reset/Suspend/PowerOff/some-fatal-error).936 */937 case EXCP_RC:938 Log2(("REMR3EmulateInstruction: cpu_exec -> EXCP_RC rc=%Rrc\n", pVM->rem.s.rc));939 rc = pVM->rem.s.rc;940 pVM->rem.s.rc = VERR_INTERNAL_ERROR;941 break;942 943 /*944 * Figure out the rest when they arrive....945 */946 default:947 AssertMsgFailed(("rc=%d\n", rc));948 Log2(("REMR3EmulateInstruction: cpu_exec -> %d\n", rc));949 rc = VINF_SUCCESS;950 break;951 }952 953 /*954 * Switch back the state.955 */956 cpu_single_step(&pVM->rem.s.Env, 0);957 #endif958 853 pVM->rem.s.Env.interrupt_request = interrupt_request; 959 854 rc2 = REMR3StateBack(pVM); … … 1581 1476 * @param pvNextEIP Next EIP 1582 1477 */ 1583 int remR3NotifyTrap(CPUState *env, uint32_t uTrap, uint32_t uErrorCode, uint32_tpvNextEIP)1478 int remR3NotifyTrap(CPUState *env, uint32_t uTrap, uint32_t uErrorCode, RTGCPTR pvNextEIP) 1584 1479 { 1585 1480 PVM pVM = env->pVM; … … 1602 1497 } 1603 1498 #endif 1604 Log(("remR3NotifyTrap: uTrap=%x error=%x next_eip=%RGv eip=%RGv cr2=%RGv\n", uTrap, uErrorCode, (RTGCPTR)pvNextEIP, (RTGCPTR)env->eip, (RTGCPTR)env->cr[2]));1499 Log(("remR3NotifyTrap: uTrap=%x error=%x next_eip=%RGv eip=%RGv cr2=%RGv\n", uTrap, uErrorCode, pvNextEIP, (RTGCPTR)env->eip, (RTGCPTR)env->cr[2])); 1605 1500 if( uTrap < 0x20 1606 1501 && (env->cr[0] & X86_CR0_PE) … … 1612 1507 if(pVM->rem.s.uPendingException == uTrap && ++pVM->rem.s.cPendingExceptions > 512) 1613 1508 { 1614 LogRel(("VERR_REM_TOO_MANY_TRAPS -> uTrap=%x error=%x next_eip=%RGv eip=%RGv cr2=%RGv\n", uTrap, uErrorCode, (RTGCPTR)pvNextEIP, (RTGCPTR)env->eip, (RTGCPTR)env->cr[2]));1509 LogRel(("VERR_REM_TOO_MANY_TRAPS -> uTrap=%x error=%x next_eip=%RGv eip=%RGv cr2=%RGv\n", uTrap, uErrorCode, pvNextEIP, (RTGCPTR)env->eip, (RTGCPTR)env->cr[2])); 1615 1510 remR3RaiseRC(env->pVM, VERR_REM_TOO_MANY_TRAPS); 1616 1511 return VERR_REM_TOO_MANY_TRAPS; … … 2141 2036 Assert(pVM->rem.s.fInREM); 2142 2037 2143 2038 /* 2144 2039 * Copy back the registers. 2145 2040 * This is done in the order they are declared in the CPUMCTX structure. -
trunk/src/recompiler_new/cpu-all.h
r14969 r15009 279 279 #if defined(VBOX) && defined(REM_PHYS_ADDR_IN_TLB) 280 280 281 DECLINLINE( int) ldub_p(void *ptr)281 DECLINLINE(uint8_t) ldub_p(void *ptr) 282 282 { 283 283 VBOX_CHECK_ADDR(ptr); … … 285 285 } 286 286 287 DECLINLINE(int ) ldsb_p(void *ptr)287 DECLINLINE(int8_t) ldsb_p(void *ptr) 288 288 { 289 289 VBOX_CHECK_ADDR(ptr); … … 297 297 } 298 298 299 DECLINLINE( int) lduw_le_p(void *ptr)299 DECLINLINE(uint32_t) lduw_le_p(void *ptr) 300 300 { 301 301 VBOX_CHECK_ADDR(ptr); … … 303 303 } 304 304 305 DECLINLINE(int ) ldsw_le_p(void *ptr)305 DECLINLINE(int32_t) ldsw_le_p(void *ptr) 306 306 { 307 307 VBOX_CHECK_ADDR(ptr); … … 315 315 } 316 316 317 DECLINLINE( int) ldl_le_p(void *ptr)317 DECLINLINE(uint32_t) ldl_le_p(void *ptr) 318 318 { 319 319 VBOX_CHECK_ADDR(ptr); -
trunk/src/recompiler_new/target-i386/op_helper.c
r14542 r15009 5643 5643 target_ulong old_eip; 5644 5644 5645 /* ensures env is loaded in ebp! */5645 /* ensures env is loaded! */ 5646 5646 CPUX86State *savedenv = env; 5647 5647 env = env1; -
trunk/src/recompiler_new/target-i386/translate.c
r14742 r15009 4640 4640 s->rip_offset = 0; /* for relative ip address */ 4641 4641 #ifdef VBOX 4642 /* nike: seems only slow down things */ 4643 # if 0 4642 4644 /* Always update EIP. Otherwise one must be very careful with generated code that can raise exceptions. */ 4645 4643 4646 gen_update_eip(pc_start - s->cs_base); 4644 #endif 4647 # endif 4648 #endif 4649 4645 4650 next_byte: 4646 4651 b = ldub_code(s->pc);
Note:
See TracChangeset
for help on using the changeset viewer.