1 #ifndef __MIPS_H__ 2 #define __MIPS_H__ 3 4 #define KSEG0_BASE 0x80000000 5 #define KSEG1_BASE 0xA0000000 6 7 #define CP0_INDEX $0 8 #define CP0_ENTRYLO0 $2 9 #define CP0_ENTRYLO1 $3 10 #define CP0_CONTEXT $4 11 #define CP0_PAGEMASK $5 12 #define CP0_WIRED $6 13 #define CP0_BADVADDR $8 14 #define CP0_COUNT $9 15 #define CP0_ENTRYHI $10 16 #define CP0_COMPARE $11 17 #define CP0_STATUS $12 18 #define CP0_INTCTL $12, 1 19 #define CP0_CAUSE $13 20 #define CP0_EPC $14 21 #define CP0_EBASE $15, 1 22 #define CP0_CONFIG $16 23 #define CP0_WATCHLO $18 24 #define CP0_DEBUG $23 25 #define CP0_TAGLO $28 26 #define CP0_TAGHI $29 27 #define CP0_ERROREPC $30, 0 28 29 #define STATUS_CP0 0x10000000 30 #define STATUS_BEV 0x00400000 31 32 #define STATUS_IRQ 0x0000fc00 33 #define STATUS_IRQ_SHIFT 10 34 35 #define STATUS_UM 0x00000010 36 #define STATUS_ERL 0x00000004 37 #define STATUS_EXL 0x00000002 38 #define STATUS_IE 0x00000001 39 40 #define CAUSE_IV 0x00800000 41 42 #define EBASE_MASK 0x3ffff000 43 44 #define INTCTL_MASK 0x000003e0 45 46 #define DEBUG_DM 0x40000000 47 48 #define TLB_CACHED 0x00000018 49 #define TLB_UNCACHED 0x00000010 50 #define TLB_DIRTY 0x00000004 51 #define TLB_VALID 0x00000002 52 #define TLB_GLOBAL 0x00000001 53 54 #define TLB_READ (TLB_CACHED | TLB_VALID) 55 #define TLB_WRITE (TLB_CACHED | TLB_DIRTY | TLB_VALID) 56 #define TLB_ALL_READ (TLB_CACHED | TLB_VALID | TLB_GLOBAL) 57 #define TLB_ALL_WRITE (TLB_CACHED | TLB_DIRTY | TLB_VALID | TLB_GLOBAL) 58 59 #define CONFIG_K0 0x00000007 60 #define CONFIG_K0_UNCACHED 2 61 #define CONFIG_K0_CACHABLE_NONCOHERENT 3 62 63 #endif /* __MIPS_H__ */