From 150b5ae01fc47038c71f06be808f969473cb9f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sat, 2 Aug 2008 00:34:40 +0000 Subject: [PATCH] - don't movem a7, it's the stack pointer. the cpu saves it for us before processing exceptions. - push the address of the iframe before calling the C handler. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26724 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/m68k/arch_exceptions.S | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/arch/m68k/arch_exceptions.S b/src/system/kernel/arch/m68k/arch_exceptions.S index 6f0f13c529..ee918f4d81 100644 --- a/src/system/kernel/arch/m68k/arch_exceptions.S +++ b/src/system/kernel/arch/m68k/arch_exceptions.S @@ -94,7 +94,7 @@ FUNCTION(__m68k_exception_noop): FUNCTION(__m68k_exception_common): /* save regs */ - movem.l %d0-%d7/%a0-%a7,-(%sp) /* push the iframe address */ + movem.l %d0-%d7/%a0-%a6,-(%sp) /* push the iframe address */ /* save fp */ sub.l #FPU_STATE_sizeof,%sp fsave (%sp) @@ -108,7 +108,9 @@ null_sav_1: sub.l #IFRAME_fpu-IFRAME_fp,%sp null_sav_2: - bsr m68k_exception_entry /* call C entry */ + move.l %sp,-(%sp) /* push address of iframe */ + bsr m68k_exception_entry /* call C entry */ + add.l #4,%sp /* restore fp */ tst.b IFRAME_fpu-IFRAME_fp(%sp) /* check for a null state */ @@ -123,7 +125,7 @@ null_res_2: frestore (%sp) add.l #FPU_STATE_sizeof,%sp /* restore regs */ - movem.l (%sp)+,%d0-%d7/%a0-%a7 + movem.l (%sp)+,%d0-%d7/%a0-%a6 rte