powerpc/inst: Move ppc_inst_t definition in asm/reg.h
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 29 Nov 2021 17:49:40 +0000 (18:49 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 9 Dec 2021 11:41:21 +0000 (22:41 +1100)
Because of circular inclusion of asm/hw_breakpoint.h, we
need to move definition of asm/reg.h outside of inst.h
so that asm/hw_breakpoint.h gets it without including
asm/inst.h

Also remove asm/inst.h from asm/uprobes.h as it's not
needed anymore.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/4b79f1491118af96b1ac0735e74aeca02ea4c04e.1638208156.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/hw_breakpoint.h
arch/powerpc/include/asm/inst.h
arch/powerpc/include/asm/reg.h
arch/powerpc/include/asm/uprobes.h

index 88053d3c68e6656ddf983cdad38066782ee11de5..84d39fd42f7110008343f9a27ed907d73432a585 100644 (file)
@@ -10,7 +10,6 @@
 #define _PPC_BOOK3S_64_HW_BREAKPOINT_H
 
 #include <asm/cpu_has_feature.h>
-#include <asm/inst.h>
 
 #ifdef __KERNEL__
 struct arch_hw_breakpoint {
index 7ef5fd3bb167ad410eabf31c49704b204ecee413..53a40faf362ac411931f3bdbcfa8fc636c392551 100644 (file)
@@ -3,6 +3,7 @@
 #define _ASM_POWERPC_INST_H
 
 #include <asm/ppc-opcode.h>
+#include <asm/reg.h>
 
 #define ___get_user_instr(gu_op, dest, ptr)                            \
 ({                                                                     \
  */
 
 #if defined(CONFIG_PPC64) || defined(__CHECKER__)
-typedef struct {
-       u32 val;
-#ifdef CONFIG_PPC64
-       u32 suffix;
-#endif
-} __packed ppc_inst_t;
-
 static inline u32 ppc_inst_val(ppc_inst_t x)
 {
        return x.val;
@@ -50,8 +44,6 @@ static inline u32 ppc_inst_val(ppc_inst_t x)
 #define ppc_inst(x) ((ppc_inst_t){ .val = (x) })
 
 #else
-typedef u32 ppc_inst_t;
-
 static inline u32 ppc_inst_val(ppc_inst_t x)
 {
        return x;
index 50478738c8f13a489e2bc2ff02772586d3673596..2835f636322827849840789587f052207d25ba09 100644 (file)
 
 /* Macros for setting and retrieving special purpose registers */
 #ifndef __ASSEMBLY__
+
+#if defined(CONFIG_PPC64) || defined(__CHECKER__)
+typedef struct {
+       u32 val;
+#ifdef CONFIG_PPC64
+       u32 suffix;
+#endif
+} __packed ppc_inst_t;
+#else
+typedef u32 ppc_inst_t;
+#endif
+
 #define mfmsr()                ({unsigned long rval; \
                        asm volatile("mfmsr %0" : "=r" (rval) : \
                                                : "memory"); rval;})
index fe683371336fefd16a0f65ca9b383107ed48ddcf..a7ae1860115a88129503ffad7837960741bb2bcd 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <linux/notifier.h>
 #include <asm/probes.h>
-#include <asm/inst.h>
 
 typedef ppc_opcode_t uprobe_opcode_t;