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

2024-04-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 27 06:01:08 UTC 2024

Modified Files:
src/sys/arch/mips/include: float.h

Log Message:
mips: fix syntax error in LDBL_MAX (since 2011)


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mips/include/float.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/mips/include/float.h
diff -u src/sys/arch/mips/include/float.h:1.18 src/sys/arch/mips/include/float.h:1.19
--- src/sys/arch/mips/include/float.h:1.18	Sun Jul 26 08:08:41 2020
+++ src/sys/arch/mips/include/float.h	Sat Apr 27 06:01:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: float.h,v 1.18 2020/07/26 08:08:41 simonb Exp $ */
+/*	$NetBSD: float.h,v 1.19 2024/04/27 06:01:08 rillig Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
 #if __STDC_VERSION__ >= 199901L
 #define	LDBL_EPSILON	0x1p-112L
 #define	LDBL_MIN	0x1p-16382L
-#define	LDBL_MAX	0x1.p+16383L,
+#define	LDBL_MAX	0x1.p+16383L
 #else
 #define	LDBL_EPSILON	1.9259299443872358530559779425849273E-34L
 #define	LDBL_MIN	3.3621031431120935062626778173217526E-4932L



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

2024-04-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 27 06:01:08 UTC 2024

Modified Files:
src/sys/arch/mips/include: float.h

Log Message:
mips: fix syntax error in LDBL_MAX (since 2011)


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mips/include/float.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/mips/include

2023-09-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Sep 14 03:37:01 UTC 2023

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
mips: Add initial support to gprof(1) for n64 userland

Use gp relative call for _mcount().

Stop using macro name MCOUNT as well for clarity. It has nothing to
do with one provided by .

Now, gprof(1) works just fine for C programs. On the other hand, some
C++ profiling tests of ATF fail as partially observed for n32.

More C++ profile tests become broken for GCC12 in comparison to GCC10.
Something needs to be adjusted for us, or GCC, or both.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/mips/include/asm.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/mips/include

2023-09-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Sep 14 03:37:01 UTC 2023

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
mips: Add initial support to gprof(1) for n64 userland

Use gp relative call for _mcount().

Stop using macro name MCOUNT as well for clarity. It has nothing to
do with one provided by .

Now, gprof(1) works just fine for C programs. On the other hand, some
C++ profiling tests of ATF fail as partially observed for n32.

More C++ profile tests become broken for GCC12 in comparison to GCC10.
Something needs to be adjusted for us, or GCC, or both.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/mips/include/asm.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/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.74 src/sys/arch/mips/include/asm.h:1.75
--- src/sys/arch/mips/include/asm.h:1.74	Thu Feb 23 14:56:00 2023
+++ src/sys/arch/mips/include/asm.h	Thu Sep 14 03:37:01 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.74 2023/02/23 14:56:00 riastradh Exp $	*/
+/*	$NetBSD: asm.h,v 1.75 2023/09/14 03:37:01 rin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -71,6 +71,9 @@
 #define	__SHIFTIN(__x, __mask) ((__x) * __LOWEST_SET_BIT(__mask))
 #endif	/* __ASSEMBLER__ */
 
+#ifndef GPROF
+#define	_MIPS_ASM_MCOUNT(x)
+#else
 /*
  * Define -pg profile entry code.
  * Must always be noreorder, must never use a macro instruction.
@@ -81,7 +84,7 @@
  * stack and the final addiu to t9 must always equal the size of this
  * _MIPS_ASM_MCOUNT.
  */
-#define	_MIPS_ASM_MCOUNT	\
+#define	_MIPS_ASM_MCOUNT(x)	\
 	.set	push;		\
 	.set	noreorder;	\
 	.set	noat;		\
@@ -104,7 +107,8 @@
  * call _mcount().  For the no abicalls case, skip the reloc dance.
  */
 #ifdef __mips_abicalls
-#define	_MIPS_ASM_MCOUNT	\
+#if defined(__mips_n32)		/* n32 */
+#define	_MIPS_ASM_MCOUNT(x)	\
 	.set	push;		\
 	.set	noreorder;	\
 	.set	noat;		\
@@ -118,8 +122,28 @@
 	lw	t9,8(sp);	\
 	addiu	sp,16;		\
 	.set	pop;
+#else/* n64 */
+#define	_MIPS_ASM_MCOUNT(x)	\
+	.set	push;		\
+	.set	noreorder;	\
+	.set	noat;		\
+	dsubu	sp,16;		\
+	sd	gp,0(sp);	\
+	sd	t9,8(sp);	\
+	move	AT,ra;		\
+	lui	gp,%hi(%neg(%gp_rel(x)));			\
+	daddiu	gp,%lo(%neg(%gp_rel(x)));			\
+	daddu	gp,gp,t9;	\
+	ld	t9,%call16(_mcount)(gp);			\
+	jalr	t9;		\
+	 nop;			\
+	ld	gp,0(sp);	\
+	ld	t9,8(sp);	\
+	daddiu	sp,16;		\
+	.set	pop;
+#endif
 #else /* !__mips_abicalls */
-#define	_MIPS_ASM_MCOUNT	\
+#define	_MIPS_ASM_MCOUNT(x)	\
 	.set	push;		\
 	.set	noreorder;	\
 	.set	noat;		\
@@ -129,12 +153,7 @@
 	.set	pop;
 #endif /* !__mips_abicalls */
 #endif /* n32/n64 */
-
-#ifdef GPROF
-#define	MCOUNT _MIPS_ASM_MCOUNT
-#else
-#define	MCOUNT
-#endif
+#endif /* GPROF */
 
 #ifdef USE_AENT
 #define	AENT(x)\
@@ -187,7 +206,7 @@ _C_LABEL(x): ;\
  */
 #define	STATIC_LEAF(x)			\
 	STATIC_LEAF_NOPROFILE(x);	\
-	MCOUNT
+	_MIPS_ASM_MCOUNT(x)
 
 /*
  * LEAF
@@ -198,7 +217,7 @@ _C_LABEL(x): ;\
  */
 #define	LEAF(x)\
 	LEAF_NOPROFILE(x);		\
-	MCOUNT
+	_MIPS_ASM_MCOUNT(x)
 
 /*
  * STATIC_XLEAF
@@ -241,7 +260,7 @@ _C_LABEL(x): ;		\
  */
 #define	NESTED(x, fsize, retpc)			\
 	NESTED_NOPROFILE(x, fsize, retpc);	\
-	MCOUNT
+	_MIPS_ASM_MCOUNT(x)
 
 /*
  * STATIC_NESTED
@@ -249,7 +268,7 @@ _C_LABEL(x): ;		\
  */
 #define	STATIC_NESTED(x, fsize, retpc)			\
 	STATIC_NESTED_NOPROFILE(x, fsize, retpc);	\
-	MCOUNT
+	_MIPS_ASM_MCOUNT(x)
 
 /*
  * XNESTED



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

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 18:49:21 UTC 2023

Modified Files:
src/sys/arch/mips/include: mips3_pte.h

Log Message:
change #define to #error for MIPS3_4100i 8KB page size build protection.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mips/include/mips3_pte.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/mips/include/mips3_pte.h
diff -u src/sys/arch/mips/include/mips3_pte.h:1.31 src/sys/arch/mips/include/mips3_pte.h:1.32
--- src/sys/arch/mips/include/mips3_pte.h:1.31	Mon Aug 17 03:19:35 2020
+++ src/sys/arch/mips/include/mips3_pte.h	Sat Sep  9 18:49:21 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips3_pte.h,v 1.31 2020/08/17 03:19:35 mrg Exp $	*/
+/*	$NetBSD: mips3_pte.h,v 1.32 2023/09/09 18:49:21 andvar Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -77,7 +77,7 @@ unsigned int 	pg_g:1,			/* HW: ignore as
 #define	MIPS3_PG_ODDPG	(MIPS3_PG_SVPN ^ MIPS3_PG_HVPN)
 #elif PGSHIFT == 13
 #ifdef MIPS3_4100
-#define	8KB page size is not supported on the MIPS3_4100
+#error	8KB page size is not supported on the MIPS3_4100
 #endif
 #define	MIPS3_PG_SVPN	(~0UL << 13)	/* Software page no mask */
 #define	MIPS3_PG_HVPN	(~0UL << 13)	/* Hardware page no mask */



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

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 18:49:21 UTC 2023

Modified Files:
src/sys/arch/mips/include: mips3_pte.h

Log Message:
change #define to #error for MIPS3_4100i 8KB page size build protection.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mips/include/mips3_pte.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/mips/include

2023-07-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jul 23 07:20:45 UTC 2023

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

Log Message:
USE __BIT() for CPUF_* flags. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/arch/mips/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/mips/include/cpu.h
diff -u src/sys/arch/mips/include/cpu.h:1.134 src/sys/arch/mips/include/cpu.h:1.135
--- src/sys/arch/mips/include/cpu.h:1.134	Tue Jan 31 21:11:24 2023
+++ src/sys/arch/mips/include/cpu.h	Sun Jul 23 07:20:45 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.134 2023/01/31 21:11:24 andvar Exp $	*/
+/*	$NetBSD: cpu.h,v 1.135 2023/07/23 07:20:45 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -150,11 +150,11 @@ struct cpu_info {
 	struct evcnt ci_evcnt_synci_deferred_rqst;
 	struct evcnt ci_evcnt_synci_ipi_rqst;
 
-#define	CPUF_PRIMARY	0x01		/* CPU is primary CPU */
-#define	CPUF_PRESENT	0x02		/* CPU is present */
-#define	CPUF_RUNNING	0x04		/* CPU is running */
-#define	CPUF_PAUSED	0x08		/* CPU is paused */
-#define	CPUF_USERPMAP	0x20		/* CPU has a user pmap activated */
+#define	CPUF_PRIMARY	__BIT(0)	/* CPU is primary CPU */
+#define	CPUF_PRESENT	__BIT(1)	/* CPU is present */
+#define	CPUF_RUNNING	__BIT(2)	/* CPU is running */
+#define	CPUF_PAUSED	__BIT(3)	/* CPU is paused */
+#define	CPUF_USERPMAP	__BIT(5)	/* CPU has a user pmap activated */
 	kcpuset_t *ci_shootdowncpus;
 	kcpuset_t *ci_multicastcpus;
 	kcpuset_t *ci_watchcpus;



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

2023-07-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jul 23 07:20:45 UTC 2023

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

Log Message:
USE __BIT() for CPUF_* flags. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/arch/mips/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/mips/include

2023-05-14 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun May 14 18:44:27 UTC 2023

Modified Files:
src/sys/arch/mips/include: vmparam.h

Log Message:
Bump MAXTSIZ from 64MB to 128MB also for o32.

This so that the rather large cc1 from gcc12 can be run.
OK'ed by simonb@


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/mips/include/vmparam.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/mips/include

2023-05-14 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun May 14 18:44:27 UTC 2023

Modified Files:
src/sys/arch/mips/include: vmparam.h

Log Message:
Bump MAXTSIZ from 64MB to 128MB also for o32.

This so that the rather large cc1 from gcc12 can be run.
OK'ed by simonb@


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/mips/include/vmparam.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/mips/include/vmparam.h
diff -u src/sys/arch/mips/include/vmparam.h:1.66 src/sys/arch/mips/include/vmparam.h:1.67
--- src/sys/arch/mips/include/vmparam.h:1.66	Wed Jun 23 15:11:40 2021
+++ src/sys/arch/mips/include/vmparam.h	Sun May 14 18:44:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.66 2021/06/23 15:11:40 simonb Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.67 2023/05/14 18:44:27 he Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -88,7 +88,7 @@
  */
 #if defined(__mips_o32)
 #ifndef MAXTSIZ
