--- previous/src/cpu/cpummu.h 2018/04/24 19:27:49 1.1.1.2 +++ previous/src/cpu/cpummu.h 2018/04/24 19:28:56 1.1.1.3 @@ -27,6 +27,7 @@ #define CPUMMU_H #include "compat.h" +#include "mmu_common.h" #ifndef FULLMMU #define FULLMMU @@ -40,43 +41,6 @@ #define bug #endif -#if 0 -struct m68k_exception { - int prb; - m68k_exception (int exc) : prb (exc) {} - operator int() { return prb; } -}; -#define SAVE_EXCEPTION -#define RESTORE_EXCEPTION -#define TRY(var) try -#define CATCH(var) catch(m68k_exception var) -#define THROW(n) throw m68k_exception(n) -#define THROW_AGAIN(var) throw - -#else -/* we are in plain C, just use a stack of long jumps */ -#include -extern jmp_buf __exbuf; -extern int __exvalue; -#define TRY(DUMMY) __exvalue=setjmp(__exbuf); \ - if (__exvalue==0) { __pushtry(&__exbuf); -#define CATCH(x) __poptry(); } else { fprintf(stderr,"Gotcha! %d %s in %d\n",__exvalue,__FILE__,__LINE__); __poptry(); -#define ENDTRY } -#define THROW(x) if (__is_catched()) {fprintf(stderr,"Longjumping %s in %d\n",__FILE__,__LINE__);longjmp(__exbuf,x);} else fprintf(stderr,"/!\\ cannot Longjumping %s in %d\n",__FILE__,__LINE__) -#define THROW_AGAIN(var) if (__is_catched()) longjmp(__exbuf,__exvalue); else fprintf(stderr,"/!\\ cannot Longjumping %s in %d\n",__FILE__,__LINE__) -#define SAVE_EXCEPTION -#define RESTORE_EXCEPTION -jmp_buf* __poptry(void); -void __pushtry(jmp_buf *j); -int __is_catched(void); - -typedef int m68k_exception; - -#endif - -#define VOLATILE -#define ALWAYS_INLINE __inline - static __inline void flush_internals (void) { } //typedef uae_u8 flagtype; @@ -181,22 +145,6 @@ extern void mmu_dump_tables(void); #define MMU_MMUSR_T (1 << 1) #define MMU_MMUSR_R (1 << 0) -/* special status word (access error stack frame) */ -#define MMU_SSW_TM 0x0007 -#define MMU_SSW_TT 0x0018 -#define MMU_SSW_SIZE 0x0060 -#define MMU_SSW_SIZE_B 0x0020 -#define MMU_SSW_SIZE_W 0x0040 -#define MMU_SSW_SIZE_L 0x0000 -#define MMU_SSW_RW 0x0100 -#define MMU_SSW_LK 0x0200 -#define MMU_SSW_ATC 0x0400 -#define MMU_SSW_MA 0x0800 -#define MMU_SSW_CM 0x1000 -#define MMU_SSW_CT 0x2000 -#define MMU_SSW_CU 0x4000 -#define MMU_SSW_CP 0x8000 - #define TTR_I0 4 #define TTR_I1 5 #define TTR_D0 6 @@ -375,42 +323,11 @@ extern void REGPARAM3 mmu_reset(void) RE extern void REGPARAM3 mmu_set_tc(uae_u16 tc) REGPARAM; extern void REGPARAM3 mmu_set_super(bool super) REGPARAM; -// take care of 2 kinds of alignement, bus size and page -static ALWAYS_INLINE bool is_unaligned(uaecptr addr, int size) -{ - return unlikely((addr & (size - 1)) && (addr ^ (addr + size - 1)) & 0x1000); -} - static ALWAYS_INLINE uaecptr mmu_get_real_address(uaecptr addr, struct mmu_atc_line *cl) { return cl->phys | (addr & (regs.mmu_pagesize_8k?0x00001fff:0x00000fff)); } -static ALWAYS_INLINE void phys_put_long(uaecptr addr, uae_u32 l) -{ - longput(addr, l); -} -static ALWAYS_INLINE void phys_put_word(uaecptr addr, uae_u32 w) -{ - wordput(addr, w); -} -static ALWAYS_INLINE void phys_put_byte(uaecptr addr, uae_u32 b) -{ - byteput(addr, b); -} -static ALWAYS_INLINE uae_u32 phys_get_long(uaecptr addr) -{ - return longget (addr); -} -static ALWAYS_INLINE uae_u32 phys_get_word(uaecptr addr) -{ - return wordget (addr); -} -static ALWAYS_INLINE uae_u32 phys_get_byte(uaecptr addr) -{ - return byteget (addr); -} - static ALWAYS_INLINE uae_u32 mmu_get_long(uaecptr addr, bool data, int size) { struct mmu_atc_line *cl; @@ -707,11 +624,4 @@ extern void m68k_do_rts_mmu (void); extern void m68k_do_rte_mmu (uaecptr a7); extern void m68k_do_bsr_mmu (uaecptr oldpc, uae_s32 offset); -struct mmufixup -{ - int reg; - uae_u32 value; -}; -extern struct mmufixup mmufixup[2]; - #endif /* CPUMMU_H */