summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/include
diff options
context:
space:
mode:
authorbenno <benno@FreeBSD.org>2002-05-13 07:44:48 +0000
committerbenno <benno@FreeBSD.org>2002-05-13 07:44:48 +0000
commit6ef515f72a2fd76a0660b8c6aa8bd611f5481882 (patch)
treeb87070b79c70db91dc6d8aa37b62ed7243065782 /sys/powerpc/include
parente3aab230b035c2d89fa33995f9679edc92f901cb (diff)
downloadFreeBSD-src-6ef515f72a2fd76a0660b8c6aa8bd611f5481882.zip
FreeBSD-src-6ef515f72a2fd76a0660b8c6aa8bd611f5481882.tar.gz
FPU support.
Obtained from: NetBSD (portions)
Diffstat (limited to 'sys/powerpc/include')
-rw-r--r--sys/powerpc/include/fpu.h11
-rw-r--r--sys/powerpc/include/ieeefp.h25
-rw-r--r--sys/powerpc/include/pcb.h2
-rw-r--r--sys/powerpc/include/pcpu.h3
4 files changed, 40 insertions, 1 deletions
diff --git a/sys/powerpc/include/fpu.h b/sys/powerpc/include/fpu.h
index 1f23caa..c01637b 100644
--- a/sys/powerpc/include/fpu.h
+++ b/sys/powerpc/include/fpu.h
@@ -68,4 +68,15 @@
#define FPSCR_NI 0x00000004
#define FPSCR_RN 0x00000003
+#ifdef _KERNEL
+
+/* List of PowerPC architectures that support FPUs. */
+#if defined(MPC750)
+#define PPC_HAVE_FPU
+
+void enable_fpu(struct thread *);
+void save_fpu(struct thread *);
+#endif /* PPC_HAVE_FPU */
+#endif /* _KERNEL */
+
#endif /* _MACHINE_FPU_H_ */
diff --git a/sys/powerpc/include/ieeefp.h b/sys/powerpc/include/ieeefp.h
new file mode 100644
index 0000000..42701e2
--- /dev/null
+++ b/sys/powerpc/include/ieeefp.h
@@ -0,0 +1,25 @@
+/*
+ * Written by J.T. Conklin, Apr 6, 1995
+ * Public domain.
+ * $NetBSD: ieeefp.h,v 1.2 1999/07/07 01:52:26 danw Exp $
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_IEEEFP_H_
+#define _MACHINE_IEEEFP_H_
+
+typedef int fp_except_t;
+#define FP_X_IMP 0x01 /* imprecise (loss of precision) */
+#define FP_X_DZ 0x02 /* divide-by-zero exception */
+#define FP_X_UFL 0x04 /* underflow exception */
+#define FP_X_OFL 0x08 /* overflow exception */
+#define FP_X_INV 0x10 /* invalid operation exception */
+
+typedef enum {
+ FP_RN=0, /* round to nearest representable number */
+ FP_RZ=1, /* round to zero (truncate) */
+ FP_RP=2, /* round toward positive infinity */
+ FP_RM=3 /* round toward negative infinity */
+} fp_rnd_t;
+
+#endif /* _MACHINE_IEEEFP_H_ */
diff --git a/sys/powerpc/include/pcb.h b/sys/powerpc/include/pcb.h
index fbd7cbf..41ec35c 100644
--- a/sys/powerpc/include/pcb.h
+++ b/sys/powerpc/include/pcb.h
@@ -52,6 +52,8 @@ struct pcb {
double fpr[32];
double fpscr; /* FPSCR stored as double for easier access */
} pcb_fpu; /* Floating point processor */
+ unsigned int pcb_fpcpu; /* which CPU had our FPU
+ stuff. */
};
struct md_coredump {
diff --git a/sys/powerpc/include/pcpu.h b/sys/powerpc/include/pcpu.h
index c222ee0..a2c88c4 100644
--- a/sys/powerpc/include/pcpu.h
+++ b/sys/powerpc/include/pcpu.h
@@ -39,7 +39,8 @@ struct pmap;
int pc_inside_intr; \
u_int32_t pc_next_asn; /* next ASN to alloc */ \
u_int32_t pc_current_asngen; /* ASN rollover check */\
- struct pmap *pc_curpmap /* current pmap */
+ struct pmap *pc_curpmap; /* current pmap */ \
+ struct thread *pc_fputhread /* current user of the fpu */
#define PCPUP ((struct pcpu *) powerpc_get_pcpup())
OpenPOWER on IntegriCloud