Search
lxdream.org :: lxdream :: r947:aa80962d6439
lxdream 0.9.1
released Jun 29
Download Now
changeset947:aa80962d6439 lxdream-mem
parent946:d41ee7994db7
child948:545c85cc56f1
authornkeynes
dateTue Jan 06 02:03:36 2009 +0000 (12 years ago)
branchlxdream-mem
Back out the CALL_ptr change (need to handle relocation from end-of-cache to
front in overflow situations)
src/sh4/ia32abi.h
1.1 --- a/src/sh4/ia32abi.h Tue Jan 06 01:58:08 2009 +0000
1.2 +++ b/src/sh4/ia32abi.h Tue Jan 06 02:03:36 2009 +0000
1.3 @@ -38,7 +38,8 @@
1.4 */
1.5 static inline void call_func0( void *ptr )
1.6 {
1.7 - CALL_ptr(ptr);
1.8 + load_imm32(R_ECX, (uint32_t)ptr);
1.9 + CALL_r32(R_ECX);
1.10 }
1.11
1.12 #ifdef HAVE_FASTCALL
1.13 @@ -47,7 +48,8 @@
1.14 if( arg1 != R_EAX ) {
1.15 MOV_r32_r32( arg1, R_EAX );
1.16 }
1.17 - CALL_ptr(ptr);
1.18 + load_imm32(R_ECX, (uint32_t)ptr);
1.19 + CALL_r32(R_ECX);
1.20 }
1.21
1.22 static inline void call_func1_r32( int addr_reg, int arg1 )
1.23 @@ -83,7 +85,8 @@
1.24 if( arg1 != R_EAX ) {
1.25 MOV_r32_r32( arg1, R_EAX );
1.26 }
1.27 - CALL_ptr(ptr);
1.28 + load_imm32(R_ECX, (uint32_t)ptr);
1.29 + CALL_r32(R_ECX);
1.30 }
1.31
1.32 static inline void call_func2_r32( int addr_reg, int arg1, int arg2 )
1.33 @@ -128,7 +131,8 @@
1.34 MOV_r32_r32( arg1, R_EAX );
1.35 }
1.36 load_exc_backpatch(R_EDX);
1.37 - CALL_ptr(ptr);
1.38 + load_imm32(R_ECX, (uint32_t)ptr);
1.39 + CALL_r32(R_ECX);
1.40 }
1.41
1.42 static inline void call_func2_exc( void *ptr, int arg1, int arg2, int pc )
1.43 @@ -139,8 +143,9 @@
1.44 if( arg1 != R_EAX ) {
1.45 MOV_r32_r32( arg1, R_EAX );
1.46 }
1.47 - load_exc_backpatch(R_ECX);
1.48 - CALL_ptr(ptr);
1.49 + MOV_backpatch_esp8(0);
1.50 + load_imm32(R_ECX, (uint32_t)ptr);
1.51 + CALL_r32(R_ECX);
1.52 }
1.53
1.54 #else
1.55 @@ -148,7 +153,8 @@
1.56 {
1.57 SUB_imm8s_r32( 12, R_ESP );
1.58 PUSH_r32(arg1);
1.59 - CALL_ptr(ptr);
1.60 + load_imm32(R_ECX, (uint32_t)ptr);
1.61 + CALL_r32(R_ECX);
1.62 ADD_imm8s_r32( 16, R_ESP );
1.63 }
1.64
1.65 @@ -157,7 +163,8 @@
1.66 SUB_imm8s_r32( 8, R_ESP );
1.67 PUSH_r32(arg2);
1.68 PUSH_r32(arg1);
1.69 - CALL_ptr(ptr);
1.70 + load_imm32(R_ECX, (uint32_t)ptr);
1.71 + CALL_r32(R_ECX);
1.72 ADD_imm8s_r32( 16, R_ESP );
1.73 }
1.74
.