- 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
This commit is contained in:
François Revol 2008-08-02 00:34:40 +00:00
parent b061bf2471
commit 150b5ae01f

View File

@ -94,7 +94,7 @@ FUNCTION(__m68k_exception_noop):
FUNCTION(__m68k_exception_common): FUNCTION(__m68k_exception_common):
/* save regs */ /* 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 */ /* save fp */
sub.l #FPU_STATE_sizeof,%sp sub.l #FPU_STATE_sizeof,%sp
fsave (%sp) fsave (%sp)
@ -108,7 +108,9 @@ null_sav_1:
sub.l #IFRAME_fpu-IFRAME_fp,%sp sub.l #IFRAME_fpu-IFRAME_fp,%sp
null_sav_2: 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 */ /* restore fp */
tst.b IFRAME_fpu-IFRAME_fp(%sp) /* check for a null state */ tst.b IFRAME_fpu-IFRAME_fp(%sp) /* check for a null state */
@ -123,7 +125,7 @@ null_res_2:
frestore (%sp) frestore (%sp)
add.l #FPU_STATE_sizeof,%sp add.l #FPU_STATE_sizeof,%sp
/* restore regs */ /* restore regs */
movem.l (%sp)+,%d0-%d7/%a0-%a7 movem.l (%sp)+,%d0-%d7/%a0-%a6
rte rte