Module Name: src
Committed By: thorpej
Date: Fri Jan 12 23:46:53 UTC 2024
Modified Files:
src/sys/arch/m68k/include: frame.h
src/sys/arch/sun2/sun2: locore.s machdep.h
src/sys/arch/sun3/sun3: locore.s machdep.h sunmon.c
src/sys/arch/sun3/sun3x: locore.s
Log Message:
We only need one copy of getvbr() and setvbr().
To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/m68k/include/frame.h
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sun2/sun2/locore.s
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sun2/sun2/machdep.h
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/sun3/sun3/locore.s
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/sun3/sun3/machdep.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/sun3/sun3/sunmon.c
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/sun3/sun3x/locore.s
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/m68k/include/frame.h
diff -u src/sys/arch/m68k/include/frame.h:1.33 src/sys/arch/m68k/include/frame.h:1.34
--- src/sys/arch/m68k/include/frame.h:1.33 Tue Sep 26 14:33:55 2023
+++ src/sys/arch/m68k/include/frame.h Fri Jan 12 23:46:52 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: frame.h,v 1.33 2023/09/26 14:33:55 tsutsui Exp $ */
+/* $NetBSD: frame.h,v 1.34 2024/01/12 23:46:52 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -243,6 +243,22 @@ do { \
#define ATOMIC_CAS_CHECK(cfp) /* nothing */
#endif /* __mc68010__ */
+static inline void **
+getvbr(void)
+{
+ void **vbr;
+
+ __asm volatile("movc %%vbr,%0" : "=r" (vbr));
+
+ return vbr;
+}
+
+static inline void
+setvbr(void **vbr)
+{
+ __asm volatile("movc %0,%%vbr" : : "r" (vbr));
+}
+
#endif /* _KERNEL */
#endif /* _M68K_FRAME_H_ */
Index: src/sys/arch/sun2/sun2/locore.s
diff -u src/sys/arch/sun2/sun2/locore.s:1.31 src/sys/arch/sun2/sun2/locore.s:1.32
--- src/sys/arch/sun2/sun2/locore.s:1.31 Fri Jan 12 23:36:29 2024
+++ src/sys/arch/sun2/sun2/locore.s Fri Jan 12 23:46:52 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.31 2024/01/12 23:36:29 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.32 2024/01/12 23:46:52 thorpej Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@@ -550,18 +550,6 @@ Ldorte:
#undef FPCOPROC
#include <m68k/m68k/switch_subr.s>
-ENTRY(getvbr)
- movc %vbr,%d0
-#ifdef __ELF__
- movl %d0, %a0
-#endif /* __ELF__ */
- rts
-
-ENTRY(setvbr)
- movl %sp@(4),%d0
- movc %d0,%vbr
- rts
-
/* loadustp, ptest_addr */
/*
Index: src/sys/arch/sun2/sun2/machdep.h
diff -u src/sys/arch/sun2/sun2/machdep.h:1.14 src/sys/arch/sun2/sun2/machdep.h:1.15
--- src/sys/arch/sun2/sun2/machdep.h:1.14 Fri Jan 12 23:36:29 2024
+++ src/sys/arch/sun2/sun2/machdep.h Fri Jan 12 23:46:52 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.14 2024/01/12 23:36:29 thorpej Exp $ */
+/* $NetBSD: machdep.h,v 1.15 2024/01/12 23:46:52 thorpej Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -115,14 +115,10 @@ int fpu_emulate(struct trapframe *, str
int getdfc(void);
int getsfc(void);
-void** getvbr(void);
-
void initfpu(void);
void set_clk_mode(int, int);
-void setvbr(void **);
-
void g0_entry(void);
void g4_entry(void);
Index: src/sys/arch/sun3/sun3/locore.s
diff -u src/sys/arch/sun3/sun3/locore.s:1.103 src/sys/arch/sun3/sun3/locore.s:1.104
--- src/sys/arch/sun3/sun3/locore.s:1.103 Fri Jan 12 23:36:29 2024
+++ src/sys/arch/sun3/sun3/locore.s Fri Jan 12 23:46:53 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.103 2024/01/12 23:36:29 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.104 2024/01/12 23:46:53 thorpej Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@@ -619,15 +619,6 @@ ENTRY(DCIU)
/* ICPL, ICPP, DCPL, DCPP, DCPA, DCFL, DCFP */
/* PCIA, ecacheon, ecacheoff */
-ENTRY(getvbr)
- movc %vbr,%a0
- rts
-
-ENTRY(setvbr)
- movl %sp@(4),%d0
- movc %d0,%vbr
- rts
-
/* loadustp, ptest_addr */
/*
Index: src/sys/arch/sun3/sun3/machdep.h
diff -u src/sys/arch/sun3/sun3/machdep.h:1.40 src/sys/arch/sun3/sun3/machdep.h:1.41
--- src/sys/arch/sun3/sun3/machdep.h:1.40 Fri Jan 12 23:36:30 2024
+++ src/sys/arch/sun3/sun3/machdep.h Fri Jan 12 23:46:53 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.40 2024/01/12 23:36:30 thorpej Exp $ */
+/* $NetBSD: machdep.h,v 1.41 2024/01/12 23:46:53 thorpej Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -114,7 +114,6 @@ void enable_video(int);
int fpu_emulate(struct trapframe *, struct fpframe *, ksiginfo_t *);
-void** getvbr(void);
int getcrp(struct mmu_rootptr *);
void initfpu(void);
@@ -127,8 +126,6 @@ void netintr(void);
void obio_init(void);
-void setvbr(void **);
-
void sunmon_abort(void);
void sunmon_halt(void);
void sunmon_init(void);
Index: src/sys/arch/sun3/sun3/sunmon.c
diff -u src/sys/arch/sun3/sun3/sunmon.c:1.22 src/sys/arch/sun3/sun3/sunmon.c:1.23
--- src/sys/arch/sun3/sun3/sunmon.c:1.22 Thu Sep 10 02:03:44 2020
+++ src/sys/arch/sun3/sun3/sunmon.c Fri Jan 12 23:46:53 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: sunmon.c,v 1.22 2020/09/10 02:03:44 rin Exp $ */
+/* $NetBSD: sunmon.c,v 1.23 2024/01/12 23:46:53 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunmon.c,v 1.22 2020/09/10 02:03:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunmon.c,v 1.23 2024/01/12 23:46:53 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -40,6 +40,8 @@ __KERNEL_RCSID(0, "$NetBSD: sunmon.c,v 1
#include <machine/mon.h>
#include <machine/mc68851.h>
+#include <m68k/frame.h>
+
#include <sun3/sun3/machdep.h>
#include <sun3/sun3/interreg.h>
#include <sun68k/sun68k/vector.h>
Index: src/sys/arch/sun3/sun3x/locore.s
diff -u src/sys/arch/sun3/sun3x/locore.s:1.71 src/sys/arch/sun3/sun3x/locore.s:1.72
--- src/sys/arch/sun3/sun3x/locore.s:1.71 Fri Jan 12 23:36:30 2024
+++ src/sys/arch/sun3/sun3x/locore.s Fri Jan 12 23:46:53 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.71 2024/01/12 23:36:30 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.72 2024/01/12 23:46:53 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -599,16 +599,6 @@ ENTRY(ecacheon)
ENTRY(ecacheoff)
rts
-ENTRY(getvbr)
- movc %vbr,%d0
- movl %d0,%a0
- rts
-
-ENTRY(setvbr)
- movl %sp@(4),%d0
- movc %d0,%vbr
- rts
-
/*
* Load a new CPU Root Pointer (CRP) into the MMU.
* void loadcrp(struct mmu_rootptr *);