-#define	MAXTSIZ		(64*1024*1024)		/* max text size */
+#define	MAXTSIZ		(128*1024*1024)		/* max text size */
 #endif
 #ifndef DFLDSIZ
 #define	DFLDSIZ		(128*1024*1024)		/* initial data size limit */



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

2023-03-28 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Tue Mar 28 10:54:13 UTC 2023

Modified Files:
src/sys/arch/mips/include: bus_space_defs.h types.h

Log Message:
Add missing PRIuBUSSIZE to mips.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/include/bus_space_defs.h
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/mips/include/types.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/mips/include/bus_space_defs.h
diff -u src/sys/arch/mips/include/bus_space_defs.h:1.4 src/sys/arch/mips/include/bus_space_defs.h:1.5
--- src/sys/arch/mips/include/bus_space_defs.h:1.4	Sun Jul 26 08:08:41 2020
+++ src/sys/arch/mips/include/bus_space_defs.h	Tue Mar 28 10:54:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space_defs.h,v 1.4 2020/07/26 08:08:41 simonb Exp $	*/
+/*	$NetBSD: bus_space_defs.h,v 1.5 2023/03/28 10:54:13 nakayama Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -112,11 +112,13 @@ typedef int64_t bus_addr_t;
 typedef uint64_t bus_size_t;
 #define	PRIxBUSADDR	PRIx64
 #define	PRIxBUSSIZE	PRIx64
+#define	PRIuBUSSIZE	PRIu64
 #else
 typedef paddr_t bus_addr_t;
 typedef psize_t bus_size_t;
 #define	PRIxBUSADDR	PRIxPADDR
 #define	PRIxBUSSIZE	PRIxPSIZE
+#define	PRIuBUSSIZE	PRIuPSIZE
 #endif
 
 /*

Index: src/sys/arch/mips/include/types.h
diff -u src/sys/arch/mips/include/types.h:1.77 src/sys/arch/mips/include/types.h:1.78
--- src/sys/arch/mips/include/types.h:1.77	Thu Jul  7 10:06:02 2022
+++ src/sys/arch/mips/include/types.h	Tue Mar 28 10:54:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.77 2022/07/07 10:06:02 martin Exp $	*/
+/*	$NetBSD: types.h,v 1.78 2023/03/28 10:54:13 nakayama Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -74,12 +74,14 @@ typedef __uint64_t	psize_t;
 #define	PRIxPADDR	PRIx64
 #define	PRIxPSIZE	PRIx64
 #define	PRIdPSIZE	PRId64
+#define	PRIuPSIZE	PRIu64
 #else
 typedef __uint32_t	paddr_t;
 typedef __uint32_t	psize_t;
 #define	PRIxPADDR	PRIx32
 #define	PRIxPSIZE	PRIx32
 #define	PRIdPSIZE	PRId32
+#define	PRIuPSIZE	PRIu32
 #endif
 #ifdef _LP64
 typedef __uint64_t	vaddr_t;



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

2023-03-28 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Tue Mar 28 10:54:13 UTC 2023

Modified Files:
src/sys/arch/mips/include: bus_space_defs.h types.h

Log Message:
Add missing PRIuBUSSIZE to mips.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/include/bus_space_defs.h
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/mips/include/types.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/mips/include

2023-02-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 20 13:30:47 UTC 2023

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
mips/asm.h: Make membar macros conditional on MULTIPROCESSOR.

For !MULTIPROCESSOR, define them to be empty or nop as appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/mips/include/asm.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/mips/include

2023-02-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 20 13:30:47 UTC 2023

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
mips/asm.h: Make membar macros conditional on MULTIPROCESSOR.

For !MULTIPROCESSOR, define them to be empty or nop as appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/mips/include/asm.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/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.72 src/sys/arch/mips/include/asm.h:1.73
--- src/sys/arch/mips/include/asm.h:1.72	Mon Feb 13 12:00:18 2023
+++ src/sys/arch/mips/include/asm.h	Mon Feb 20 13:30:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.72 2023/02/13 12:00:18 riastradh Exp $	*/
+/*	$NetBSD: asm.h,v 1.73 2023/02/20 13:30:47 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -59,6 +59,7 @@
 
 #if defined(_KERNEL_OPT)
 #include "opt_gprof.h"
+#include "opt_multiprocessor.h"
 #endif
 
 #ifdef __ASSEMBLER__
@@ -573,7 +574,7 @@ _C_LABEL(x):
 #endif
 
 /* compiler define */
-#if defined(__OCTEON__)
+#if defined(MULTIPROCESSOR) && defined(__OCTEON__)
 /*
  * See common/lib/libc/arch/mips/atomic/membar_ops.S for notes on
  * Octeon memory ordering guarantees and barriers.
@@ -614,7 +615,7 @@ _C_LABEL(x):
 #define	SYNC_REL	sync 4
 #define	BDSYNC_PLUNGER	sync 4
 #define	SYNC_PLUNGER	sync 4
-#elif __mips >= 3 || !defined(__mips_o32)
+#elif defined(MULTIPROCESSOR) && (__mips >= 3 || !defined(__mips_o32))
 #define	LLSCSYNC	/* nothing */
 #define	BDSYNC		sync
 #define	BDSYNC_ACQ	sync



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

2023-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 13 12:00:18 UTC 2023

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
mips/asm.h: Cite source for Cavium sync plunger business.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/mips/include/asm.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/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.71 src/sys/arch/mips/include/asm.h:1.72
--- src/sys/arch/mips/include/asm.h:1.71	Thu Apr 21 12:06:31 2022
+++ src/sys/arch/mips/include/asm.h	Mon Feb 13 12:00:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.71 2022/04/21 12:06:31 riastradh Exp $	*/
+/*	$NetBSD: asm.h,v 1.72 2023/02/13 12:00:18 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -582,7 +582,30 @@ _C_LABEL(x):
  * we need to apply a plunger to it _after_ releasing a lock or else
  * other CPUs may spin for hundreds of thousands of cycles before they
  * see the lock is released.  So we also have the quirky SYNC_PLUNGER
- * barrier as syncw.
+ * barrier as syncw.  See the note in the SYNCW instruction description
+ * on p. 2168 of Cavium OCTEON III CN78XX Hardware Reference Manual,
+ * CN78XX-HM-0.99E, September 2014:
+ *
+ *	Core A (writer)
+ *
+ *	SW R1, DATA#		change shared DATA value
+ *	LI R1, 1
+ *	SYNCW# (or SYNCWS)	Perform DATA store before performing FLAG store
+ *	SW R2, FLAG#		say that the shared DATA value is valid
+ *	SYNCW# (or SYNCWS)	Force the FLAG store soon (CN78XX-specific)
+ *
+ *	...
+ *
+ *	The second SYNCW instruction executed by core A is not
+ *	necessary for correctness, but has very important performance
+ *	effects on the CN78XX.  Without it, the store to FLAG may
+ *	linger in core A's write buffer before it becomes visible to
+ *	any other cores.  (If core A is not performing many stores,
+ *	this may add hundreds of thousands of cycles to the flag
+ *	release time since the CN78XX core nominally retains stores to
+ *	attempt to merge them before sending the store on the CMI.)
+ *	Applications should include this second SYNCW instruction after
+ *	flag or lock release.
  */
 #define	LLSCSYNC	/* nothing */
 #define	BDSYNC		sync



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

2023-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 13 12:00:18 UTC 2023

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
mips/asm.h: Cite source for Cavium sync plunger business.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/mips/include/asm.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/mips/include

2022-11-08 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Nov  8 13:04:49 UTC 2022

Modified Files:
src/sys/arch/mips/include: mipsNN.h

Log Message:
Fix tyop in __BITS for the MIPSNN_MTI_CFG7_PREF_MASK macro.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/include/mipsNN.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/mips/include/mipsNN.h
diff -u src/sys/arch/mips/include/mipsNN.h:1.12 src/sys/arch/mips/include/mipsNN.h:1.13
--- src/sys/arch/mips/include/mipsNN.h:1.12	Sun Aug  2 23:20:25 2020
+++ src/sys/arch/mips/include/mipsNN.h	Tue Nov  8 13:04:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsNN.h,v 1.12 2020/08/02 23:20:25 simonb Exp $	*/
+/*	$NetBSD: mipsNN.h,v 1.13 2022/11/08 13:04:49 simonb Exp $	*/
 
 /*
  * Copyright 2000, 2001
@@ -677,7 +677,7 @@
 #define	MIPSNN_MTI_CFG7_AR		__BIT(16)	/* 1: no virt aliases */
 
 /* "PREF" (R/W): Instruction Prefetching (74K, 1074K). */
-#define	MIPSNN_MTI_CFG7_PREF_MASK	__BITS(12:11)
+#define	MIPSNN_MTI_CFG7_PREF_MASK	__BITS(12,11)
 #define	MIPSNN_MTI_CFG7_PREF_SHIFT	11
 #define	MIPSNN_MTI_CFG7_PREF_DISABLE	0
 #define	MIPSNN_MTI_CFG7_PREF_ONELINE	1



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

2022-11-08 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Nov  8 13:04:49 UTC 2022

Modified Files:
src/sys/arch/mips/include: mipsNN.h

Log Message:
Fix tyop in __BITS for the MIPSNN_MTI_CFG7_PREF_MASK macro.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/include/mipsNN.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/mips/include

2022-08-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 16 13:50:55 UTC 2022

Modified Files:
src/sys/arch/mips/include: pci_machdep.h

Log Message:
Provide pci_intr_setattr


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mips/include/pci_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/mips/include/pci_machdep.h
diff -u src/sys/arch/mips/include/pci_machdep.h:1.9 src/sys/arch/mips/include/pci_machdep.h:1.10
--- src/sys/arch/mips/include/pci_machdep.h:1.9	Sun Jul 26 08:08:41 2020
+++ src/sys/arch/mips/include/pci_machdep.h	Tue Aug 16 13:50:54 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.9 2020/07/26 08:08:41 simonb Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.10 2022/08/16 13:50:54 skrll Exp $ */
 
 /*
  * Copyright (c) 1996 Carnegie-Mellon University.
@@ -68,6 +68,8 @@ struct mips_pci_chipset {
 	const char	*(*pc_intr_string)(void *, pci_intr_handle_t,
 			char *, size_t);
 	const struct evcnt *(*pc_intr_evcnt)(void *, pci_intr_handle_t);
+	int		(*pc_intr_setattr)(void *, pci_intr_handle_t *,
+			int, uint64_t);
 	void		*(*pc_intr_establish)(void *, pci_intr_handle_t,
 			int, int (*)(void *), void *);
 	void		(*pc_intr_disestablish)(void *, void *);
@@ -110,6 +112,15 @@ struct mips_pci_chipset {
 #define	pci_conf_interrupt(c, b, d, p, s, lp)\
 (*(c)->pc_conf_interrupt)((c)->pc_intr_v, (b), (d), (p), (s), (lp))
 
+static inline int
+pci_intr_setattr(pci_chipset_tag_t pc, pci_intr_handle_t *ihp,
+int attr, uint64_t data)
+{
+	if (!pc->pc_intr_setattr)
+		return ENODEV;
+	return pc->pc_intr_setattr(pc, ihp, attr, data);
+}
+
 /*
  * mips-specific PCI functions.
  * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.



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

2022-08-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 16 13:50:55 UTC 2022

Modified Files:
src/sys/arch/mips/include: pci_machdep.h

Log Message:
Provide pci_intr_setattr


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mips/include/pci_machdep.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/mips/include

2022-07-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jul  7 10:06:02 UTC 2022

Modified Files:
src/sys/arch/mips/include: types.h

Log Message:
Add PRIuVSIZE


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/mips/include/types.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/mips/include

2022-07-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jul  7 10:06:02 UTC 2022

Modified Files:
src/sys/arch/mips/include: types.h

Log Message:
Add PRIuVSIZE


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/mips/include/types.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/mips/include/types.h
diff -u src/sys/arch/mips/include/types.h:1.76 src/sys/arch/mips/include/types.h:1.77
--- src/sys/arch/mips/include/types.h:1.76	Sat May 15 02:37:07 2021
+++ src/sys/arch/mips/include/types.h	Thu Jul  7 10:06:02 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.76 2021/05/15 02:37:07 simonb Exp $	*/
+/*	$NetBSD: types.h,v 1.77 2022/07/07 10:06:02 martin Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -87,12 +87,14 @@ typedef __uint64_t	vsize_t;
 #define	PRIxVADDR	PRIx64
 #define	PRIxVSIZE	PRIx64
 #define	PRIdVSIZE	PRId64
+#define	PRIuVSIZE	PRIu64
 #else
 typedef __uint32_t	vaddr_t;
 typedef __uint32_t	vsize_t;
 #define	PRIxVADDR	PRIx32
 #define	PRIxVSIZE	PRIx32
 #define	PRIdVSIZE	PRId32
+#define	PRIuVSIZE	PRIu32
 #endif
 
 typedef	vaddr_t	vm_offset_t;	/* deprecated (cddl/FreeBSD compat) */



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

