Search
lxdream.org :: lxdream/src/sh4/sh4core.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4core.h
changeset 1202:01ae5cbad4c8
prev1194:ee6ce5804608
next1218:be02e87f9f87
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/sh4core.h Mon Dec 12 21:13:36 2011 +1000
1.2 +++ b/src/sh4/sh4core.h Fri Dec 23 08:20:17 2011 +1000
1.3 @@ -242,6 +242,19 @@
1.4 void FASTCALL sh4_raise_tlb_multihit( sh4vma_t );
1.5 void FASTCALL sh4_accept_interrupt( void );
1.6
1.7 +#define RAISE_TLB_ERROR(code, vpn) sh4_raise_tlb_exception(code, vpn)
1.8 +#define RAISE_MEM_ERROR(code, vpn) \
1.9 + MMIO_WRITE(MMU, TEA, vpn); \
1.10 + MMIO_WRITE(MMU, PTEH, ((MMIO_READ(MMU, PTEH) & 0x000003FF) | (vpn&0xFFFFFC00))); \
1.11 + sh4_raise_exception(code);
1.12 +#define RAISE_TLB_MULTIHIT_ERROR(vpn) sh4_raise_tlb_multihit(vpn)
1.13 +
1.14 +#ifdef HAVE_FRAME_ADDRESS
1.15 +#define SH4_EXCEPTION_EXIT() do{ *(((void * volatile *)__builtin_frame_address(0))+1) = exc; } while(0)
1.16 +#else
1.17 +#define SH4_EXCEPTION_EXIT() sh4_core_exit(CORE_EXIT_EXCEPTION)
1.18 +#endif
1.19 +
1.20 /**
1.21 * Helper method to update the SH4 registers for an exception, without
1.22 * touching the MMU registers. Mainly for use in shadow mode.
.