Search
lxdream.org :: lxdream/src/sh4/shadow.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/shadow.c
changeset 1202:01ae5cbad4c8
prev1201:5502572ce192
next1217:677b1d85f1b4
author nkeynes
date Fri Dec 23 08:20:17 2011 +1000 (8 years ago)
permissions -rw-r--r--
last change Move the exception exit macros up to sh4core.h
file annotate diff log raw
1.1 --- a/src/sh4/shadow.c Thu Dec 22 18:10:36 2011 +1000
1.2 +++ b/src/sh4/shadow.c Fri Dec 23 08:20:17 2011 +1000
1.3 @@ -31,10 +31,8 @@
1.4 #ifdef HAVE_FRAME_ADDRESS
1.5 static FASTCALL __attribute__((noinline)) void *__first_arg(void *a, void *b) { return a; }
1.6 #define INIT_EXCEPTIONS(label) goto *__first_arg(&&fnstart,&&label); fnstart:
1.7 -#define EXCEPTION_EXIT(exc) do{ *(((void * volatile *)__builtin_frame_address(0))+1) = exc; } while(0)
1.8 #else
1.9 #define INIT_EXCEPTIONS(label)
1.10 -#define EXCEPTION_EXIT(exc) sh4_core_exit(CORE_EXIT_EXCEPTION)
1.11 #endif
1.12
1.13 typedef enum {
1.14 @@ -211,7 +209,7 @@
1.15 return rv;
1.16 except:
1.17 log_mem_op( READ_LONG, addr, rv, 1 );
1.18 - EXCEPTION_EXIT(exc);
1.19 + SH4_EXCEPTION_EXIT();
1.20 }
1.21
1.22 static FASTCALL int32_t log_read_word( sh4addr_t addr, void *exc )
1.23 @@ -222,7 +220,7 @@
1.24 return rv;
1.25 except:
1.26 log_mem_op( READ_WORD, addr, rv, 1 );
1.27 - EXCEPTION_EXIT(exc);
1.28 + SH4_EXCEPTION_EXIT();
1.29 }
1.30
1.31 static FASTCALL int32_t log_read_byte( sh4addr_t addr, void *exc )
1.32 @@ -233,7 +231,7 @@
1.33 return rv;
1.34 except:
1.35 log_mem_op( READ_BYTE, addr, rv, 1 );
1.36 - EXCEPTION_EXIT(exc);
1.37 + SH4_EXCEPTION_EXIT();
1.38 }
1.39
1.40 static FASTCALL int32_t log_read_byte_for_write( sh4addr_t addr, void *exc )
1.41 @@ -244,7 +242,7 @@
1.42 return rv;
1.43 except:
1.44 log_mem_op( READ_BYTE_FOR_WRITE, addr, rv, 1 );
1.45 - EXCEPTION_EXIT(exc);
1.46 + SH4_EXCEPTION_EXIT();
1.47 }
1.48
1.49 static FASTCALL void log_write_long( sh4addr_t addr, uint32_t val, void *exc )
1.50 @@ -257,7 +255,7 @@
1.51 except:
1.52 if( !IS_STORE_QUEUE(addr) )
1.53 log_mem_op( WRITE_LONG, addr, val, 1 );
1.54 - EXCEPTION_EXIT(exc);
1.55 + SH4_EXCEPTION_EXIT();
1.56 }
1.57
1.58 static FASTCALL void log_write_word( sh4addr_t addr, uint32_t val, void *exc )
1.59 @@ -270,7 +268,7 @@
1.60 except:
1.61 if( !IS_STORE_QUEUE(addr) )
1.62 log_mem_op( WRITE_WORD, addr, val, 1 );
1.63 - EXCEPTION_EXIT(exc);
1.64 + SH4_EXCEPTION_EXIT();
1.65 }
1.66
1.67 static FASTCALL void log_write_byte( sh4addr_t addr, uint32_t val, void *exc )
1.68 @@ -283,7 +281,7 @@
1.69 except:
1.70 if( !IS_STORE_QUEUE(addr) )
1.71 log_mem_op( WRITE_BYTE, addr, val, 1 );
1.72 - EXCEPTION_EXIT(exc);
1.73 + SH4_EXCEPTION_EXIT();
1.74 }
1.75
1.76 static FASTCALL void log_prefetch( sh4addr_t addr, void *exc )
1.77 @@ -294,7 +292,7 @@
1.78 return;
1.79 except:
1.80 log_mem_op( PREFETCH, addr, 0, 1 );
1.81 - EXCEPTION_EXIT(exc);
1.82 + SH4_EXCEPTION_EXIT();
1.83 }
1.84
1.85 static FASTCALL int32_t check_read_long( sh4addr_t addr, void *exc )
1.86 @@ -302,7 +300,7 @@
1.87 int except;
1.88 int32_t value = check_mem_op( READ_LONG, addr, 0, &except );
1.89 if( except ) {
1.90 - EXCEPTION_EXIT(exc);
1.91 + SH4_EXCEPTION_EXIT();
1.92 }
1.93 return value;
1.94 }
1.95 @@ -312,7 +310,7 @@
1.96 int except;
1.97 int32_t value = check_mem_op( READ_WORD, addr, 0, &except );
1.98 if( except ) {
1.99 - EXCEPTION_EXIT(exc);
1.100 + SH4_EXCEPTION_EXIT();
1.101 }
1.102 return value;
1.103 }
1.104 @@ -322,7 +320,7 @@
1.105 int except;
1.106 int32_t value = check_mem_op( READ_BYTE, addr, 0, &except );
1.107 if( except ) {
1.108 - EXCEPTION_EXIT(exc);
1.109 + SH4_EXCEPTION_EXIT();
1.110 }
1.111 return value;
1.112 }
1.113 @@ -332,7 +330,7 @@
1.114 int except;
1.115 int32_t value = check_mem_op( READ_BYTE_FOR_WRITE, addr, 0, &except );
1.116 if( except ) {
1.117 - EXCEPTION_EXIT(exc);
1.118 + SH4_EXCEPTION_EXIT();
1.119 }
1.120 return value;
1.121 }
1.122 @@ -343,7 +341,7 @@
1.123 int except;
1.124 check_mem_op( WRITE_LONG, addr, value, &except );
1.125 if( except ) {
1.126 - EXCEPTION_EXIT(exc);
1.127 + SH4_EXCEPTION_EXIT();
1.128 }
1.129 } else {
1.130 real_address_space[addr>>12]->write_long(addr, value);
1.131 @@ -356,7 +354,7 @@
1.132 int except;
1.133 check_mem_op( WRITE_WORD, addr, value, &except );
1.134 if( except ) {
1.135 - EXCEPTION_EXIT(exc);
1.136 + SH4_EXCEPTION_EXIT();
1.137 }
1.138 } else {
1.139 real_address_space[addr>>12]->write_word(addr, value);
1.140 @@ -369,7 +367,7 @@
1.141 int except;
1.142 check_mem_op( WRITE_BYTE, addr, value, &except );
1.143 if( except ) {
1.144 - EXCEPTION_EXIT(exc);
1.145 + SH4_EXCEPTION_EXIT();
1.146 }
1.147 } else {
1.148 real_address_space[addr>>12]->write_byte(addr, value);
1.149 @@ -381,7 +379,7 @@
1.150 int except;
1.151 check_mem_op( PREFETCH, addr, 0, &except );
1.152 if( except ) {
1.153 - EXCEPTION_EXIT(exc);
1.154 + SH4_EXCEPTION_EXIT();
1.155 }
1.156 }
1.157
.