MIPS: Fix the declaration conflict of mm_isBranchInstr()
Subsystems (2)
PATCH v3 1/3 MIPS: Fix the declaration conflict of mm_isBranchInstr()
mm_isBranchInstr() is declared both in branch.h and in fpu_emulator.h but the two declarations are conflict. If both of them are included by a same file, they will cause a build error:
./arch/mips/include/asm/branch.h:33:19: error: static declaration of 'mm_isBranchInstr' follows non-static declaration
static inline int mm_isBranchInstr(struct pt_regs *regs,
^
./arch/mips/include/asm/fpu_emulator.h:177:5: note: previous declaration of 'mm_isBranchInstr' was here
int mm_isBranchInstr(struct pt_regs *regs, struct mm_decoded_insn dec_insn,
Fix this error by removing both isBranchInstr() and mm_isBranchInstr() in fpu_emulator.h, and declaring both of them in branch.h.
--- arch/mips/include/asm/branch.h | 3 +++ arch/mips/include/asm/fpu_emulator.h | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-)
arch/mips/include/asm/branch.h +3 -0
@@ -27,6 +27,9 @@ extern int __MIPS16e_compute_return_epc(struct pt_regs *regs);#define MM_POOL32A_MINOR_SHIFT 0x6#define MM_MIPS32_COND_FC 0x30 +int isBranchInstr (struct pt_regs *regs, +struct mm_decoded_insn dec_insn,unsigned long *contpc); +extern int __mm_isBranchInstr (struct pt_regs *regs,struct mm_decoded_insn dec_insn,unsigned long *contpc);
arch/mips/include/asm/fpu_emulator.h +0 -4
@@ -172,10 +172,6 @@ void force_fcr31_sig(unsigned long fcr31, void __user *fault_addr, struct task_struct *tsk);int process_fpemu_return (int sig,void __user *fault_addr,unsigned long fcr31); -int isBranchInstr (struct pt_regs *regs,struct mm_decoded_insn dec_insn, -unsigned long *contpc); -int mm_isBranchInstr (struct pt_regs *regs,struct mm_decoded_insn dec_insn, -unsigned long *contpc);/* * Mask the FCSR Cause bits according to the Enable bits, observing
Signature · 1 line
2.7.0
PATCH v3 2/3 MIPS: Move unaligned load/store helpers to inst.h
Move unaligned load/store helpers from unaligned.c to inst.h, then other parts of the kernel can use these helpers.
Use __ASSEMBLY__ to guard the definition of "LONG" in asm.h to avoid build error on IPxx platforms.
--- arch/mips/include/asm/asm.h | 4 + arch/mips/include/asm/inst.h | 773 ++++++++++++++++++++++++++++++++++++++++++ arch/mips/kernel/unaligned.c | 775 ------------------------------------------- 3 files changed, 777 insertions(+), 775 deletions(-)
arch/mips/include/asm/asm.h +4 -0
@@ -202,7 +202,9 @@ symbol = value#define LONG_SRA sra#define LONG_SRAV srav +#ifdef __ASSEMBLY__#define LONG .word +#endif #define LONGSIZE 4#define LONGMASK 3#define LONGLOG 2
@@ -225,7 +227,9 @@ symbol = value#define LONG_SRA dsra#define LONG_SRAV dsrav +#ifdef __ASSEMBLY__#define LONG .dword +#endif #define LONGSIZE 8#define LONGMASK 7#define LONGLOG 3
arch/mips/include/asm/inst.h +773 -0
783 lines not on this page · raw message
arch/mips/kernel/unaligned.c +0 -775
787 lines not on this page · raw message
Signature · 1 line
2.7.0
PATCH v3 3/3 MIPS: Loongson-3: Add some unaligned instructions emulation
In reply to Huacai Chen1, Add unaligned gslq, gssq, gslqc1, gssqc1 emulation; 2, Add unaligned gsl{h, w, d}x, gss{h, w, d}x emulation; 3, Add unaligned gslwxc1, gsswxc1, gsldxc1, gssdxc1 emulation.
--- arch/mips/include/uapi/asm/inst.h | 26 ++++ arch/mips/loongson64/cop2-ex.c | 289 +++++++++++++++++++++++++++++++++++++- 2 files changed, 314 insertions(+), 1 deletion(-)
arch/mips/include/uapi/asm/inst.h +26 -0
@@ -989,6 +989,30 @@ struct mm16_r5_format { /* Load/store from stack pointer format */ };/* +* Loongson-3 overridden COP2 instruction formats (32-bit length) +*/ +struct loongson3_lswc2_format { /* Loongson-3 overridden lwc2/swc2 Load/Store format */ + __BITFIELD_FIELD(unsigned int opcode : 6, + __BITFIELD_FIELD(unsigned int base : 5, + __BITFIELD_FIELD(unsigned int rt : 5, + __BITFIELD_FIELD(unsigned int fr : 1, + __BITFIELD_FIELD(unsigned int offset : 9, + __BITFIELD_FIELD(unsigned int ls : 1, + __BITFIELD_FIELD(unsigned int rq : 5, + ;))))))) +}; + +struct loongson3_lsdc2_format { /* Loongson-3 overridden ldc2/sdc2 Load/Store format */ + __BITFIELD_FIELD(unsigned int opcode : 6, + __BITFIELD_FIELD(unsigned int base : 5, + __BITFIELD_FIELD(unsigned int rt : 5, + __BITFIELD_FIELD(unsigned int index : 5, + __BITFIELD_FIELD(unsigned int offset : 8, + __BITFIELD_FIELD(unsigned int opcode1 : 3, + ;)))))) +}; + +/* * MIPS16e instruction formats (16-bit length) */ struct m16e_rr {
@@ -1088,6 +1112,8 @@ union mips_instruction {struct mm16_rb_format mm16_rb_format;struct mm16_r3_format mm16_r3_format;struct mm16_r5_format mm16_r5_format; +struct loongson3_lswc2_format loongson3_lswc2_format; +struct loongson3_lsdc2_format loongson3_lsdc2_format; };union mips16e_instruction {
arch/mips/loongson64/cop2-ex.c +288 -1
314 lines not on this page · raw message
Signature · 1 line
2.7.0
Thomas Bogendoerfer
maintainerQuoted 13 lines · Huacai Chen
mm_isBranchInstr()is declared both inbranch.hand infpu_emulator.hbut the two declarations are conflict. If both of them are included by a same file, they will cause a build error:
./arch/mips/include/asm/branch.h:33:19: error: static declaration of 'mm_isBranchInstr' follows non-static declaration
static inline int mm_isBranchInstr(structpt_regs*regs,^
./arch/mips/include/asm/fpu_emulator.h:177:5: note: previous declaration of 'mm_isBranchInstr' was here
int mm_isBranchInstr(structpt_regs*regs, structmm_decoded_insndec_insn,Fix this error by removing both
isBranchInstr()andmm_isBranchInstr()infpu_emulator.h, and declaring both of them inbranch.h.
Quoted 6 lines
Signed-off-by Huacai Chen <[email protected]>Reviewed-by Jiaxun Yang <[email protected]>--- arch/mips/include/asm/branch.h | 3 +++ arch/mips/include/asm/fpu_emulator.h | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-)
Patch 1-3 applied to mips-next.
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]