Commit 22b0763a authored by David Daney's avatar David Daney Committed by Ralf Baechle

MIPS: uasm: Add option to export uasm API.

A 'select EXPORT_UASM' in Kconfig will cause the uasm to be exported
for use in modules.  When it is exported, all the uasm data and code
cease to be __init and __initdata.

Also daddiu_bug cannot be __cpuinitdata if uasm is exported.  The
cleanest thing is to just make it normal data.
Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
To: wim@iguana.be
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/1500/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 5b97c3f7
...@@ -915,6 +915,9 @@ config CPU_LITTLE_ENDIAN ...@@ -915,6 +915,9 @@ config CPU_LITTLE_ENDIAN
endchoice endchoice
config EXPORT_UASM
bool
config SYS_SUPPORTS_APM_EMULATION config SYS_SUPPORTS_APM_EMULATION
bool bool
......
...@@ -10,44 +10,55 @@ ...@@ -10,44 +10,55 @@
#include <linux/types.h> #include <linux/types.h>
#ifdef CONFIG_EXPORT_UASM
#include <linux/module.h>
#define __uasminit
#define __uasminitdata
#define UASM_EXPORT_SYMBOL(sym) EXPORT_SYMBOL(sym)
#else
#define __uasminit __cpuinit
#define __uasminitdata __cpuinitdata
#define UASM_EXPORT_SYMBOL(sym)
#endif
#define Ip_u1u2u3(op) \ #define Ip_u1u2u3(op) \
void __cpuinit \ void __uasminit \
uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c)
#define Ip_u2u1u3(op) \ #define Ip_u2u1u3(op) \
void __cpuinit \ void __uasminit \
uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c)
#define Ip_u3u1u2(op) \ #define Ip_u3u1u2(op) \
void __cpuinit \ void __uasminit \
uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c) uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c)
#define Ip_u1u2s3(op) \ #define Ip_u1u2s3(op) \
void __cpuinit \ void __uasminit \
uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c) uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c)
#define Ip_u2s3u1(op) \ #define Ip_u2s3u1(op) \
void __cpuinit \ void __uasminit \
uasm_i##op(u32 **buf, unsigned int a, signed int b, unsigned int c) uasm_i##op(u32 **buf, unsigned int a, signed int b, unsigned int c)
#define Ip_u2u1s3(op) \ #define Ip_u2u1s3(op) \
void __cpuinit \ void __uasminit \
uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c) uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c)
#define Ip_u2u1msbu3(op) \ #define Ip_u2u1msbu3(op) \
void __cpuinit \ void __uasminit \
uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c, \ uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c, \
unsigned int d) unsigned int d)
#define Ip_u1u2(op) \ #define Ip_u1u2(op) \
void __cpuinit uasm_i##op(u32 **buf, unsigned int a, unsigned int b) void __uasminit uasm_i##op(u32 **buf, unsigned int a, unsigned int b)
#define Ip_u1s2(op) \ #define Ip_u1s2(op) \
void __cpuinit uasm_i##op(u32 **buf, unsigned int a, signed int b) void __uasminit uasm_i##op(u32 **buf, unsigned int a, signed int b)
#define Ip_u1(op) void __cpuinit uasm_i##op(u32 **buf, unsigned int a) #define Ip_u1(op) void __uasminit uasm_i##op(u32 **buf, unsigned int a)
#define Ip_0(op) void __cpuinit uasm_i##op(u32 **buf) #define Ip_0(op) void __uasminit uasm_i##op(u32 **buf)
Ip_u2u1s3(_addiu); Ip_u2u1s3(_addiu);
Ip_u3u1u2(_addu); Ip_u3u1u2(_addu);
...@@ -112,7 +123,7 @@ struct uasm_label { ...@@ -112,7 +123,7 @@ struct uasm_label {
int lab; int lab;
}; };
void __cpuinit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid); void __uasminit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid);
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
int uasm_in_compat_space_p(long addr); int uasm_in_compat_space_p(long addr);
#endif #endif
...@@ -122,7 +133,7 @@ void UASM_i_LA_mostly(u32 **buf, unsigned int rs, long addr); ...@@ -122,7 +133,7 @@ void UASM_i_LA_mostly(u32 **buf, unsigned int rs, long addr);
void UASM_i_LA(u32 **buf, unsigned int rs, long addr); void UASM_i_LA(u32 **buf, unsigned int rs, long addr);
#define UASM_L_LA(lb) \ #define UASM_L_LA(lb) \
static inline void __cpuinit uasm_l##lb(struct uasm_label **lab, u32 *addr) \ static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \
{ \ { \
uasm_build_label(lab, addr, label##lb); \ uasm_build_label(lab, addr, label##lb); \
} }
......
...@@ -239,7 +239,7 @@ static inline void check_daddi(void) ...@@ -239,7 +239,7 @@ static inline void check_daddi(void)
panic(bug64hit, !DADDI_WAR ? daddiwar : nowar); panic(bug64hit, !DADDI_WAR ? daddiwar : nowar);
} }
int daddiu_bug __cpuinitdata = -1; int daddiu_bug = -1;
static inline void check_daddiu(void) static inline void check_daddiu(void)
{ {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment