Commit cf6d9058 authored by Steven J. Hill's avatar Steven J. Hill Committed by Ralf Baechle

MIPS: microMIPS: Fix macro naming in micro-assembler.

The macros did not properly take into account the ISA that
the kernel was being compiled with. A classic MIPS kernel
will have the standard 'uasm_i_##op' macro functions with
'MM_uasm_i_##op' macro functions for the microMIPS version.
A pure microMIPS kernel will have the standard macros with
'CL_uasm_i_##op' macro functions for the classic version.
Signed-off-by: default avatarSteven J. Hill <Steven.Hill@imgtec.com>
parent 8fe4bb98
...@@ -26,15 +26,29 @@ ...@@ -26,15 +26,29 @@
#define _UASM_ISA_MICROMIPS 1 #define _UASM_ISA_MICROMIPS 1
#ifndef UASM_ISA #ifndef UASM_ISA
#ifdef CONFIG_CPU_MICROMIPS
#define UASM_ISA _UASM_ISA_MICROMIPS
#else
#define UASM_ISA _UASM_ISA_CLASSIC #define UASM_ISA _UASM_ISA_CLASSIC
#endif #endif
#endif
#if (UASM_ISA == _UASM_ISA_CLASSIC) #if (UASM_ISA == _UASM_ISA_CLASSIC)
#ifdef CONFIG_CPU_MICROMIPS
#define ISAOPC(op) CL_uasm_i##op
#define ISAFUNC(x) CL_##x
#else
#define ISAOPC(op) uasm_i##op #define ISAOPC(op) uasm_i##op
#define ISAFUNC(x) x #define ISAFUNC(x) x
#endif
#elif (UASM_ISA == _UASM_ISA_MICROMIPS) #elif (UASM_ISA == _UASM_ISA_MICROMIPS)
#ifdef CONFIG_CPU_MICROMIPS
#define ISAOPC(op) uasm_i##op
#define ISAFUNC(x) x
#else
#define ISAOPC(op) MM_uasm_i##op #define ISAOPC(op) MM_uasm_i##op
#define ISAFUNC(x) MM_##x #define ISAFUNC(x) MM_##x
#endif
#else #else
#error Unsupported micro-assembler ISA!!! #error Unsupported micro-assembler ISA!!!
#endif #endif
...@@ -160,9 +174,9 @@ void ISAFUNC(UASM_i_LA_mostly)(u32 **buf, unsigned int rs, long addr); ...@@ -160,9 +174,9 @@ void ISAFUNC(UASM_i_LA_mostly)(u32 **buf, unsigned int rs, long addr);
void ISAFUNC(UASM_i_LA)(u32 **buf, unsigned int rs, long addr); void ISAFUNC(UASM_i_LA)(u32 **buf, unsigned int rs, long addr);
#define UASM_L_LA(lb) \ #define UASM_L_LA(lb) \
static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \ static inline void __uasminit ISAFUNC(uasm_l##lb)(struct uasm_label **lab, u32 *addr) \
{ \ { \
uasm_build_label(lab, addr, label##lb); \ ISAFUNC(uasm_build_label)(lab, addr, label##lb); \
} }
/* convenience macros for instructions */ /* convenience macros for instructions */
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <asm/inst.h> #include <asm/inst.h>
#include <asm/elf.h> #include <asm/elf.h>
#include <asm/bugs.h> #include <asm/bugs.h>
#define UASM_ISA _UASM_ISA_CLASSIC
#include <asm/uasm.h> #include <asm/uasm.h>
#define RS_MASK 0x1f #define RS_MASK 0x1f
...@@ -38,6 +39,14 @@ ...@@ -38,6 +39,14 @@
| (e) << RE_SH \ | (e) << RE_SH \
| (f) << FUNC_SH) | (f) << FUNC_SH)
/* Define these when we are not the ISA the kernel is being compiled with. */
#ifdef CONFIG_CPU_MICROMIPS
#define CL_uasm_i_b(buf, off) ISAOPC(_beq)(buf, 0, 0, off)
#define CL_uasm_i_beqz(buf, rs, off) ISAOPC(_beq)(buf, rs, 0, off)
#define CL_uasm_i_beqzl(buf, rs, off) ISAOPC(_beql)(buf, rs, 0, off)
#define CL_uasm_i_bnez(buf, rs, off) ISAOPC(_bne)(buf, rs, 0, off)
#endif
#include "uasm.c" #include "uasm.c"
static struct insn insn_table[] __uasminitdata = { static struct insn insn_table[] __uasminitdata = {
......
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