[OpenBIOS] [PATCH 4/4] Changes for MorphOS

BALATON Zoltan balaton at eik.bme.hu
Thu Mar 6 19:37:37 CET 2014


arch/ppc/qemu: Move exception handling stubs to a place where it is
less likely that they get overwritten.

In particular this allows MorphOS to not crash at its first move which
has previously overwritten the exception_return code at 0x80.
According to the comments in ofmem.c it should still be safe to use
space between 0x3000 and 0x3FFF

Signed-off-by: BALATON Zoltan <balaton at eik.bme.hu>

Index: openbios-devel/arch/ppc/qemu/start.S
===================================================================
--- openbios-devel/arch/ppc/qemu/start.S	(revision 1272)
+++ openbios-devel/arch/ppc/qemu/start.S	(working copy)
@@ -280,21 +280,6 @@
 1:	nop			//
 	b	1b

-call_dsi_exception:
-	LOAD_REG_FUNC(r3, dsi_exception)
-	mtctr	r3
-	bctrl
-	b	exception_return
-
-call_isi_exception:
-	LOAD_REG_FUNC(r3, isi_exception)
-	mtctr	r3
-	bctrl
-	b	exception_return
-
-exception_return:
-	EXCEPTION_EPILOGUE
-
 trap_error:
 	lis	r1, 0x8000			/* r1=0x80000000 */
 	add.	r1,r1,r1			/* r1=r1+r1 (high 32bit !0) */
@@ -371,13 +356,19 @@

 #endif

+VECTOR( 0x3000, "DSI_ISI" ):
 real_dsi:
 	EXCEPTION_PREAMBLE
-	b	call_dsi_exception
+	LOAD_REG_FUNC(r3, dsi_exception)
+	b call_exception_handler

 real_isi:
 	EXCEPTION_PREAMBLE
-	b	call_isi_exception
+	LOAD_REG_FUNC(r3, isi_exception)
+call_exception_handler:
+	mtctr	r3
+	bctrl
+	EXCEPTION_EPILOGUE

 GLOBL(__vectors_end):




More information about the OpenBIOS mailing list