We only need one copy of getvbr() and setvbr().

This commit is contained in:
thorpej 2024-01-12 23:46:52 +00:00
parent f2eefce19f
commit 451f3d23c3
7 changed files with 26 additions and 46 deletions

View File

@ -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_ */

View File

@ -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 */
/*

View File

@ -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 *, struct fpframe *, ksiginfo_t *);
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);

View File

@ -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 */
/*

View File

@ -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);

View File

@ -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.22 2020/09/10 02:03:44 rin Exp $");
#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>

View File

@ -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 *);