CVS commit: src/sys/arch/m68k/include

2024-02-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  1 22:00:29 UTC 2024

Modified Files:
src/sys/arch/m68k/include: vectors.h

Log Message:
s/Prototol/Protocol/ and s/Umimplemented/Unimplemented/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/vectors.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/vectors.h
diff -u src/sys/arch/m68k/include/vectors.h:1.5 src/sys/arch/m68k/include/vectors.h:1.6
--- src/sys/arch/m68k/include/vectors.h:1.5	Fri Jan 19 05:45:28 2024
+++ src/sys/arch/m68k/include/vectors.h	Thu Feb  1 22:00:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vectors.h,v 1.5 2024/01/19 05:45:28 thorpej Exp $	*/
+/*	$NetBSD: vectors.h,v 1.6 2024/02/01 22:00:29 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
 #define	VECI_LINE1010		10	/* Line 1010 Emulator */
 #define	VECI_LINE		11	/* Line  Emulator */
 #define	VECI_rsvd12		12	/* unassigned, reserved */
-#define	VECI_CPV		13	/* Coprocessor Prototol Violation */
+#define	VECI_CPV		13	/* Coprocessor Protocol Violation */
 #define	VECI_FORMATERR		14	/* Format Error */
 #define	VECI_UNINT_INTR		15	/* Uninitialized Interrupt */
 #define	VECI_rsvd16		16	/* unassigned, reserved */
@@ -109,7 +109,7 @@
 #define	VECI_PMMU_ACCESS	58	/* PMMU Access Level Violation */
 #define	VECI_rsvd59		59	/* unassigned, reserved */
 #define	VECI_UNIMP_EA		60	/* Unimplemented Effective Address */
-#define	VECI_UNIMP_II		61	/* Umimplemented Integer Instruction */
+#define	VECI_UNIMP_II		61	/* Unimplemented Integer Instruction */
 #define	VECI_rsvd62		62	/* unassigned, reserved */
 #define	VECI_rsvd63		63	/* unassigned, reserved */
 #define	VECI_USRVEC_START	64	/* User defined vectors (192) */



CVS commit: src/sys/arch/m68k/include

2024-02-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  1 22:00:29 UTC 2024

Modified Files:
src/sys/arch/m68k/include: vectors.h

Log Message:
s/Prototol/Protocol/ and s/Umimplemented/Unimplemented/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/vectors.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 14:37:25 UTC 2024

Modified Files:
src/sys/arch/m68k/include: ieee.h

Log Message:
Add multiple inclusion protection guard - the long double math routines
have a tendency to sometimes make that happen.

This seems to fix the sun3 build, and probably other m68k builds which
were working before the libm upgrades (it will do nothing for any that
were failing before that).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/m68k/include/ieee.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 14:37:25 UTC 2024

Modified Files:
src/sys/arch/m68k/include: ieee.h

Log Message:
Add multiple inclusion protection guard - the long double math routines
have a tendency to sometimes make that happen.

This seems to fix the sun3 build, and probably other m68k builds which
were working before the libm upgrades (it will do nothing for any that
were failing before that).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/m68k/include/ieee.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/ieee.h
diff -u src/sys/arch/m68k/include/ieee.h:1.16 src/sys/arch/m68k/include/ieee.h:1.17
--- src/sys/arch/m68k/include/ieee.h:1.16	Mon Sep 20 16:13:35 2010
+++ src/sys/arch/m68k/include/ieee.h	Mon Jan 22 14:37:25 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee.h,v 1.16 2010/09/20 16:13:35 christos Exp $	*/
+/*	$NetBSD: ieee.h,v 1.17 2024/01/22 14:37:25 kre Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -40,6 +40,9 @@
  *	@(#)ieee.h	8.1 (Berkeley) 6/11/93
  */
 
+#ifndef	__68K_IEEE_H_INCLUDED
+#define	__68K_IEEE_H_INCLUDED
+
 /*
  * ieee.h defines the machine-dependent layout of the machine's IEEE
  * floating point.  It does *not* define (yet?) any of the rounding
@@ -111,3 +114,5 @@ union ieee_ext_u {
 #define LDBL_NBIT	0x8000
 #define mask_nbit_l(u)	((u).extu_frach &= ~LDBL_NBIT)
 #endif /* !__mc68010__ || _KERNEL */
+
+#endif /* __68K_IEEE_H_INCLUDED */



CVS commit: src/sys/arch/m68k/include

2024-01-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 20 02:23:15 UTC 2024

Modified Files:
src/sys/arch/m68k/include: cpu.h

Log Message:
What good are comments, really, if you can't have a little color?  Add
a note above CLKF_INTR() about why NetBSD will likely never switch to
using the "master" stack for the kernel, and thus why the not-enabled
version of CLKF_INTR() will never be enabled.