2022-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr  9 23:43:20 UTC 2022

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

Log Message:
mips: Convert lock.h to membar_release/acquire.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mips/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/mips/include/lock.h
diff -u src/sys/arch/mips/include/lock.h:1.22 src/sys/arch/mips/include/lock.h:1.23
--- src/sys/arch/mips/include/lock.h:1.22	Sat Feb 12 17:10:02 2022
+++ src/sys/arch/mips/include/lock.h	Sat Apr  9 23:43:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.22 2022/02/12 17:10:02 riastradh Exp $	*/
+/*	$NetBSD: lock.h,v 1.23 2022/04/09 23:43:20 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -114,7 +114,7 @@ __cpu_simple_lock_try(__cpu_simple_lock_
 	 * Successful _atomic_cas_uint functions as a load-acquire --
 	 * on MP systems, it issues sync after the LL/SC CAS succeeds;
 	 * on non-MP systems every load is a load-acquire so it's moot.
-	 * This pairs with the membar_exit and store sequence in
+	 * This pairs with the membar_release and store sequence in
 	 * __cpu_simple_unlock that functions as a store-release
 	 * operation.
 	 *
@@ -153,14 +153,14 @@ __cpu_simple_unlock(__cpu_simple_lock_t 
 {
 
 	/*
-	 * The membar_exit and then store functions as a store-release
-	 * operation that pairs with the load-acquire operation in
-	 * successful __cpu_simple_lock_try.
+	 * The membar_release and then store functions as a
+	 * store-release operation that pairs with the load-acquire
+	 * operation in successful __cpu_simple_lock_try.
 	 *
 	 * Can't use atomic_store_release here because that's not
 	 * available in userland at the moment.
 	 */
-	membar_exit();
+	membar_release();
 	*lp = __SIMPLELOCK_UNLOCKED;
 
 #ifdef _MIPS_ARCH_OCTEONP



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

2022-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr  9 23:43:20 UTC 2022

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

Log Message:
mips: Convert lock.h to membar_release/acquire.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mips/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/mips/include

2022-02-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 27 19:22:20 UTC 2022

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
mips: Redefine LLSCSYNC as empty on non-Octeon MP.

This change deletes memory barriers on non-Octeon MP.  However, all
the appropriate acquire and release barriers are already used in
mutex stubs, and no barriers are needed in atomic_* unless we set
__HAVE_ATOMIC_AS_MEMBAR which we don't on MIPS.  So this should be
safe.

Unclear whether we need this even on Octeon -- don't have a clear
reference on why it's here.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/mips/include/asm.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/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.68 src/sys/arch/mips/include/asm.h:1.69
--- src/sys/arch/mips/include/asm.h:1.68	Sun Feb 27 19:22:12 2022
+++ src/sys/arch/mips/include/asm.h	Sun Feb 27 19:22:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.68 2022/02/27 19:22:12 riastradh Exp $	*/
+/*	$NetBSD: asm.h,v 1.69 2022/02/27 19:22:20 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -581,7 +581,7 @@ _C_LABEL(x):
 #define	BDSYNC_PLUNGER	sync 4
 #define	SYNC_PLUNGER	sync 4
 #elif __mips >= 3 || !defined(__mips_o32)
-#define	LLSCSYNC	sync
+#define	LLSCSYNC	/* nothing */
 #define	BDSYNC		sync
 #define	BDSYNC_ACQ	sync
 #define	SYNC_ACQ	sync



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

2022-02-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 27 19:22:20 UTC 2022

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
mips: Redefine LLSCSYNC as empty on non-Octeon MP.

This change deletes memory barriers on non-Octeon MP.  However, all
the appropriate acquire and release barriers are already used in
mutex stubs, and no barriers are needed in atomic_* unless we set
__HAVE_ATOMIC_AS_MEMBAR which we don't on MIPS.  So this should be
safe.

Unclear whether we need this even on Octeon -- don't have a clear
reference on why it's here.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/mips/include/asm.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/mips/include

2022-02-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 27 19:22:12 UTC 2022

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
mips: Redefine BDSYNC as sync on Octeon, not syncw.

BDSYNC is used for membar_sync, which is supposed to be a full
sequential consistency barrier, which is not provided by syncw, so
this is necessary for correctness.

BDSYNC is not used for anything else, so this can't hurt performance,
except where it was necessary for correctness anyway or where the
semantic choice of membar_sync was too strong anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/mips/include/asm.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/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.67 src/sys/arch/mips/include/asm.h:1.68
--- src/sys/arch/mips/include/asm.h:1.67	Sun Feb 27 19:22:02 2022
+++ src/sys/arch/mips/include/asm.h	Sun Feb 27 19:22:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.67 2022/02/27 19:22:02 riastradh Exp $	*/
+/*	$NetBSD: asm.h,v 1.68 2022/02/27 19:22:12 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -574,7 +574,7 @@ _C_LABEL(x):
 #if defined(__OCTEON__)
 /* early cnMIPS have erratum which means 2 */
 #define	LLSCSYNC	sync 4; sync 4
-#define	BDSYNC		sync 4		/* sync 4 == syncw - sync all writes */
+#define	BDSYNC		sync
 #define	BDSYNC_ACQ	sync
 #define	SYNC_ACQ	sync
 #define	SYNC_REL	sync



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

2022-02-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 27 19:22:12 UTC 2022

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
mips: Redefine BDSYNC as sync on Octeon, not syncw.

BDSYNC is used for membar_sync, which is supposed to be a full
sequential consistency barrier, which is not provided by syncw, so
this is necessary for correctness.

BDSYNC is not used for anything else, so this can't hurt performance,
except where it was necessary for correctness anyway or where the
semantic choice of membar_sync was too strong anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/mips/include/asm.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/mips/include

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 05:39:12 UTC 2022

Modified Files:
src/sys/arch/mips/include: pmap.h

Log Message:
consistency. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/mips/include/pmap.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/mips/include/pmap.h
diff -u src/sys/arch/mips/include/pmap.h:1.75 src/sys/arch/mips/include/pmap.h:1.76
--- src/sys/arch/mips/include/pmap.h:1.75	Sun Dec 20 16:38:25 2020
+++ src/sys/arch/mips/include/pmap.h	Tue Jan  4 05:39:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.75 2020/12/20 16:38:25 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.76 2022/01/04 05:39:12 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -100,7 +100,7 @@ struct vm_page_md;
 
 #define	PMAP_VIRTUAL_CACHE_ALIASES
 #define	PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)NULL)
-#define	PMAP_TLB_NEED_SHOOTDOWN
+#define	PMAP_TLB_NEED_SHOOTDOWN		1
 #define	PMAP_TLB_FLUSH_ASID_ON_RESET	false
 #if UPAGES > 1
 #define	PMAP_TLB_WIRED_UPAGES		MIPS3_TLB_WIRED_UPAGES



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

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 05:39:12 UTC 2022

Modified Files:
src/sys/arch/mips/include: pmap.h

Log Message:
consistency. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/mips/include/pmap.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/mips/include

2021-11-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Nov 16 06:04:53 UTC 2021

Modified Files:
src/sys/arch/mips/include: cpuregs.h

Log Message:
Add some comments for the RDHWR register numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/mips/include/cpuregs.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/mips/include/cpuregs.h
diff -u src/sys/arch/mips/include/cpuregs.h:1.114 src/sys/arch/mips/include/cpuregs.h:1.115
--- src/sys/arch/mips/include/cpuregs.h:1.114	Tue Nov 16 06:04:00 2021
+++ src/sys/arch/mips/include/cpuregs.h	Tue Nov 16 06:04:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuregs.h,v 1.114 2021/11/16 06:04:00 simonb Exp $	*/
+/*	$NetBSD: cpuregs.h,v 1.115 2021/11/16 06:04:52 simonb Exp $	*/
 
 /*
  * Copyright (c) 2009 Miodrag Vallat.
@@ -876,13 +876,13 @@
 /*
  * RDHWR register numbers
  */
-#define	MIPS_HWR_CPUNUM			_(0)
-#define	MIPS_HWR_SYNCI_STEP		_(1)
-#define	MIPS_HWR_CC			_(2)
-#define	MIPS_HWR_CCRES			_(3)
+#define	MIPS_HWR_CPUNUM			_(0)	/* Which CPU are we on? */
+#define	MIPS_HWR_SYNCI_STEP		_(1)	/* Address step size for SYNCI */
+#define	MIPS_HWR_CC			_(2)	/* Hi-res cycle counter */
+#define	MIPS_HWR_CCRES			_(3)	/* Cycle counter resolution */
 #define	MIPS_HWR_UL			_(29)	/* Userlocal */
-#define	MIPS_HWR_IMPL30			_(30)
-#define	MIPS_HWR_IMPL31			_(31)
+#define	MIPS_HWR_IMPL30			_(30)	/* Implementation dependent use */
+#define	MIPS_HWR_IMPL31			_(31)	/* Implementation dependent use */
 
 /*
  * Bits defined for HWREna (CP0 register 7, select 0).



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

2021-11-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Nov 16 06:04:53 UTC 2021

Modified Files:
src/sys/arch/mips/include: cpuregs.h

Log Message:
Add some comments for the RDHWR register numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/mips/include/cpuregs.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/mips/include

2021-11-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Nov 16 06:04:00 UTC 2021

Modified Files:
src/sys/arch/mips/include: cpuregs.h

Log Message:
Only need one #define for MIPS_HWR_CPUNUM.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/mips/include/cpuregs.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/mips/include/cpuregs.h
diff -u src/sys/arch/mips/include/cpuregs.h:1.113 src/sys/arch/mips/include/cpuregs.h:1.114
--- src/sys/arch/mips/include/cpuregs.h:1.113	Mon Nov  1 21:28:02 2021
+++ src/sys/arch/mips/include/cpuregs.h	Tue Nov 16 06:04:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuregs.h,v 1.113 2021/11/01 21:28:02 andvar Exp $	*/
+/*	$NetBSD: cpuregs.h,v 1.114 2021/11/16 06:04:00 simonb Exp $	*/
 
 /*
  * Copyright (c) 2009 Miodrag Vallat.
@@ -883,7 +883,6 @@
 #define	MIPS_HWR_UL			_(29)	/* Userlocal */
 #define	MIPS_HWR_IMPL30			_(30)
 #define	MIPS_HWR_IMPL31			_(31)
