Skip to contentSkip to conversation

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

PATCH Superseded Chen Gang 2 participants 3 messages Jul 31, 2013 – Aug 1, 2013

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 sh: include: asm: include "linux/sched.h" in "ptrace.h"

Need include "linux/sched.h" in "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/ptrace.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/sh/include/asm/ptrace.h +1 -0
index 2506c7d..b5784f9 100644
@@ -11,6 +11,7 @@
 #include <asm/addrspace.h>
 #include <asm/page.h>
 #include <uapi/asm/ptrace.h>
+#include <linux/sched.h>
 
 #define user_mode(regs)			(((regs)->sr & 0x40000000)=0)
 #define kernel_stack_pointer(_regs)	((unsigned long)(_regs)->regs[15])
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 2 lines · Chen Gang

Need include "linux/sched.h" in "ptrace.h", or 'allmodconfig' can not pass compiling.

You can't do that. linux/sched.h #includes asm/ptrace.h already.

David

author
#2 lore raw
In reply to Chen Gang
Quoted 5 lines · David Howells
Quoted 2 lines · Chen Gang
Quoted 2 lines

Need include "linux/sched.h" in "ptrace.h", or 'allmodconfig' can not pass compiling.

You can't do that. linux/sched.h #includes asm/ptrace.h already.

OH, really it is. Although it can pass compiling, it is incorrect (will make things worse).

I will send patch v2 for it. :-)

Thanks.

Signature · 1 line
Chen Gang