From 64a17a0ff19a938e1246474666635219f2c3bc15 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 16 Apr 2014 00:39:02 +0200 Subject: MIPS: Move definition of __BITFIELD_FIELD to sharable header. Signed-off-by: Ralf Baechle --- arch/mips/include/uapi/asm/Kbuild | 1 + arch/mips/include/uapi/asm/bitfield.h | 29 +++++++++++++++++++++++++++++ arch/mips/include/uapi/asm/inst.h | 20 ++------------------ 3 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 arch/mips/include/uapi/asm/bitfield.h (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/Kbuild b/arch/mips/include/uapi/asm/Kbuild index be7196eacb88..96fe7395ed8d 100644 --- a/arch/mips/include/uapi/asm/Kbuild +++ b/arch/mips/include/uapi/asm/Kbuild @@ -4,6 +4,7 @@ include include/uapi/asm-generic/Kbuild.asm generic-y += auxvec.h generic-y += ipcbuf.h +header-y += bitfield.h header-y += bitsperlong.h header-y += break.h header-y += byteorder.h diff --git a/arch/mips/include/uapi/asm/bitfield.h b/arch/mips/include/uapi/asm/bitfield.h new file mode 100644 index 000000000000..ad9861359cea --- /dev/null +++ b/arch/mips/include/uapi/asm/bitfield.h @@ -0,0 +1,29 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2014 by Ralf Baechle + */ +#ifndef __UAPI_ASM_BITFIELD_H +#define __UAPI_ASM_BITFIELD_H + +/* + * * Damn ... bitfields depend from byteorder :-( + * */ +#ifdef __MIPSEB__ +#define __BITFIELD_FIELD(field, more) \ + field; \ + more + +#elif defined(__MIPSEL__) + +#define __BITFIELD_FIELD(field, more) \ + more \ + field; + +#else /* !defined (__MIPSEB__) && !defined (__MIPSEL__) */ +#error "MIPS but neither __MIPSEL__ nor __MIPSEB__?" +#endif + +#endif /* __UAPI_ASM_BITFIELD_H */ diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index 3125797f2a88..fce8367da245 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -13,6 +13,8 @@ #ifndef _UAPI_ASM_INST_H #define _UAPI_ASM_INST_H +#include + /* * Major opcodes; before MIPS IV cop1x was called cop3. */ @@ -480,24 +482,6 @@ enum MIPS6e_i8_func { */ #define MM_NOP16 0x0c00 -/* - * Damn ... bitfields depend from byteorder :-( - */ -#ifdef __MIPSEB__ -#define __BITFIELD_FIELD(field, more) \ - field; \ - more - -#elif defined(__MIPSEL__) - -#define __BITFIELD_FIELD(field, more) \ - more \ - field; - -#else /* !defined (__MIPSEB__) && !defined (__MIPSEL__) */ -#error "MIPS but neither __MIPSEL__ nor __MIPSEB__?" -#endif - struct j_format { __BITFIELD_FIELD(unsigned int opcode : 6, /* Jump format */ __BITFIELD_FIELD(unsigned int target : 26, -- cgit v1.2.1 From f4b3aa7cd9d32407670e67238c5ee752bb98f481 Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Tue, 6 May 2014 15:55:43 +0300 Subject: MIPS: Add __SANE_USERSPACE_TYPES__ to asm/types.h for LL64 Allow 64-bit userspace programs to use ll64 types. The define name comes from commit 2c9c6ce0199a4d252e20c531cfdc9d24e39235c0 (powerpc: Add __SANE_USERSPACE_TYPES__ to asm/types.h for LL64). The patch allows to compile perf on MIPS64 and eliminates the following warnings: tests/attr.c:74:4: error: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type '__u64' [-Werror=format=] Signed-off-by: Aaro Koskinen Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/6890/ Signed-off-by: Ralf Baechle --- arch/mips/include/uapi/asm/types.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/types.h b/arch/mips/include/uapi/asm/types.h index 7ac9d0baad84..f3dd9ff0cc0c 100644 --- a/arch/mips/include/uapi/asm/types.h +++ b/arch/mips/include/uapi/asm/types.h @@ -14,9 +14,12 @@ /* * We don't use int-l64.h for the kernel anymore but still use it for * userspace to avoid code changes. + * + * However, some user programs (e.g. perf) may not want this. They can + * flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here. */ #ifndef __KERNEL__ -# if _MIPS_SZLONG == 64 +# if _MIPS_SZLONG == 64 && !defined(__SANE_USERSPACE_TYPES__) # include # else # include -- cgit v1.2.1 From b0a3eae2b943ef62cb8265aa604c78bb6565a2cd Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Tue, 24 Dec 2013 03:44:28 +0000 Subject: MIPS: inst.h: define COP0 wait op The func field for the wait instruction was missing from inst.h - this patch adds it. Signed-off-by: Paul Burton --- arch/mips/include/uapi/asm/inst.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index df6e775f3fef..044123bfab90 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -125,7 +125,8 @@ enum bcop_op { enum cop0_coi_func { tlbr_op = 0x01, tlbwi_op = 0x02, tlbwr_op = 0x06, tlbp_op = 0x08, - rfe_op = 0x10, eret_op = 0x18 + rfe_op = 0x10, eret_op = 0x18, + wait_op = 0x20, }; /* -- cgit v1.2.1 From 6f5bb42498b0c7901d32a81d163962fd8e37f827 Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Tue, 4 Mar 2014 15:11:12 +0000 Subject: MIPS: inst.h: define MT yield op The opcode for the MT ASE yield instruction within the spec3 group was missing. This patch adds it for use by a subsequent patch. Signed-off-by: Paul Burton --- arch/mips/include/uapi/asm/inst.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index 044123bfab90..b7492c69aa00 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -74,16 +74,17 @@ enum spec2_op { enum spec3_op { ext_op, dextm_op, dextu_op, dext_op, ins_op, dinsm_op, dinsu_op, dins_op, - lx_op = 0x0a, lwle_op = 0x19, - lwre_op = 0x1a, cachee_op = 0x1b, - sbe_op = 0x1c, she_op = 0x1d, - sce_op = 0x1e, swe_op = 0x1f, - bshfl_op = 0x20, swle_op = 0x21, - swre_op = 0x22, prefe_op = 0x23, - dbshfl_op = 0x24, lbue_op = 0x28, - lhue_op = 0x29, lbe_op = 0x2c, - lhe_op = 0x2d, lle_op = 0x2e, - lwe_op = 0x2f, rdhwr_op = 0x3b + yield_op = 0x09, lx_op = 0x0a, + lwle_op = 0x19, lwre_op = 0x1a, + cachee_op = 0x1b, sbe_op = 0x1c, + she_op = 0x1d, sce_op = 0x1e, + swe_op = 0x1f, bshfl_op = 0x20, + swle_op = 0x21, swre_op = 0x22, + prefe_op = 0x23, dbshfl_op = 0x24, + lbue_op = 0x28, lhue_op = 0x29, + lbe_op = 0x2c, lhe_op = 0x2d, + lle_op = 0x2e, lwe_op = 0x2f, + rdhwr_op = 0x3b }; /* -- cgit v1.2.1 From 7ed82ad12c1553a40a5dd7e9c0b34a80c2c02e47 Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Thu, 9 Jan 2014 15:27:32 +0000 Subject: MIPS: inst.h: define microMIPS sync op The opcode for the sync instruction within POOL32AXf was missing. This patch adds it for use by a subsequent patch. Signed-off-by: Paul Burton --- arch/mips/include/uapi/asm/inst.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index b7492c69aa00..89e915587417 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -303,6 +303,7 @@ enum mm_32axf_minor_op { mm_tlbwr_op = 0x0cd, mm_jalrs_op = 0x13c, mm_jalrshb_op = 0x17c, + mm_sync_op = 0x1ad, mm_syscall_op = 0x22d, mm_eret_op = 0x3cd, }; -- cgit v1.2.1 From f263839ab59a7f4beb74fc9a7ce0234b62ab2b52 Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Thu, 9 Jan 2014 15:30:37 +0000 Subject: MIPS: inst.h: define microMIPS wait op The opcode for the wait instruction within POOL32AXf was missing. This patch adds it for use by a subsequent patch. Signed-off-by: Paul Burton --- arch/mips/include/uapi/asm/inst.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index 89e915587417..e6e7fe372cbd 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -305,6 +305,7 @@ enum mm_32axf_minor_op { mm_jalrshb_op = 0x17c, mm_sync_op = 0x1ad, mm_syscall_op = 0x22d, + mm_wait_op = 0x24d, mm_eret_op = 0x3cd, }; -- cgit v1.2.1 From bef581ba1c240cda9c550d314ca70c2b8deb6e87 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 8 Apr 2014 12:47:04 +0100 Subject: MIPS: uasm: Add sllv uasm instruction It will be used later on by bpf-jit [ralf@linux-mips.org: Fixed conflict with 49e9529b9d43773307b8c73bd251b71784830c3d [MIPS: uasm: add jalr instruction]. Signed-off-by: Markos Chandras Cc: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/6725/ Signed-off-by: Ralf Baechle --- arch/mips/include/uapi/asm/inst.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index a1ad5516ad1f..217d696bd1d3 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -248,6 +248,7 @@ enum mm_32i_minor_op { enum mm_32a_minor_op { mm_sll32_op = 0x000, mm_ins_op = 0x00c, + mm_sllv32_op = 0x010, mm_ext_op = 0x02c, mm_pool32axf_op = 0x03c, mm_srl32_op = 0x040, -- cgit v1.2.1 From f31318fdf324901ce5a17ccc3d71213117fb44af Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 8 Apr 2014 12:47:05 +0100 Subject: MIPS: uasm: Add srlv uasm instruction It will be used later on by bpf-jit [ralf@linux-mips.org: Fixed conflict due to other preceeding conflicts.] Signed-off-by: Markos Chandras Cc: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/6726/ Signed-off-by: Ralf Baechle --- arch/mips/include/uapi/asm/inst.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index 217d696bd1d3..abcdebe60e70 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -253,6 +253,7 @@ enum mm_32a_minor_op { mm_pool32axf_op = 0x03c, mm_srl32_op = 0x040, mm_sra_op = 0x080, + mm_srlv32_op = 0x090, mm_rotr_op = 0x0c0, mm_lwxs_op = 0x118, mm_addu32_op = 0x150, -- cgit v1.2.1 From 4c12a854d81db5454436c015ec30f39882e923a4 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 8 Apr 2014 12:47:06 +0100 Subject: MIPS: uasm: Add divu uasm instruction It will be used later on by bpf-jit [ralf@linux-mips.org: Resolved conflict.] Signed-off-by: Markos Chandras Cc: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/6727/ Signed-off-by: Ralf Baechle --- arch/mips/include/uapi/asm/inst.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index abcdebe60e70..a4bef362d7a8 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -311,6 +311,7 @@ enum mm_32axf_minor_op { mm_syscall_op = 0x22d, mm_wait_op = 0x24d, mm_eret_op = 0x3cd, + mm_divu_op = 0x5dc, }; /* -- cgit v1.2.1 From f3ec7a23b640a064410e31afe9a203f7c125460e Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 8 Apr 2014 12:47:07 +0100 Subject: MIPS: uasm: Add mfhi uasm instruction It will be used later on by bpf-jit [ralf@linux-mips.org: Resolved conflict.] Signed-off-by: Markos Chandras Cc: linux-mips@linux-mips.org Cc: Markos Chandras Patchwork: http://patchwork.linux-mips.org/patch/6728/ Signed-off-by: Ralf Baechle --- arch/mips/include/uapi/asm/inst.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index a4bef362d7a8..a7f6a16fd26c 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -300,6 +300,7 @@ enum mm_32axf_minor_op { mm_mfc0_op = 0x003, mm_mtc0_op = 0x00b, mm_tlbp_op = 0x00d, + mm_mfhi32_op = 0x035, mm_jalr_op = 0x03c, mm_tlbr_op = 0x04d, mm_jalrhb_op = 0x07c, -- cgit v1.2.1 From e8ef868b470984064c23ce4bf2cd4c0167e1fbe5 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 8 Apr 2014 12:47:10 +0100 Subject: MIPS: uasm: Add sltu uasm instruction It will be used later on by bpf-jit [ralf@linux-mips.org: Resolved conflict.] Signed-off-by: Markos Chandras Cc: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/6731/ Signed-off-by: Ralf Baechle --- arch/mips/include/uapi/asm/inst.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index a7f6a16fd26c..c78d235f86ee 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -261,6 +261,7 @@ enum mm_32a_minor_op { mm_and_op = 0x250, mm_or32_op = 0x290, mm_xor32_op = 0x310, + mm_sltu_op = 0x390, }; /* -- cgit v1.2.1 From ab9e4fa092db6c4beea8fde67261959520675456 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 8 Apr 2014 12:47:11 +0100 Subject: MIPS: uasm: Add wsbh uasm instruction It will be used later on by bpf-jit [ralf@linux-mips.org: Resolved conflict.] Signed-off-by: Markos Chandras Cc: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/6732/ Signed-off-by: Ralf Baechle --- arch/mips/include/uapi/asm/inst.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index c78d235f86ee..aa37373bfd64 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -205,6 +205,16 @@ enum lx_func { lbx_op = 0x16, }; +/* + * BSHFL opcodes + */ +enum bshfl_func { + wsbh_op = 0x2, + dshd_op = 0x5, + seb_op = 0x10, + seh_op = 0x18, +}; + /* * (microMIPS) Major opcodes. */ @@ -258,6 +268,7 @@ enum mm_32a_minor_op { mm_lwxs_op = 0x118, mm_addu32_op = 0x150, mm_subu32_op = 0x1d0, + mm_wsbh_op = 0x1ec, mm_and_op = 0x250, mm_or32_op = 0x290, mm_xor32_op = 0x310, -- cgit v1.2.1 From a8e897ad00d3cfd0ab9029978f0c3f8ecd6fba61 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 8 Apr 2014 12:47:13 +0100 Subject: MIPS: uasm: Add mul uasm instruction It will be used later on by bpf-jit [ralf@linux-mips.org: Resolved conflict.] Signed-off-by: Markos Chandras Cc: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/6736/ Signed-off-by: Ralf Baechle --- arch/mips/include/uapi/asm/inst.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index aa37373bfd64..67933839ce6a 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -269,6 +269,7 @@ enum mm_32a_minor_op { mm_addu32_op = 0x150, mm_subu32_op = 0x1d0, mm_wsbh_op = 0x1ec, + mm_mul_op = 0x210, mm_and_op = 0x250, mm_or32_op = 0x290, mm_xor32_op = 0x310, -- cgit v1.2.1 From 16d21a812f6bfcbfa84ccc19d38abe797c71b73e Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 14 Apr 2014 15:42:31 +0100 Subject: MIPS: uasm: Add mflo uasm instruction It will be used later on by bpf-jit [ralf@linux-mips.org: Resolved conflict.] Signed-off-by: Markos Chandras --- arch/mips/include/uapi/asm/inst.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index 67933839ce6a..4b7160259292 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -316,6 +316,7 @@ enum mm_32axf_minor_op { mm_mfhi32_op = 0x035, mm_jalr_op = 0x03c, mm_tlbr_op = 0x04d, + mm_mflo32_op = 0x075, mm_jalrhb_op = 0x07c, mm_tlbwi_op = 0x08d, mm_tlbwr_op = 0x0cd, -- cgit v1.2.1 From 90dfdc7ceb577c0d7b7635def3c62039a091e50d Mon Sep 17 00:00:00 2001 From: David Daney Date: Wed, 28 May 2014 23:52:12 +0200 Subject: MIPS: Add functions for hypervisor call Introduce kvm_hypercall[0-3]. Define three new hypercalls for MIPS: GET_CLOCK_FREQ, EXIT_VM, and CONSOLE_OUTPUT. [andreas.herrmann: * Properly define hypercalls and HC numbers for MIPS in kvm_para.h header files] Signed-off-by: David Daney Signed-off-by: Andreas Herrmann Cc: linux-mips@linux-mips.org Cc: James Hogan Cc: kvm@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/7005/ Signed-off-by: Ralf Baechle --- arch/mips/include/uapi/asm/kvm_para.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'arch/mips/include/uapi') diff --git a/arch/mips/include/uapi/asm/kvm_para.h b/arch/mips/include/uapi/asm/kvm_para.h index 14fab8f0b957..7e16d7c42e65 100644 --- a/arch/mips/include/uapi/asm/kvm_para.h +++ b/arch/mips/include/uapi/asm/kvm_para.h @@ -1 +1,5 @@ -#include +#ifndef _UAPI_ASM_MIPS_KVM_PARA_H +#define _UAPI_ASM_MIPS_KVM_PARA_H + + +#endif /* _UAPI_ASM_MIPS_KVM_PARA_H */ -- cgit v1.2.1