Skip to content

Commit

Permalink
Some ifdefs to improve builds (#1325)
Browse files Browse the repository at this point in the history
* mmu: hide some jit and fast mmu functions behind ifdef
* linux: move log to the correct place
  • Loading branch information
scribam authored Dec 1, 2023
1 parent f3a774a commit db7895c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/hw/sh4/modules/mmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ void mmu_set_state()
setSqwHandler();
}

#ifdef FAST_MMU
u32 mmuAddressLUT[0x100000];
#endif

void MMU_init()
{
Expand Down
4 changes: 4 additions & 0 deletions core/hw/sh4/modules/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ template<typename T> 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];

Expand All @@ -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;
Expand All @@ -157,6 +160,7 @@ static inline u32 DYNACALL mmuDynarecLookup(u32 vaddr, u32 write, u32 pc)

return paddr;
}
#endif

void MMU_init();
void MMU_reset();
Expand Down
4 changes: 3 additions & 1 deletion core/linux/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit db7895c

Please sign in to comment.