Module Name:    src
Committed By:   thorpej
Date:           Fri Jan 12 23:36:30 UTC 2024

Modified Files:
        src/sys/arch/luna68k/luna68k: isr.c locore.s
        src/sys/arch/m68k/include: psl.h
        src/sys/arch/mvme68k/mvme68k: locore.s
        src/sys/arch/news68k/include: cpu.h
        src/sys/arch/news68k/news68k: locore.s
        src/sys/arch/next68k/next68k: locore.s
        src/sys/arch/sun2/sun2: locore.s machdep.h
        src/sys/arch/sun3/sun3: locore.s machdep.h
        src/sys/arch/sun3/sun3x: locore.s
        src/sys/arch/sun68k/include: intr.h
        src/sys/arch/sun68k/sun68k: isr.c
        src/sys/arch/virt68k/virt68k: locore.s

Log Message:
Make getsr() an inline in <m68k/psl.h> and G/C all of the now-redudant
copies.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/luna68k/luna68k/isr.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/luna68k/luna68k/locore.s
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/m68k/include/psl.h
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/news68k/include/cpu.h
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/news68k/news68k/locore.s
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/next68k/next68k/locore.s
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/sun2/sun2/locore.s
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sun2/sun2/machdep.h
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/sun3/sun3/locore.s
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/sun3/sun3/machdep.h
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/sun3/sun3x/locore.s
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sun68k/include/intr.h
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sun68k/sun68k/isr.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/virt68k/virt68k/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/luna68k/luna68k/isr.c
diff -u src/sys/arch/luna68k/luna68k/isr.c:1.25 src/sys/arch/luna68k/luna68k/isr.c:1.26
--- src/sys/arch/luna68k/luna68k/isr.c:1.25	Fri Apr  2 12:11:41 2021
+++ src/sys/arch/luna68k/luna68k/isr.c	Fri Jan 12 23:36:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: isr.c,v 1.25 2021/04/02 12:11:41 rin Exp $	*/
+/*	$NetBSD: isr.c,v 1.26 2024/01/12 23:36:29 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.25 2021/04/02 12:11:41 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.26 2024/01/12 23:36:29 thorpej Exp $");
 
 /*
  * Link and dispatch interrupts.
@@ -56,8 +56,6 @@ extern	void (*vectab[])(void);
 extern	void badtrap(void);
 extern	void intrhand_vectored(void);
 
-extern	int getsr(void);	/* in locore.s */
-
 void
 isrinit(void)
 {

Index: src/sys/arch/luna68k/luna68k/locore.s
diff -u src/sys/arch/luna68k/luna68k/locore.s:1.74 src/sys/arch/luna68k/luna68k/locore.s:1.75
--- src/sys/arch/luna68k/luna68k/locore.s:1.74	Tue Jan  9 07:28:25 2024
+++ src/sys/arch/luna68k/luna68k/locore.s	Fri Jan 12 23:36:29 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.74 2024/01/09 07:28:25 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.75 2024/01/12 23:36:29 thorpej Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -777,11 +777,6 @@ ENTRY(ecacheon)
 ENTRY(ecacheoff)
 	rts
 
-ENTRY(getsr)
-	moveq	#0,%d0
-	movw	%sr,%d0
-	rts
-
 /*
  * _delay(u_int N)
  *

Index: src/sys/arch/m68k/include/psl.h
diff -u src/sys/arch/m68k/include/psl.h:1.16 src/sys/arch/m68k/include/psl.h:1.17
--- src/sys/arch/m68k/include/psl.h:1.16	Fri Jan 27 23:29:14 2023
+++ src/sys/arch/m68k/include/psl.h	Fri Jan 12 23:36:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.16 2023/01/27 23:29:14 tsutsui Exp $	*/
+/*	$NetBSD: psl.h,v 1.17 2024/01/12 23:36:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -75,12 +75,22 @@
  * spl functions; platform-specific code must define spl0 and splx().
  */
 
+static inline int
+getsr(void)
+{
+	int sr;
+
+	__asm volatile("clrl %0; movew %%sr,%0" : "=&d" (sr));
+
+	return sr;
+}
+
 static __inline int
 _spl(int s)
 {
 	int sr;
 
-	__asm volatile ("movew %%sr,%0; movew %1,%%sr" :
+	__asm volatile ("clrl %0; movew %%sr,%0; movew %1,%%sr" :
 	    "=&d" (sr) : "di" (s) : "memory");
 
 	return sr;
@@ -91,10 +101,10 @@ _splraise(int level)
 {
 	int sr;
 
-	__asm volatile("movw %%sr,%0" : "=d" (sr));
+	__asm volatile("clrl %0; movew %%sr,%0" : "=&d" (sr));
 
 	if ((uint16_t)level >= PSL_HIGHIPL || (uint16_t)level > (uint16_t)sr)
-		__asm volatile("movw %0,%%sr" :: "di" (level) : "memory");
+		__asm volatile("movew %0,%%sr" : : "di" (level) : "memory");
 
 	return sr;
 }

Index: src/sys/arch/mvme68k/mvme68k/locore.s
diff -u src/sys/arch/mvme68k/mvme68k/locore.s:1.124 src/sys/arch/mvme68k/mvme68k/locore.s:1.125
--- src/sys/arch/mvme68k/mvme68k/locore.s:1.124	Fri Jan 12 01:53:57 2024
+++ src/sys/arch/mvme68k/mvme68k/locore.s	Fri Jan 12 23:36:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.124 2024/01/12 01:53:57 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.125 2024/01/12 23:36:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -1080,11 +1080,6 @@ ENTRY(ecacheon)
 ENTRY(ecacheoff)
 	rts
 
-ENTRY(getsr)
-	moveq	#0,%d0
-	movw	%sr,%d0
-	rts
-
 /*
  * _delay(unsigned N)
  *

Index: src/sys/arch/news68k/include/cpu.h
diff -u src/sys/arch/news68k/include/cpu.h:1.47 src/sys/arch/news68k/include/cpu.h:1.48
--- src/sys/arch/news68k/include/cpu.h:1.47	Tue Jan  9 04:16:26 2024
+++ src/sys/arch/news68k/include/cpu.h	Fri Jan 12 23:36:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.47 2024/01/09 04:16:26 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.48 2024/01/12 23:36:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -157,8 +157,6 @@ struct frame;
 /* locore.s functions */
 void badtrap(void);
 void intrhand_vectored(void);
-int getsr(void);
-
 
 void doboot(int)
 	__attribute__((__noreturn__));

Index: src/sys/arch/news68k/news68k/locore.s
diff -u src/sys/arch/news68k/news68k/locore.s:1.77 src/sys/arch/news68k/news68k/locore.s:1.78
--- src/sys/arch/news68k/news68k/locore.s:1.77	Tue Jan  9 07:28:26 2024
+++ src/sys/arch/news68k/news68k/locore.s	Fri Jan 12 23:36:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.77 2024/01/09 07:28:26 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.78 2024/01/12 23:36:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -880,11 +880,6 @@ ENTRY(ecacheoff)
 Lnocache8:
 	rts
 
-ENTRY(getsr)
-	moveq	#0,%d0
-	movw	%sr,%d0
-	rts
-
 /*
  * _delay(unsigned N)
  *

Index: src/sys/arch/next68k/next68k/locore.s
diff -u src/sys/arch/next68k/next68k/locore.s:1.79 src/sys/arch/next68k/next68k/locore.s:1.80
--- src/sys/arch/next68k/next68k/locore.s:1.79	Tue Jan  9 07:28:26 2024
+++ src/sys/arch/next68k/next68k/locore.s	Fri Jan 12 23:36:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.79 2024/01/09 07:28:26 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.80 2024/01/12 23:36:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998 Darrin B. Jewell
@@ -902,11 +902,6 @@ ENTRY(spl0)
 Lspldone:
 	rts
 
-ENTRY(getsr)
-	moveq	#0,%d0
-	movw	%sr,%d0
-	rts
-
 /*
  * _delay(u_int N)
  *

Index: src/sys/arch/sun2/sun2/locore.s
diff -u src/sys/arch/sun2/sun2/locore.s:1.30 src/sys/arch/sun2/sun2/locore.s:1.31
--- src/sys/arch/sun2/sun2/locore.s:1.30	Fri Jan 12 01:53:57 2024
+++ src/sys/arch/sun2/sun2/locore.s	Fri Jan 12 23:36:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.30 2024/01/12 01:53:57 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.31 2024/01/12 23:36:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -571,11 +571,6 @@ ENTRY(setvbr)
  * Most places will use the inlined functions param.h supplies.
  */
 
-ENTRY(_getsr)
-	clrl	%d0
-	movw	%sr,%d0
-	rts
-
 ENTRY(_spl)
 	clrl	%d0
 	movw	%sr,%d0

Index: src/sys/arch/sun2/sun2/machdep.h
diff -u src/sys/arch/sun2/sun2/machdep.h:1.13 src/sys/arch/sun2/sun2/machdep.h:1.14
--- src/sys/arch/sun2/sun2/machdep.h:1.13	Fri Jun 16 18:17:42 2017
+++ src/sys/arch/sun2/sun2/machdep.h	Fri Jan 12 23:36:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.h,v 1.13 2017/06/16 18:17:42 jdolecek Exp $	*/
+/*	$NetBSD: machdep.h,v 1.14 2024/01/12 23:36:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -115,9 +115,6 @@ int 	fpu_emulate(struct trapframe *, str
 int 	getdfc(void);
 int 	getsfc(void);
 
-/* Backward compatibility... */
-#define getsr	_getsr
-
 void**	getvbr(void);
 
 void	initfpu(void);

Index: src/sys/arch/sun3/sun3/locore.s
diff -u src/sys/arch/sun3/sun3/locore.s:1.102 src/sys/arch/sun3/sun3/locore.s:1.103
--- src/sys/arch/sun3/sun3/locore.s:1.102	Fri Jan 12 01:53:57 2024
+++ src/sys/arch/sun3/sun3/locore.s	Fri Jan 12 23:36:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.102 2024/01/12 01:53:57 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.103 2024/01/12 23:36:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -637,12 +637,6 @@ ENTRY(setvbr)
  * Most places will use the inlined functions param.h supplies.
  */
 
-ENTRY(_getsr)
-	clrl	%d0
-	movw	%sr,%d0
-	movl	%d0,%a0
-	rts
-
 ENTRY(_spl)
 	clrl	%d0
 	movw	%sr,%d0

Index: src/sys/arch/sun3/sun3/machdep.h
diff -u src/sys/arch/sun3/sun3/machdep.h:1.39 src/sys/arch/sun3/sun3/machdep.h:1.40
--- src/sys/arch/sun3/sun3/machdep.h:1.39	Fri Jun 16 18:17:42 2017
+++ src/sys/arch/sun3/sun3/machdep.h	Fri Jan 12 23:36:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.h,v 1.39 2017/06/16 18:17:42 jdolecek Exp $	*/
+/*	$NetBSD: machdep.h,v 1.40 2024/01/12 23:36:30 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -114,9 +114,6 @@ void	enable_video(int);
 
 int	fpu_emulate(struct trapframe *, struct fpframe *, ksiginfo_t *);
 
-/* Backward compatibility... */
-#define getsr	_getsr
-
 void**	getvbr(void);
 int	getcrp(struct mmu_rootptr *);
 

Index: src/sys/arch/sun3/sun3x/locore.s
diff -u src/sys/arch/sun3/sun3x/locore.s:1.70 src/sys/arch/sun3/sun3x/locore.s:1.71
--- src/sys/arch/sun3/sun3x/locore.s:1.70	Fri Jan 12 01:53:57 2024
+++ src/sys/arch/sun3/sun3x/locore.s	Fri Jan 12 23:36:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.70 2024/01/12 01:53:57 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.71 2024/01/12 23:36:30 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -642,12 +642,6 @@ ENTRY(ptest_addr)
  * Most places will use the inlined functions param.h supplies.
  */
 
-ENTRY(_getsr)
-	clrl	%d0
-	movw	%sr,%d0
-	movl	%a1,%d0
-	rts
-
 ENTRY(_spl)
 	clrl	%d0
 	movw	%sr,%d0

Index: src/sys/arch/sun68k/include/intr.h
diff -u src/sys/arch/sun68k/include/intr.h:1.21 src/sys/arch/sun68k/include/intr.h:1.22
--- src/sys/arch/sun68k/include/intr.h:1.21	Tue Jul 11 11:46:38 2023
+++ src/sys/arch/sun68k/include/intr.h	Fri Jan 12 23:36:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.21 2023/07/11 11:46:38 riastradh Exp $	*/
+/*	$NetBSD: intr.h,v 1.22 2024/01/12 23:36:30 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2001 Matt Fredette.
@@ -105,18 +105,6 @@ void isr_add_custom(int, void *);
  * (See the GCC extensions info document.)
  */
 
-static __inline int _getsr(void);
-
-/* Get current sr value. */
-static __inline int
-_getsr(void)
-{
-	int rv;
-
-	__asm volatile ("clrl %0; movew %%sr,%0" : "=&d" (rv));
-	return (rv);
-}
-
 /*
  * The rest of this is sun68k specific, because other ports may
  * need to do special things in spl0() (i.e. simulate SIR).

Index: src/sys/arch/sun68k/sun68k/isr.c
diff -u src/sys/arch/sun68k/sun68k/isr.c:1.27 src/sys/arch/sun68k/sun68k/isr.c:1.28
--- src/sys/arch/sun68k/sun68k/isr.c:1.27	Fri Sep  2 23:48:10 2022
+++ src/sys/arch/sun68k/sun68k/isr.c	Fri Jan 12 23:36:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: isr.c,v 1.27 2022/09/02 23:48:10 thorpej Exp $	*/
+/*	$NetBSD: isr.c,v 1.28 2024/01/12 23:36:30 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.27 2022/09/02 23:48:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.28 2024/01/12 23:36:30 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -172,7 +172,7 @@ isr_vectored(struct clockframe cf)
 	idepth++;
 
 	vec = (cf.cf_vo & 0xFFF) >> 2;
-	ipl = _getsr();
+	ipl = getsr();
 	ipl = (ipl >> 8) & 7;
 
 	intrcnt[ipl]++;

Index: src/sys/arch/virt68k/virt68k/locore.s
diff -u src/sys/arch/virt68k/virt68k/locore.s:1.7 src/sys/arch/virt68k/virt68k/locore.s:1.8
--- src/sys/arch/virt68k/virt68k/locore.s:1.7	Fri Jan 12 01:53:57 2024
+++ src/sys/arch/virt68k/virt68k/locore.s	Fri Jan 12 23:36:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.7 2024/01/12 01:53:57 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.8 2024/01/12 23:36:30 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -648,11 +648,6 @@ ENTRY(ecacheon)
 ENTRY(ecacheoff)
 	rts
 
-ENTRY(getsr)
-	moveq	#0,%d0
-	movw	%sr,%d0
-	rts
-
 /*
  * Misc. global variables.
  */

Reply via email to