diff options
Diffstat (limited to 'arch/mips/include/asm/uasm.h')
-rw-r--r-- | arch/mips/include/asm/uasm.h | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/arch/mips/include/asm/uasm.h b/arch/mips/include/asm/uasm.h index 697e40c06497..892062d6d748 100644 --- a/arch/mips/include/asm/uasm.h +++ b/arch/mips/include/asm/uasm.h | |||
@@ -10,44 +10,55 @@ | |||
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | 12 | ||
13 | #ifdef CONFIG_EXPORT_UASM | ||
14 | #include <linux/module.h> | ||
15 | #define __uasminit | ||
16 | #define __uasminitdata | ||
17 | #define UASM_EXPORT_SYMBOL(sym) EXPORT_SYMBOL(sym) | ||
18 | #else | ||
19 | #define __uasminit __cpuinit | ||
20 | #define __uasminitdata __cpuinitdata | ||
21 | #define UASM_EXPORT_SYMBOL(sym) | ||
22 | #endif | ||
23 | |||
13 | #define Ip_u1u2u3(op) \ | 24 | #define Ip_u1u2u3(op) \ |
14 | void __cpuinit \ | 25 | void __uasminit \ |
15 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) | 26 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) |
16 | 27 | ||
17 | #define Ip_u2u1u3(op) \ | 28 | #define Ip_u2u1u3(op) \ |
18 | void __cpuinit \ | 29 | void __uasminit \ |
19 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) | 30 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) |
20 | 31 | ||
21 | #define Ip_u3u1u2(op) \ | 32 | #define Ip_u3u1u2(op) \ |
22 | void __cpuinit \ | 33 | void __uasminit \ |
23 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) | 34 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) |
24 | 35 | ||
25 | #define Ip_u1u2s3(op) \ | 36 | #define Ip_u1u2s3(op) \ |
26 | void __cpuinit \ | 37 | void __uasminit \ |
27 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c) | 38 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c) |
28 | 39 | ||
29 | #define Ip_u2s3u1(op) \ | 40 | #define Ip_u2s3u1(op) \ |
30 | void __cpuinit \ | 41 | void __uasminit \ |
31 | uasm_i##op(u32 **buf, unsigned int a, signed int b, unsigned int c) | 42 | uasm_i##op(u32 **buf, unsigned int a, signed int b, unsigned int c) |
32 | 43 | ||
33 | #define Ip_u2u1s3(op) \ | 44 | #define Ip_u2u1s3(op) \ |
34 | void __cpuinit \ | 45 | void __uasminit \ |
35 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c) | 46 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c) |
36 | 47 | ||
37 | #define Ip_u2u1msbu3(op) \ | 48 | #define Ip_u2u1msbu3(op) \ |
38 | void __cpuinit \ | 49 | void __uasminit \ |
39 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c, \ | 50 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c, \ |
40 | unsigned int d) | 51 | unsigned int d) |
41 | 52 | ||
42 | #define Ip_u1u2(op) \ | 53 | #define Ip_u1u2(op) \ |
43 | void __cpuinit uasm_i##op(u32 **buf, unsigned int a, unsigned int b) | 54 | void __uasminit uasm_i##op(u32 **buf, unsigned int a, unsigned int b) |
44 | 55 | ||
45 | #define Ip_u1s2(op) \ | 56 | #define Ip_u1s2(op) \ |
46 | void __cpuinit uasm_i##op(u32 **buf, unsigned int a, signed int b) | 57 | void __uasminit uasm_i##op(u32 **buf, unsigned int a, signed int b) |
47 | 58 | ||
48 | #define Ip_u1(op) void __cpuinit uasm_i##op(u32 **buf, unsigned int a) | 59 | #define Ip_u1(op) void __uasminit uasm_i##op(u32 **buf, unsigned int a) |
49 | 60 | ||
50 | #define Ip_0(op) void __cpuinit uasm_i##op(u32 **buf) | 61 | #define Ip_0(op) void __uasminit uasm_i##op(u32 **buf) |
51 | 62 | ||
52 | Ip_u2u1s3(_addiu); | 63 | Ip_u2u1s3(_addiu); |
53 | Ip_u3u1u2(_addu); | 64 | Ip_u3u1u2(_addu); |
@@ -71,6 +82,7 @@ Ip_u2u1u3(_dsra); | |||
71 | Ip_u2u1u3(_dsrl); | 82 | Ip_u2u1u3(_dsrl); |
72 | Ip_u2u1u3(_dsrl32); | 83 | Ip_u2u1u3(_dsrl32); |
73 | Ip_u2u1u3(_drotr); | 84 | Ip_u2u1u3(_drotr); |
85 | Ip_u2u1u3(_drotr32); | ||
74 | Ip_u3u1u2(_dsubu); | 86 | Ip_u3u1u2(_dsubu); |
75 | Ip_0(_eret); | 87 | Ip_0(_eret); |
76 | Ip_u1(_j); | 88 | Ip_u1(_j); |
@@ -111,7 +123,7 @@ struct uasm_label { | |||
111 | int lab; | 123 | int lab; |
112 | }; | 124 | }; |
113 | 125 | ||
114 | void __cpuinit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid); | 126 | void __uasminit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid); |
115 | #ifdef CONFIG_64BIT | 127 | #ifdef CONFIG_64BIT |
116 | int uasm_in_compat_space_p(long addr); | 128 | int uasm_in_compat_space_p(long addr); |
117 | #endif | 129 | #endif |
@@ -121,7 +133,7 @@ void UASM_i_LA_mostly(u32 **buf, unsigned int rs, long addr); | |||
121 | void UASM_i_LA(u32 **buf, unsigned int rs, long addr); | 133 | void UASM_i_LA(u32 **buf, unsigned int rs, long addr); |
122 | 134 | ||
123 | #define UASM_L_LA(lb) \ | 135 | #define UASM_L_LA(lb) \ |
124 | static inline void __cpuinit uasm_l##lb(struct uasm_label **lab, u32 *addr) \ | 136 | static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \ |
125 | { \ | 137 | { \ |
126 | uasm_build_label(lab, addr, label##lb); \ | 138 | uasm_build_label(lab, addr, label##lb); \ |
127 | } | 139 | } |
@@ -176,6 +188,15 @@ static inline void uasm_i_dsrl_safe(u32 **p, unsigned int a1, | |||
176 | uasm_i_dsrl32(p, a1, a2, a3 - 32); | 188 | uasm_i_dsrl32(p, a1, a2, a3 - 32); |
177 | } | 189 | } |
178 | 190 | ||
191 | static inline void uasm_i_drotr_safe(u32 **p, unsigned int a1, | ||
192 | unsigned int a2, unsigned int a3) | ||
193 | { | ||
194 | if (a3 < 32) | ||
195 | uasm_i_drotr(p, a1, a2, a3); | ||
196 | else | ||
197 | uasm_i_drotr32(p, a1, a2, a3 - 32); | ||
198 | } | ||
199 | |||
179 | static inline void uasm_i_dsll_safe(u32 **p, unsigned int a1, | 200 | static inline void uasm_i_dsll_safe(u32 **p, unsigned int a1, |
180 | unsigned int a2, unsigned int a3) | 201 | unsigned int a2, unsigned int a3) |
181 | { | 202 | { |
@@ -213,3 +234,7 @@ void uasm_il_bne(u32 **p, struct uasm_reloc **r, unsigned int reg1, | |||
213 | void uasm_il_bnez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid); | 234 | void uasm_il_bnez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid); |
214 | void uasm_il_bgezl(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid); | 235 | void uasm_il_bgezl(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid); |
215 | void uasm_il_bgez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid); | 236 | void uasm_il_bgez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid); |
237 | void uasm_il_bbit0(u32 **p, struct uasm_reloc **r, unsigned int reg, | ||
238 | unsigned int bit, int lid); | ||
239 | void uasm_il_bbit1(u32 **p, struct uasm_reloc **r, unsigned int reg, | ||
240 | unsigned int bit, int lid); | ||