Re: nf_get_id() and real hardware

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 19 May 2008, Andreas Schwab wrote:
Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> writes:
I need the patch below to run a multi-platform kernel on my Amiga 4000/040,
else nf_get_id crashes with e.g.:

Does that help?  (Completely untested!)

Thanks!

It helps for the call in nfeth_init().

It doesn't help for the call in setup_arch(), as trap_init() hasn't been
called yet.

--- linux/arch/m68k/kernel/traps.c.~1.33.~	2008-05-08 11:23:16.000000000 +0200
+++ linux/arch/m68k/kernel/traps.c	2008-05-19 23:46:15.000000000 +0200
@@ -1018,8 +1018,28 @@ void dump_stack(void)
 
 EXPORT_SYMBOL(dump_stack);
 
+extern const int frame_extra_sizes[]; /* in m68k/kernel/signal.c */
+
 void bad_super_trap (struct frame *fp)
 {
+	const struct exception_table_entry *fixup;
+
+	/* Are we prepared to handle this kernel fault? */
+	fixup = search_exception_tables(fp->ptregs.pc);
+	if (fixup) {
+		struct pt_regs *regs, *tregs;
+		/* Create a new four word stack frame, discarding the old
+		   one.  */
+		regs = &fp->ptregs;
+		regs->stkadj = frame_extra_sizes[regs->format];
+		tregs =	(struct pt_regs *)((ulong)regs + regs->stkadj);
+		tregs->vector = regs->vector;
+		tregs->format = 0;
+		tregs->pc = fixup->fixup;
+		tregs->sr = regs->sr;
+		return;
+	}
+
 	console_verbose();
 	if (fp->ptregs.vector < 4 * ARRAY_SIZE(vec_names))
 		printk ("*** %s ***   FORMAT=%X\n",

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux