|
@@ -150,13 +150,6 @@ struct kgdb_regs trap_registers;
|
|
char kgdb_in_gdb_mode;
|
|
char kgdb_in_gdb_mode;
|
|
char in_nmi; /* Set during NMI to prevent reentry */
|
|
char in_nmi; /* Set during NMI to prevent reentry */
|
|
int kgdb_nofault; /* Boolean to ignore bus errs (i.e. in GDB) */
|
|
int kgdb_nofault; /* Boolean to ignore bus errs (i.e. in GDB) */
|
|
-int kgdb_enabled = 1; /* Default to enabled, cmdline can disable */
|
|
|
|
-
|
|
|
|
-/* Exposed for user access */
|
|
|
|
-struct task_struct *kgdb_current;
|
|
|
|
-unsigned int kgdb_g_imask;
|
|
|
|
-int kgdb_trapa_val;
|
|
|
|
-int kgdb_excode;
|
|
|
|
|
|
|
|
/* Default values for SCI (can override via kernel args in setup.c) */
|
|
/* Default values for SCI (can override via kernel args in setup.c) */
|
|
#ifndef CONFIG_KGDB_DEFPORT
|
|
#ifndef CONFIG_KGDB_DEFPORT
|
|
@@ -640,7 +633,6 @@ static void do_single_step(void)
|
|
|
|
|
|
/* Flush and return */
|
|
/* Flush and return */
|
|
kgdb_flush_icache_range((long) addr, (long) addr + 2);
|
|
kgdb_flush_icache_range((long) addr, (long) addr + 2);
|
|
- return;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/* Undo a single step */
|
|
/* Undo a single step */
|
|
@@ -815,14 +807,10 @@ static void set_regs_msg(void)
|
|
/*
|
|
/*
|
|
* Bring up the ports..
|
|
* Bring up the ports..
|
|
*/
|
|
*/
|
|
-static int kgdb_serial_setup(void)
|
|
|
|
|
|
+static int __init kgdb_serial_setup(void)
|
|
{
|
|
{
|
|
- extern int kgdb_console_setup(struct console *co, char *options);
|
|
|
|
struct console dummy;
|
|
struct console dummy;
|
|
-
|
|
|
|
- kgdb_console_setup(&dummy, 0);
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return kgdb_console_setup(&dummy, 0);
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
#define kgdb_serial_setup() 0
|
|
#define kgdb_serial_setup() 0
|
|
@@ -833,22 +821,6 @@ static void kgdb_command_loop(const int excep_code, const int trapa_value)
|
|
{
|
|
{
|
|
int sigval;
|
|
int sigval;
|
|
|
|
|
|
- if (excep_code == NMI_VEC) {
|
|
|
|
-#ifndef CONFIG_KGDB_NMI
|
|
|
|
- printk(KERN_NOTICE "KGDB: Ignoring unexpected NMI?\n");
|
|
|
|
- return;
|
|
|
|
-#else /* CONFIG_KGDB_NMI */
|
|
|
|
- if (!kgdb_enabled) {
|
|
|
|
- kgdb_enabled = 1;
|
|
|
|
- kgdb_init();
|
|
|
|
- }
|
|
|
|
-#endif /* CONFIG_KGDB_NMI */
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /* Ignore if we're disabled */
|
|
|
|
- if (!kgdb_enabled)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
/* Enter GDB mode (e.g. after detach) */
|
|
/* Enter GDB mode (e.g. after detach) */
|
|
if (!kgdb_in_gdb_mode) {
|
|
if (!kgdb_in_gdb_mode) {
|
|
/* Do serial setup, notify user, issue preemptive ack */
|
|
/* Do serial setup, notify user, issue preemptive ack */
|
|
@@ -959,18 +931,10 @@ static void handle_exception(struct pt_regs *regs)
|
|
|
|
|
|
/* Get excode for command loop call, user access */
|
|
/* Get excode for command loop call, user access */
|
|
asm("stc r2_bank, %0":"=r"(excep_code));
|
|
asm("stc r2_bank, %0":"=r"(excep_code));
|
|
- kgdb_excode = excep_code;
|
|
|
|
-
|
|
|
|
- /* Other interesting environment items for reference */
|
|
|
|
- asm("stc r6_bank, %0":"=r"(kgdb_g_imask));
|
|
|
|
- kgdb_current = current;
|
|
|
|
- kgdb_trapa_val = trapa_value;
|
|
|
|
|
|
|
|
/* Act on the exception */
|
|
/* Act on the exception */
|
|
kgdb_command_loop(excep_code, trapa_value);
|
|
kgdb_command_loop(excep_code, trapa_value);
|
|
|
|
|
|
- kgdb_current = NULL;
|
|
|
|
-
|
|
|
|
/* Copy back the (maybe modified) registers */
|
|
/* Copy back the (maybe modified) registers */
|
|
for (count = 0; count < 16; count++)
|
|
for (count = 0; count < 16; count++)
|
|
regs->regs[count] = trap_registers.regs[count];
|
|
regs->regs[count] = trap_registers.regs[count];
|
|
@@ -994,11 +958,8 @@ asmlinkage void kgdb_handle_exception(unsigned long r4, unsigned long r5,
|
|
}
|
|
}
|
|
|
|
|
|
/* Initialise the KGDB data structures and serial configuration */
|
|
/* Initialise the KGDB data structures and serial configuration */
|
|
-int kgdb_init(void)
|
|
|
|
|
|
+int __init kgdb_init(void)
|
|
{
|
|
{
|
|
- if (!kgdb_enabled)
|
|
|
|
- return 1;
|
|
|
|
-
|
|
|
|
in_nmi = 0;
|
|
in_nmi = 0;
|
|
kgdb_nofault = 0;
|
|
kgdb_nofault = 0;
|
|
stepped_opcode = 0;
|
|
stepped_opcode = 0;
|