All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: inst.h: Stop including asm.h to avoid various build failures
@ 2020-05-08  9:30 Huacai Chen
  2020-05-08 13:01 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 7+ messages in thread
From: Huacai Chen @ 2020-05-08  9:30 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: linux-mips, Fuxin Zhang, Zhangjin Wu, Huacai Chen, Jiaxun Yang,
	Huacai Chen

Commit d339cd02b888eb8 ("MIPS: Move unaligned load/store helpers to
inst.h") causes a lot of build failures because macros in asm.h conflict
with various subsystems. Some of these conflictions has been fixed (such
as LONG, PANIC and PRINT) by adjusting asm.h, but some of them is nearly
impossible to fix (such as PTR and END). The only reason of including
asm.h in inst.h is that we need the PTR macro which is used by unaligned
load/store helpers. So in this patch we define a new PTR_STR macro and
use it to replace STR(PTR), then we can stop including asm.h to avoid
various build failures.

Fixes: d339cd02b888eb8 ("MIPS: Move unaligned load/store helpers to inst.h")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
 arch/mips/include/asm/inst.h | 184 ++++++++++++++++++++++---------------------
 1 file changed, 95 insertions(+), 89 deletions(-)

diff --git a/arch/mips/include/asm/inst.h b/arch/mips/include/asm/inst.h
index 8254545..6d74ba3 100644
--- a/arch/mips/include/asm/inst.h
+++ b/arch/mips/include/asm/inst.h
@@ -11,9 +11,15 @@
 #ifndef _ASM_INST_H
 #define _ASM_INST_H
 
-#include <asm/asm.h>
 #include <uapi/asm/inst.h>
 
+#if (_MIPS_SZPTR == 32)
+#define PTR_STR		".word"
+#endif
+#if (_MIPS_SZPTR == 64)
+#define PTR_STR		".dword"
+#endif
+
 /* HACHACHAHCAHC ...  */
 
 /* In case some other massaging is needed, keep MIPSInst as wrapper */
@@ -102,8 +108,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -123,8 +129,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -156,10 +162,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 11b\n\t"		    \
-		STR(PTR)"\t2b, 11b\n\t"		    \
-		STR(PTR)"\t3b, 11b\n\t"		    \
-		STR(PTR)"\t4b, 11b\n\t"		    \
+		PTR_STR"\t1b, 11b\n\t"		    \
+		PTR_STR"\t2b, 11b\n\t"		    \
+		PTR_STR"\t3b, 11b\n\t"		    \
+		PTR_STR"\t4b, 11b\n\t"		    \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -184,8 +190,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -207,8 +213,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -227,8 +233,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -260,10 +266,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 11b\n\t"		    \
-		STR(PTR)"\t2b, 11b\n\t"		    \
-		STR(PTR)"\t3b, 11b\n\t"		    \
-		STR(PTR)"\t4b, 11b\n\t"		    \
+		PTR_STR"\t1b, 11b\n\t"		    \
+		PTR_STR"\t2b, 11b\n\t"		    \
+		PTR_STR"\t3b, 11b\n\t"		    \
+		PTR_STR"\t4b, 11b\n\t"		    \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -305,14 +311,14 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 11b\n\t"		    \
-		STR(PTR)"\t2b, 11b\n\t"		    \
-		STR(PTR)"\t3b, 11b\n\t"		    \
-		STR(PTR)"\t4b, 11b\n\t"		    \
-		STR(PTR)"\t5b, 11b\n\t"		    \
-		STR(PTR)"\t6b, 11b\n\t"		    \
-		STR(PTR)"\t7b, 11b\n\t"		    \
-		STR(PTR)"\t8b, 11b\n\t"		    \
+		PTR_STR"\t1b, 11b\n\t"		    \
+		PTR_STR"\t2b, 11b\n\t"		    \
+		PTR_STR"\t3b, 11b\n\t"		    \
+		PTR_STR"\t4b, 11b\n\t"		    \
+		PTR_STR"\t5b, 11b\n\t"		    \
+		PTR_STR"\t6b, 11b\n\t"		    \
+		PTR_STR"\t7b, 11b\n\t"		    \
+		PTR_STR"\t8b, 11b\n\t"		    \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -337,8 +343,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"              \
+		PTR_STR"\t2b, 4b\n\t"              \
 		".previous"                         \
 		: "=r" (res)                        \
 		: "r" (value), "r" (addr), "i" (-EFAULT));\
@@ -358,8 +364,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=r" (res)                                \
 		: "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -378,8 +384,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=r" (res)                                \
 		: "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -407,10 +413,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 11b\n\t"		    \
-		STR(PTR)"\t2b, 11b\n\t"		    \
-		STR(PTR)"\t3b, 11b\n\t"		    \
-		STR(PTR)"\t4b, 11b\n\t"		    \
+		PTR_STR"\t1b, 11b\n\t"		    \
+		PTR_STR"\t2b, 11b\n\t"		    \
+		PTR_STR"\t3b, 11b\n\t"		    \
+		PTR_STR"\t4b, 11b\n\t"		    \
 		".previous"			    \
 		: "=&r" (res)				    \
 		: "r" (value), "r" (addr), "i" (-EFAULT)    \
@@ -447,14 +453,14 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 11b\n\t"		    \
-		STR(PTR)"\t2b, 11b\n\t"		    \
-		STR(PTR)"\t3b, 11b\n\t"		    \
-		STR(PTR)"\t4b, 11b\n\t"		    \
-		STR(PTR)"\t5b, 11b\n\t"		    \
-		STR(PTR)"\t6b, 11b\n\t"		    \
-		STR(PTR)"\t7b, 11b\n\t"		    \
-		STR(PTR)"\t8b, 11b\n\t"		    \
+		PTR_STR"\t1b, 11b\n\t"		    \
+		PTR_STR"\t2b, 11b\n\t"		    \
+		PTR_STR"\t3b, 11b\n\t"		    \
+		PTR_STR"\t4b, 11b\n\t"		    \
+		PTR_STR"\t5b, 11b\n\t"		    \
+		PTR_STR"\t6b, 11b\n\t"		    \
+		PTR_STR"\t7b, 11b\n\t"		    \
+		PTR_STR"\t8b, 11b\n\t"		    \
 		".previous"			    \
 		: "=&r" (res)				    \
 		: "r" (value), "r" (addr), "i" (-EFAULT)    \
