4 /* Macros for reading and writing support/special registers. */
7 #define STRINGIFYFY(i) #i
11 #define STRINGIFY(i) STRINGIFYFY(i)
14 #define SPEC_REG_BZ "BZ"
15 #define SPEC_REG_VR "VR"
16 #define SPEC_REG_PID "PID"
17 #define SPEC_REG_SRS "SRS"
18 #define SPEC_REG_WZ "WZ"
19 #define SPEC_REG_EXS "EXS"
20 #define SPEC_REG_EDA "EDA"
21 #define SPEC_REG_MOF "MOF"
22 #define SPEC_REG_DZ "DZ"
23 #define SPEC_REG_EBP "EBP"
24 #define SPEC_REG_ERP "ERP"
25 #define SPEC_REG_SRP "SRP"
26 #define SPEC_REG_NRP "NRP"
27 #define SPEC_REG_CCS "CCS"
28 #define SPEC_REG_USP "USP"
29 #define SPEC_REG_SPC "SPC"
32 #define RW_MM_KBASE_LO 1
33 #define RW_MM_KBASE_HI 2
35 #define RW_MM_TLB_SEL 4
36 #define RW_MM_TLB_LO 5
37 #define RW_MM_TLB_HI 6
38 #define RW_MM_TLB_PGD 7
53 #define SPEC_REG_WR(r,v) \
54 __asm__ __volatile__ ("move %0, $" r : : "r" (v));
56 #define SPEC_REG_RD(r,v) \
57 __asm__ __volatile__ ("move $" r ",%0" : "=r" (v));
60 __asm__ __volatile__ ("nop");
62 #define SUPP_BANK_SEL(b) \
63 SPEC_REG_WR(SPEC_REG_SRS,b); \
68 #define SUPP_REG_WR(r,v) \
69 __asm__ __volatile__ ("move %0, $S" STRINGIFYFY(r) "\n\t" \
75 #define SUPP_REG_RD(r,v) \
76 __asm__ __volatile__ ("move $S" STRINGIFYFY(r) ",%0" : "=r" (v));
78 #endif /* __SUPP_REG_H__ */