00001
00010
00011
00012 #ifndef _MIPS_H
00013 #define _MIPS_H
00014
00019 #define zero $0
00020 #define AT $1
00021 #define v0 $2
00022 #define v1 $3
00023 #define a0 $4
00024 #define a1 $5
00025 #define a2 $6
00026 #define a3 $7
00027 #define t0 $8
00028 #define t1 $9
00029 #define t2 $10
00030 #define t3 $11
00031 #define t4 $12
00032 #define t5 $13
00033 #define t6 $14
00034 #define t7 $15
00035 #define s0 $16
00036 #define s1 $17
00037 #define s2 $18
00038 #define s3 $19
00039 #define s4 $20
00040 #define s5 $21
00041 #define s6 $22
00042 #define s7 $23
00043 #define t8 $24
00044 #define t9 $25
00045 #define jp $25
00046 #define k0 $26
00047 #define k1 $27
00048 #define gp $28
00049 #define sp $29
00050 #define fp $30
00051 #define s8 $30
00052 #define ra $31
00057 #define CP0_INDEX $0
00058 #define CP0_RANDOM $1
00059 #define CP0_ENTRYLO0 $2
00060 #define CP0_ENTRYLO1 $3
00061 #define CP0_CONTEXT $4
00062 #define CP0_PGMASK $5
00063 #define CP0_WIRED $6
00064 #define CP0_BADVADDR $8
00065 #define CP0_COUNT $9
00066 #define CP0_ENTRYHI $10
00067 #define CP0_COMPARE $11
00068 #define CP0_STATUS $12
00069 #define CP0_CAUSE $13
00070 #define CP0_EPC $14
00071 #define CP0_PRID $15
00072 #define CP0_CONFIG $16
00073 #define CP0_DIAG $22
00074 #define CP0_TAGLO $28
00075 #define CP0_TAGHI $29
00076 #define CP0_ERREPC $30
00077
00081 #define PRID_REV 0x000000FF
00082 #define PRID_CPUID 0x0000FF00
00088
00089 #define PRID_REV_WRT54G 0x29
00090 #define PRID_REV_WRT54GL 0x08
00091 #define PRID_REV_WRT350N 0x1A
00092
00096 #define CAUSE_EXC 0x0000007C
00097 #define CAUSE_SW0 0x00000100
00098 #define CAUSE_SW1 0x00000200
00099 #define CAUSE_HW0 0x00000400
00100 #define CAUSE_HW1 0x00000800
00101 #define CAUSE_HW2 0x00001000
00102 #define CAUSE_HW3 0x00002000
00103 #define CAUSE_HW4 0x00004000
00104 #define CAUSE_HW5 0x00008000
00109 #define STATUS_IE 0x00000001
00110 #define STATUS_EXL 0x00000002
00111 #define STATUS_ERL 0x00000004
00112 #define STATUS_SW0 CAUSE_SW0
00113 #define STATUS_SW1 CAUSE_SW1
00114 #define STATUS_HW0 CAUSE_HW0
00115 #define STATUS_HW1 CAUSE_HW1
00116 #define STATUS_HW2 CAUSE_HW2
00117 #define STATUS_HW3 CAUSE_HW3
00118 #define STATUS_HW4 CAUSE_HW4
00119 #define STATUS_HW5 CAUSE_HW5
00124 #define KUSEG_BASE 0x00000000
00125 #define KUSEG_SIZE 0x80000000
00126 #define KSEG0_BASE 0x80000000
00127 #define KSEG0_SIZE 0x20000000
00128 #define KSEG1_BASE 0xA0000000
00129 #define KSEG1_SIZE 0x20000000
00130 #define KSEG2_BASE 0xC0000000
00131 #define KSEG2_SIZE 0x40000000
00136 #define CONTEXT 64
00138 #define CONTEXT_WORDS (CONTEXT / sizeof(long))
00139
00140 #define RA_CON (CONTEXT - 8)
00141 #define S0_CON 52
00142 #define S1_CON 48
00143 #define S2_CON 44
00144 #define S3_CON 40
00145 #define S4_CON 36
00146 #define S5_CON 32
00147 #define S6_CON 28
00148 #define S7_CON 24
00149 #define GP_CON 20
00150 #define FP_CON 16
00155 #define CONFIG1_IS 22
00156 #define CONFIG1_IL 19
00157 #define CONFIG1_IA 16
00158 #define CONFIG1_DS 13
00159 #define CONFIG1_DL 10
00160 #define CONFIG1_DA 7
00161 #define CONFIG1_MASK 7
00166 #define INDEX_STORE_TAG_I 0x8
00167 #define FILL_I_CACHE 0x14
00168 #define INDEX_STORE_TAG_D 0x9
00170 #endif