@@ -480,8 +486,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -501,8 +507,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -534,10 +540,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 11b\n\t"		    \
-		STR(PTR)"\t2b, 11b\n\t"		    \
-		STR(PTR)"\t3b, 11b\n\t"		    \
-		STR(PTR)"\t4b, 11b\n\t"		    \
+		PTR_STR"\t1b, 11b\n\t"		    \
+		PTR_STR"\t2b, 11b\n\t"		    \
+		PTR_STR"\t3b, 11b\n\t"		    \
+		PTR_STR"\t4b, 11b\n\t"		    \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -563,8 +569,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -586,8 +592,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -606,8 +612,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -639,10 +645,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 11b\n\t"		    \
-		STR(PTR)"\t2b, 11b\n\t"		    \
-		STR(PTR)"\t3b, 11b\n\t"		    \
-		STR(PTR)"\t4b, 11b\n\t"		    \
+		PTR_STR"\t1b, 11b\n\t"		    \
+		PTR_STR"\t2b, 11b\n\t"		    \
+		PTR_STR"\t3b, 11b\n\t"		    \
+		PTR_STR"\t4b, 11b\n\t"		    \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -684,14 +690,14 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 11b\n\t"		    \
-		STR(PTR)"\t2b, 11b\n\t"		    \
-		STR(PTR)"\t3b, 11b\n\t"		    \
-		STR(PTR)"\t4b, 11b\n\t"		    \
-		STR(PTR)"\t5b, 11b\n\t"		    \
-		STR(PTR)"\t6b, 11b\n\t"		    \
-		STR(PTR)"\t7b, 11b\n\t"		    \
-		STR(PTR)"\t8b, 11b\n\t"		    \
+		PTR_STR"\t1b, 11b\n\t"		    \
+		PTR_STR"\t2b, 11b\n\t"		    \
+		PTR_STR"\t3b, 11b\n\t"		    \
+		PTR_STR"\t4b, 11b\n\t"		    \
+		PTR_STR"\t5b, 11b\n\t"		    \
+		PTR_STR"\t6b, 11b\n\t"		    \
+		PTR_STR"\t7b, 11b\n\t"		    \
+		PTR_STR"\t8b, 11b\n\t"		    \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -714,8 +720,8 @@ do {                                                 \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=r" (res)                        \
 		: "r" (value), "r" (addr), "i" (-EFAULT));\
@@ -735,8 +741,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=r" (res)                                \
 		: "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -755,8 +761,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 4b\n\t"              \
-		STR(PTR)"\t2b, 4b\n\t"              \
+		PTR_STR"\t1b, 4b\n\t"               \
+		PTR_STR"\t2b, 4b\n\t"               \
 		".previous"                         \
 		: "=r" (res)                                \
 		: "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -785,10 +791,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 11b\n\t"		    \
-		STR(PTR)"\t2b, 11b\n\t"		    \
-		STR(PTR)"\t3b, 11b\n\t"		    \
-		STR(PTR)"\t4b, 11b\n\t"		    \
+		PTR_STR"\t1b, 11b\n\t"		    \
+		PTR_STR"\t2b, 11b\n\t"		    \
+		PTR_STR"\t3b, 11b\n\t"		    \
+		PTR_STR"\t4b, 11b\n\t"		    \
 		".previous"			    \
 		: "=&r" (res)				    \
 		: "r" (value), "r" (addr), "i" (-EFAULT)    \
@@ -825,14 +831,14 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		STR(PTR)"\t1b, 11b\n\t"		    \
-		STR(PTR)"\t2b, 11b\n\t"		    \
-		STR(PTR)"\t3b, 11b\n\t"		    \
-		STR(PTR)"\t4b, 11b\n\t"		    \
-		STR(PTR)"\t5b, 11b\n\t"		    \
-		STR(PTR)"\t6b, 11b\n\t"		    \
-		STR(PTR)"\t7b, 11b\n\t"		    \
-		STR(PTR)"\t8b, 11b\n\t"		    \
+		PTR_STR"\t1b, 11b\n\t"		    \
+		PTR_STR"\t2b, 11b\n\t"		    \
+		PTR_STR"\t3b, 11b\n\t"		    \
+		PTR_STR"\t4b, 11b\n\t"		    \
+		PTR_STR"\t5b, 11b\n\t"		    \
+		PTR_STR"\t6b, 11b\n\t"		    \
+		PTR_STR"\t7b, 11b\n\t"		    \
+		PTR_STR"\t8b, 11b\n\t"		    \
 		".previous"			    \
 		: "=&r" (res)				    \
 		: "r" (value), "r" (addr), "i" (-EFAULT)    \
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-14 12:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  9:30 [PATCH] MIPS: inst.h: Stop including asm.h to avoid various build failures Huacai Chen
2020-05-08 13:01 ` Thomas Bogendoerfer
2020-05-09  4:10   ` Huacai Chen
2020-05-09 15:25     ` Thomas Bogendoerfer
2020-05-12 23:52       ` Maciej W. Rozycki
2020-05-14  5:46         ` Huacai Chen
2020-05-14 12:23           ` Maciej W. Rozycki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.