2001-03-12 08:03:17

by Matti Aarnio

[permalink] [raw]
Subject: 2.4.2-ac18 fix for Alpha machines

The linkage of vmlinux fails with lacking code for bust_spinlocks(),
thus I cloned the i386 one as is -- which apparently is not really
processor specific...


--- arch/alpha/mm/fault.c~ Sun Mar 11 11:49:23 2001
+++ arch/alpha/mm/fault.c Sun Mar 11 14:46:39 2001
@@ -231,3 +231,39 @@
}
#endif
}
+
+extern spinlock_t timerlist_lock;
+
+/*
+ * Unlock any spinlocks which will prevent us from getting the
+ * message out (timerlist_lock is acquired through the
+ * console unblank code)
+ */
+void bust_spinlocks(int yes)
+{
+ spin_lock_init(&timerlist_lock);
+ if (yes) {
+ oops_in_progress = 1;
+#ifdef CONFIG_SMP
+ global_irq_lock = 0; /* Many serial drivers do __global_cli() */
+#endif
+ } else {
+ int loglevel_save = console_loglevel;
+ unblank_screen();
+ oops_in_progress = 0;
+ /*
+ * OK, the message is on the console. Now we call printk()
+ * without oops_in_progress set so that printk will give klogd
+ * a poke. Hold onto your hats...
+ */
+ console_loglevel = 15; /* NMI oopser may have shut the console up */
+ printk(" ");
+ console_loglevel = loglevel_save;
+ }
+}
+
+void do_BUG(const char *file, int line)
+{
+ bust_spinlocks(1);
+ printk("kernel BUG at %s:%d!\n", file, line);
+}


2001-03-12 08:27:34

by Jeff Garzik

[permalink] [raw]
Subject: Re: 2.4.2-ac18 fix for Alpha machines

--- linux/fs/proc/array.c.orig Sun Mar 11 22:42:37 2001
+++ linux/fs/proc/array.c Sun Mar 11 22:43:26 2001
@@ -271,6 +271,7 @@
extern int get_wchan_stack(struct task_struct *p, unsigned long *stack, int max);
inline char *task_stack(struct task_struct *p, char *buffer)
{
+#ifdef CONFIG_X86
unsigned long stack[64];
int i;
int cnt = get_wchan_stack(p, stack, 64);
@@ -278,6 +279,7 @@
buffer += sprintf(buffer, "Stack[%d]: %lx\n",
i, stack[i]);
}
+#endif
return buffer;
}


Attachments:
fault.patch (1.22 kB)
array.patch (497.00 B)
Download all attachments