summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-11-08 16:43:03 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-11-08 16:43:03 +0000
commit87a487af4f87b7cd05749bdfb3d30710d51f1079 (patch)
treeb72947d6d60ebe2088977e0c813ca5619e28a365
parent7149df53582597e8b4c1430f6cadecdb60a73e6b (diff)
Save the current floatingpoint state in the pcb.
-rw-r--r--sys/arch/mvme88k/include/pcb.h54
-rw-r--r--sys/arch/mvme88k/mvme88k/genassym.cf8
-rw-r--r--sys/arch/mvme88k/mvme88k/process.S18
3 files changed, 45 insertions, 35 deletions
diff --git a/sys/arch/mvme88k/include/pcb.h b/sys/arch/mvme88k/include/pcb.h
index 6f6395d8d8a..e94954c93b4 100644
--- a/sys/arch/mvme88k/include/pcb.h
+++ b/sys/arch/mvme88k/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.10 2003/10/11 22:08:57 miod Exp $ */
+/* $OpenBSD: pcb.h,v 1.11 2003/11/08 16:43:00 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* Mach Operating System
@@ -55,26 +55,29 @@
*/
struct m88100_pcb {
- unsigned pcb_pc; /* address to return */
- unsigned pcb_ipl;
- unsigned pcb_r14;
- unsigned pcb_r15;
- unsigned pcb_r16;
- unsigned pcb_r17;
- unsigned pcb_r18;
- unsigned pcb_r19;
- unsigned pcb_r20;
- unsigned pcb_r21;
- unsigned pcb_r22;
- unsigned pcb_r23;
- unsigned pcb_r24;
- unsigned pcb_r25;
- unsigned pcb_r26;
- unsigned pcb_r27;
- unsigned pcb_r28;
- unsigned pcb_r29;
- unsigned pcb_r30;
- unsigned pcb_sp; /* kernel stack pointer */
+ unsigned pcb_pc; /* address to return */
+ unsigned pcb_ipl;
+ unsigned pcb_r14;
+ unsigned pcb_r15;
+ unsigned pcb_r16;
+ unsigned pcb_r17;
+ unsigned pcb_r18;
+ unsigned pcb_r19;
+ unsigned pcb_r20;
+ unsigned pcb_r21;
+ unsigned pcb_r22;
+ unsigned pcb_r23;
+ unsigned pcb_r24;
+ unsigned pcb_r25;
+ unsigned pcb_r26;
+ unsigned pcb_r27;
+ unsigned pcb_r28;
+ unsigned pcb_r29;
+ unsigned pcb_r30;
+ unsigned pcb_sp; /* kernel stack pointer */
+ /* floating-point state */
+ unsigned pcb_fcr62;
+ unsigned pcb_fcr63;
};
#define m88100_saved_state reg
@@ -82,14 +85,11 @@ struct m88100_pcb {
struct pcb
{
- struct m88100_pcb kernel_state;
- struct m88100_saved_state user_state;
- int pcb_onfault; /* for copyin/copyout faults */
- int pcb_pad; /* pad it XXX */
+ struct m88100_pcb kernel_state;
+ struct m88100_saved_state user_state;
+ int pcb_onfault;
};
-typedef struct pcb *pcb_t; /* exported */
-
/*
* Location of saved user registers for the proc.
*/
diff --git a/sys/arch/mvme88k/mvme88k/genassym.cf b/sys/arch/mvme88k/mvme88k/genassym.cf
index 68e03ce90a0..f3b2b25a609 100644
--- a/sys/arch/mvme88k/mvme88k/genassym.cf
+++ b/sys/arch/mvme88k/mvme88k/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.8 2003/10/11 22:08:57 miod Exp $
+# $OpenBSD: genassym.cf,v 1.9 2003/11/08 16:43:02 miod Exp $
#
# Copyright (c) 1982, 1990 The Regents of the University of California.
# All rights reserved.
@@ -28,7 +28,7 @@
# SUCH DAMAGE.
#
# @(#)genassym.c 7.8 (Berkeley) 5/7/91
-# $Id: genassym.cf,v 1.8 2003/10/11 22:08:57 miod Exp $
+# $Id: genassym.cf,v 1.9 2003/11/08 16:43:02 miod Exp $
#
include <sys/param.h>
@@ -86,8 +86,6 @@ define EF_DMT2 offsetof(struct m88100_saved_state, dmt2) / sizeof(int)
define EF_DMD2 offsetof(struct m88100_saved_state, dmd2) / sizeof(int)
define EF_DMA2 offsetof(struct m88100_saved_state, dma2) / sizeof(int)
define EF_FPECR offsetof(struct m88100_saved_state, fpecr) / sizeof(int)
-define EF_FPCR offsetof(struct m88100_saved_state, fpcr) / sizeof(int)
-define EF_FPSR offsetof(struct m88100_saved_state, fpsr) / sizeof(int)
define EF_FPHS1 offsetof(struct m88100_saved_state, fphs1) / sizeof(int)
define EF_FPLS1 offsetof(struct m88100_saved_state, fpls1) / sizeof(int)
define EF_FPHS2 offsetof(struct m88100_saved_state, fphs2) / sizeof(int)
@@ -142,3 +140,5 @@ member pcb_r28
member pcb_r29
member pcb_r30
member pcb_sp
+member pcb_fcr62
+member pcb_fcr63
diff --git a/sys/arch/mvme88k/mvme88k/process.S b/sys/arch/mvme88k/mvme88k/process.S
index 075c8a9d5ec..87a75f36639 100644
--- a/sys/arch/mvme88k/mvme88k/process.S
+++ b/sys/arch/mvme88k/mvme88k/process.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.S,v 1.22 2003/10/27 10:45:58 miod Exp $ */
+/* $OpenBSD: process.S,v 1.23 2003/11/08 16:43:02 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* All rights reserved.
@@ -122,6 +122,10 @@ ENTRY(cpu_switch)
st r29,r10, PCB_R29
st r30,r10, PCB_R30 /* save frame pointer & stack pointer */
st r31,r10, PCB_SP
+ fldcr r2, fcr62
+ fldcr r3, fcr63
+ st r2, r10, PCB_FCR62
+ st r3, r10, PCB_FCR63
bsr.n _C_LABEL(getipl)
or r14,r10, 0 /* save r10 in r14 */
@@ -265,7 +269,11 @@ ASLOCAL(Lswnochg)
st r10, r14, P_ADDR /* p->p_addr = curpcb; restore p_addr */
/* restore from the current context */
- ld r1,r10, PCB_PC
+ ld r2, r10, PCB_FCR62
+ ld r3, r10, PCB_FCR63
+ fstcr r2, fcr62
+ fstcr r3, fcr63
+ ld r1, r10, PCB_PC
ld r14,r10, PCB_R14
ld r15,r10, PCB_R15
ld r16,r10, PCB_R16
@@ -331,6 +339,8 @@ ENTRY(savectx)
st r30,r10, PCB_R30 /* save frame pointer & stack pointer */
st r31,r10, PCB_SP
st r2, r10, PCB_IPL /* save interrupt mask */
+ fldcr r2, fcr62
+ fldcr r3, fcr63
+ st r2, r10, PCB_FCR62
jmp.n r1
- or r2,r0,r0
-
+ st r3, r10, PCB_FCR63