From db7895cea55eae6fb90c49e953eae03c28627cca Mon Sep 17 00:00:00 2001 From: scribam Date: Fri, 1 Dec 2023 15:03:59 +0100 Subject: [PATCH] Some ifdefs to improve builds (#1325) * mmu: hide some jit and fast mmu functions behind ifdef * linux: move log to the correct place --- core/hw/sh4/modules/mmu.cpp | 2 ++ core/hw/sh4/modules/mmu.h | 4 ++++ core/linux/common.cpp | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/hw/sh4/modules/mmu.cpp b/core/hw/sh4/modules/mmu.cpp index 5bb1f2fa79..54ec72d51d 100644 --- a/core/hw/sh4/modules/mmu.cpp +++ b/core/hw/sh4/modules/mmu.cpp @@ -459,7 +459,9 @@ void mmu_set_state() setSqwHandler(); } +#ifdef FAST_MMU u32 mmuAddressLUT[0x100000]; +#endif void MMU_init() { diff --git a/core/hw/sh4/modules/mmu.h b/core/hw/sh4/modules/mmu.h index 6e6eea39aa..c594f4dcf9 100644 --- a/core/hw/sh4/modules/mmu.h +++ b/core/hw/sh4/modules/mmu.h @@ -117,6 +117,7 @@ template void DYNACALL mmu_WriteMem(u32 adr, T data); void mmu_TranslateSQW(u32 adr, u32* out); +#ifdef FAST_MMU // maps 4K virtual page number to physical address extern u32 mmuAddressLUT[0x100000]; @@ -130,7 +131,9 @@ static inline void mmuAddressLUTFlush(bool full) memset(mmuAddressLUT, 0, slotPages * sizeof(u32)); // flush slot 0 } } +#endif +#if FEAT_SHREC == DYNAREC_JIT static inline u32 DYNACALL mmuDynarecLookup(u32 vaddr, u32 write, u32 pc) { u32 paddr; @@ -157,6 +160,7 @@ static inline u32 DYNACALL mmuDynarecLookup(u32 vaddr, u32 write, u32 pc) return paddr; } +#endif void MMU_init(); void MMU_reset(); diff --git a/core/linux/common.cpp b/core/linux/common.cpp index 11f1bb4564..c8af1387c1 100644 --- a/core/linux/common.cpp +++ b/core/linux/common.cpp @@ -65,8 +65,10 @@ void fault_handler(int sn, siginfo_t * si, void *segfault_ctx) context_to_segfault(&ctx, segfault_ctx); return; } -#endif + ERROR_LOG(COMMON, "SIGSEGV @ %p invalid access to %p", (void *)ctx.pc, si->si_addr); +#endif + #ifdef __SWITCH__ MemoryInfo meminfo; u32 pageinfo;