1 /* SPDX-License-Identifier: GPL-2.0 */
5 /* Macros for reading and writing support/special registers. */
8 #define STRINGIFYFY(i) #i
12 #define STRINGIFY(i) STRINGIFYFY(i)
15 #define SPEC_REG_BZ "BZ"
16 #define SPEC_REG_VR "VR"
17 #define SPEC_REG_PID "PID"
18 #define SPEC_REG_SRS "SRS"
19 #define SPEC_REG_WZ "WZ"
20 #define SPEC_REG_EXS "EXS"
21 #define SPEC_REG_EDA "EDA"
22 #define SPEC_REG_MOF "MOF"
23 #define SPEC_REG_DZ "DZ"
24 #define SPEC_REG_EBP "EBP"
25 #define SPEC_REG_ERP "ERP"
26 #define SPEC_REG_SRP "SRP"
27 #define SPEC_REG_NRP "NRP"
28 #define SPEC_REG_CCS "CCS"
29 #define SPEC_REG_USP "USP"
30 #define SPEC_REG_SPC "SPC"
33 #define RW_MM_KBASE_LO 1
34 #define RW_MM_KBASE_HI 2
36 #define RW_MM_TLB_SEL 4
37 #define RW_MM_TLB_LO 5
38 #define RW_MM_TLB_HI 6
39 #define RW_MM_TLB_PGD 7
54 #define SPEC_REG_WR(r,v) \
55 __asm__ __volatile__ ("move %0, $" r : : "r" (v));
57 #define SPEC_REG_RD(r,v) \
58 __asm__ __volatile__ ("move $" r ",%0" : "=r" (v));
61 __asm__ __volatile__ ("nop");
63 #define SUPP_BANK_SEL(b) \
64 SPEC_REG_WR(SPEC_REG_SRS,b); \
69 #define SUPP_REG_WR(r,v) \
70 __asm__ __volatile__ ("move %0, $S" STRINGIFYFY(r) "\n\t" \
76 #define SUPP_REG_RD(r,v) \
77 __asm__ __volatile__ ("move $S" STRINGIFYFY(r) ",%0" : "=r" (v));
79 #endif /* __SUPP_REG_H__ */