1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/mips.h Sat May 06 17:53:56 2017 +0200
1.3 @@ -0,0 +1,49 @@
1.4 +#ifndef __MIPS_H__
1.5 +#define __MIPS_H__
1.6 +
1.7 +#define CP0_INDEX $0
1.8 +#define CP0_ENTRYLO0 $2
1.9 +#define CP0_ENTRYLO1 $3
1.10 +#define CP0_CONTEXT $4
1.11 +#define CP0_PAGEMASK $5
1.12 +#define CP0_WIRED $6
1.13 +#define CP0_ENTRYHI $10
1.14 +#define CP0_STATUS $12
1.15 +#define CP0_INTCTL $12, 1
1.16 +#define CP0_CAUSE $13
1.17 +#define CP0_EPC $14
1.18 +#define CP0_EBASE $15, 1
1.19 +#define CP0_CONFIG $16
1.20 +#define CP0_WATCHLO $18
1.21 +#define CP0_TAGLO $28
1.22 +#define CP0_TAGHI $29
1.23 +
1.24 +#define STATUS_CP0 0x10000000
1.25 +#define STATUS_BEV 0x00400000
1.26 +#define STATUS_IRQ 0x0000fc00
1.27 +#define STATUS_UM 0x00000010
1.28 +#define STATUS_ERL 0x00000004
1.29 +#define STATUS_EXL 0x00000002
1.30 +#define STATUS_IE 0x00000001
1.31 +
1.32 +#define CAUSE_IV 0x00800000
1.33 +
1.34 +#define EBASE_MASK 0x3ffff000
1.35 +
1.36 +#define INTCTL_MASK 0x000003e0
1.37 +
1.38 +#define TLB_CACHED 0x00000018
1.39 +#define TLB_UNCACHED 0x00000010
1.40 +#define TLB_DIRTY 0x00000004
1.41 +#define TLB_VALID 0x00000002
1.42 +#define TLB_GLOBAL 0x00000001
1.43 +
1.44 +#define TLB_READ (TLB_CACHED | TLB_VALID)
1.45 +#define TLB_WRITE (TLB_CACHED | TLB_DIRTY | TLB_VALID)
1.46 +#define TLB_ALL_READ (TLB_CACHED | TLB_VALID | TLB_GLOBAL)
1.47 +#define TLB_ALL_WRITE (TLB_CACHED | TLB_DIRTY | TLB_VALID | TLB_GLOBAL)
1.48 +
1.49 +#define CONFIG_CM_UNCACHED 2
1.50 +#define CONFIG_CM_CACHABLE_NONCOHERENT 3
1.51 +
1.52 +#endif /* __MIPS_H__ */