Re: nf_get_id() and real hardware

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

 



Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> writes:

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.

Does it work to set up the trap vector for illegal insn in
base_trap_init?

Andreas.

--- linux/arch/m68k/kernel/traps.c.~1.33.~	2008-05-08 11:23:16.000000000 +0200
+++ linux/arch/m68k/kernel/traps.c	2008-05-21 09:43:52.000000000 +0200
@@ -50,6 +50,7 @@ asmlinkage void fpu_emu(void);
 
 e_vector vectors[256] = {
 	[VEC_BUSERR]	= buserr,
+	[VEC_ILLEGAL]	= trap,	/* needed for nf_init */
 	[VEC_SYS]	= system_call,
 };
 
@@ -1018,8 +1019,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",

-- 
Andreas Schwab, SuSE Labs, schwab@xxxxxxx
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
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