Search
lxdream.org :: lxdream/src/sh4/ia32abi.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/ia32abi.h
changeset 939:6f2302afeb89
prev930:07e5b11419db
next944:a4e31314bee1
author nkeynes
date Sat Jan 03 03:30:26 2009 +0000 (15 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change MMU work-in-progress
* Move SDRAM out into separate sdram.c
* Move all page-table management into mmu.c
* Convert UTLB management to use the new page-tables
* Rip out all calls to mmu_vma_to_phys_* and replace with direct access
file annotate diff log raw
1.1 --- a/src/sh4/ia32abi.h Mon Dec 22 09:51:11 2008 +0000
1.2 +++ b/src/sh4/ia32abi.h Sat Jan 03 03:30:26 2009 +0000
1.3 @@ -65,6 +65,15 @@
1.4 CALL_r32disp8(preg, disp8);
1.5 }
1.6
1.7 +static inline void call_func1_r32disp8_exc( int preg, uint32_t disp8, int arg1, int pc )
1.8 +{
1.9 + if( arg1 != R_EAX ) {
1.10 + MOV_r32_r32( arg1, R_EAX );
1.11 + }
1.12 + load_exc_backpatch(R_EDX);
1.13 + CALL_r32disp8(preg, disp8);
1.14 +}
1.15 +
1.16 static inline void call_func2( void *ptr, int arg1, int arg2 )
1.17 {
1.18 if( arg2 != R_EDX ) {
1.19 @@ -98,6 +107,18 @@
1.20 CALL_r32disp8(preg, disp8);
1.21 }
1.22
1.23 +static inline void call_func2_r32disp8_exc( int preg, uint32_t disp8, int arg1, int arg2, int pc )
1.24 +{
1.25 + if( arg2 != R_EDX ) {
1.26 + MOV_r32_r32( arg2, R_EDX );
1.27 + }
1.28 + if( arg1 != R_EAX ) {
1.29 + MOV_r32_r32( arg1, R_EAX );
1.30 + }
1.31 + MOV_backpatch_esp8( 0 );
1.32 + CALL_r32disp8(preg, disp8);
1.33 +}
1.34 +
1.35
1.36
1.37 static inline void call_func1_exc( void *ptr, int arg1, int pc )
1.38 @@ -121,35 +142,6 @@
1.39 CALL_ptr(ptr);
1.40 }
1.41
1.42 -/**
1.43 - * Write a double (64-bit) value into memory, with the first word in arg2a, and
1.44 - * the second in arg2b
1.45 - */
1.46 -static inline void MEM_WRITE_DOUBLE( int addr, int arg2a, int arg2b )
1.47 -{
1.48 - MOV_r32_esp8(addr, 0);
1.49 - MOV_r32_esp8(arg2b, 4);
1.50 - MEM_WRITE_LONG(addr, arg2a);
1.51 - MOV_esp8_r32(0, R_EAX);
1.52 - MOV_esp8_r32(4, R_EDX);
1.53 - ADD_imm8s_r32(4, R_EAX);
1.54 - MEM_WRITE_LONG(R_EAX, R_EDX);
1.55 -}
1.56 -
1.57 -/**
1.58 - * Read a double (64-bit) value from memory, writing the first word into arg2a
1.59 - * and the second into arg2b. The addr must not be in EAX
1.60 - */
1.61 -static inline void MEM_READ_DOUBLE( int addr, int arg2a, int arg2b )
1.62 -{
1.63 - MOV_r32_esp8(addr, 0);
1.64 - MEM_READ_LONG(addr, R_EAX);
1.65 - MOV_r32_esp8(R_EAX, 4);
1.66 - MOV_esp8_r32(0, R_EAX);
1.67 - ADD_imm8s_r32(4, R_EAX);
1.68 - MEM_READ_LONG(R_EAX, arg2b );
1.69 - MOV_esp8_r32(4, arg2a);
1.70 -}
1.71 #else
1.72 static inline void call_func1( void *ptr, int arg1 )
1.73 {
1.74 @@ -168,44 +160,6 @@
1.75 ADD_imm8s_r32( 16, R_ESP );
1.76 }
1.77
1.78 -/**
1.79 - * Write a double (64-bit) value into memory, with the first word in arg2a, and
1.80 - * the second in arg2b
1.81 - */
1.82 -static inline void MEM_WRITE_DOUBLE( int addr, int arg2a, int arg2b )
1.83 -{
1.84 - SUB_imm8s_r32( 8, R_ESP );
1.85 - PUSH_r32(arg2b);
1.86 - LEA_r32disp8_r32( addr, 4, arg2b );
1.87 - PUSH_r32(arg2b);
1.88 - SUB_imm8s_r32( 8, R_ESP );
1.89 - PUSH_r32(arg2a);
1.90 - PUSH_r32(addr);
1.91 - CALL_ptr(sh4_write_long);
1.92 - ADD_imm8s_r32( 16, R_ESP );
1.93 - CALL_ptr(sh4_write_long);
1.94 - ADD_imm8s_r32( 16, R_ESP );
1.95 -}
1.96 -
1.97 -/**
1.98 - * Read a double (64-bit) value from memory, writing the first word into arg2a
1.99 - * and the second into arg2b. The addr must not be in EAX
1.100 - */
1.101 -static inline void MEM_READ_DOUBLE( int addr, int arg2a, int arg2b )
1.102 -{
1.103 - SUB_imm8s_r32( 12, R_ESP );
1.104 - PUSH_r32(addr);
1.105 - CALL_ptr(sh4_read_long);
1.106 - MOV_r32_esp8(R_EAX, 4);
1.107 - ADD_imm8s_esp8(4, 0);
1.108 - CALL_ptr(sh4_read_long);
1.109 - if( arg2b != R_EAX ) {
1.110 - MOV_r32_r32( R_EAX, arg2b );
1.111 - }
1.112 - MOV_esp8_r32( 4, arg2a );
1.113 - ADD_imm8s_r32( 16, R_ESP );
1.114 -}
1.115 -
1.116 #endif
1.117
1.118 /**
.