From: Alan Cox Date: Mon, 4 Feb 2019 18:53:05 +0000 (+0000) Subject: 68000: exception handling fix for 68010 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=fdda9260a4d14c973186182b5bce3b13fd6d9f2e;p=FUZIX.git 68000: exception handling fix for 68010 This needs cleaning up now it works --- diff --git a/Kernel/lib/68000exception.c b/Kernel/lib/68000exception.c index 8448e2d7..febe8e22 100644 --- a/Kernel/lib/68000exception.c +++ b/Kernel/lib/68000exception.c @@ -205,14 +205,20 @@ int exception(struct trapdata *framedata) move.w (sp)+,ccr rts */ - /* Push the recovery PC */ /* Now update the user stack */ - err |= pushw(&usp, sp[31 + fsize]); - err |= pushw(&usp, sp[30 + fsize]); - - /* Patch the kernel exception frame */ - *(uint32_t *)(&sp[30 + fsize]) = (uint32_t)udata.u_sigvec[sig]; + /* - Push the recovery PC */ + /* - Patch the kernel exception frame */ + if (sysinfo.cpu[0]) { + /* FIXME */ + err |= pushw(&usp, sp[34]); + err |= pushw(&usp, sp[33]); + *(uint32_t *)(&sp[33]) = (uint32_t)udata.u_sigvec[sig]; + } else { + err |= pushw(&usp, sp[31 + fsize]); + err |= pushw(&usp, sp[30 + fsize]); + *(uint32_t *)(&sp[30 + fsize]) = (uint32_t)udata.u_sigvec[sig]; + } /* FIXME: when we do ptrace we will need to support adding the T flag back here as the exception cleared it */