Skip to content

Commit 9b30757

Browse files
chleroympe
authored andcommitted
powerpc/inst: Move ppc_inst_t definition in asm/reg.h
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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/4b79f1491118af96b1ac0735e74aeca02ea4c04e.1638208156.git.christophe.leroy@csgroup.eu
1 parent 07b863a commit 9b30757

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

arch/powerpc/include/asm/hw_breakpoint.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define _PPC_BOOK3S_64_HW_BREAKPOINT_H
1111

1212
#include <asm/cpu_has_feature.h>
13-
#include <asm/inst.h>
1413

1514
#ifdef __KERNEL__
1615
struct arch_hw_breakpoint {

arch/powerpc/include/asm/inst.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#define _ASM_POWERPC_INST_H
44

55
#include <asm/ppc-opcode.h>
6+
#include <asm/reg.h>
67

78
#define ___get_user_instr(gu_op, dest, ptr) \
89
({ \
@@ -35,13 +36,6 @@
3536
*/
3637

3738
#if defined(CONFIG_PPC64) || defined(__CHECKER__)
38-
typedef struct {
39-
u32 val;
40-
#ifdef CONFIG_PPC64
41-
u32 suffix;
42-
#endif
43-
} __packed ppc_inst_t;
44-
4539
static inline u32 ppc_inst_val(ppc_inst_t x)
4640
{
4741
return x.val;
@@ -50,8 +44,6 @@ static inline u32 ppc_inst_val(ppc_inst_t x)
5044
#define ppc_inst(x) ((ppc_inst_t){ .val = (x) })
5145

5246
#else
53-
typedef u32 ppc_inst_t;
54-
5547
static inline u32 ppc_inst_val(ppc_inst_t x)
5648
{
5749
return x;

arch/powerpc/include/asm/reg.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,18 @@
13661366

13671367
/* Macros for setting and retrieving special purpose registers */
13681368
#ifndef __ASSEMBLY__
1369+
1370+
#if defined(CONFIG_PPC64) || defined(__CHECKER__)
1371+
typedef struct {
1372+
u32 val;
1373+
#ifdef CONFIG_PPC64
1374+
u32 suffix;
1375+
#endif
1376+
} __packed ppc_inst_t;
1377+
#else
1378+
typedef u32 ppc_inst_t;
1379+
#endif
1380+
13691381
#define mfmsr() ({unsigned long rval; \
13701382
asm volatile("mfmsr %0" : "=r" (rval) : \
13711383
: "memory"); rval;})

arch/powerpc/include/asm/uprobes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include <linux/notifier.h>
1313
#include <asm/probes.h>
14-
#include <asm/inst.h>
1514

1615
typedef ppc_opcode_t uprobe_opcode_t;
1716

0 commit comments

Comments
 (0)