(Adding the comment here, rather than just deleting the code, has value,
I think, for future retrocomputing archeologists.)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/m68k/include/cpu.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/cpu.h
diff -u src/sys/arch/m68k/include/cpu.h:1.22 src/sys/arch/m68k/include/cpu.h:1.23
--- src/sys/arch/m68k/include/cpu.h:1.22	Sat Jan 20 00:15:31 2024
+++ src/sys/arch/m68k/include/cpu.h	Sat Jan 20 02:23:15 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.22 2024/01/20 00:15:31 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.23 2024/01/20 02:23:15 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -168,6 +168,13 @@ struct clockframe {
  *
  * XXX Actually, we can't, because we don't use the master stack
  * XXX right now.
+ *
+ * (Actually, it's unlikely that we'll ever use the master stack in NetBSD.
+ * It would complicate the spl*() functions considerably and it just doesn't
+ * seem like a good trade-off for what seems like extremely marginal gains.
+ * So, just blissfully run the kernel on the interrupt stack all the time,
+ * and it's been that way for >30 years and no one has really complained
+ * about it.)
  */
 #define	CLKF_INTR(framep)	(((framep)->cf_sr & PSL_M) == 0)
 #else



CVS commit: src/sys/arch/m68k/include

2024-01-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 20 02:23:15 UTC 2024

Modified Files:
src/sys/arch/m68k/include: cpu.h

Log Message:
What good are comments, really, if you can't have a little color?  Add
a note above CLKF_INTR() about why NetBSD will likely never switch to
using the "master" stack for the kernel, and thus why the not-enabled
version of CLKF_INTR() will never be enabled.

(Adding the comment here, rather than just deleting the code, has value,
I think, for future retrocomputing archeologists.)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/m68k/include/cpu.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2024-01-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 14:42:09 UTC 2024

Modified Files:
src/sys/arch/m68k/include: cpu.h

Log Message:
Remove a comment that is no longer applicable.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/m68k/include/cpu.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/cpu.h
diff -u src/sys/arch/m68k/include/cpu.h:1.20 src/sys/arch/m68k/include/cpu.h:1.21
--- src/sys/arch/m68k/include/cpu.h:1.20	Thu Jan 18 14:39:06 2024
+++ src/sys/arch/m68k/include/cpu.h	Thu Jan 18 14:42:09 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.20 2024/01/18 14:39:06 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.21 2024/01/18 14:42:09 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -47,24 +47,6 @@
 
 /*
  * Exported definitions common to Motorola m68k-based ports.
- *
- * Note that are some port-specific definitions here, such as
- * HP and Sun MMU types.  These facilitate adding very small
- * amounts of port-specific code to what would otherwise be
- * identical.  The is especially true in the case of the HP
- * and other m68k pmaps.
- *
- * Individual ports are expected to define the following CPP symbols
- * in  to enable conditional code:
- *
- *	M68K_MMU_MOTOROLA	Machine has a Motorola MMU (incl.
- *68851, 68030, 68040, 68060)
- *
- *	M68K_MMU_HP		Machine has an HP MMU.
- *
- * Note also that while m68k-generic code conditionalizes on the
- * M68K_MMU_HP CPP symbol, none of the HP MMU definitions are in this
- * file (since none are used in otherwise sharable code).
  */
 
 /*



CVS commit: src/sys/arch/m68k/include

2024-01-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 14:42:09 UTC 2024

Modified Files:
src/sys/arch/m68k/include: cpu.h

Log Message:
Remove a comment that is no longer applicable.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/m68k/include/cpu.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 05:29:44 UTC 2024

Modified Files:
src/sys/arch/m68k/include: psl.h

Log Message:
Provide PSLTOIPL() and IPLTOPSL() macros.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/m68k/include/psl.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/psl.h
diff -u src/sys/arch/m68k/include/psl.h:1.18 src/sys/arch/m68k/include/psl.h:1.19
--- src/sys/arch/m68k/include/psl.h:1.18	Sun Jan 14 22:06:03 2024
+++ src/sys/arch/m68k/include/psl.h	Tue Jan 16 05:29:44 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.18 2024/01/14 22:06:03 thorpej Exp $	*/
+/*	$NetBSD: psl.h,v 1.19 2024/01/16 05:29:44 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -65,6 +65,9 @@
 #define	PSL_USERSET	(0)
 #define	PSL_USERCLR	(PSL_S | PSL_IPL7 | PSL_MBZ)
 
+#define	PSLTOIPL(x)	(((x) >> 8) & 0x7)
+#define	IPLTOPSL(x)	x) & 0x7) << 8) | PSL_S)
+
 #define	USERMODE(ps)	(((ps) & PSL_S) == 0)
 
 #if defined(_KERNEL) && !defined(_LOCORE)



CVS commit: src/sys/arch/m68k/include

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 05:29:44 UTC 2024

Modified Files:
src/sys/arch/m68k/include: psl.h

Log Message:
Provide PSLTOIPL() and IPLTOPSL() macros.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/m68k/include/psl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2024-01-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan 14 22:06:03 UTC 2024

Modified Files:
src/sys/arch/m68k/include: psl.h

Log Message:
Provide a _splx() inline.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/m68k/include/psl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2024-01-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan 14 22:06:03 UTC 2024

Modified Files:
src/sys/arch/m68k/include: psl.h

Log Message:
Provide a _splx() inline.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/m68k/include/psl.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/psl.h
diff -u src/sys/arch/m68k/include/psl.h:1.17 src/sys/arch/m68k/include/psl.h:1.18
--- src/sys/arch/m68k/include/psl.h:1.17	Fri Jan 12 23:36:29 2024
+++ src/sys/arch/m68k/include/psl.h	Sun Jan 14 22:06:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.17 2024/01/12 23:36:29 thorpej Exp $	*/
+/*	$NetBSD: psl.h,v 1.18 2024/01/14 22:06:03 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -85,7 +85,7 @@ getsr(void)
 	return sr;
 }
 
-static __inline int
+static inline int
 _spl(int s)
 {
 	int sr;
@@ -96,7 +96,13 @@ _spl(int s)
 	return sr;
 }
 
-static __inline int
+static inline void
+_splx(int s)
+{
+	__asm volatile("movew %0,%%sr" : : "di" (s) : "memory");
+}
+
+static inline int
 _splraise(int level)
 {
 	int sr;



CVS commit: src/sys/arch/m68k/include

2024-01-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan 14 00:00:15 UTC 2024

Modified Files:
src/sys/arch/m68k/include: vectors.h

Log Message:
Provide NAUTOVECTORS and NUSERVECTORS constants.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/m68k/include/vectors.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/vectors.h
diff -u src/sys/arch/m68k/include/vectors.h:1.3 src/sys/arch/m68k/include/vectors.h:1.4
--- src/sys/arch/m68k/include/vectors.h:1.3	Sat Jan 13 20:10:36 2024
+++ src/sys/arch/m68k/include/vectors.h	Sun Jan 14 00:00:15 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vectors.h,v 1.3 2024/01/13 20:10:36 thorpej Exp $	*/
+/*	$NetBSD: vectors.h,v 1.4 2024/01/14 00:00:15 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -115,6 +115,8 @@
 #define	VECI_USRVEC_START	64	/* User defined vectors (192) */
 
 #define	NVECTORS		256
+#define	NAUTOVECTORS		8
+#define	NUSERVECTORS		(NVECTORS - VECI_USRVEC_START)
 
 #define	VECI_INTRAV(ipl)	((ipl) + VECI_SPURIOUS_INTR)
 #define	VECI_TRAP(x)		((x) + VECI_TRAP0)



CVS commit: src/sys/arch/m68k/include

2024-01-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan 14 00:00:15 UTC 2024

Modified Files:
src/sys/arch/m68k/include: vectors.h

Log Message:
Provide NAUTOVECTORS and NUSERVECTORS constants.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/m68k/include/vectors.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2024-01-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 13 17:07:26 UTC 2024

Modified Files:
src/sys/arch/m68k/include: frame.h

Log Message:
G/C some unused definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/m68k/include/frame.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/frame.h
diff -u src/sys/arch/m68k/include/frame.h:1.34 src/sys/arch/m68k/include/frame.h:1.35
--- src/sys/arch/m68k/include/frame.h:1.34	Fri Jan 12 23:46:52 2024
+++ src/sys/arch/m68k/include/frame.h	Sat Jan 13 17:07:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.34 2024/01/12 23:46:52 thorpej Exp $	*/
+/*	$NetBSD: frame.h,v 1.35 2024/01/13 17:07:26 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -70,10 +70,6 @@
 #define	FMTASIZE	sizeof(struct fmtA)
 #define	FMTBSIZE	sizeof(struct fmtB)
 
-#define	V_BUSERR	0x008
-#define	V_ADDRERR	0x00C
-#define	V_TRAP1		0x084
-
 /* 68010 SSW bits */
 #define SSW1_RR		0x8000
 #define SSW1_IF		0x2000



CVS commit: src/sys/arch/m68k/include

2024-01-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 13 17:07:26 UTC 2024

Modified Files:
src/sys/arch/m68k/include: frame.h

Log Message:
G/C some unused definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/m68k/include/frame.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2024-01-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan  3 12:46:12 UTC 2024

Modified Files:
src/sys/arch/m68k/include: cpu.h

Log Message:
G/C some bit defs that are redundant with mmu_{51,40}.h


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/m68k/include/cpu.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2024-01-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan  3 12:46:12 UTC 2024

Modified Files:
src/sys/arch/m68k/include: cpu.h

Log Message:
G/C some bit defs that are redundant with mmu_{51,40}.h


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/m68k/include/cpu.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/cpu.h
diff -u src/sys/arch/m68k/include/cpu.h:1.18 src/sys/arch/m68k/include/cpu.h:1.19
--- src/sys/arch/m68k/include/cpu.h:1.18	Wed Dec 27 17:35:35 2023
+++ src/sys/arch/m68k/include/cpu.h	Wed Jan  3 12:46:12 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.18 2023/12/27 17:35:35 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.19 2024/01/03 12:46:12 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -73,36 +73,6 @@
 
 #include 
 
-/* XXX - Move this stuff into  maybe? */
-
-/*
- * 68851 and 68030 MMU
- */
-#define	PMMU_LVLMASK	0x0007
-#define	PMMU_INV	0x0400
-#define	PMMU_WP		0x0800
-#define	PMMU_ALV	0x1000
-#define	PMMU_SO		0x2000
-#define	PMMU_LV		0x4000
-#define	PMMU_BE		0x8000
-#define	PMMU_FAULT	(PMMU_WP|PMMU_INV)
-
-/* XXX - Move this stuff into  maybe? */
-
-/*
- * 68040 MMU
- */
-#define	MMU40_RES	0x001
-#define	MMU40_TTR	0x002
-#define	MMU40_WP	0x004
-#define	MMU40_MOD	0x010
-#define	MMU40_CMMASK	0x060
-#define	MMU40_SUP	0x080
-#define	MMU40_U0	0x100
-#define	MMU40_U1	0x200
-#define	MMU40_GLB	0x400
-#define	MMU40_BE	0x800
-
 /* XXX - Move this stuff into  maybe? */
 
 /* fields in the 68020 cache control register */



CVS commit: src/sys/arch/m68k/include

2024-01-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan  1 22:47:58 UTC 2024

Modified Files:
src/sys/arch/m68k/include: pte_motorola.h

Log Message:
Define PTE used in the pmap module int terms of the bit definitions
in mmu_{51,40}.h.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/m68k/include/pte_motorola.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2024-01-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan  1 22:47:58 UTC 2024

Modified Files:
src/sys/arch/m68k/include: pte_motorola.h

Log Message:
Define PTE used in the pmap module int terms of the bit definitions
in mmu_{51,40}.h.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/m68k/include/pte_motorola.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/pte_motorola.h
diff -u src/sys/arch/m68k/include/pte_motorola.h:1.9 src/sys/arch/m68k/include/pte_motorola.h:1.10
--- src/sys/arch/m68k/include/pte_motorola.h:1.9	Wed Dec 27 03:03:41 2023
+++ src/sys/arch/m68k/include/pte_motorola.h	Mon Jan  1 22:47:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte_motorola.h,v 1.9 2023/12/27 03:03:41 thorpej Exp $	*/
+/*	$NetBSD: pte_motorola.h,v 1.10 2024/01/01 22:47:58 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -56,55 +56,63 @@ typedef u_int	pt_entry_t;	/* page table 
 
 #define PG_SHIFT	PGSHIFT
 
-#define	SG_V		0x0002	/* segment is valid */
-#define	SG_NV		0x
-#define	SG_PROT		0x0004	/* access protection mask */
-#define	SG_RO		0x0004
+/*
+ * "Segment" Table Entry bits, defined in terms of the 68851 bits
+ * (compatible 68040 bits noted in comments).
+ */
+#define	SG_V		DT51_SHORT	/* == UTE40_RESIDENT */
+#define	SG_NV		DT51_INVALID	/* == UTE40_INVALID */
+#define	SG_RO		DTE51_WP	/* == UTE40_W */
 #define	SG_RW		0x
-#define	SG_U		0x0008	/* modified bit (68040) */
-#define	SG_FRAME	((~0) << PG_SHIFT)
+#define	SG_PROT		DTE51_WP
+#define	SG_U		DTE51_U		/* == UTE40_U */
+#define	SG_FRAME	((~0U) << PG_SHIFT)
 #define	SG_ISHIFT	((PG_SHIFT << 1) - 2)	/* 24 or 22 */
-#define	SG_IMASK	((~0) << SG_ISHIFT)
+#define	SG_IMASK	((~0U) << SG_ISHIFT)
 #define	SG_PSHIFT	PG_SHIFT
-#define	SG_PMASK	(((~0) << SG_PSHIFT) & ~SG_IMASK)
+#define	SG_PMASK	(((~0U) << SG_PSHIFT) & ~SG_IMASK)
 
 /* 68040 additions */
-#define	SG4_MASK1	0xfe00
+#define	SG4_MASK1	0xfe00U
 #define	SG4_SHIFT1	25
-#define	SG4_MASK2	0x01fc
+#define	SG4_MASK2	0x01fcU
 #define	SG4_SHIFT2	18
-#define	SG4_MASK3	(((~0) << PG_SHIFT) & ~(SG4_MASK1 | SG4_MASK2))
+#define	SG4_MASK3	(((~0U) << PG_SHIFT) & ~(SG4_MASK1 | SG4_MASK2))
 #define	SG4_SHIFT3	PG_SHIFT
 #define	SG4_ADDR1	0xfe00
-#define	SG4_ADDR2	((~0) << (20 - PG_SHIFT))
+#define	SG4_ADDR2	((~0U) << (20 - PG_SHIFT))
 #define	SG4_LEV1SIZE	128
 #define	SG4_LEV2SIZE	128
-#define	SG4_LEV3SIZE	(1 << (SG4_SHIFT2 - PG_SHIFT))	/* 64 or 32 */
+#define	SG4_LEV3SIZE	(1U << (SG4_SHIFT2 - PG_SHIFT))	/* 64 or 32 */
 
-#define	PG_V		0x0001
-#define	PG_NV		0x
-#define	PG_PROT		0x0004
-#define	PG_U		0x0008
-#define	PG_M		0x0010
-#define	PG_W		0x0100
-#define	PG_RO		0x0004
+/*
+ * Page Table Entry bits, defined in terms of the 68851 bits
+ * (compatible 68040 bits noted in comments).
+ */
+#define	PG_V		DT51_PAGE	/* == PTE40_RESIDENT */
+#define	PG_NV		DT51_INVALID	/* == PTE40_INVALID */
+#define	PG_RO		PTE51_WP	/* == PTE40_W */
 #define	PG_RW		0x
-#define	PG_FRAME	((~0) << PG_SHIFT)
-#define	PG_CI		0x0040
-#define	PG_PFNUM(x)	(((x) & PG_FRAME) >> PG_SHIFT)
+#define	PG_PROT		PG_RO
+#define	PG_U		PTE51_U		/* == PTE40_U */
+#define	PG_M		PTE51_M		/* == PTE40_M */
+#define	PG_CI		PTE51_CI
+#define	PG_W		__BIT(8)	/* 851 unused bit XXX040 PTE40_U0 */
+#define	PG_FRAME	((~0U) << PG_SHIFT)
+#define	PG_PFNUM(x)	(((uintptr_t)(x) & PG_FRAME) >> PG_SHIFT)
 
 /* 68040 additions */
-#define	PG_CMASK	0x0060	/* cache mode mask */
-#define	PG_CWT		0x	/* writethrough caching */
-#define	PG_CCB		0x0020	/* copyback caching */
-#define	PG_CIS		0x0040	/* cache inhibited serialized */
-#define	PG_CIN		0x0060	/* cache inhibited nonserialized */
-#define	PG_SO		0x0080	/* supervisor only */
+#define	PG_CMASK	PTE40_CM	/* cache mode mask */
+#define	PG_CWT		PTE40_CM_WT	/* writethrough caching */
+#define	PG_CCB		PTE40_CM_CB	/* copyback caching */
+#define	PG_CIS		PTE40_CM_NC_SER	/* cache inhibited serialized */
+#define	PG_CIN		PTE40_CM_NC	/* cache inhibited nonserialized */
+#define	PG_SO		PTE40_S		/* supervisor only */
 
 #define M68K_STSIZE	(MAXUL2SIZE * SG4_LEV2SIZE * sizeof(st_entry_t))
 	/* user process segment table size */
-#define M68K_MAX_PTSIZE	(1 << (32 - PG_SHIFT + 2))	/* max size of UPT */
-#define M68K_MAX_KPTSIZE	(M68K_MAX_PTSIZE >> 2)	/* max memory to allocate to KPT */
+#define M68K_MAX_PTSIZE	 (1U << (32 - PG_SHIFT + 2))	/* max size of UPT */
+#define M68K_MAX_KPTSIZE (M68K_MAX_PTSIZE >> 2)	/* max memory to allocate to KPT */
 #define M68K_PTBASE	0x1000	/* UPT map base address */
 #define M68K_PTMAXSIZE	0x7000	/* UPT map maximum size */
 



CVS commit: src/sys/arch/m68k/include

2023-09-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep 28 06:34:22 UTC 2023

Modified Files:
src/sys/arch/m68k/include: pmap_coldfire.h

Log Message:
whitespace nit


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/pmap_coldfire.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/pmap_coldfire.h
diff -u src/sys/arch/m68k/include/pmap_coldfire.h:1.5 src/sys/arch/m68k/include/pmap_coldfire.h:1.6
--- src/sys/arch/m68k/include/pmap_coldfire.h:1.5	Thu Sep 28 06:23:43 2023
+++ src/sys/arch/m68k/include/pmap_coldfire.h	Thu Sep 28 06:34:22 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_coldfire.h,v 1.5 2023/09/28 06:23:43 skrll Exp $	*/
+/*	$NetBSD: pmap_coldfire.h,v 1.6 2023/09/28 06:34:22 skrll Exp $	*/
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -65,7 +65,7 @@
 
 #define	KERNEL_PID	0
 
-#define	PMAP_TLB_MAX			  1
+#define	PMAP_TLB_MAX			1
 #define	PMAP_TLB_NUM_PIDS		256
 #define	PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)0xfeeddead)
 



CVS commit: src/sys/arch/m68k/include

2023-09-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep 28 06:34:22 UTC 2023

Modified Files:
src/sys/arch/m68k/include: pmap_coldfire.h

Log Message:
whitespace nit


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/pmap_coldfire.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2023-09-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep 28 06:23:43 UTC 2023

Modified Files:
src/sys/arch/m68k/include: pmap_coldfire.h

Log Message:
#define -> #define for consistency


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/m68k/include/pmap_coldfire.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/pmap_coldfire.h
diff -u src/sys/arch/m68k/include/pmap_coldfire.h:1.4 src/sys/arch/m68k/include/pmap_coldfire.h:1.5
--- src/sys/arch/m68k/include/pmap_coldfire.h:1.4	Sun Dec 20 16:38:25 2020
+++ src/sys/arch/m68k/include/pmap_coldfire.h	Thu Sep 28 06:23:43 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_coldfire.h,v 1.4 2020/12/20 16:38:25 skrll Exp $	*/
+/*	$NetBSD: pmap_coldfire.h,v 1.5 2023/09/28 06:23:43 skrll Exp $	*/
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -59,13 +59,13 @@
 
 #define	NBSEG		(NBPG*NPTEPG)
 #define	SEGSHIFT	(PGSHIFT + PGSHIFT - 2)
-#define SEGOFSET	((1 << SEGSHIFT) - 1)
-#define PMAP_SEGTABSIZE	(1 << (32 - SEGSHIFT))
+#define	SEGOFSET	((1 << SEGSHIFT) - 1)
+#define	PMAP_SEGTABSIZE	(1 << (32 - SEGSHIFT))
 #define	NPTEPG		(NBPG >> 2)
 
 #define	KERNEL_PID	0
 
-#define PMAP_TLB_MAX			  1
+#define	PMAP_TLB_MAX			  1
 #define	PMAP_TLB_NUM_PIDS		256
 #define	PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)0xfeeddead)
 



CVS commit: src/sys/arch/m68k/include

2023-09-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep 28 06:23:43 UTC 2023

Modified Files:
src/sys/arch/m68k/include: pmap_coldfire.h

Log Message:
#define -> #define for consistency


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/m68k/include/pmap_coldfire.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2023-01-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jan 29 09:24:33 UTC 2023

Modified Files:
src/sys/arch/m68k/include: kcore.h

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/m68k/include/kcore.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/kcore.h
diff -u src/sys/arch/m68k/include/kcore.h:1.6 src/sys/arch/m68k/include/kcore.h:1.7
--- src/sys/arch/m68k/include/kcore.h:1.6	Fri Jan 27 23:29:14 2023
+++ src/sys/arch/m68k/include/kcore.h	Sun Jan 29 09:24:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kcore.h,v 1.6 2023/01/27 23:29:14 tsutsui Exp $	*/
+/*	$NetBSD: kcore.h,v 1.7 2023/01/29 09:24:33 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -110,7 +110,7 @@ struct sun3x_kcore_hdr {
 	uint32_t	pg_valid;
 	uint32_t	contig_end;
 	uint32_t	kernCbase;	/* VA of kernel level C page table */
-	pys_ram_seg_t	ram_segs[SUN3X_NPHYS_RAM_SEGS];
+	phys_ram_seg_t	ram_segs[SUN3X_NPHYS_RAM_SEGS];
 };
 
 /*



CVS commit: src/sys/arch/m68k/include

2023-01-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jan 29 09:24:33 UTC 2023

Modified Files:
src/sys/arch/m68k/include: kcore.h

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/m68k/include/kcore.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2023-01-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jan 27 23:29:15 UTC 2023

Modified Files:
src/sys/arch/m68k/include: kcore.h psl.h

Log Message:
Use proper uintNN_t integer types.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/kcore.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/m68k/include/psl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2023-01-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jan 27 23:29:15 UTC 2023

Modified Files:
src/sys/arch/m68k/include: kcore.h psl.h

Log Message:
Use proper uintNN_t integer types.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/kcore.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/m68k/include/psl.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/kcore.h
diff -u src/sys/arch/m68k/include/kcore.h:1.5 src/sys/arch/m68k/include/kcore.h:1.6
--- src/sys/arch/m68k/include/kcore.h:1.5	Mon Apr 28 20:23:26 2008
+++ src/sys/arch/m68k/include/kcore.h	Fri Jan 27 23:29:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kcore.h,v 1.5 2008/04/28 20:23:26 martin Exp $	*/
+/*	$NetBSD: kcore.h,v 1.6 2023/01/27 23:29:14 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -57,24 +57,24 @@
 #define	M68K_NPHYS_RAM_SEGS	8	/* XXX */
 struct m68k_kcore_hdr {
 	int32_t		mmutype;	/* MMU type */
-	u_int32_t	sg_v;		/* STE bits */
-	u_int32_t	sg_frame;
-	u_int32_t	sg_ishift;
-	u_int32_t	sg_pmask;
-	u_int32_t	sg40_shift1;
-	u_int32_t	sg40_mask2;
-	u_int32_t	sg40_shift2;
-	u_int32_t	sg40_mask3;
-	u_int32_t	sg40_shift3;
-	u_int32_t	sg40_addr1;
-	u_int32_t	sg40_addr2;
-	u_int32_t	pg_v;		/* PTE bits */
-	u_int32_t	pg_frame;
-	u_int32_t	sysseg_pa;	/* PA of Sysseg[] */
-	u_int32_t	reloc;		/* value added to relocate a symbol
+	uint32_t	sg_v;		/* STE bits */
+	uint32_t	sg_frame;
+	uint32_t	sg_ishift;
+	uint32_t	sg_pmask;
+	uint32_t	sg40_shift1;
+	uint32_t	sg40_mask2;
+	uint32_t	sg40_shift2;
+	uint32_t	sg40_mask3;
+	uint32_t	sg40_shift3;
+	uint32_t	sg40_addr1;
+	uint32_t	sg40_addr2;
+	uint32_t	pg_v;		/* PTE bits */
+	uint32_t	pg_frame;
+	uint32_t	sysseg_pa;	/* PA of Sysseg[] */
+	uint32_t	reloc;		/* value added to relocate a symbol
 	   before address translation is
 	   enabled */
-	u_int32_t	relocend;	/* if kernbase < va < relocend, we
+	uint32_t	relocend;	/* if kernbase < va < relocend, we
 	   can do simple relocation to get
 	   the physical address */
 	phys_ram_seg_t	ram_segs[M68K_NPHYS_RAM_SEGS];
@@ -84,20 +84,20 @@ struct m68k_kcore_hdr {
  * kcore information for the sun2
  */
 struct sun2_kcore_hdr {
-	u_int32_t	segshift;
-	u_int32_t	pg_frame;	/* PTE bits */
-	u_int32_t	pg_valid;
-	u_int8_t	ksegmap[512];	/* kernel segment map */
+	uint32_t	segshift;
+	uint32_t	pg_frame;	/* PTE bits */
+	uint32_t	pg_valid;
+	uint8_t		ksegmap[512];	/* kernel segment map */
 };
 
 /*
  * kcore information for the sun3
  */
 struct sun3_kcore_hdr {
-	u_int32_t	segshift;
-	u_int32_t	pg_frame;	/* PTE bits */
-	u_int32_t	pg_valid;
-	u_int8_t	ksegmap[256];	/* kernel segment map */
+	uint32_t	segshift;
+	uint32_t	pg_frame;	/* PTE bits */
+	uint32_t	pg_valid;
+	uint8_t		ksegmap[256];	/* kernel segment map */
 };
 
 /*
@@ -106,11 +106,11 @@ struct sun3_kcore_hdr {
  */
 #define	SUN3X_NPHYS_RAM_SEGS	4
 struct sun3x_kcore_hdr {
-	u_int32_t	pg_frame;	/* PTE bits */
-	u_int32_t	pg_valid;
-	u_int32_t	contig_end;
-	u_int32_t	kernCbase;	/* VA of kernel level C page table */
-	phys_ram_seg_t	ram_segs[SUN3X_NPHYS_RAM_SEGS];
+	uint32_t	pg_frame;	/* PTE bits */
+	uint32_t	pg_valid;
+	uint32_t	contig_end;
+	uint32_t	kernCbase;	/* VA of kernel level C page table */
+	pys_ram_seg_t	ram_segs[SUN3X_NPHYS_RAM_SEGS];
 };
 
 /*
@@ -118,8 +118,8 @@ struct sun3x_kcore_hdr {
  */
 struct cpu_kcore_hdr {
 	char		name[16];	/* machine name */
-	u_int32_t	page_size;	/* hardware page size */
-	u_int32_t	kernbase;	/* start of KVA space */
+	uint32_t	page_size;	/* hardware page size */
+	uint32_t	kernbase;	/* start of KVA space */
 	union {
 		struct m68k_kcore_hdr _m68k;
 		struct sun2_kcore_hdr _sun2;

Index: src/sys/arch/m68k/include/psl.h
diff -u src/sys/arch/m68k/include/psl.h:1.15 src/sys/arch/m68k/include/psl.h:1.16
--- src/sys/arch/m68k/include/psl.h:1.15	Fri Jul 27 05:36:11 2012
+++ src/sys/arch/m68k/include/psl.h	Fri Jan 27 23:29:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.15 2012/07/27 05:36:11 matt Exp $	*/
+/*	$NetBSD: psl.h,v 1.16 2023/01/27 23:29:14 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -93,7 +93,7 @@ _splraise(int level)
 
 	__asm volatile("movw %%sr,%0" : "=d" (sr));
 
-	if ((u_int16_t)level >= PSL_HIGHIPL || (u_int16_t)level > (u_int16_t)sr)
+	if ((uint16_t)level >= PSL_HIGHIPL || (uint16_t)level > (uint16_t)sr)
 		__asm volatile("movw %0,%%sr" :: "di" (level) : "memory");
 
 	return sr;



CVS commit: src/sys/arch/m68k/include

2022-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 13 13:41:44 UTC 2022

Modified Files:
src/sys/arch/m68k/include: lock.h

Log Message:
m68k: __cpu_simple_unlock audit.

- Use `cc' clobbers in asm volatile because they touch the condition
  codes.

- Use `memory' clobbers in asm volatile so the compiler doesn't move
  up loads and stores in the critical section at _other_ addresses
  than the lock so they happen before __cpu_simple_lock or
  __cpu_simple_lock_try.

- Not sure if we have any (or if there even are any?) multicore m68k
  systems out there, but __cpu_simple_unlock needs __insn_barrier
  either way so the compiler doesn't delay loads and stores prior to
  __cpu_simple_unlock so they happen after it.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/m68k/include/lock.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/lock.h
diff -u src/sys/arch/m68k/include/lock.h:1.16 src/sys/arch/m68k/include/lock.h:1.17
--- src/sys/arch/m68k/include/lock.h:1.16	Fri Nov 29 20:05:49 2019
+++ src/sys/arch/m68k/include/lock.h	Sun Feb 13 13:41:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.16 2019/11/29 20:05:49 riastradh Exp $	*/
+/*	$NetBSD: lock.h,v 1.17 2022/02/13 13:41:44 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -75,7 +75,9 @@ __cpu_simple_lock(__cpu_simple_lock_t *a
 	__asm volatile(
 		"1:	tas	%0	\n"
 		"	jne	1b	\n"
-		: "=m" (*alp));
+		: "=m" (*alp)
+		: /* no inputs */
+		: "cc", "memory");
 }
 
 static __inline int
@@ -89,7 +91,9 @@ __cpu_simple_lock_try(__cpu_simple_lock_
 		"	jeq	1f	\n"
 		"	moveq	#0, %1	\n"
 		"1:			\n"
-		: "=m" (*alp), "=d" (__rv));
+		: "=m" (*alp), "=d" (__rv)
+		: /* no inputs */
+		: "cc", "memory");
 
 	return (__rv);
 }
