[PATCH] Fix to update the OP panel on enterting/exiting kdb.
Nitin Vashisth
nitin at in.ibm.com
Sat Apr 24 00:16:22 EST 2004
Hello,
This patch will update the OP panel with the KDB message every time kdb
is entered and will put back the Linux kernel version string back on the
panel while exiting KDB.
Best Regards,
Nitin.
--
Nitin Vashisth
Linux Technology Center
IBM Software Lab
Bangalore, INDIA
Direct 91-80-2504 4611
Board 91-80-2526 2355 / 7117 Extension 3611.
-------------- next part --------------
--- ameslab-org/kdb/kdbmain.c 2004-04-22 21:54:42.000000000 -0700
+++ ameslab/kdb/kdbmain.c 2004-04-23 17:14:57.352949016 -0700
@@ -62,6 +62,12 @@
#include <linux/dump.h>
#endif
+#ifdef CONFIG_PPC64
+#include <linux/version.h>
+#include <asm/rtas.h>
+#include <asm/machdep.h>
+#endif
+
#include <asm/system.h>
/*
@@ -3450,8 +3456,17 @@ kdb_cmd_init(void)
static int
kdb_panic(struct notifier_block *self, unsigned long command, void *ptr)
{
+#ifdef CONFIG_PPC64
+ int cpu=smp_processor_id();
+ ppc64_attention_msg(0x3200+cpu,"KDB Call ");
+#endif
KDB_FLAG_SET(CATASTROPHIC); /* kernel state is dubious now */
KDB_ENTER();
+#ifdef CONFIG_PPC64
+ ppc64_attention_msg(0x3300+cpu,"KDB Done ");
+ ppc_md.progress("Linux ppc64\n", 0);
+ ppc_md.progress(UTS_RELEASE, 0);
+#endif
return(0);
}
--- ameslab-org/arch/ppc64/kdb/kdbasupport.c 2004-04-22 21:52:09.000000000 -0700
+++ ameslab/arch/ppc64/kdb/kdbasupport.c 2004-04-23 17:14:57.354948712 -0700
@@ -41,6 +41,10 @@
#include <asm/iommu.h>
#include "../kernel/pci.h" // for traverse_all_pci_devices()
+#include <linux/version.h>
+#include <asm/rtas.h>
+
+
extern const char *kdb_diemsg;
unsigned long cpus_in_kdb=0;
volatile unsigned long kdb_do_reboot=0;
@@ -1757,6 +1761,8 @@ kdb_reset_debugger(struct pt_regs *regs)
ppc64_attention_msg(0x3200+cpu,"KDB Call ");
kdb(KDB_REASON_ENTER, regs->trap, (kdb_eframe_t) regs);
ppc64_attention_msg(0x3300+cpu,"KDB Done ");
+ ppc_md.progress("Linux ppc64\n", 0);
+ ppc_md.progress(UTS_RELEASE, 0);
} else {
kdb_on=1;
kdb_do_reboot=1;
@@ -1780,14 +1786,24 @@ kdb_reset_debugger(struct pt_regs *regs)
int
kdb_debugger(struct pt_regs *regs) {
+
+ int cpu=smp_processor_id();
if (regs) {
if (regs->trap==0x100) {
kdb_reset_debugger(regs);
} else {
+ ppc64_attention_msg(0x3200+cpu,"KDB Call ");
kdb(KDB_REASON_ENTER,regs->trap,regs); /* ok */
+ ppc64_attention_msg(0x3300+cpu,"KDB Done ");
+ ppc_md.progress("Linux ppc64\n", 0);
+ ppc_md.progress(UTS_RELEASE, 0);
}
} else { /* regs invalid */
+ ppc64_attention_msg(0x3200+cpu,"KDB Call ");
kdb(KDB_REASON_SILENT,0,regs);
+ ppc64_attention_msg(0x3300+cpu,"KDB Done ");
+ ppc_md.progress("Linux ppc64\n", 0);
+ ppc_md.progress(UTS_RELEASE, 0);
}
return 1;
}
@@ -1795,41 +1811,82 @@ kdb_debugger(struct pt_regs *regs) {
int
kdb_debugger_bpt(struct pt_regs *regs)
{
+ int cpu=smp_processor_id();
+ int ret = 0;
+
+ ppc64_attention_msg(0x3200+cpu,"KDB Call ");
if (regs) {
if (regs->msr & MSR_SE) {
regs->msr &= ~MSR_SE;
- return kdb(KDB_REASON_DEBUG, regs->trap, regs);
- }
- return kdb(KDB_REASON_BREAK,regs->trap,regs);
+ ret = kdb(KDB_REASON_DEBUG, regs->trap, regs);
+ } else
+ ret = kdb(KDB_REASON_BREAK,regs->trap,regs);
+
} else /* regs invalid */
- return kdb(KDB_REASON_SILENT,0,regs);
+ ret = kdb(KDB_REASON_SILENT,0,regs);
+
+ ppc64_attention_msg(0x3300+cpu,"KDB Done ");
+ ppc_md.progress("Linux ppc64\n", 0);
+ ppc_md.progress(UTS_RELEASE, 0);
+
+ return ret;
}
int
kdb_debugger_sstep(struct pt_regs *regs)
{
- if (regs)
- return kdb(KDB_REASON_DEBUG,regs->trap,regs); /* ok */
+ int cpu=smp_processor_id();
+ int ret = 0;
+
+ ppc64_attention_msg(0x3200+cpu,"KDB Call ");
+ if (regs)
+ ret = kdb(KDB_REASON_DEBUG,regs->trap,regs); /* ok */
else /* regs invalid */
- return kdb(KDB_REASON_SILENT,0,regs);
+ ret = kdb(KDB_REASON_SILENT,0,regs);
+
+ ppc64_attention_msg(0x3300+cpu,"KDB Done ");
+ ppc_md.progress("Linux ppc64\n", 0);
+ ppc_md.progress(UTS_RELEASE, 0);
+
+ return ret;
+
+
}
int
kdb_debugger_iabr_match(struct pt_regs *regs)
{
+ int cpu=smp_processor_id();
+ int ret = 0;
+
+ ppc64_attention_msg(0x3200+cpu,"KDB Call ");
if (regs)
- return kdb(KDB_REASON_BREAK,regs->trap,regs);
+ ret = kdb(KDB_REASON_BREAK,regs->trap,regs);
else /* regs invalid */
- return kdb(KDB_REASON_SILENT,0,regs);
+ ret = kdb(KDB_REASON_SILENT,0,regs);
+
+ ppc64_attention_msg(0x3300+cpu,"KDB Done ");
+ ppc_md.progress("Linux ppc64\n", 0);
+ ppc_md.progress(UTS_RELEASE, 0);
+ return ret;
}
int
kdb_debugger_dabr_match(struct pt_regs *regs)
{
+ int cpu=smp_processor_id();
+ int ret = 0;
+
+ ppc64_attention_msg(0x3200+cpu,"KDB Call ");
if (regs)
- return kdb(KDB_REASON_BREAK,regs->trap,regs);
+ ret = kdb(KDB_REASON_BREAK,regs->trap,regs);
else /* regs invalid */
- return kdb(KDB_REASON_SILENT,0,regs);
+ ret = kdb(KDB_REASON_SILENT,0,regs);
+
+ ppc64_attention_msg(0x3300+cpu,"KDB Done ");
+ ppc_md.progress("Linux ppc64\n", 0);
+ ppc_md.progress(UTS_RELEASE, 0);
+ return ret;
}
void
--- ameslab-org/arch/ppc64/kdb/kdba_bp.c 2004-04-22 21:52:09.000000000 -0700
+++ ameslab/arch/ppc64/kdb/kdba_bp.c 2004-04-23 17:14:57.355948560 -0700
@@ -169,9 +169,9 @@ kdba_db_trap(kdb_eframe_t ef, int error_
KDB_STATE_CLEAR(DOING_SSB);
KDB_STATE_CLEAR(DOING_SS);
} else {
- char *argv[] = {"ssb", NULL};
+ const char *argv[] = {"ssb", NULL};
rv = KDB_DB_SSB; /* Indicate ssb - dismiss immediately */
- kdb_ss(0, (char **)argv, NULL, ef);
+ kdb_ss(0, argv, NULL, ef);
}
} else {
/*
--- ameslab-org/drivers/char/sn_serial.c 2004-04-22 21:52:35.000000000 -0700
+++ ameslab/drivers/char/sn_serial.c 2004-04-23 17:14:57.357948256 -0700
@@ -31,6 +31,9 @@
#ifdef CONFIG_KDB
#include <linux/kdb.h>
#include <linux/serial_reg.h>
+#include <linux/version.h>
+#include <asm/rtas.h>
+#include <asm/machdep.h>
/*
* kdb_serial_line records the serial line number of the first serial console.
* NOTE: The kernel ignores characters on the serial line unless a user space
@@ -311,8 +314,14 @@ sn_receive_chars(struct pt_regs *regs, u
if (!(*++kdb_serial_ptr)) {
if (!regs)
KDB_ENTER(); /* to get some registers */
- else
+ else {
+ int cpu=smp_processor_id();
+ ppc64_attention_msg(0x3200+cpu,"KDB Call ");
kdb(KDB_REASON_KEYBOARD, 0, regs);
+ ppc64_attention_msg(0x3300+cpu,"KDB Done ");
+ ppc_md.progress("Linux ppc64\n", 0);
+ ppc_md.progress(UTS_RELEASE, 0);
+ }
kdb_serial_ptr = (char *)kdb_serial_str;
break;
}
--- ameslab-org/drivers/char/keyboard.c 2004-04-22 21:52:35.000000000 -0700
+++ ameslab/drivers/char/keyboard.c 2004-04-23 17:14:57.358948104 -0700
@@ -42,6 +42,9 @@
#include <linux/input.h>
#ifdef CONFIG_KDB
#include <linux/kdb.h>
+#include <linux/version.h>
+#include <asm/rtas.h>
+#include <asm/machdep.h>
#endif /* CONFIG_KDB */
static void kbd_disconnect(struct input_handle *handle);
@@ -1064,7 +1067,12 @@ void kbd_keycode(unsigned int keycode, i
#ifdef CONFIG_KDB
if (down && !rep && (keycode == KEY_PAUSE) && kdb_on) {
+ int cpu=smp_processor_id();
+ ppc64_attention_msg(0x3200+cpu,"KDB Call ");
kdb(KDB_REASON_KEYBOARD, 0, regs);
+ ppc64_attention_msg(0x3300+cpu,"KDB Done ");
+ ppc_md.progress("Linux ppc64\n", 0);
+ ppc_md.progress(UTS_RELEASE, 0);
return;
}
#endif /* CONFIG_KDB */
--- ameslab-org/drivers/serial/8250.c 2004-04-22 21:53:17.000000000 -0700
+++ ameslab/drivers/serial/8250.c 2004-04-23 17:14:57.360947800 -0700
@@ -44,6 +44,9 @@
#include "8250.h"
#ifdef CONFIG_KDB
#include <linux/kdb.h>
+#include <linux/version.h>
+#include <asm/rtas.h>
+#include <asm/machdep.h>
/*
* kdb_serial_line records the serial line number of the first serial console.
* NOTE: The kernel ignores characters on the serial line unless a user space
@@ -852,7 +855,12 @@ receive_chars(struct uart_8250_port *up,
if ((up->port.line == kdb_serial_line) && kdb_on) {
if (ch == *kdb_serial_ptr) {
if (!(*++kdb_serial_ptr)) {
+ int cpu=smp_processor_id();
+ ppc64_attention_msg(0x3200+cpu,"KDB Call ");
kdb(KDB_REASON_KEYBOARD, 0, regs);
+ ppc64_attention_msg(0x3300+cpu,"KDB Done ");
+ ppc_md.progress("Linux ppc64\n", 0);
+ ppc_md.progress(UTS_RELEASE, 0);
kdb_serial_ptr = kdb_serial_str;
break;
}
More information about the Linuxppc64-dev
mailing list