Module Name:    src
Committed By:   thorpej
Date:           Sat Jan 13 00:44:42 UTC 2024

Modified Files:
        src/sys/arch/m68k/include: fcode.h m68k.h
        src/sys/arch/m68k/m68k: regdump.c support.s
        src/sys/arch/sun2/sun2: machdep.h

Log Message:
Make getsfc() and getdfc() inlines; it's slightly smaller.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/m68k/include/fcode.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/m68k/include/m68k.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/m68k/m68k/regdump.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/m68k/m68k/support.s
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sun2/sun2/machdep.h

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/fcode.h
diff -u src/sys/arch/m68k/include/fcode.h:1.1 src/sys/arch/m68k/include/fcode.h:1.2
--- src/sys/arch/m68k/include/fcode.h:1.1	Wed Dec 27 17:35:35 2023
+++ src/sys/arch/m68k/include/fcode.h	Sat Jan 13 00:44:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fcode.h,v 1.1 2023/12/27 17:35:35 thorpej Exp $	*/
+/*	$NetBSD: fcode.h,v 1.2 2024/01/13 00:44:42 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -67,4 +67,28 @@
 #define	FC_SUPERP	6	/* supervisor program space */
 #define	FC_CPU		7	/* CPU space */
 
+#ifdef _KERNEL
+
+static inline int
+getdfc(void)
+{
+	int rv;
+
+	__asm volatile("movc %%dfc,%0" : "=d" (rv));
+
+	return rv;
+}
+
+static inline int
+getsfc(void)
+{
+	int rv;
+
+	__asm volatile("movc %%sfc,%0" : "=d" (rv));
+
+	return rv;
+}
+
+#endif /* _KERNEL */
+
 #endif /* _M68K_FCODE_H_ */

Index: src/sys/arch/m68k/include/m68k.h
diff -u src/sys/arch/m68k/include/m68k.h:1.26 src/sys/arch/m68k/include/m68k.h:1.27
--- src/sys/arch/m68k/include/m68k.h:1.26	Tue Sep 26 14:33:55 2023
+++ src/sys/arch/m68k/include/m68k.h	Sat Jan 13 00:44:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k.h,v 1.26 2023/09/26 14:33:55 tsutsui Exp $	*/
+/*	$NetBSD: m68k.h,v 1.27 2024/01/13 00:44:42 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -103,10 +103,6 @@ void	copypage040(void *fromaddr, void *t
 void	copypage(void *fromaddr, void *toaddr);
 void	zeropage(void *addr);
 
-/* support.s */
-int	getdfc(void);
-int	getsfc(void);
-
 /* switch_subr.s */
 void	lwp_trampoline(void);
 void	m68881_save(struct fpframe *);

Index: src/sys/arch/m68k/m68k/regdump.c
diff -u src/sys/arch/m68k/m68k/regdump.c:1.15 src/sys/arch/m68k/m68k/regdump.c:1.16
--- src/sys/arch/m68k/m68k/regdump.c:1.15	Thu Aug  3 08:16:31 2023
+++ src/sys/arch/m68k/m68k/regdump.c	Sat Jan 13 00:44:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: regdump.c,v 1.15 2023/08/03 08:16:31 mrg Exp $	*/
+/*	$NetBSD: regdump.c,v 1.16 2024/01/13 00:44:42 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: regdump.c,v 1.15 2023/08/03 08:16:31 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: regdump.c,v 1.16 2024/01/13 00:44:42 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -47,6 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: regdump.c,v 
 #include <uvm/uvm_extern.h>
 
 #include <m68k/m68k.h>
+#include <m68k/fcode.h>
 #include <m68k/frame.h>
 #include <m68k/reg.h>
 

Index: src/sys/arch/m68k/m68k/support.s
diff -u src/sys/arch/m68k/m68k/support.s:1.8 src/sys/arch/m68k/m68k/support.s:1.9
--- src/sys/arch/m68k/m68k/support.s:1.8	Thu Aug  1 13:42:52 2013
+++ src/sys/arch/m68k/m68k/support.s	Sat Jan 13 00:44:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: support.s,v 1.8 2013/08/01 13:42:52 matt Exp $	*/
+/*	$NetBSD: support.s,v 1.9 2024/01/13 00:44:42 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -65,14 +65,3 @@ ENTRY(longjmp)
 	movl	(%a0),(%sp)
 	moveq	#1,%d0
 	rts
-
-/*
- * fetch registers for debugger
- */
-ENTRY_NOPROFILE(getsfc)
-	movc	%sfc,%d0
-	rts
-
-ENTRY_NOPROFILE(getdfc)
-	movc	%dfc,%d0
-	rts

Index: src/sys/arch/sun2/sun2/machdep.h
diff -u src/sys/arch/sun2/sun2/machdep.h:1.15 src/sys/arch/sun2/sun2/machdep.h:1.16
--- src/sys/arch/sun2/sun2/machdep.h:1.15	Fri Jan 12 23:46:52 2024
+++ src/sys/arch/sun2/sun2/machdep.h	Sat Jan 13 00:44:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.h,v 1.15 2024/01/12 23:46:52 thorpej Exp $	*/
+/*	$NetBSD: machdep.h,v 1.16 2024/01/13 00:44:42 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -112,9 +112,6 @@ void	dumpsys(void);
 
 int 	fpu_emulate(struct trapframe *, struct fpframe *, ksiginfo_t *);
 
-int 	getdfc(void);
-int 	getsfc(void);
-
 void	initfpu(void);
 
 void	set_clk_mode(int, int);

Reply via email to