@@ -98,6 +102,7 @@ static __inline void
 __cpu_simple_unlock(__cpu_simple_lock_t *alp)
 {
 
+	__insn_barrier();
 	*alp = __SIMPLELOCK_UNLOCKED;
 }
 



CVS commit: src/sys/arch/m68k/include

2022-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 13 13:41:44 UTC 2022

Modified Files:
src/sys/arch/m68k/include: lock.h

Log Message:
m68k: __cpu_simple_unlock audit.

- Use `cc' clobbers in asm volatile because they touch the condition
  codes.

- Use `memory' clobbers in asm volatile so the compiler doesn't move
  up loads and stores in the critical section at _other_ addresses
  than the lock so they happen before __cpu_simple_lock or
  __cpu_simple_lock_try.

- Not sure if we have any (or if there even are any?) multicore m68k
  systems out there, but __cpu_simple_unlock needs __insn_barrier
  either way so the compiler doesn't delay loads and stores prior to
  __cpu_simple_unlock so they happen after it.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/m68k/include/lock.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2021-12-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Dec  5 02:53:51 UTC 2021

Modified Files:
src/sys/arch/m68k/include: cpuframe.h

Log Message:
s/expecially/especially/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/include/cpuframe.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/cpuframe.h
diff -u src/sys/arch/m68k/include/cpuframe.h:1.7 src/sys/arch/m68k/include/cpuframe.h:1.8
--- src/sys/arch/m68k/include/cpuframe.h:1.7	Mon Sep  7 23:41:38 2020
+++ src/sys/arch/m68k/include/cpuframe.h	Sun Dec  5 02:53:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuframe.h,v 1.7 2020/09/07 23:41:38 mrg Exp $	*/
+/*	$NetBSD: cpuframe.h,v 1.8 2021/12/05 02:53:51 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -188,7 +188,7 @@ struct fpframe {
 #define fpf_unimp	FPF_u2.FPF_unimp
 
 /* 
- * This is incompatible with the earlier one; expecially, an earlier frame 
+ * This is incompatible with the earlier one; especially, an earlier frame 
  * must not be FRESTOREd on a 060 or vv, because a frame error exception is
  * not guaranteed.
  */



