From fdda9260a4d14c973186182b5bce3b13fd6d9f2e Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 4 Feb 2019 18:53:05 +0000 Subject: [PATCH] 68000: exception handling fix for 68010 This needs cleaning up now it works --- Kernel/lib/68000exception.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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 */ -- 2.34.1