diff options
| -rw-r--r-- | arch/mips/include/asm/uasm.h | 18 | ||||
| -rw-r--r-- | arch/mips/mm/uasm-mips.c | 9 |
2 files changed, 25 insertions, 2 deletions
diff --git a/arch/mips/include/asm/uasm.h b/arch/mips/include/asm/uasm.h index f924b87b5308..370d967725c2 100644 --- a/arch/mips/include/asm/uasm.h +++ b/arch/mips/include/asm/uasm.h | |||
| @@ -26,15 +26,29 @@ | |||
| 26 | #define _UASM_ISA_MICROMIPS 1 | 26 | #define _UASM_ISA_MICROMIPS 1 |
| 27 | 27 | ||
| 28 | #ifndef UASM_ISA | 28 | #ifndef UASM_ISA |
| 29 | #ifdef CONFIG_CPU_MICROMIPS | ||
| 30 | #define UASM_ISA _UASM_ISA_MICROMIPS | ||
| 31 | #else | ||
| 29 | #define UASM_ISA _UASM_ISA_CLASSIC | 32 | #define UASM_ISA _UASM_ISA_CLASSIC |
| 30 | #endif | 33 | #endif |
| 34 | #endif | ||
| 31 | 35 | ||
| 32 | #if (UASM_ISA == _UASM_ISA_CLASSIC) | 36 | #if (UASM_ISA == _UASM_ISA_CLASSIC) |
| 37 | #ifdef CONFIG_CPU_MICROMIPS | ||
| 38 | #define ISAOPC(op) CL_uasm_i##op | ||
| 39 | #define ISAFUNC(x) CL_##x | ||
| 40 | #else | ||
| 33 | #define ISAOPC(op) uasm_i##op | 41 | #define ISAOPC(op) uasm_i##op |
| 34 | #define ISAFUNC(x) x | 42 | #define ISAFUNC(x) x |
| 43 | #endif | ||
| 35 | #elif (UASM_ISA == _UASM_ISA_MICROMIPS) | 44 | #elif (UASM_ISA == _UASM_ISA_MICROMIPS) |
| 45 | #ifdef CONFIG_CPU_MICROMIPS | ||
| 46 | #define ISAOPC(op) uasm_i##op | ||
| 47 | #define ISAFUNC(x) x | ||
| 48 | #else | ||
| 36 | #define ISAOPC(op) MM_uasm_i##op | 49 | #define ISAOPC(op) MM_uasm_i##op |
| 37 | #define ISAFUNC(x) MM_##x | 50 | #define ISAFUNC(x) MM_##x |
| 51 | #endif | ||
| 38 | #else | 52 | #else |
| 39 | #error Unsupported micro-assembler ISA!!! | 53 | #error Unsupported micro-assembler ISA!!! |
| 40 | #endif | 54 | #endif |
| @@ -160,9 +174,9 @@ void ISAFUNC(UASM_i_LA_mostly)(u32 **buf, unsigned int rs, long addr); | |||
| 160 | void ISAFUNC(UASM_i_LA)(u32 **buf, unsigned int rs, long addr); | 174 | void ISAFUNC(UASM_i_LA)(u32 **buf, unsigned int rs, long addr); |
| 161 | 175 | ||
| 162 | #define UASM_L_LA(lb) \ | 176 | #define UASM_L_LA(lb) \ |
| 163 | static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \ | 177 | static inline void __uasminit ISAFUNC(uasm_l##lb)(struct uasm_label **lab, u32 *addr) \ |
| 164 | { \ | 178 | { \ |
| 165 | uasm_build_label(lab, addr, label##lb); \ | 179 | ISAFUNC(uasm_build_label)(lab, addr, label##lb); \ |
| 166 | } | 180 | } |
| 167 | 181 | ||
| 168 | /* convenience macros for instructions */ | 182 | /* convenience macros for instructions */ |
diff --git a/arch/mips/mm/uasm-mips.c b/arch/mips/mm/uasm-mips.c index e78e74dc3aea..5fcdd8fe3e83 100644 --- a/arch/mips/mm/uasm-mips.c +++ b/arch/mips/mm/uasm-mips.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <asm/inst.h> | 20 | #include <asm/inst.h> |
| 21 | #include <asm/elf.h> | 21 | #include <asm/elf.h> |
| 22 | #include <asm/bugs.h> | 22 | #include <asm/bugs.h> |
| 23 | #define UASM_ISA _UASM_ISA_CLASSIC | ||
| 23 | #include <asm/uasm.h> | 24 | #include <asm/uasm.h> |
| 24 | 25 | ||
| 25 | #define RS_MASK 0x1f | 26 | #define RS_MASK 0x1f |
| @@ -38,6 +39,14 @@ | |||
| 38 | | (e) << RE_SH \ | 39 | | (e) << RE_SH \ |
| 39 | | (f) << FUNC_SH) | 40 | | (f) << FUNC_SH) |
| 40 | 41 | ||
| 42 | /* Define these when we are not the ISA the kernel is being compiled with. */ | ||
| 43 | #ifdef CONFIG_CPU_MICROMIPS | ||
| 44 | #define CL_uasm_i_b(buf, off) ISAOPC(_beq)(buf, 0, 0, off) | ||
| 45 | #define CL_uasm_i_beqz(buf, rs, off) ISAOPC(_beq)(buf, rs, 0, off) | ||
| 46 | #define CL_uasm_i_beqzl(buf, rs, off) ISAOPC(_beql)(buf, rs, 0, off) | ||
| 47 | #define CL_uasm_i_bnez(buf, rs, off) ISAOPC(_bne)(buf, rs, 0, off) | ||
| 48 | #endif | ||
| 49 | |||
| 41 | #include "uasm.c" | 50 | #include "uasm.c" |
| 42 | 51 | ||
| 43 | static struct insn insn_table[] __uasminitdata = { | 52 | static struct insn insn_table[] __uasminitdata = { |