CVS commit: src/sys/arch/m68k/include

2021-12-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Dec  5 02:53:51 UTC 2021

Modified Files:
src/sys/arch/m68k/include: cpuframe.h

Log Message:
s/expecially/especially/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/include/cpuframe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2021-10-29 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Oct 29 17:29:45 UTC 2021

Modified Files:
src/sys/arch/m68k/include: signal.h

Log Message:
Define __HAVE_STRUCT_SIGCONTEXT regardless of its current visibility.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/m68k/include/signal.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/signal.h
diff -u src/sys/arch/m68k/include/signal.h:1.27 src/sys/arch/m68k/include/signal.h:1.28
--- src/sys/arch/m68k/include/signal.h:1.27	Wed Oct 27 01:10:06 2021
+++ src/sys/arch/m68k/include/signal.h	Fri Oct 29 17:29:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.27 2021/10/27 01:10:06 thorpej Exp $	*/
+/*	$NetBSD: signal.h,v 1.28 2021/10/29 17:29:45 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
@@ -36,6 +36,8 @@
 
 #include 
 
+#define	__HAVE_STRUCT_SIGCONTEXT
+
 typedef int sig_atomic_t;
 
 #if defined(_NETBSD_SOURCE)
@@ -65,7 +67,6 @@ struct sigcontext13 {
 #endif /* _KERNEL */
 
 #if defined(_LIBC) || defined(_KERNEL)
