Search
lxdream.org :: lxdream/src/sh4/mmu.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/mmu.c
changeset 951:63483914846f
prev948:545c85cc56f1
next952:18e579840923
author nkeynes
date Wed Jan 07 05:45:15 2009 +0000 (11 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Tidy up exceptions+resets
Implement manual reset on general exception when SR.BL == 1
file annotate diff log raw
1.1 --- a/src/sh4/mmu.c Wed Jan 07 04:39:04 2009 +0000
1.2 +++ b/src/sh4/mmu.c Wed Jan 07 05:45:15 2009 +0000
1.3 @@ -27,18 +27,12 @@
1.4 #include "mem.h"
1.5 #include "mmu.h"
1.6
1.7 -#define RAISE_TLB_ERROR(code, vpn) \
1.8 - MMIO_WRITE(MMU, TEA, vpn); \
1.9 - MMIO_WRITE(MMU, PTEH, ((MMIO_READ(MMU, PTEH) & 0x000003FF) | (vpn&0xFFFFFC00))); \
1.10 - sh4_raise_tlb_exception(code);
1.11 +#define RAISE_TLB_ERROR(code, vpn) sh4_raise_tlb_exception(code, vpn)
1.12 #define RAISE_MEM_ERROR(code, vpn) \
1.13 MMIO_WRITE(MMU, TEA, vpn); \
1.14 MMIO_WRITE(MMU, PTEH, ((MMIO_READ(MMU, PTEH) & 0x000003FF) | (vpn&0xFFFFFC00))); \
1.15 sh4_raise_exception(code);
1.16 -#define RAISE_TLB_MULTIHIT_ERROR(vpn) \
1.17 - sh4_raise_reset(EXC_TLB_MULTI_HIT); \
1.18 - MMIO_WRITE(MMU, TEA, vpn); \
1.19 - MMIO_WRITE(MMU, PTEH, ((MMIO_READ(MMU, PTEH) & 0x000003FF) | (vpn&0xFFFFFC00)));
1.20 +#define RAISE_TLB_MULTIHIT_ERROR(vpn) sh4_raise_tlb_multihit(vpn)
1.21
1.22 /* An entry is a 1K entry if it's one of the mmu_utlb_1k_pages entries */
1.23 #define IS_1K_PAGE_ENTRY(ent) ( ((uintptr_t)(((struct utlb_1k_entry *)ent) - &mmu_utlb_1k_pages[0])) < UTLB_ENTRY_COUNT )
1.24 @@ -1418,24 +1412,18 @@
1.25
1.26 static int32_t FASTCALL tlb_multi_hit_read( sh4addr_t addr, void *exc )
1.27 {
1.28 - MMIO_WRITE(MMU, TEA, addr);
1.29 - MMIO_WRITE(MMU, PTEH, ((MMIO_READ(MMU, PTEH) & 0x000003FF) | (addr&0xFFFFFC00)));
1.30 - sh4_raise_reset(EXC_TLB_MULTI_HIT);
1.31 + sh4_raise_tlb_multihit(addr);
1.32 EXCEPTION_EXIT();
1.33 }
1.34
1.35 static int32_t FASTCALL tlb_multi_hit_read_burst( unsigned char *dest, sh4addr_t addr, void *exc )
1.36 {
1.37 - MMIO_WRITE(MMU, TEA, addr);
1.38 - MMIO_WRITE(MMU, PTEH, ((MMIO_READ(MMU, PTEH) & 0x000003FF) | (addr&0xFFFFFC00)));
1.39 - sh4_raise_reset(EXC_TLB_MULTI_HIT);
1.40 + sh4_raise_tlb_multihit(addr);
1.41 EXCEPTION_EXIT();
1.42 }
1.43 static void FASTCALL tlb_multi_hit_write( sh4addr_t addr, uint32_t val, void *exc )
1.44 {
1.45 - MMIO_WRITE(MMU, TEA, addr);
1.46 - MMIO_WRITE(MMU, PTEH, ((MMIO_READ(MMU, PTEH) & 0x000003FF) | (addr&0xFFFFFC00)));
1.47 - sh4_raise_reset(EXC_TLB_MULTI_HIT);
1.48 + sh4_raise_tlb_multihit(addr);
1.49 EXCEPTION_EXIT();
1.50 }
1.51
.