Skip to contentSkip to conversation

sh: include: asm: include "linux/sched.h" instead of "asm/ptrace.h" in "kgdb.h"

PATCH New Chen Gang 1 participant 1 message Aug 1, 2013 SuperH

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH v2 1/1 sh: include: asm: include "linux/sched.h" instead of "asm/ptrace.h" in "kgdb.h"

Before really use "asm/ptrace.h", need include "linux/sched.h" firstly, and also "linux/sched.h" has already included "asm/ptrace.h".

So in "kgdb.h", need include "linux/sched.h" instead of "asm/ptrace.h", or 'allmodconfig' can not pass compiling.

The relate error:

CC arch/sh/kernel/kgdb.o
In file included from /root/linux-next/arch/sh/include/asm/kgdb.h:5:0,

                   from include/linux/kgdb.h:20,
                   from arch/sh/kernel/kgdb.c:12:
  arch/sh/kernel/kgdb.c: In function 'sleeping_thread_to_gdb_regs':
  arch/sh/include/asm/ptrace.h:103:11: error: implicit declaration of function 'task_stack_page' [-Werror=implicit-function-declaration]
    ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE) - 1)
             ^
  arch/sh/kernel/kgdb.c:225:32: note: in expansion of macro 'task_pt_regs'
    struct pt_regs *thread_regs = task_pt_regs(p);
                                  ^
  arch/sh/kernel/kgdb.c:242:23: error: dereferencing pointer to incomplete type
    gdb_regs[GDB_R15] = p->thread.sp;
                         ^
  arch/sh/kernel/kgdb.c:243:22: error: dereferencing pointer to incomplete type
    gdb_regs[GDB_PC] = p->thread.pc;
                        ^
  arch/sh/kernel/kgdb.c: In function 'singlestep_trap_handler':
  arch/sh/kernel/kgdb.c:310:27: error: 'SIGTRAP' undeclared (first use in this function)
    kgdb_handle_exception(0, SIGTRAP, 0, regs);
                             ^

arch/sh/kernel/kgdb.c:310:27: note: each undeclared identifier is reported only once for each function it appears in

---
 arch/sh/include/asm/kgdb.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/sh/include/asm/kgdb.h +1 -1
index 9e7d2d1..fef7091 100644
@@ -2,7 +2,7 @@
 #define __ASM_SH_KGDB_H
 
 #include <asm/cacheflush.h>
-#include <asm/ptrace.h>
+#include <linux/sched.h>
 
 enum regnames {
 	GDB_R0, GDB_R1, GDB_R2, GDB_R3, GDB_R4, GDB_R5, GDB_R6, GDB_R7,
Signature · 1 line
1.7.7.6