From db111a01338d9539b9462855fc92bf6ad67d7c10 Mon Sep 17 00:00:00 2001 From: scw Date: Wed, 18 Jul 2001 17:13:15 +0000 Subject: [PATCH] Restore FPU context properly on 68060-specific kernels... --- sys/arch/mvme68k/mvme68k/locore.s | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/sys/arch/mvme68k/mvme68k/locore.s b/sys/arch/mvme68k/mvme68k/locore.s index d45614fedad5..f6be3404c36b 100644 --- a/sys/arch/mvme68k/mvme68k/locore.s +++ b/sys/arch/mvme68k/mvme68k/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.85 2001/07/06 19:00:14 scw Exp $ */ +/* $NetBSD: locore.s,v 1.86 2001/07/18 17:13:15 scw Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -1430,9 +1430,8 @@ Lswnofpsave: moveml %a1@(PCB_REGS),#0xFCFC | and registers movl %a1@(PCB_USP),%a0 movl %a0,%usp | and USP - - tstl _C_LABEL(fputype) | If we don't have an FPU, - jeq Lnofprest | don't try to restore it. + tstl _C_LABEL(fputype) | Do we have an FPU? + jeq Lnofprest | No Then don't attempt restore. lea %a1@(PCB_FPCTX),%a0 | pointer to FP save area #if defined(M68020) || defined(M68030) || defined(M68040) #if defined(M68060) @@ -1443,28 +1442,26 @@ Lswnofpsave: jeq Lresfprest | yes, easy fmovem %a0@(FPF_FPCR),%fpcr/%fpsr/%fpi | restore FP control registers fmovem %a0@(FPF_REGS),%fp0-%fp7 | restore FP general registers -Lresfprest: +#if defined(M68060) + jra Lresfprest +#endif #endif - frestore %a0@ | restore state -Lnofprest: - movw %a1@(PCB_PS),%sr | restore PS - moveq #1,%d0 | return 1 (for alternate returns) - rts #if defined(M68060) Lresfp60rest1: tstb %a0@(2) | null state frame? - jeq Lresfp60rest2 | yes, easy + jeq Lresfprest | yes, easy fmovem %a0@(FPF_FPCR),%fpcr | restore FP control registers fmovem %a0@(FPF_FPSR),%fpsr fmovem %a0@(FPF_FPI),%fpi fmovem %a0@(FPF_REGS),%fp0-%fp7 | restore FP general registers -Lresfp60rest2: +#endif +Lresfprest: frestore %a0@ | restore state +Lnofprest: movw %a1@(PCB_PS),%sr | no, restore PS moveq #1,%d0 | return 1 (for alternate returns) rts -#endif /* * savectx(pcb)