summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbriggs <briggs@openbsd.org>1996-10-14 01:15:52 +0000
committerbriggs <briggs@openbsd.org>1996-10-14 01:15:52 +0000
commit92ab79d3ce644fb0f071d400e9070277e6561779 (patch)
treed789bd6dcf6a27a1f5cf297920386f66eb4ef2de
parentMerge in from NetBSD. Use <m68k/cpu.h> and (diff)
downloadwireguard-openbsd-92ab79d3ce644fb0f071d400e9070277e6561779.tar.xz
wireguard-openbsd-92ab79d3ce644fb0f071d400e9070277e6561779.zip
From NetBSD--use m68k/cpu.h defines, rename fpu_type to fputype.
-rw-r--r--sys/arch/mac68k/mac68k/fpu.c32
-rw-r--r--sys/arch/mac68k/mac68k/genassym.c10
2 files changed, 26 insertions, 16 deletions
diff --git a/sys/arch/mac68k/mac68k/fpu.c b/sys/arch/mac68k/mac68k/fpu.c
index ff060fb13e4..075d37f391d 100644
--- a/sys/arch/mac68k/mac68k/fpu.c
+++ b/sys/arch/mac68k/mac68k/fpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpu.c,v 1.4 1996/06/23 16:00:35 briggs Exp $ */
+/* $OpenBSD: fpu.c,v 1.5 1996/10/14 01:15:52 briggs Exp $ */
/* $NetBSD: fpu.c,v 1.16 1996/06/11 02:56:22 scottr Exp $ */
/*
@@ -46,7 +46,11 @@
#include <machine/cpu.h>
#include <machine/frame.h>
-extern int fpu_type;
+/*
+ * FPU type; emulator uses FPU_NONE
+ */
+int fputype;
+
extern int *nofault;
static int fpu_match __P((struct device *, void *, void *));
@@ -78,7 +82,8 @@ static char *fpu_descr[] = {
"mc68881", /* 1 */
"mc68882", /* 2 */
"mc68040", /* 3 */
- "?" };
+ "mc68060", /* 4 */
+ "unknown" };
static void
fpu_attach(parent, self, args)
@@ -88,9 +93,9 @@ fpu_attach(parent, self, args)
{
char *descr;
- fpu_type = fpu_probe();
- if ((0 <= fpu_type) && (fpu_type <= 3))
- descr = fpu_descr[fpu_type];
+ fputype = fpu_probe();
+ if ((0 <= fputype) && (fputype <= 3))
+ descr = fpu_descr[fputype];
else
descr = "unknown type";
@@ -111,7 +116,7 @@ fpu_probe()
nofault = (int *) &faultbuf;
if (setjmp(&faultbuf)) {
nofault = (int *) 0;
- return(0);
+ return (FPU_NONE);
}
/*
@@ -128,9 +133,8 @@ fpu_probe()
* Presumably, if we're an 040 and did not take exception
* above, we have an FPU. Don't bother probing.
*/
- if (mmutype == MMU_68040) {
- return 3;
- }
+ if (mmutype == MMU_68040)
+ return (FPU_68040);
/*
* Presumably, this will not cause a fault--the fnop should
@@ -151,11 +155,13 @@ fpu_probe()
* The size of a 68881 IDLE frame is 0x18
* and a 68882 frame is 0x38
*/
- if (b == 0x18) return 1;
- if (b == 0x38) return 2;
+ if (b == 0x18)
+ return (FPU_68881);
+ if (b == 0x38)
+ return (FPU_68882);
/*
* If it's not one of the above, we have no clue what it is.
*/
- return 4;
+ return (FPU_UNKNOWN);
}
diff --git a/sys/arch/mac68k/mac68k/genassym.c b/sys/arch/mac68k/mac68k/genassym.c
index 0d8af62c8c3..175628e5be5 100644
--- a/sys/arch/mac68k/mac68k/genassym.c
+++ b/sys/arch/mac68k/mac68k/genassym.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: genassym.c,v 1.3 1996/05/26 18:36:19 briggs Exp $ */
-/* $NetBSD: genassym.c,v 1.18 1996/05/05 06:18:27 briggs Exp $ */
+/* $OpenBSD: genassym.c,v 1.4 1996/10/14 01:17:05 briggs Exp $ */
+/* $NetBSD: genassym.c,v 1.20 1996/09/16 18:00:27 scottr Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -155,7 +155,7 @@ main(void)
printf("#define\tCACHE_ON %d\n", CACHE_ON);
printf("#define\tCACHE_OFF %d\n", CACHE_OFF);
printf("#define\tCACHE_CLR %d\n", CACHE_CLR);
- printf("#define\tCACHE4_OFF %d\n", CACHE4_OFF);
+ printf("#define\tCACHE40_OFF %d\n", CACHE40_OFF);
printf("#define\tIC_CLEAR %d\n", IC_CLEAR);
printf("#define\tDC_CLEAR %d\n", DC_CLEAR);
@@ -185,6 +185,10 @@ main(void)
printf("#define\tSYS_execve %d\n", SYS_execve);
printf("#define\tSYS_sigreturn %d\n", SYS_sigreturn);
+ printf("#define\tFPU_68881 %d\n", FPU_68881);
+ printf("#define\tFPU_68882 %d\n", FPU_68882);
+ printf("#define\tFPU_68040 %d\n", FPU_68040);
+
printf("#define\tMMU_68040 %d\n", MMU_68040);
printf("#define\tMMU_68030 %d\n", MMU_68030);
printf("#define\tMMU_68851 %d\n", MMU_68851);