aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/uasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include/asm/uasm.h')
-rw-r--r--arch/mips/include/asm/uasm.h51
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) \
14void __cpuinit \ 25void __uasminit \
15uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) 26uasm_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) \
18void __cpuinit \ 29void __uasminit \
19uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) 30uasm_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) \
22void __cpuinit \ 33void __uasminit \
23uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) 34uasm_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) \
26void __cpuinit \ 37void __uasminit \
27uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c) 38uasm_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) \
30void __cpuinit \ 41void __uasminit \
31uasm_i##op(u32 **buf, unsigned int a, signed int b, unsigned int c) 42uasm_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) \
34void __cpuinit \ 45void __uasminit \
35uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c) 46uasm_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) \
38void __cpuinit \ 49void __uasminit \
39uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c, \ 50uasm_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) \
43void __cpuinit uasm_i##op(u32 **buf, unsigned int a, unsigned int b) 54void __uasminit uasm_i##op(u32 **buf, unsigned int a, unsigned int b)
44 55
45#define Ip_u1s2(op) \ 56#define Ip_u1s2(op) \
46void __cpuinit uasm_i##op(u32 **buf, unsigned int a, signed int b) 57void __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
52Ip_u2u1s3(_addiu); 63Ip_u2u1s3(_addiu);
53Ip_u3u1u2(_addu); 64Ip_u3u1u2(_addu);
@@ -71,6 +82,7 @@ Ip_u2u1u3(_dsra);
71Ip_u2u1u3(_dsrl); 82Ip_u2u1u3(_dsrl);
72Ip_u2u1u3(_dsrl32); 83Ip_u2u1u3(_dsrl32);
73Ip_u2u1u3(_drotr); 84Ip_u2u1u3(_drotr);
85Ip_u2u1u3(_drotr32);
74Ip_u3u1u2(_dsubu); 86Ip_u3u1u2(_dsubu);
75Ip_0(_eret); 87Ip_0(_eret);
76Ip_u1(_j); 88Ip_u1(_j);
@@ -111,7 +123,7 @@ struct uasm_label {
111 int lab; 123 int lab;
112}; 124};
113 125
114void __cpuinit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid); 126void __uasminit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid);
115#ifdef CONFIG_64BIT 127#ifdef CONFIG_64BIT
116int uasm_in_compat_space_p(long addr); 128int 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);
121void UASM_i_LA(u32 **buf, unsigned int rs, long addr); 133void UASM_i_LA(u32 **buf, unsigned int rs, long addr);
122 134
123#define UASM_L_LA(lb) \ 135#define UASM_L_LA(lb) \
124static inline void __cpuinit uasm_l##lb(struct uasm_label **lab, u32 *addr) \ 136static 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
191static 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
179static inline void uasm_i_dsll_safe(u32 **p, unsigned int a1, 200static 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,
213void uasm_il_bnez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid); 234void uasm_il_bnez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid);
214void uasm_il_bgezl(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid); 235void uasm_il_bgezl(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid);
215void uasm_il_bgez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid); 236void uasm_il_bgez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid);
237void uasm_il_bbit0(u32 **p, struct uasm_reloc **r, unsigned int reg,
238 unsigned int bit, int lid);
239void uasm_il_bbit1(u32 **p, struct uasm_reloc **r, unsigned int reg,
240 unsigned int bit, int lid);