Skip to content

Commit

Permalink
[MIPS] Make KGDB compile on UP
Browse files Browse the repository at this point in the history
Building UP kernel with KGDB enabled produces the following errors and warning
(fatal due to -Werror in arch/mips/kernel/Makefile):

In file included from arch/mips/kernel/gdb-stub.c:142:
include/asm/smp.h:25:1: "raw_smp_processor_id" redefined
In file included from include/linux/sched.h:69,
                 from arch/mips/kernel/gdb-stub.c:126:
include/linux/smp.h:88:1: this is the location of the previous definition
In file included from arch/mips/kernel/gdb-stub.c:142:
include/asm/smp.h:62: error: redefinition of 'smp_send_reschedule'
include/linux/smp.h:102: error: previous definition of 'smp_send_reschedule' was here
include/asm/smp.h: In function `smp_send_reschedule':
include/asm/smp.h:65: error: dereferencing pointer to incomplete type
arch/mips/kernel/gdb-stub.c: At top level:
arch/mips/kernel/gdb-stub.c:660: warning: 'kgdb_wait' defined but not used

Fix the errors by not directly including <asm/smp.h> (which is already included
by <linux/smp.h>) and the warning by enclosing kgdb_wait() in #ifdef CONFIG_SMP.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Sergei Shtylyov authored and Ralf Baechle committed Apr 4, 2008
1 parent 865ab87 commit e64a3cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/mips/kernel/gdb-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
#include <asm/system.h>
#include <asm/gdb-stub.h>
#include <asm/inst.h>
#include <asm/smp.h>

/*
* external low-level support routines
Expand Down Expand Up @@ -656,6 +655,7 @@ void set_async_breakpoint(unsigned long *epc)
*epc = (unsigned long)async_breakpoint;
}

#ifdef CONFIG_SMP
static void kgdb_wait(void *arg)
{
unsigned flags;
Expand All @@ -668,6 +668,7 @@ static void kgdb_wait(void *arg)

local_irq_restore(flags);
}
#endif

/*
* GDB stub needs to call kgdb_wait on all processor with interrupts
Expand Down

0 comments on commit e64a3cf

Please sign in to comment.