revision 367:9c52dcbad3fb
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 367:9c52dcbad3fb |
parent | 366:6fb0d05152d7 |
child | 368:36fac4c42322 |
author | nkeynes |
date | Tue Sep 04 08:38:33 2007 +0000 (16 years ago) |
Move EXC_* codes to sh4core.h and rename to match the EX_* codes
src/sh4/sh4core.c | view | annotate | diff | log | ||
src/sh4/sh4core.h | view | annotate | diff | log | ||
src/sh4/sh4core.in | view | annotate | diff | log |
1.1 --- a/src/sh4/sh4core.c Tue Sep 04 08:32:44 2007 +00001.2 +++ b/src/sh4/sh4core.c Tue Sep 04 08:38:33 2007 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: sh4core.c,v 1.41 2007-08-23 12:33:27 nkeynes Exp $1.6 + * $Id: sh4core.c,v 1.42 2007-09-04 08:38:33 nkeynes Exp $1.7 *1.8 * SH4 emulation core, and parent module for all the SH4 peripheral1.9 * modules.1.10 @@ -34,17 +34,6 @@1.11 #define MAX_INTF 2147483647.01.12 #define MIN_INTF -2147483648.01.14 -/* CPU-generated exception code/vector pairs */1.15 -#define EXC_POWER_RESET 0x000 /* vector special */1.16 -#define EXC_MANUAL_RESET 0x0201.17 -#define EXC_READ_ADDR_ERR 0x0E01.18 -#define EXC_WRITE_ADDR_ERR 0x1001.19 -#define EXC_SLOT_ILLEGAL 0x1A01.20 -#define EXC_ILLEGAL 0x1801.21 -#define EXC_TRAP 0x1601.22 -#define EXC_FPDISABLE 0x8001.23 -#define EXC_SLOT_FPDISABLE 0x8201.24 -1.25 #define EXV_EXCEPTION 0x100 /* General exception vector */1.26 #define EXV_TLBMISS 0x400 /* TLB-miss exception vector */1.27 #define EXV_INTERRUPT 0x600 /* External interrupt vector */1.28 @@ -322,12 +311,12 @@1.29 #define MEM_FP_WRITE( addr, reg ) sh4_write_float( addr, reg );1.31 #define CHECKPRIV() if( !IS_SH4_PRIVMODE() ) return sh4_raise_slot_exception( EXC_ILLEGAL, EXC_SLOT_ILLEGAL )1.32 -#define CHECKRALIGN16(addr) if( (addr)&0x01 ) return sh4_raise_exception( EXC_READ_ADDR_ERR )1.33 -#define CHECKRALIGN32(addr) if( (addr)&0x03 ) return sh4_raise_exception( EXC_READ_ADDR_ERR )1.34 -#define CHECKWALIGN16(addr) if( (addr)&0x01 ) return sh4_raise_exception( EXC_WRITE_ADDR_ERR )1.35 -#define CHECKWALIGN32(addr) if( (addr)&0x03 ) return sh4_raise_exception( EXC_WRITE_ADDR_ERR )1.36 +#define CHECKRALIGN16(addr) if( (addr)&0x01 ) return sh4_raise_exception( EXC_DATA_ADDR_READ )1.37 +#define CHECKRALIGN32(addr) if( (addr)&0x03 ) return sh4_raise_exception( EXC_DATA_ADDR_READ )1.38 +#define CHECKWALIGN16(addr) if( (addr)&0x01 ) return sh4_raise_exception( EXC_DATA_ADDR_WRITE )1.39 +#define CHECKWALIGN32(addr) if( (addr)&0x03 ) return sh4_raise_exception( EXC_DATA_ADDR_WRITE )1.41 -#define CHECKFPUEN() if( !IS_FPU_ENABLED() ) { if( ir == 0xFFFD ) { UNDEF(ir); } else { return sh4_raise_slot_exception( EXC_FPDISABLE, EXC_SLOT_FPDISABLE ); } }1.42 +#define CHECKFPUEN() if( !IS_FPU_ENABLED() ) { if( ir == 0xFFFD ) { UNDEF(ir); } else { return sh4_raise_slot_exception( EXC_FPU_DISABLED, EXC_SLOT_FPU_DISABLED ); } }1.43 #define CHECKDEST(p) if( (p) == 0 ) { ERROR( "%08X: Branch/jump to NULL, CPU halted", sh4r.pc ); dreamcast_stop(); return FALSE; }1.44 #define CHECKSLOTILLEGAL() if(sh4r.in_delay_slot) return sh4_raise_exception(EXC_SLOT_ILLEGAL)
2.1 --- a/src/sh4/sh4core.h Tue Sep 04 08:32:44 2007 +00002.2 +++ b/src/sh4/sh4core.h Tue Sep 04 08:38:33 2007 +00002.3 @@ -1,5 +1,5 @@2.4 /**2.5 - * $Id: sh4core.h,v 1.19 2007-08-23 12:33:27 nkeynes Exp $2.6 + * $Id: sh4core.h,v 1.20 2007-09-04 08:38:33 nkeynes Exp $2.7 *2.8 * This file defines the internal functions exported/used by the SH4 core,2.9 * except for disassembly functions defined in sh4dasm.h2.10 @@ -179,6 +179,17 @@2.11 #define FPULf *((float *)&sh4r.fpul)2.12 #define FPULi (sh4r.fpul)2.14 +/* CPU-generated exception code/vector pairs */2.15 +#define EXC_POWER_RESET 0x000 /* vector special */2.16 +#define EXC_MANUAL_RESET 0x0202.17 +#define EXC_DATA_ADDR_READ 0x0E02.18 +#define EXC_DATA_ADDR_WRITE 0x1002.19 +#define EXC_SLOT_ILLEGAL 0x1A02.20 +#define EXC_ILLEGAL 0x1802.21 +#define EXC_TRAP 0x1602.22 +#define EXC_FPU_DISABLED 0x8002.23 +#define EXC_SLOT_FPU_DISABLED 0x8202.24 +2.25 /* Exceptions (for use with sh4_raise_exception) */2.27 #define EX_ILLEGAL_INSTRUCTION 0x180, 0x100
3.1 --- a/src/sh4/sh4core.in Tue Sep 04 08:32:44 2007 +00003.2 +++ b/src/sh4/sh4core.in Tue Sep 04 08:38:33 2007 +00003.3 @@ -1,5 +1,5 @@3.4 /**3.5 - * $Id: sh4core.in,v 1.1 2007-08-23 12:33:27 nkeynes Exp $3.6 + * $Id: sh4core.in,v 1.2 2007-09-04 08:38:33 nkeynes Exp $3.7 *3.8 * SH4 emulation core, and parent module for all the SH4 peripheral3.9 * modules.3.10 @@ -34,17 +34,6 @@3.11 #define MAX_INTF 2147483647.03.12 #define MIN_INTF -2147483648.03.14 -/* CPU-generated exception code/vector pairs */3.15 -#define EXC_POWER_RESET 0x000 /* vector special */3.16 -#define EXC_MANUAL_RESET 0x0203.17 -#define EXC_READ_ADDR_ERR 0x0E03.18 -#define EXC_WRITE_ADDR_ERR 0x1003.19 -#define EXC_SLOT_ILLEGAL 0x1A03.20 -#define EXC_ILLEGAL 0x1803.21 -#define EXC_TRAP 0x1603.22 -#define EXC_FPDISABLE 0x8003.23 -#define EXC_SLOT_FPDISABLE 0x8203.24 -3.25 #define EXV_EXCEPTION 0x100 /* General exception vector */3.26 #define EXV_TLBMISS 0x400 /* TLB-miss exception vector */3.27 #define EXV_INTERRUPT 0x600 /* External interrupt vector */3.28 @@ -322,12 +311,12 @@3.29 #define MEM_FP_WRITE( addr, reg ) sh4_write_float( addr, reg );3.31 #define CHECKPRIV() if( !IS_SH4_PRIVMODE() ) return sh4_raise_slot_exception( EXC_ILLEGAL, EXC_SLOT_ILLEGAL )3.32 -#define CHECKRALIGN16(addr) if( (addr)&0x01 ) return sh4_raise_exception( EXC_READ_ADDR_ERR )3.33 -#define CHECKRALIGN32(addr) if( (addr)&0x03 ) return sh4_raise_exception( EXC_READ_ADDR_ERR )3.34 -#define CHECKWALIGN16(addr) if( (addr)&0x01 ) return sh4_raise_exception( EXC_WRITE_ADDR_ERR )3.35 -#define CHECKWALIGN32(addr) if( (addr)&0x03 ) return sh4_raise_exception( EXC_WRITE_ADDR_ERR )3.36 +#define CHECKRALIGN16(addr) if( (addr)&0x01 ) return sh4_raise_exception( EXC_DATA_ADDR_READ )3.37 +#define CHECKRALIGN32(addr) if( (addr)&0x03 ) return sh4_raise_exception( EXC_DATA_ADDR_READ )3.38 +#define CHECKWALIGN16(addr) if( (addr)&0x01 ) return sh4_raise_exception( EXC_DATA_ADDR_WRITE )3.39 +#define CHECKWALIGN32(addr) if( (addr)&0x03 ) return sh4_raise_exception( EXC_DATA_ADDR_WRITE )3.41 -#define CHECKFPUEN() if( !IS_FPU_ENABLED() ) { if( ir == 0xFFFD ) { UNDEF(ir); } else { return sh4_raise_slot_exception( EXC_FPDISABLE, EXC_SLOT_FPDISABLE ); } }3.42 +#define CHECKFPUEN() if( !IS_FPU_ENABLED() ) { if( ir == 0xFFFD ) { UNDEF(ir); } else { return sh4_raise_slot_exception( EXC_FPU_DISABLED, EXC_SLOT_FPU_DISABLED ); } }3.43 #define CHECKDEST(p) if( (p) == 0 ) { ERROR( "%08X: Branch/jump to NULL, CPU halted", sh4r.pc ); dreamcast_stop(); return FALSE; }3.44 #define CHECKSLOTILLEGAL() if(sh4r.in_delay_slot) return sh4_raise_exception(EXC_SLOT_ILLEGAL)
.