-#define	__HAVE_STRUCT_SIGCONTEXT
 struct sigcontext {
 	int	sc_onstack;		/* sigstack state to restore */
 	int	__sc_mask13;		/* signal mask to restore (old style) */
@@ -96,7 +97,7 @@ struct sigstate {
 
 u_int fpsr2siginfocode(u_int fpsr);
 
-#endif
+#endif /* _KERNEL */
 
 #if defined(__M68K_SIGNAL_PRIVATE)
 



CVS commit: src/sys/arch/m68k/include

2021-10-29 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Oct 29 17:29:45 UTC 2021

Modified Files:
src/sys/arch/m68k/include: signal.h

Log Message:
Define __HAVE_STRUCT_SIGCONTEXT regardless of its current visibility.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/m68k/include/signal.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2021-10-26 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Oct 27 01:10:06 UTC 2021

Modified Files:
src/sys/arch/m68k/include: signal.h

Log Message:
Make sigcontext13 visible only to _KERNEL.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/m68k/include/signal.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/signal.h
diff -u src/sys/arch/m68k/include/signal.h:1.26 src/sys/arch/m68k/include/signal.h:1.27
--- src/sys/arch/m68k/include/signal.h:1.26	Tue Oct 26 16:16:35 2021
+++ src/sys/arch/m68k/include/signal.h	Wed Oct 27 01:10:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.26 2021/10/26 16:16:35 christos Exp $	*/
+/*	$NetBSD: signal.h,v 1.27 2021/10/27 01:10:06 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
@@ -52,7 +52,7 @@ typedef int sig_atomic_t;
  * to the handler to allow it to restore state properly if
  * a non-standard exit is performed.
  */
-#if defined(__LIBC12_SOURCE__) || defined(_KERNEL)
+#if defined(_KERNEL)
 struct sigcontext13 {
 	int	sc_onstack;		/* sigstack state to restore */
 	int	sc_mask;		/* signal mask to restore (old style) */
@@ -62,7 +62,7 @@ struct sigcontext13 {
 	int	sc_pc;			/* pc to restore */
 	int	sc_ps;			/* psl to restore */
 };
-#endif /* __LIBC12_SOURCE__ || _KERNEL */
+#endif /* _KERNEL */
 
 #if defined(_LIBC) || defined(_KERNEL)
 #define	__HAVE_STRUCT_SIGCONTEXT



CVS commit: src/sys/arch/m68k/include

2021-10-26 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Oct 27 01:10:06 UTC 2021

Modified Files:
src/sys/arch/m68k/include: signal.h

Log Message:
Make sigcontext13 visible only to _KERNEL.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/m68k/include/signal.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2019-11-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Nov 29 20:05:49 UTC 2019

Modified Files:
src/sys/arch/m68k/include: lock.h mutex.h

Log Message:
Nix mb_* on m68k.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/m68k/include/lock.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/include/mutex.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2019-11-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Nov 29 20:05:49 UTC 2019

Modified Files:
src/sys/arch/m68k/include: lock.h mutex.h

Log Message:
Nix mb_* on m68k.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/m68k/include/lock.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/include/mutex.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/lock.h
diff -u src/sys/arch/m68k/include/lock.h:1.15 src/sys/arch/m68k/include/lock.h:1.16
--- src/sys/arch/m68k/include/lock.h:1.15	Sun Sep 17 00:01:07 2017
+++ src/sys/arch/m68k/include/lock.h	Fri Nov 29 20:05:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.15 2017/09/17 00:01:07 christos Exp $	*/
+/*	$NetBSD: lock.h,v 1.16 2019/11/29 20:05:49 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -101,22 +101,4 @@ __cpu_simple_unlock(__cpu_simple_lock_t 
 	*alp = __SIMPLELOCK_UNLOCKED;
 }
 
-static __inline void
-mb_read(void)
-{
-	__asm volatile("" : : : "memory");
-}
-
-static __inline void
-mb_write(void)
-{
-	__asm volatile("" : : : "memory");
-}
-
-static __inline void
-mb_memory(void)
-{
-	__asm volatile("" : : : "memory");
-}
-
 #endif /* _M68K_LOCK_H_ */

Index: src/sys/arch/m68k/include/mutex.h
diff -u src/sys/arch/m68k/include/mutex.h:1.7 src/sys/arch/m68k/include/mutex.h:1.8
--- src/sys/arch/m68k/include/mutex.h:1.7	Mon Apr 28 20:23:26 2008
+++ src/sys/arch/m68k/include/mutex.h	Fri Nov 29 20:05:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mutex.h,v 1.7 2008/04/28 20:23:26 martin Exp $	*/
+/*	$NetBSD: mutex.h,v 1.8 2019/11/29 20:05:49 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -62,8 +62,8 @@ struct kmutex {
 #define	__HAVE_SIMPLE_MUTEXES		1
 #define	__HAVE_MUTEX_STUBS		1
 
-#define	MUTEX_RECEIVE(mtx)		mb_read()
-#define	MUTEX_GIVE(mtx)			mb_memory()
+#define	MUTEX_RECEIVE(mtx)		__insn_barrier()
+#define	MUTEX_GIVE(mtx)			__insn_barrier()
 
 #define	MUTEX_CAS(p, o, n)		(atomic_cas_uint((p), (o), (n)) == (o))
 



CVS commit: src/sys/arch/m68k/include

2019-10-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Oct 27 09:38:10 UTC 2019

Modified Files:
src/sys/arch/m68k/include: reg.h

Log Message:
Expose register difinitions for _STANDALONE.
Fix build failure in arch/luna68k/stand/boot.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/m68k/include/reg.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/reg.h
diff -u src/sys/arch/m68k/include/reg.h:1.20 src/sys/arch/m68k/include/reg.h:1.21
--- src/sys/arch/m68k/include/reg.h:1.20	Sat Oct 26 17:49:34 2019
+++ src/sys/arch/m68k/include/reg.h	Sun Oct 27 09:38:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: reg.h,v 1.20 2019/10/26 17:49:34 christos Exp $	*/
+/*	$NetBSD: reg.h,v 1.21 2019/10/27 09:38:09 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -57,7 +57,7 @@ struct fpreg {
 	int	r_fpiar;
 };
 
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(_STANDALONE)
 
 /*  this is historical (but it can't be deprecated quite yet) */
 /*
@@ -95,10 +95,14 @@ struct fpreg {
 #define	R0	D1
 #define	R1	A0
 
+#endif /* _KERNEL || _STANDALONE */
+
+#ifdef _KERNEL
+
 struct lwp;
 int	process_read_regs(struct lwp *, struct reg *);
 int	process_read_fpregs(struct lwp *, struct fpreg *, size_t *);
 
-#endif
+#endif /* _KERNEL */
 
 #endif /* !_M68K_REG_H_ */



CVS commit: src/sys/arch/m68k/include

2019-10-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Oct 27 09:38:10 UTC 2019

Modified Files:
src/sys/arch/m68k/include: reg.h

Log Message:
Expose register difinitions for _STANDALONE.
Fix build failure in arch/luna68k/stand/boot.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/m68k/include/reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:51:49 UTC 2019

Modified Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
disable -Wshadow because in c99 mode these get marked as builtins.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/include/fenv.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/fenv.h
diff -u src/sys/arch/m68k/include/fenv.h:1.7 src/sys/arch/m68k/include/fenv.h:1.8
--- src/sys/arch/m68k/include/fenv.h:1.7	Wed Sep 13 05:55:35 2017
+++ src/sys/arch/m68k/include/fenv.h	Sat Oct 26 13:51:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.7 2017/09/13 09:55:35 phx Exp $	*/
+/*	$NetBSD: fenv.h,v 1.8 2019/10/26 17:51:49 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -108,6 +108,11 @@ typedef struct {
 
 __BEGIN_DECLS
 
+#if __GNUC_PREREQ__(8, 0)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
+#endif
+
 __fenv_static inline int
 feclearexcept(int __excepts)
 {
@@ -259,6 +264,10 @@ feupdateenv(const fenv_t *__envp)
 	return 0;
 }
 
+#if __GNUC_PREREQ__(8, 0)
+#pragma GCC diagnostic pop
+#endif
+
 #if defined(_NETBSD_SOURCE) || defined(_GNU_SOURCE)
 
 __fenv_static inline int



CVS commit: src/sys/arch/m68k/include

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:51:49 UTC 2019

Modified Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
disable -Wshadow because in c99 mode these get marked as builtins.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/include/fenv.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:49:34 UTC 2019

Modified Files:
src/sys/arch/m68k/include: reg.h

Log Message:
Hide the register definitions that should eventually be removed (or prefixed
with _REG_ with #ifdef _KERNEL. This avoids conflicts with let's say PC in
.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/m68k/include/reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/m68k/include

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:49:34 UTC 2019

Modified Files:
src/sys/arch/m68k/include: reg.h

Log Message:
Hide the register definitions that should eventually be removed (or prefixed
with _REG_ with #ifdef _KERNEL. This avoids conflicts with let's say PC in
.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/m68k/include/reg.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/reg.h
diff -u src/sys/arch/m68k/include/reg.h:1.19 src/sys/arch/m68k/include/reg.h:1.20
--- src/sys/arch/m68k/include/reg.h:1.19	Fri Jan  3 19:10:02 2014
+++ src/sys/arch/m68k/include/reg.h	Sat Oct 26 13:49:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: reg.h,v 1.19 2014/01/04 00:10:02 dsl Exp $	*/
+/*	$NetBSD: reg.h,v 1.20 2019/10/26 17:49:34 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -57,8 +57,9 @@ struct fpreg {
 	int	r_fpiar;
 };
 
-/*  this is historical (but it can't be deprecated quite yet) */
+#ifdef _KERNEL
 
+/*  this is historical (but it can't be deprecated quite yet) */
 /*
  * Location of the users' stored
  * registers relative to D0.
@@ -86,7 +87,6 @@ struct fpreg {
 #define	PS	(16)
 #define	PC	(17)
 
-#ifdef _KERNEL
 /*
  * Due to a mental lapse somewhere down the line, wait returns its values
  * in strange registers.  Kludge it up here so we don't have to in the