-#define	MIPS_HWR_CPUNUM			_(0)
 
 /*
  * Bits defined for HWREna (CP0 register 7, select 0).



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

2021-11-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Nov 16 06:04:00 UTC 2021

Modified Files:
src/sys/arch/mips/include: cpuregs.h

Log Message:
Only need one #define for MIPS_HWR_CPUNUM.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/mips/include/cpuregs.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/mips/include

2021-10-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Oct 30 14:05:40 UTC 2021

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

Log Message:
Adjust the rules for sigcontext visibility on MIPS:
- Define __HAVE_STRUCT_SIGCONTEXT if _KERNEL (because it's needed for
  32-bit binary compatibility) or if the O32 ABI is active (because
  that's the only ABI that ever used sigcontext for signal delivery).
- For _KERNEL, define a "struct sigcontext" suitable only for 32-bit
  compatible signal delivery.
- For userspace, define a "struct sigcontext" appropriate for any ABI
  if _LIBC is defined (it's used for setjmp / longjmp) or if O32 is
  the active ABI (because it was part of the old BSD signal API).


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mips/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/mips/include/signal.h
diff -u src/sys/arch/mips/include/signal.h:1.32 src/sys/arch/mips/include/signal.h:1.33
--- src/sys/arch/mips/include/signal.h:1.32	Wed Oct 27 02:00:46 2021
+++ src/sys/arch/mips/include/signal.h	Sat Oct 30 14:05:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.32 2021/10/27 02:00:46 thorpej Exp $	*/
+/*	$NetBSD: signal.h,v 1.33 2021/10/30 14:05:40 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -78,8 +78,12 @@ struct sigcontext13 {
 };
 #endif /* _KERNEL && COMPAT_13 */
 
-#if defined(_LIBC) || (defined(_KERNEL) && (defined(COMPAT_16) || defined(COMPAT_ULTRIX)))
+#if defined(_KERNEL) || defined(__mips_o32)
 #define	__HAVE_STRUCT_SIGCONTEXT
+#endif
+
+#if defined(_NETBSD_SOURCE)
+#include 
 /*
  * Only need an O32 version.
  */
@@ -98,19 +102,17 @@ struct sigcontext { \
 }
 
 /*
- * These will be identical in O32
- */
-#ifdef _KERNEL
-/*
- * We need this only compatibility.
+ * The only binaries that used sigcontext used the O32 ABI.  The kernel
+ * needs this for 32-bit compatibility, and O32 ABI user-space needs this
+ * natively.
  */
+#if defined(_KERNEL)
 _SIGCONTEXT_DEFINE(sigcontext, int, int);
-#endif
-#ifdef _LIBC
+#elif defined(__mips_o32) || defined(_LIBC)
 _SIGCONTEXT_DEFINE(sigcontext, __register_t, __fpregister_t);
 #endif
 
-#endif /* _LIBC || _KERNEL */
+#endif /* _NETBSD_SOURCE */
 
 #endif	/* !_LANGUAGE_ASSEMBLY */
 #endif	/* !_MIPS_SIGNAL_H_ */



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

2021-10-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Oct 30 14:05:40 UTC 2021

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

