Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel
In directory usw-pr-cvs1:/tmp/cvs-serv27602
Modified Files:
interrupt.c interrupt.h
Log Message:
Add a reserved instruction exception handler (which will also deal with
BUGx instructions). Remove some unnecessary #includes. Print longer
stack dumps.
Index: interrupt.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/interrupt.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- interrupt.c 2001/01/26 00:27:00 1.4
+++ interrupt.c 2001/01/29 00:56:19 1.5
@@ -13,13 +13,10 @@
#include <linux/random.h>
#include <linux/sched.h>
#include <linux/mm.h>
-#include <linux/stddef.h>
#include <linux/string.h>
-#include <asm/scb.h>
-#include <asm/pgtable.h>
#include <asm/pgalloc.h>
-
+#include <asm/scb.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
@@ -29,11 +26,6 @@
union scb_and_device_vectors __attribute((__aligned__(VPAGE_SIZE))) scb;
-#if 0
-unsigned int local_irq_count[NR_CPUS];
-unsigned int local_bh_count[NR_CPUS];
-#endif
-
/* Statically-defined pool of irqvector structures. This will go once
we have a working kmalloc()/kfree().
@@ -120,6 +112,11 @@
machine_halt();
}
+ if (register_excep_handler(SCB_RESINSTR, reserved_instr_handler, 0, 0)) {
+ printk("Panic: unable to register reserved operand handler\n");
+ machine_halt();
+ }
+
if (register_excep_handler(SCB_CHMK, syscall_handler, 1, 0)) {
printk("Panic: unable to register syscall handler\n");
machine_halt();
@@ -145,8 +142,31 @@
{
printk("\nReserved operand fault at PC=%08lx\n", regs->pc);
+ printk("\nStack dump\n");
+ hex_dump((void *)(regs->sp), 256);
+
+ show_regs(regs);
+ show_cpu_regs();
+
+ machine_halt();
+}
+
+/* This is the handler for reserved instruction exceptions.
+ Eventually this will have to check if the fault was from user
+ mode or kernel mode and either throw a SIGILL or panic. */
+
+void reserved_instr_handler(struct pt_regs *regs, void *unused)
+{
+ unsigned short instr = *(unsigned short *)(regs->pc);
+
+ if ((instr == 0xfeff) || (instr == 0xfdff)) {
+ printk("\nKernel bugcheck at PC=%08lx\n", regs->pc);
+ } else {
+ printk("\nReserved instruction at PC=%08lx\n", regs->pc);
+ }
+
printk("\nStack dump\n");
- hex_dump((void *)(regs->sp), 32);
+ hex_dump((void *)(regs->sp), 256);
show_regs(regs);
show_cpu_regs();
Index: interrupt.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/interrupt.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- interrupt.h 2001/01/26 00:27:00 1.3
+++ interrupt.h 2001/01/29 00:56:19 1.4
@@ -62,6 +62,7 @@
extern void accvio_handler(struct pt_regs *regs, void *excep_info);
extern void page_fault_handler(struct pt_regs *regs, void *excep_info);
extern void reserved_operand_handler(struct pt_regs *regs, void *excep_info);
+extern void reserved_instr_handler(struct pt_regs *regs, void *excep_info);
extern void corrected_read_handler(struct pt_regs *regs, void *excep_info);
extern void syscall_handler(struct pt_regs *regs, void *excep_info);
|