Log Message:
Adjust the rules for sigcontext visibility on MIPS:
- Define __HAVE_STRUCT_SIGCONTEXT if _KERNEL (because it's needed for
  32-bit binary compatibility) or if the O32 ABI is active (because
  that's the only ABI that ever used sigcontext for signal delivery).
- For _KERNEL, define a "struct sigcontext" suitable only for 32-bit
  compatible signal delivery.
- For userspace, define a "struct sigcontext" appropriate for any ABI
  if _LIBC is defined (it's used for setjmp / longjmp) or if O32 is
  the active ABI (because it was part of the old BSD signal API).


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mips/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/mips/include

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

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

Log Message:
Define __HAVE_STRUCT_SIGCONTEXT for _KERNEL in addition to _LIBC.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mips/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/mips/include/signal.h
diff -u src/sys/arch/mips/include/signal.h:1.31 src/sys/arch/mips/include/signal.h:1.32
--- src/sys/arch/mips/include/signal.h:1.31	Tue Oct 26 16:16:35 2021
+++ src/sys/arch/mips/include/signal.h	Wed Oct 27 02:00:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.31 2021/10/26 16:16:35 christos Exp $	*/
+/*	$NetBSD: signal.h,v 1.32 2021/10/27 02:00:46 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -79,6 +79,7 @@ struct sigcontext13 {
 #endif /* _KERNEL && COMPAT_13 */
 
 #if defined(_LIBC) || (defined(_KERNEL) && (defined(COMPAT_16) || defined(COMPAT_ULTRIX)))
+#define	__HAVE_STRUCT_SIGCONTEXT
 /*
  * Only need an O32 version.
  */
@@ -106,7 +107,6 @@ struct sigcontext { \
 _SIGCONTEXT_DEFINE(sigcontext, int, int);
 #endif
 #ifdef _LIBC
-#define	__HAVE_STRUCT_SIGCONTEXT
 _SIGCONTEXT_DEFINE(sigcontext, __register_t, __fpregister_t);
 #endif
 



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

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

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

Log Message:
Define __HAVE_STRUCT_SIGCONTEXT for _KERNEL in addition to _LIBC.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mips/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/mips/include

2021-06-23 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Jun 23 15:11:40 UTC 2021

Modified Files:
src/sys/arch/mips/include: vmparam.h

Log Message:
Remove an unused #define.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/mips/include/vmparam.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/mips/include

2021-06-23 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Jun 23 15:11:40 UTC 2021

Modified Files:
src/sys/arch/mips/include: vmparam.h

Log Message:
Remove an unused #define.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/mips/include/vmparam.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/mips/include/vmparam.h
diff -u src/sys/arch/mips/include/vmparam.h:1.65 src/sys/arch/mips/include/vmparam.h:1.66
--- src/sys/arch/mips/include/vmparam.h:1.65	Fri Feb 26 02:18:29 2021
+++ src/sys/arch/mips/include/vmparam.h	Wed Jun 23 15:11:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.65 2021/02/26 02:18:29 simonb Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.66 2021/06/23 15:11:40 simonb Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -198,7 +198,6 @@
 
 /* VM_PHYSSEG_MAX defined by platform-dependent code. */
 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
-#define	VM_PHYSSEG_NOADD	/* can add RAM after vm_mem_init */
 
 #ifndef VM_NFREELIST
 #define	VM_NFREELIST		16	/* 16 distinct memory segments */



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

2021-05-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue May 18 06:38:24 UTC 2021

Modified Files:
src/sys/arch/mips/include: db_machdep.h

Log Message:
Remove argument names from function declaration prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/mips/include/db_machdep.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/mips/include

2021-05-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue May 18 06:38:24 UTC 2021

Modified Files:
src/sys/arch/mips/include: db_machdep.h

Log Message:
Remove argument names from function declaration prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/mips/include/db_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/mips/include/db_machdep.h
diff -u src/sys/arch/mips/include/db_machdep.h:1.37 src/sys/arch/mips/include/db_machdep.h:1.38
--- src/sys/arch/mips/include/db_machdep.h:1.37	Mon Mar 29 03:09:41 2021
+++ src/sys/arch/mips/include/db_machdep.h	Tue May 18 06:38:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.37 2021/03/29 03:09:41 simonb Exp $ */
+/* $NetBSD: db_machdep.h,v 1.38 2021/05/18 06:38:24 skrll Exp $ */
 
 /*
  * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -91,7 +91,7 @@ db_addr_t	db_disasm_insn(int insn, db_ad
  * Entrypoints to DDB for kernel, keyboard drivers, init hook
  */
 void 	kdb_kbd_trap(db_regs_t *);
-int 	kdb_trap(int type, struct reg *);
+int 	kdb_trap(int, struct reg *);
 
 static inline void
 db_set_ddb_regs(int type, struct reg *regs)
@@ -103,7 +103,7 @@ db_set_ddb_regs(int type, struct reg *re
  * Helper functions for fetching 32-bit and 64-bit kernel memory.
  */
 bool		kdbpeek(vaddr_t, unsigned *);
-mips_reg_t	kdbrpeek(vaddr_t addr, size_t n);
+mips_reg_t	kdbrpeek(vaddr_t, size_t);
 
 
 /*



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

2021-05-14 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat May 15 02:37:07 UTC 2021

Modified Files:
src/sys/arch/mips/include: types.h

Log Message:
The MIPS O64 ABI uses full 64-bit FP regs.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/mips/include/types.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/mips/include/types.h
diff -u src/sys/arch/mips/include/types.h:1.75 src/sys/arch/mips/include/types.h:1.76
--- src/sys/arch/mips/include/types.h:1.75	Mon Mar 29 02:07:43 2021
+++ src/sys/arch/mips/include/types.h	Sat May 15 02:37:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.75 2021/03/29 02:07:43 simonb Exp $	*/
+/*	$NetBSD: types.h,v 1.76 2021/05/15 02:37:07 simonb Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -49,13 +49,10 @@ typedef __uint64_t		__fpregister64_t;
 typedef	unsigned int		__cpu_simple_lock_nv_t;
 #if defined(__mips_o32)
 typedef __register32_t		__register_t;
+typedef __fpregister32_t	__fpregister_t;
 #else
 typedef __register64_t		__register_t;
-#endif
-#if defined(__mips_o64) || defined(__mips_o32)
-typedef	__fpregister32_t	__fpregister_t;
-#else
-typedef	__fpregister64_t	__fpregister_t;
+typedef __fpregister64_t	__fpregister_t;
 #endif
 
 /*



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

2021-05-14 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat May 15 02:37:07 UTC 2021

Modified Files:
src/sys/arch/mips/include: types.h

Log Message:
The MIPS O64 ABI uses full 64-bit FP regs.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/mips/include/types.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/mips/include

2021-05-11 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed May 12 03:53:37 UTC 2021

Modified Files:
src/sys/arch/mips/include: locore.h

Log Message:
Whitespace nit.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/mips/include/locore.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/mips/include/locore.h
diff -u src/sys/arch/mips/include/locore.h:1.117 src/sys/arch/mips/include/locore.h:1.118
--- src/sys/arch/mips/include/locore.h:1.117	Tue Mar  2 08:16:52 2021
+++ src/sys/arch/mips/include/locore.h	Wed May 12 03:53:37 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.117 2021/03/02 08:16:52 skrll Exp $ */
+/* $NetBSD: locore.h,v 1.118 2021/05/12 03:53:37 simonb Exp $ */
 
 /*
  * This file should not be included by MI code!!!
@@ -306,7 +306,7 @@ struct mips_options {
 #endif
 #define	MIPS_HAS_LLADDR		((mips_options.mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0)
 #define	MIPS_HAS_DSP		(mips_options.mips_cpu_flags & CPU_MIPS_HAVE_DSP)
-# define MIPS_HAS_USERLOCAL	(mips_options.mips_cpu_flags & CPU_MIPS_HAVE_USERLOCAL)
+#define MIPS_HAS_USERLOCAL	(mips_options.mips_cpu_flags & CPU_MIPS_HAVE_USERLOCAL)
 
 /* This test is ... rather bogus */
 #define	CPUISMIPS3	((mips_options.mips_cpu_arch & \



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

2021-05-11 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed May 12 03:53:37 UTC 2021

Modified Files:
src/sys/arch/mips/include: locore.h

Log Message:
Whitespace nit.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/mips/include/locore.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/mips/include

2021-05-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May  8 13:09:58 UTC 2021

Modified Files:
src/sys/arch/mips/include: mips_param.h

Log Message:
KNG


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/mips/include/mips_param.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/mips/include/mips_param.h
diff -u src/sys/arch/mips/include/mips_param.h:1.48 src/sys/arch/mips/include/mips_param.h:1.49
--- src/sys/arch/mips/include/mips_param.h:1.48	Mon Apr 26 13:29:51 2021
+++ src/sys/arch/mips/include/mips_param.h	Sat May  8 13:09:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_param.h,v 1.48 2021/04/26 13:29:51 christos Exp $	*/
+/*	$NetBSD: mips_param.h,v 1.49 2021/05/08 13:09:58 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -104,7 +104,7 @@
 
 #define	SEGSHIFT	(PGSHIFT + PTPLENGTH)	/* LOG2(NBSEG) */
 #define	NBSEG		(1 << SEGSHIFT)	/* bytes/segment */
-#define	SEGOFSET	(NBSEG-1)	/* byte offset into segment */
+#define	SEGOFSET	(NBSEG - 1)	/* byte offset into segment */
 
 #ifdef _LP64
 #define	SEGLENGTH	(PGSHIFT - 3)



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

2021-05-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May  8 13:09:58 UTC 2021

Modified Files:
src/sys/arch/mips/include: mips_param.h

Log Message:
KNG


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/mips/include/mips_param.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/mips/include

2021-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 26 13:29:51 UTC 2021

Modified Files:
src/sys/arch/mips/include: mips_param.h

Log Message:
Make MACHINE_ARCH for n64 binaries mipsn64e[bl] instead of mips64e[bl] to
differentiate them from n32/o32 binaries.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/mips/include/mips_param.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/mips/include/mips_param.h
diff -u src/sys/arch/mips/include/mips_param.h:1.47 src/sys/arch/mips/include/mips_param.h:1.48
--- src/sys/arch/mips/include/mips_param.h:1.47	Wed Aug 26 06:51:45 2020
+++ src/sys/arch/mips/include/mips_param.h	Mon Apr 26 09:29:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_param.h,v 1.47 2020/08/26 10:51:45 simonb Exp $	*/
+/*	$NetBSD: mips_param.h,v 1.48 2021/04/26 13:29:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -29,27 +29,28 @@
  * No reason this can't be common
  */
 #if defined(__MIPSEB__)
-# if defined(__mips_n32) || defined(__mips_n64)
-#  define	_MACHINE_ARCH	mips64eb
-#  define	MACHINE_ARCH	"mips64eb"
-#  define	_MACHINE32_ARCH	mipseb
-#  define	MACHINE32_ARCH	"mipseb"
-# else
-#  define	_MACHINE_ARCH	mipseb
-#  define	MACHINE_ARCH	"mipseb"
-# endif
+# define _MACHINE_SUFFIX eb
+# define MACHINE_SUFFIX "eb"
 #elif defined(__MIPSEL__)
-# if defined(__mips_n32) || defined(__mips_n64)
-#  define	_MACHINE_ARCH	mips64el
-#  define	MACHINE_ARCH	"mips64el"
-#  define	_MACHINE32_ARCH	mipsel
-#  define	MACHINE32_ARCH	"mipsel"
-# else
-#  define	_MACHINE_ARCH	mipsel
-#  define	MACHINE_ARCH	"mipsel"
-#endif
+# define _MACHINE_SUFFIX el
+# define MACHINE_SUFFIX "el"
 #else
-#error neither __MIPSEL__ nor __MIPSEB__ are defined.
+# error neither __MIPSEL__ nor __MIPSEB__ are defined.
+#endif
+
+#if defined(__mips_n32) || defined(__mips_n64)
+# if defined(__mips_n32)
+#  define	_MACHINE_ARCH	mips64##_MACHINE_SUFFIX
+#  define	MACHINE_ARCH	"mips64" MACHINE_SUFFIX
+# else /* __mips_n64 */
+#  define	_MACHINE_ARCH	mipsn64##_MACHINE_SUFFIX
+#  define	MACHINE_ARCH	"mipsn64" MACHINE_SUFFIX
+# endif
+# define	_MACHINE32_ARCH	mips##_MACHINE_SUFFIX
+# define	MACHINE32_ARCH	"mips" MACHINE_SUFFIX
+#else /* o32 */
+# define	_MACHINE_ARCH	mips##_MACHINE_SUFFIX
+# define	MACHINE_ARCH	"mips" MACHINE_SUFFIX
 #endif
 
 /*



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

2021-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 26 13:29:51 UTC 2021

Modified Files:
src/sys/arch/mips/include: mips_param.h

Log Message:
Make MACHINE_ARCH for n64 binaries mipsn64e[bl] instead of mips64e[bl] to
differentiate them from n32/o32 binaries.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/mips/include/mips_param.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/mips/include

2021-03-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Mar 29 03:07:33 UTC 2021

Modified Files:
src/sys/arch/mips/include: db_machdep.h

Log Message:
Move the cpu_reset_address() declaration inside #ifdef _KERNEL, add a
comment.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/mips/include/db_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/mips/include/db_machdep.h
diff -u src/sys/arch/mips/include/db_machdep.h:1.35 src/sys/arch/mips/include/db_machdep.h:1.36
--- src/sys/arch/mips/include/db_machdep.h:1.35	Mon Mar 29 03:03:48 2021
+++ src/sys/arch/mips/include/db_machdep.h	Mon Mar 29 03:07:33 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.35 2021/03/29 03:03:48 simonb Exp $ */
+/* $NetBSD: db_machdep.h,v 1.36 2021/03/29 03:07:33 simonb Exp $ */
 
 /*
  * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -128,10 +128,15 @@ bool ddb_running_on_any_cpu_p(void);
 void db_resume_others(void);
 void db_mips_stack_trace(void *, void *, void (*pr)(const char *, ...));
 
-extern void (*cpu_reset_address)(void);
 
 #ifdef _KERNEL
 /*
+ * Optional function to perform machine- or cpu-specific reset.
+ * Called from ddb "machine reset".
+ */
+extern void (*cpu_reset_address)(void);
+
+/*
  * We have machine-dependent commands.
  */
 #define	DB_MACHINE_COMMANDS



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

2021-03-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Mar 29 03:07:33 UTC 2021

Modified Files:
src/sys/arch/mips/include: db_machdep.h

Log Message:
Move the cpu_reset_address() declaration inside #ifdef _KERNEL, add a
comment.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/mips/include/db_machdep.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/mips/include

2021-03-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Mar 29 03:03:48 UTC 2021

Modified Files:
src/sys/arch/mips/include: db_machdep.h

Log Message:
Whitespace nits.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/mips/include/db_machdep.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/mips/include

2021-03-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Mar 29 03:03:48 UTC 2021

Modified Files:
src/sys/arch/mips/include: db_machdep.h

Log Message:
Whitespace nits.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/mips/include/db_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/mips/include/db_machdep.h
diff -u src/sys/arch/mips/include/db_machdep.h:1.34 src/sys/arch/mips/include/db_machdep.h:1.35
--- src/sys/arch/mips/include/db_machdep.h:1.34	Wed Feb 10 07:19:54 2021
+++ src/sys/arch/mips/include/db_machdep.h	Mon Mar 29 03:03:48 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.34 2021/02/10 07:19:54 simonb Exp $ */
+/* $NetBSD: db_machdep.h,v 1.35 2021/03/29 03:03:48 simonb Exp $ */
 
 /*
  * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -83,11 +83,10 @@ extern db_regs_t	ddb_regs;	/* register s
 #define	IS_WATCHPOINT_TRAP(type, code)	(0)	/* XXX mips3 watchpoint */
 
 /*
- * Interface to  disassembly (shared with mdb)
+ * Interface to disassembly (shared with mdb)
  */
 db_addr_t	db_disasm_insn(int insn, db_addr_t loc, bool altfmt);
 
-
 /*
  * Entrypoints to DDB for kernel, keyboard drivers, init hook
  */



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

2021-03-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Mar 29 02:07:43 UTC 2021

Modified Files:
src/sys/arch/mips/include: types.h

Log Message:
Provide vm_offset_t and vm_size_t typedefs - used by dtrace.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/mips/include/types.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/mips/include/types.h
diff -u src/sys/arch/mips/include/types.h:1.74 src/sys/arch/mips/include/types.h:1.75
--- src/sys/arch/mips/include/types.h:1.74	Sat Jan 23 19:38:53 2021
+++ src/sys/arch/mips/include/types.h	Mon Mar 29 02:07:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.74 2021/01/23 19:38:53 christos Exp $	*/
+/*	$NetBSD: types.h,v 1.75 2021/03/29 02:07:43 simonb Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -98,6 +98,9 @@ typedef __uint32_t	vsize_t;
 #define	PRIdVSIZE	PRId32
 #endif
 
+typedef	vaddr_t	vm_offset_t;	/* deprecated (cddl/FreeBSD compat) */
+typedef	vsize_t	vm_size_t;	/* deprecated (cddl/FreeBSD compat) */
+
 
 typedef int		mips_prid_t;
 /* Make sure this is signed; we need pointers to be sign-extended. */



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

2021-03-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Mar 29 02:07:43 UTC 2021

Modified Files:
src/sys/arch/mips/include: types.h

Log Message:
Provide vm_offset_t and vm_size_t typedefs - used by dtrace.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/mips/include/types.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/mips/include

2021-03-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Mar 29 01:47:46 UTC 2021

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

Log Message:
Include #include  to get lwp_trapframe() definition.
Needed for dtrace.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/arch/mips/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/mips/include/cpu.h
diff -u src/sys/arch/mips/include/cpu.h:1.131 src/sys/arch/mips/include/cpu.h:1.132
--- src/sys/arch/mips/include/cpu.h:1.131	Mon Aug 17 03:19:35 2020
+++ src/sys/arch/mips/include/cpu.h	Mon Mar 29 01:47:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.131 2020/08/17 03:19:35 mrg Exp $	*/
+/*	$NetBSD: cpu.h,v 1.132 2021/03/29 01:47:45 simonb Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -53,6 +53,8 @@
 #include "opt_multiprocessor.h"
 #endif
 
+#include 
+
 #include 
 #include 
 #include 



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

2021-03-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Mar 29 01:47:46 UTC 2021

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

Log Message:
Include #include  to get lwp_trapframe() definition.
Needed for dtrace.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/arch/mips/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/mips/include

2021-03-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Mar 29 01:46:26 UTC 2021

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

Log Message:
Add an lwp_trapframe() interface to return an LWP's user trapframe.
Needed by dtrace.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/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/mips/include/frame.h
diff -u src/sys/arch/mips/include/frame.h:1.11 src/sys/arch/mips/include/frame.h:1.12
--- src/sys/arch/mips/include/frame.h:1.11	Wed Mar 24 05:35:05 2021
+++ src/sys/arch/mips/include/frame.h	Mon Mar 29 01:46:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.11 2021/03/24 05:35:05 simonb Exp $	*/
+/*	$NetBSD: frame.h,v 1.12 2021/03/29 01:46:26 simonb Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -42,6 +42,8 @@
 #include 
 
 void *getframe(struct lwp *, int, int *);
+#define	lwp_trapframe(l)	((l)->l_md.md_utf)
+
 #if defined(COMPAT_16) || defined(COMPAT_ULTRIX)
 void sendsig_sigcontext(const ksiginfo_t *, const sigset_t *);
 #endif



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

2021-03-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Mar 29 01:46:26 UTC 2021

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

Log Message:
Add an lwp_trapframe() interface to return an LWP's user trapframe.
Needed by dtrace.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/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/mips/include

2021-03-23 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Mar 24 05:35:06 UTC 2021

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

Log Message:
We don't really need a comment at the end of the file saying "this is
the end of the file".


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/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/mips/include/frame.h
diff -u src/sys/arch/mips/include/frame.h:1.10 src/sys/arch/mips/include/frame.h:1.11
--- src/sys/arch/mips/include/frame.h:1.10	Sun Jul 26 08:08:41 2020
+++ src/sys/arch/mips/include/frame.h	Wed Mar 24 05:35:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.10 2020/07/26 08:08:41 simonb Exp $	*/
+/*	$NetBSD: frame.h,v 1.11 2021/03/24 05:35:05 simonb Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -49,5 +49,3 @@ void sendsig_sigcontext(const ksiginfo_t
 #endif /* _LOCORE */
 
 #endif /* _MIPS_FRAME_H_ */
-
-/* End of frame.h */



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

2021-03-23 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Mar 24 05:35:06 UTC 2021

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

Log Message:
We don't really need a comment at the end of the file saying "this is
the end of the file".


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/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/mips/include

2021-03-23 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Mar 23 11:56:55 UTC 2021

Modified Files:
src/sys/arch/mips/include: Makefile.inc

Log Message:
Remove addition of -msym32 to CFLAGS. Hinders rather than helps build
MIPS modules.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/include/Makefile.inc

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



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

2021-03-23 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Mar 23 11:56:55 UTC 2021

Modified Files:
src/sys/arch/mips/include: Makefile.inc

Log Message:
Remove addition of -msym32 to CFLAGS. Hinders rather than helps build
MIPS modules.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/include/Makefile.inc

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/mips/include/Makefile.inc
diff -u src/sys/arch/mips/include/Makefile.inc:1.10 src/sys/arch/mips/include/Makefile.inc:1.11
--- src/sys/arch/mips/include/Makefile.inc:1.10	Thu Jun  9 05:43:51 2016
+++ src/sys/arch/mips/include/Makefile.inc	Tue Mar 23 11:56:55 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.10 2016/06/09 05:43:51 martin Exp $
+# $NetBSD: Makefile.inc,v 1.11 2021/03/23 11:56:55 simonb Exp $
 
 CFLAGS+=	-G 0 -ffixed-24
 
@@ -8,8 +8,4 @@ CFLAGS+=	-mno-abicalls
 AFLAGS+=	-mno-abicalls
 .endif
 
-.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
-CFLAGS+=	-msym32
-.endif
-
 AFLAGS+=	-x assembler-with-cpp ${AOPTS}



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

2021-03-18 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Thu Mar 18 23:18:36 UTC 2021

Modified Files:
src/sys/arch/mips/include: ptrace.h

Log Message:
Add PTRACE_ILLEGAL_ASM using the MIPS32r6/MIPS64r6 backwards and
forwards compatible "sigrie" instruction to generate a Reserved
Instruction trap.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mips/include/ptrace.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/mips/include/ptrace.h
diff -u src/sys/arch/mips/include/ptrace.h:1.18 src/sys/arch/mips/include/ptrace.h:1.19
--- src/sys/arch/mips/include/ptrace.h:1.18	Sun Jul 26 08:08:41 2020
+++ src/sys/arch/mips/include/ptrace.h	Thu Mar 18 23:18:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.h,v 1.18 2020/07/26 08:08:41 simonb Exp $	*/
+/*	$NetBSD: ptrace.h,v 1.19 2021/03/18 23:18:36 simonb Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -67,6 +67,21 @@
 #define	PTRACE_REG_SP(r)	(r)->r_regs[29]
 #define	PTRACE_REG_INTRV(r)	(r)->r_regs[2]
 
+/*
+ * The sigrie is defined in the MIPS32r6 and MIPS64r6 specs to
+ * generate a Reserved Instruction trap but uses a previously
+ * reserved instruction encoding and is thus both backwards and
+ * forwards compatible.
+ */
+#define	PTRACE_ILLEGAL_ASM	do {	\
+		asm volatile(		\
+			".set	push;		"			\
+			".set	mips32r6;	"			\
+			"sigrie	0;		"			\
+			".set	pop;		"			\
+		);			\
+	} while (0);
+
 #define	PTRACE_BREAKPOINT	((const uint8_t[]) { 0x00, 0x00, 0x00, 0x0d })
 #define	PTRACE_BREAKPOINT_ASM	__asm __volatile("break")
 #define	PTRACE_BREAKPOINT_SIZE	4



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

2021-03-18 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Thu Mar 18 23:18:36 UTC 2021

Modified Files:
src/sys/arch/mips/include: ptrace.h

Log Message:
Add PTRACE_ILLEGAL_ASM using the MIPS32r6/MIPS64r6 backwards and
forwards compatible "sigrie" instruction to generate a Reserved
Instruction trap.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mips/include/ptrace.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/mips/include

2021-03-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar  2 08:16:53 UTC 2021

Modified Files:
src/sys/arch/mips/include: locore.h

Log Message:
Ensure the "memory" clobber is on inline assembly store operations

No binary change of note with this change in MALTA32


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/mips/include/locore.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/mips/include/locore.h
diff -u src/sys/arch/mips/include/locore.h:1.116 src/sys/arch/mips/include/locore.h:1.117
--- src/sys/arch/mips/include/locore.h:1.116	Sat Aug 22 09:08:21 2020
+++ src/sys/arch/mips/include/locore.h	Tue Mar  2 08:16:52 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.116 2020/08/22 09:08:21 simonb Exp $ */
+/* $NetBSD: locore.h,v 1.117 2021/03/02 08:16:52 skrll Exp $ */
 
 /*
  * This file should not be included by MI code!!!
@@ -539,7 +539,7 @@ static inline void
 mips_sb(register_t addr, uint8_t val)
 {
 #if defined(__mips_n32)
-	__asm volatile("sb\t%1, 0(%0)" :: "d"(addr), "r"(val));
+	__asm volatile("sb\t%1, 0(%0)" :: "d"(addr), "r"(val) : "memory");
 #else
 	*(volatile uint8_t *)addr = val;
 #endif
@@ -549,7 +549,7 @@ static inline void
 mips_sh(register_t addr, uint16_t val)
 {
 #if defined(__mips_n32)
-	__asm volatile("sh\t%1, 0(%0)" :: "d"(addr), "r"(val));
+	__asm volatile("sh\t%1, 0(%0)" :: "d"(addr), "r"(val) : "memory");
 #else
 	*(volatile uint16_t *)addr = val;
 #endif
@@ -559,7 +559,7 @@ static inline void
 mips_sw(register_t addr, uint32_t val)
 {
 #if defined(__mips_n32)
-	__asm volatile("sw\t%1, 0(%0)" :: "d"(addr), "r"(val));
+	__asm volatile("sw\t%1, 0(%0)" :: "d"(addr), "r"(val) : "memory");
 #else
 	*(volatile uint32_t *)addr = val;
 #endif
@@ -570,7 +570,7 @@ static inline void
 mips3_sd(register_t addr, uint64_t val)
 {
 #if defined(__mips_n32)
-	__asm volatile("sd\t%1, 0(%0)" :: "d"(addr), "r"(val));
+	__asm volatile("sd\t%1, 0(%0)" :: "d"(addr), "r"(val) : "memory");
 #else
 	*(volatile uint64_t *)addr = val;
 #endif



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

2021-03-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar  2 08:16:53 UTC 2021

Modified Files:
src/sys/arch/mips/include: locore.h

Log Message:
Ensure the "memory" clobber is on inline assembly store operations

No binary change of note with this change in MALTA32


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/mips/include/locore.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/mips/include

2021-02-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Feb 18 20:37:02 UTC 2021

Modified Files:
src/sys/arch/mips/include: profile.h

Log Message:
Revert previous... somehow the register names aren't available apparently


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mips/include/profile.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/mips/include

2021-02-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Feb 18 20:37:02 UTC 2021

Modified Files:
src/sys/arch/mips/include: profile.h

Log Message:
Revert previous... somehow the register names aren't available apparently


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mips/include/profile.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/mips/include/profile.h
diff -u src/sys/arch/mips/include/profile.h:1.24 src/sys/arch/mips/include/profile.h:1.25
--- src/sys/arch/mips/include/profile.h:1.24	Wed Feb 17 08:09:22 2021
+++ src/sys/arch/mips/include/profile.h	Thu Feb 18 20:37:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: profile.h,v 1.24 2021/02/17 08:09:22 skrll Exp $	*/
+/*	$NetBSD: profile.h,v 1.25 2021/02/18 20:37:02 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -57,7 +57,7 @@
 #ifdef _KERNEL
 # define _PROF_CPLOAD	""
 #else
-# define _PROF_CPLOAD	".cpload t9;"
+# define _PROF_CPLOAD	".cpload $25;"
 #endif
 
 



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

2021-02-18 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Thu Feb 18 12:28:02 UTC 2021

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
Add an abicalls version of asm mcount prologue.  XXX not tested because
profiled programs fail to link, but fixes build.  Thanks dholland@ for
help analysing this.

While here, rename _KERN_MCOUNT to _MIPS_ASM_MCOUNT - it's not kernel
specific.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/mips/include/asm.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/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.64 src/sys/arch/mips/include/asm.h:1.65
--- src/sys/arch/mips/include/asm.h:1.64	Tue Feb 16 06:06:58 2021
+++ src/sys/arch/mips/include/asm.h	Thu Feb 18 12:28:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.64 2021/02/16 06:06:58 simonb Exp $	*/
+/*	$NetBSD: asm.h,v 1.65 2021/02/18 12:28:01 simonb Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -76,9 +76,9 @@
 /*
  * The old ABI version must also decrement two less words off the
  * stack and the final addiu to t9 must always equal the size of this
- * _KERN_MCOUNT.
+ * _MIPS_ASM_MCOUNT.
  */
-#define	_KERN_MCOUNT		\
+#define	_MIPS_ASM_MCOUNT	\
 	.set	push;		\
 	.set	noreorder;	\
 	.set	noat;		\
@@ -98,9 +98,25 @@
 #else/* New (n32/n64) ABI */
 /*
  * The new ABI version just needs to put the return address in AT and
- * call _mcount().
+ * call _mcount().  For the no abicalls case, skip the reloc dance.
  */
-#define	_KERN_MCOUNT		\
+#ifdef __mips_abicalls
+#define	_MIPS_ASM_MCOUNT	\
+	.set	push;		\
+	.set	noreorder;	\
+	.set	noat;		\
+	subu	sp,16;		\
+	sw	t9,8(sp);	\
+	move	AT,ra;		\
+	lui	t9,%hi(_mcount); \
+	addiu	t9,t9,%lo(_mcount);\
+	jalr	t9;		\
+	 nop;			\
+	lw	t9,8(sp);	\
+	addiu	sp,16;		\
+	.set	pop;
+#else /* !__mips_abicalls */
+#define	_MIPS_ASM_MCOUNT	\
 	.set	push;		\
 	.set	noreorder;	\
 	.set	noat;		\
@@ -108,10 +124,11 @@
 	jal	_mcount;	\
 	 nop;			\
 	.set	pop;
+#endif /* !__mips_abicalls */
 #endif /* n32/n64 */
 
 #ifdef GPROF
-#define	MCOUNT _KERN_MCOUNT
+#define	MCOUNT _MIPS_ASM_MCOUNT
 #else
 #define	MCOUNT
 #endif



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

2021-02-18 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Thu Feb 18 12:28:02 UTC 2021

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
Add an abicalls version of asm mcount prologue.  XXX not tested because
profiled programs fail to link, but fixes build.  Thanks dholland@ for
help analysing this.

While here, rename _KERN_MCOUNT to _MIPS_ASM_MCOUNT - it's not kernel
specific.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/mips/include/asm.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/mips/include

2021-02-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 17 08:09:22 UTC 2021

Modified Files:
src/sys/arch/mips/include: profile.h

Log Message:
Use the register name and not its number in _PROF_CPLOAD.

"yes please!" from simon@


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mips/include/profile.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/mips/include/profile.h
diff -u src/sys/arch/mips/include/profile.h:1.23 src/sys/arch/mips/include/profile.h:1.24
--- src/sys/arch/mips/include/profile.h:1.23	Tue Feb 16 06:06:58 2021
+++ src/sys/arch/mips/include/profile.h	Wed Feb 17 08:09:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: profile.h,v 1.23 2021/02/16 06:06:58 simonb Exp $	*/
+/*	$NetBSD: profile.h,v 1.24 2021/02/17 08:09:22 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -57,7 +57,7 @@
 #ifdef _KERNEL
 # define _PROF_CPLOAD	""
 #else
-# define _PROF_CPLOAD	".cpload $25;"
+# define _PROF_CPLOAD	".cpload t9;"
 #endif
 
 



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

2021-02-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 17 08:09:22 UTC 2021

Modified Files:
src/sys/arch/mips/include: profile.h

Log Message:
Use the register name and not its number in _PROF_CPLOAD.

"yes please!" from simon@


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mips/include/profile.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/mips/include

2021-02-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Feb 16 05:11:27 UTC 2021

Modified Files:
src/sys/arch/mips/include: intr.h

Log Message:
Add no-profiled attribute for splhigh_noprof() and splx_noprof().


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/include/intr.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/mips/include

2021-02-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Feb 16 05:11:27 UTC 2021

Modified Files:
src/sys/arch/mips/include: intr.h

Log Message:
Add no-profiled attribute for splhigh_noprof() and splx_noprof().


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/include/intr.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/mips/include/intr.h
diff -u src/sys/arch/mips/include/intr.h:1.12 src/sys/arch/mips/include/intr.h:1.13
--- src/sys/arch/mips/include/intr.h:1.12	Mon Aug 17 14:17:49 2020
+++ src/sys/arch/mips/include/intr.h	Tue Feb 16 05:11:26 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.12 2020/08/17 14:17:49 skrll Exp $ */
+/* $NetBSD: intr.h,v 1.13 2021/02/16 05:11:26 simonb Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@ extern	struct ipl_sr_map ipl_sr_map;
 #endif /* __INTR_PRIVATE */
 
 int	splhigh(void);
-int	splhigh_noprof(void);
+int	__noprofile splhigh_noprof(void);
 int	splsched(void);
 int	splvm(void);
 int	splsoftserial(void);
@@ -134,7 +134,7 @@ int	splsoftbio(void);
 int	splsoftclock(void);
 int	splraise(int);
 void	splx(int);
-void	splx_noprof(int);
+void	__noprofile splx_noprof(int);
 void	spl0(void);
 int	splintr(uint32_t *);
 void	_setsoftintr(uint32_t);



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

2021-02-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Feb  4 08:51:42 UTC 2021

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
Use t9 instead of $25 in the SETUP_GP64 macro to hopefully make things
a bit clearer.  Same libc binary after.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/mips/include/asm.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/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.62 src/sys/arch/mips/include/asm.h:1.63
--- src/sys/arch/mips/include/asm.h:1.62	Sat Sep 26 08:19:11 2020
+++ src/sys/arch/mips/include/asm.h	Thu Feb  4 08:51:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.62 2020/09/26 08:19:11 simonb Exp $	*/
+/*	$NetBSD: asm.h,v 1.63 2021/02/04 08:51:42 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -619,7 +619,7 @@ _C_LABEL(x):
 #define	SETUP_GPX(r)		/* o32 specific */
 #define	SETUP_GPX_L(r,lbl)	/* o32 specific */
 #define	SAVE_GP(x)		/* o32 specific */
-#define	SETUP_GP64(a,b)		.cpsetup $25, a, b
+#define	SETUP_GP64(a,b)		.cpsetup t9, a, b
 #define	SETUP_GPX64(a,b)	\
 .set push;			\
 move	b,ra;			\



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

2021-02-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Feb  4 08:51:42 UTC 2021

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
Use t9 instead of $25 in the SETUP_GP64 macro to hopefully make things
a bit clearer.  Same libc binary after.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/mips/include/asm.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/mips/include

2020-12-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  6 03:46:23 UTC 2020

Modified Files:
src/sys/arch/mips/include: proc.h types.h

Log Message:
don't expose vaddr_t to userland.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mips/include/proc.h
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/mips/include/types.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/mips/include/proc.h
diff -u src/sys/arch/mips/include/proc.h:1.32 src/sys/arch/mips/include/proc.h:1.33
--- src/sys/arch/mips/include/proc.h:1.32	Fri Sep  4 04:17:53 2020
+++ src/sys/arch/mips/include/proc.h	Sat Dec  5 22:46:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.32 2020/09/04 08:17:53 mrg Exp $	*/
+/*	$NetBSD: proc.h,v 1.33 2020/12/06 03:46:23 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -49,7 +49,7 @@ struct trapframe;
 
 struct mdlwp {
 	struct trapframe *md_utf;	/* trapframe from userspace */
-	vaddr_t	md_ss_addr;		/* single step address for ptrace */
+	__vaddr_t md_ss_addr;		/* single step address for ptrace */
 	int	md_ss_instr;		/* single step instruction for ptrace */
 	volatile int md_astpending;	/* AST pending on return to userland */
 	int	md_upte[UPAGES_MAX];	/* ptes for mapping u page */
@@ -57,7 +57,7 @@ struct mdlwp {
 
 struct mdproc {
 	/* syscall entry for this process */
-	void	(*md_syscall)(struct lwp *, u_int, u_int, vaddr_t);
+	void	(*md_syscall)(struct lwp *, u_int, u_int, __vaddr_t);
 	int	md_abi;			/* which ABI is this process using? */
 };
 

Index: src/sys/arch/mips/include/types.h
diff -u src/sys/arch/mips/include/types.h:1.72 src/sys/arch/mips/include/types.h:1.73
--- src/sys/arch/mips/include/types.h:1.72	Sun Aug 16 23:19:35 2020
+++ src/sys/arch/mips/include/types.h	Sat Dec  5 22:46:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.72 2020/08/17 03:19:35 mrg Exp $	*/
+/*	$NetBSD: types.h,v 1.73 2020/12/06 03:46:23 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -64,6 +64,11 @@ typedef	__fpregister64_t	__fpregister_t;
  * the rest of the operating system as possible.
  */
 
+#ifdef _LP64
+typedef __uint64_t	__vaddr_t;
+#else
+typedef __uint32_t	__vaddr_t;
+#endif
 
 #if defined(_KERNEL) || defined(_KMEMUSER) || defined(_KERNTYPES) || defined(_STANDALONE)
 #if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64)



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

2020-12-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  6 03:46:23 UTC 2020

Modified Files:
src/sys/arch/mips/include: proc.h types.h

Log Message:
don't expose vaddr_t to userland.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mips/include/proc.h
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/mips/include/types.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/mips/include

2020-10-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct  3 09:56:00 UTC 2020

Modified Files:
src/sys/arch/mips/include: mcontext.h

Log Message:
Add missing __BEGIN_DECLS/__END_DECLS to force function declarations into
the "C" namespace.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mips/include/mcontext.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/mips/include/mcontext.h
diff -u src/sys/arch/mips/include/mcontext.h:1.23 src/sys/arch/mips/include/mcontext.h:1.24
--- src/sys/arch/mips/include/mcontext.h:1.23	Sun Jul 26 08:08:41 2020
+++ src/sys/arch/mips/include/mcontext.h	Sat Oct  3 09:56:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.23 2020/07/26 08:08:41 simonb Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.24 2020/10/03 09:56:00 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@@ -196,6 +196,8 @@ typedef struct {
 __CTASSERT(TLS_TP_OFFSET + sizeof(struct tls_tcb) < 0x8000);
 __CTASSERT(TLS_TP_OFFSET % sizeof(struct tls_tcb) == 0);
 
+__BEGIN_DECLS
+
 static __inline struct tls_tcb *
 __lwp_gettcb_fast(void)
 {
@@ -233,6 +235,7 @@ __lwp_settcb(struct tls_tcb *__tcb)
 	__tcb += TLS_TP_OFFSET / sizeof(*__tcb) + 1;
 	_lwp_setprivate(__tcb);
 }
+__END_DECLS
 #endif
 
 #endif	/* _MIPS_MCONTEXT_H_ */



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

2020-10-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct  3 09:56:00 UTC 2020

Modified Files:
src/sys/arch/mips/include: mcontext.h

Log Message:
Add missing __BEGIN_DECLS/__END_DECLS to force function declarations into
the "C" namespace.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mips/include/mcontext.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/mips/include

2020-09-26 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Sep 26 08:19:11 UTC 2020

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
Add EXPORT_OBJECT - export definition of symbol of symbol type Object,
visible to ksyms(4) address search.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mips/include/asm.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/mips/include

2020-09-26 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Sep 26 08:19:11 UTC 2020

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
Add EXPORT_OBJECT - export definition of symbol of symbol type Object,
visible to ksyms(4) address search.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mips/include/asm.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/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.61 src/sys/arch/mips/include/asm.h:1.62
--- src/sys/arch/mips/include/asm.h:1.61	Wed Aug 12 08:56:37 2020
+++ src/sys/arch/mips/include/asm.h	Sat Sep 26 08:19:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.61 2020/08/12 08:56:37 skrll Exp $	*/
+/*	$NetBSD: asm.h,v 1.62 2020/09/26 08:19:11 simonb Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -237,6 +237,14 @@ _C_LABEL(x):
 _C_LABEL(x):
 
 /*
+ * EXPORT_OBJECT -- export definition of symbol of symbol
+ * type Object, visible to ksyms(4) address search.
+ */
+#define	EXPORT_OBJECT(x)		\
+	EXPORT(x);			\
+	.type	_C_LABEL(x), @object;
+
+/*
  * VECTOR
  *	exception vector entrypoint
  *	XXX: regmask should be used to generate .mask



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

2020-09-25 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Sep 26 04:31:53 UTC 2020

Modified Files:
src/sys/arch/mips/include: pcb.h

Log Message:
Whitespace consistency nit.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mips/include/pcb.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/mips/include/pcb.h
diff -u src/sys/arch/mips/include/pcb.h:1.26 src/sys/arch/mips/include/pcb.h:1.27
--- src/sys/arch/mips/include/pcb.h:1.26	Mon Aug 17 04:15:33 2020
+++ src/sys/arch/mips/include/pcb.h	Sat Sep 26 04:31:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcb.h,v 1.26 2020/08/17 04:15:33 mrg Exp $	*/
+/*	$NetBSD: pcb.h,v 1.27 2020/09/26 04:31:53 simonb Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -57,7 +57,7 @@ struct pcb_faultinfo {
  */
 struct pcb {
 	mips_label_t pcb_context;	/* kernel context for resume */
-	void *	pcb_onfault;		/* for copyin/copyout faults */
+	void *pcb_onfault;		/* for copyin/copyout faults */
 	uint32_t pcb_ppl;		/* previous priority level */
 	struct fpreg pcb_fpregs;	/* saved floating point registers */
 	struct dspreg pcb_dspregs;	/* saved DSP registers */



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

2020-09-25 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Sep 26 04:31:53 UTC 2020

Modified Files:
src/sys/arch/mips/include: pcb.h

Log Message:
Whitespace consistency nit.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mips/include/pcb.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/mips/include

2020-09-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Sep  4 08:17:53 UTC 2020

Modified Files:
src/sys/arch/mips/include: proc.h

Log Message:
include machine/vmparam.h vs mips/vmparam.h to make sure we get
platform-specific defines first.

fixes build issue for playstation2.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mips/include/proc.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/mips/include/proc.h
diff -u src/sys/arch/mips/include/proc.h:1.31 src/sys/arch/mips/include/proc.h:1.32
--- src/sys/arch/mips/include/proc.h:1.31	Wed Aug 26 10:51:45 2020
+++ src/sys/arch/mips/include/proc.h	Fri Sep  4 08:17:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.31 2020/08/26 10:51:45 simonb Exp $	*/
+/*	$NetBSD: proc.h,v 1.32 2020/09/04 08:17:53 mrg Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -38,7 +38,7 @@
 #define	_MIPS_PROC_H_
 
 #include 
-#include 
+#include 
 
 struct lwp;
 



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

2020-09-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Sep  4 08:17:53 UTC 2020

Modified Files:
src/sys/arch/mips/include: proc.h

Log Message:
include machine/vmparam.h vs mips/vmparam.h to make sure we get
platform-specific defines first.

fixes build issue for playstation2.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mips/include/proc.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/mips/include

2020-08-26 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Aug 26 10:51:45 UTC 2020

Modified Files:
src/sys/arch/mips/include: mips_param.h proc.h

Log Message:
Define a UPAGES_MAX constant to size the a md_upte array in MIPS's
struct mdlwp.  This is exposed to userland, so we can't use something
based on PAGE_SIZE.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/mips/include/mips_param.h
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/mips/include/proc.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/mips/include/mips_param.h
diff -u src/sys/arch/mips/include/mips_param.h:1.46 src/sys/arch/mips/include/mips_param.h:1.47
--- src/sys/arch/mips/include/mips_param.h:1.46	Sun Aug 23 10:23:38 2020
+++ src/sys/arch/mips/include/mips_param.h	Wed Aug 26 10:51:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_param.h,v 1.46 2020/08/23 10:23:38 simonb Exp $	*/
+/*	$NetBSD: mips_param.h,v 1.47 2020/08/26 10:51:45 simonb Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -130,6 +130,7 @@
 #define	USPACE		MAX(__MIN_USPACE, PAGE_SIZE)
 #define	UPAGES		(USPACE / PAGE_SIZE) /* number of pages for u-area */
 #define	USPACE_ALIGN	USPACE		/* make sure it starts on a even VA */
+#define	UPAGES_MAX	8		/* a (constant) max for userland use */
 
 /*
  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized

Index: src/sys/arch/mips/include/proc.h
diff -u src/sys/arch/mips/include/proc.h:1.30 src/sys/arch/mips/include/proc.h:1.31
--- src/sys/arch/mips/include/proc.h:1.30	Sun Aug 23 10:23:38 2020
+++ src/sys/arch/mips/include/proc.h	Wed Aug 26 10:51:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.30 2020/08/23 10:23:38 simonb Exp $	*/
+/*	$NetBSD: proc.h,v 1.31 2020/08/26 10:51:45 simonb Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -52,7 +52,7 @@ struct mdlwp {
 	vaddr_t	md_ss_addr;		/* single step address for ptrace */
 	int	md_ss_instr;		/* single step instruction for ptrace */
 	volatile int md_astpending;	/* AST pending on return to userland */
-	int	md_upte[UPAGES];	/* ptes for mapping u page */
+	int	md_upte[UPAGES_MAX];	/* ptes for mapping u page */
 };
 
 struct mdproc {



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

2020-08-26 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Aug 26 10:51:45 UTC 2020

Modified Files:
src/sys/arch/mips/include: mips_param.h proc.h

Log Message:
Define a UPAGES_MAX constant to size the a md_upte array in MIPS's
struct mdlwp.  This is exposed to userland, so we can't use something
based on PAGE_SIZE.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/mips/include/mips_param.h
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/mips/include/proc.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/mips/include

2020-08-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Aug 22 09:08:21 UTC 2020

Modified Files:
src/sys/arch/mips/include: locore.h

Log Message:
Invert the MIPS-I non-4kB page size check.  The previous check doesn't
fail if both MIPS1 and MIPS3_PLUS are defined.  Explictly check against
MIPS1.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/mips/include/locore.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/mips/include/locore.h
diff -u src/sys/arch/mips/include/locore.h:1.115 src/sys/arch/mips/include/locore.h:1.116
--- src/sys/arch/mips/include/locore.h:1.115	Mon Aug 17 03:19:35 2020
+++ src/sys/arch/mips/include/locore.h	Sat Aug 22 09:08:21 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.115 2020/08/17 03:19:35 mrg Exp $ */
+/* $NetBSD: locore.h,v 1.116 2020/08/22 09:08:21 simonb Exp $ */
 
 /*
  * This file should not be included by MI code!!!
@@ -89,8 +89,8 @@ typedef uint32_t pt_entry_t;
 #undef MIPS3_PLUS
 #endif
 
-#if !defined(MIPS3_PLUS) && (ENABLE_MIPS_8KB_PAGE + ENABLE_MIPS_16KB_PAGE) > 0
-#error MIPS1 does not support non-4KB page sizes.
+#if defined(MIPS1) && (ENABLE_MIPS_8KB_PAGE + ENABLE_MIPS_16KB_PAGE) > 0
+#error MIPS1 only supports a 4kB page size.
 #endif
 
 /* XXX some .S files look for MIPS3_PLUS */



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

2020-08-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Aug 22 09:08:21 UTC 2020

Modified Files:
src/sys/arch/mips/include: locore.h

Log Message:
Invert the MIPS-I non-4kB page size check.  The previous check doesn't
fail if both MIPS1 and MIPS3_PLUS are defined.  Explictly check against
MIPS1.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/mips/include/locore.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/mips/include

2020-08-21 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Aug 22 03:41:33 UTC 2020

Modified Files:
src/sys/arch/mips/include: cpuregs.h

Log Message:
Remove bogus duplicate MIPS_COP_0_CONTEXT definition, it's not a MIPS32/64
specific reg and we already define MIPS_COP_0_TLB_CONTEXT elsewhere.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/mips/include/cpuregs.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/mips/include/cpuregs.h
diff -u src/sys/arch/mips/include/cpuregs.h:1.108 src/sys/arch/mips/include/cpuregs.h:1.109
--- src/sys/arch/mips/include/cpuregs.h:1.108	Sun Aug  2 23:04:23 2020
+++ src/sys/arch/mips/include/cpuregs.h	Sat Aug 22 03:41:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuregs.h,v 1.108 2020/08/02 23:04:23 simonb Exp $	*/
+/*	$NetBSD: cpuregs.h,v 1.109 2020/08/22 03:41:33 simonb Exp $	*/
 
 /*
  * Copyright (c) 2009 Miodrag Vallat.
@@ -615,7 +615,6 @@
 #define	MIPS_COP_0_ERROR_PC	_(30)
 
 /* MIPS32/64 */
-#define	MIPS_COP_0_CONTEXT	_(4)
 #define	MIPS_COP_0_CTXCONFIG	_(4), 1
 #define	MIPS_COP_0_USERLOCAL	_(4), 2
 #define	MIPS_COP_0_XCTXCONFIG	_(4), 3		/* MIPS64 */



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

2020-08-21 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Aug 22 03:41:33 UTC 2020

Modified Files:
src/sys/arch/mips/include: cpuregs.h

Log Message:
Remove bogus duplicate MIPS_COP_0_CONTEXT definition, it's not a MIPS32/64
specific reg and we already define MIPS_COP_0_TLB_CONTEXT elsewhere.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/mips/include/cpuregs.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/mips/include

2020-08-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Aug 17 14:17:49 UTC 2020

Modified Files:
src/sys/arch/mips/include: intr.h

Log Message:
Disable __HAVE_PREEMPTION.  It is currently marked

#if defined(MULTIPROCESSOR) && defined(__HAVE_FAST_SOFTINTS)

but has no chance of working on OCTEON due to at least the spl functions


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/include/intr.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/mips/include/intr.h
diff -u src/sys/arch/mips/include/intr.h:1.11 src/sys/arch/mips/include/intr.h:1.12
--- src/sys/arch/mips/include/intr.h:1.11	Sun Jul 26 08:08:41 2020
+++ src/sys/arch/mips/include/intr.h	Mon Aug 17 14:17:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.11 2020/07/26 08:08:41 simonb Exp $ */
+/* $NetBSD: intr.h,v 1.12 2020/08/17 14:17:49 skrll Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -112,10 +112,12 @@ typedef struct {
 
 #ifdef _KERNEL
 
+#if 0
 #if defined(MULTIPROCESSOR) && defined(__HAVE_FAST_SOFTINTS)
 #define	__HAVE_PREEMPTION	1
 #define	SOFTINT_KPREEMPT	(SOFTINT_COUNT+0)
 #endif
+#endif
 
 #ifdef __INTR_PRIVATE
 extern	struct splsw	mips_splsw;



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

2020-08-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Aug 17 14:17:49 UTC 2020

Modified Files:
src/sys/arch/mips/include: intr.h

Log Message:
Disable __HAVE_PREEMPTION.  It is currently marked

#if defined(MULTIPROCESSOR) && defined(__HAVE_FAST_SOFTINTS)

but has no chance of working on OCTEON due to at least the spl functions


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/include/intr.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/mips/include

2020-08-14 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Aug 15 04:27:28 UTC 2020

Modified Files:
src/sys/arch/mips/include: mips_opcode.h

Log Message:
Fix value for SCE/SWE instructions.
Problem noticed by mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mips/include/mips_opcode.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/mips/include/mips_opcode.h
diff -u src/sys/arch/mips/include/mips_opcode.h:1.22 src/sys/arch/mips/include/mips_opcode.h:1.23
--- src/sys/arch/mips/include/mips_opcode.h:1.22	Sun Jul 26 08:08:41 2020
+++ src/sys/arch/mips/include/mips_opcode.h	Sat Aug 15 04:27:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_opcode.h,v 1.22 2020/07/26 08:08:41 simonb Exp $	*/
+/*	$NetBSD: mips_opcode.h,v 1.23 2020/08/15 04:27:28 simonb Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -316,8 +316,8 @@ typedef union {
 #define	OP_CACHEE	033		/* EVA */
 #define	OP_SBE		034		/* EVA */
 #define	OP_SHE		035		/* EVA */
-#define	OP_SCE		035		/* EVA */
-#define	OP_SWE		035		/* EVA */
+#define	OP_SCE		036		/* EVA */
+#define	OP_SWE		037		/* EVA */
 #define	OP_BSHFL	040		/* MIPS32/64 r2 */
 #define	OP_SWLE		041		/* EVA */
 #define	OP_SWRE		042		/* EVA */



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

2020-08-14 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Aug 15 04:27:28 UTC 2020

Modified Files:
src/sys/arch/mips/include: mips_opcode.h

Log Message:
Fix value for SCE/SWE instructions.
Problem noticed by mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mips/include/mips_opcode.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/mips/include

2020-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Aug 12 08:56:37 UTC 2020

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
Provide assmebler versions of BITS(3) macros.  These are only good for
32 bit masks


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/mips/include/asm.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/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.60 src/sys/arch/mips/include/asm.h:1.61
--- src/sys/arch/mips/include/asm.h:1.60	Mon Aug 10 14:37:38 2020
+++ src/sys/arch/mips/include/asm.h	Wed Aug 12 08:56:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.60 2020/08/10 14:37:38 skrll Exp $	*/
+/*	$NetBSD: asm.h,v 1.61 2020/08/12 08:56:37 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -57,6 +57,13 @@
 #include 		/* for API selection */
 #include 
 
+#define	__BIT(n)	(1 << (n))
+#define	__BITS(hi,lo)	((~((~0)<<((hi)+1)))&((~0)<<(lo)))
+
+#define	__LOWEST_SET_BIT(__mask) __mask) - 1) & (__mask)) ^ (__mask))
+#define	__SHIFTOUT(__x, __mask) (((__x) & (__mask)) / __LOWEST_SET_BIT(__mask))
+#define	__SHIFTIN(__x, __mask) ((__x) * __LOWEST_SET_BIT(__mask))
+
 /*
  * Define -pg profile entry code.
  * Must always be noreorder, must never use a macro instruction



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

2020-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Aug 12 08:56:37 UTC 2020

Modified Files:
src/sys/arch/mips/include: asm.h

Log Message:
Provide assmebler versions of BITS(3) macros.  These are only good for
32 bit masks


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/mips/include/asm.h

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



  1   2   3   4   >