CVS commit: src/sys/arch/vax/boot/boot

2024-09-29 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Sep 30 00:59:26 UTC 2024

Modified Files:
src/sys/arch/vax/boot/boot: Makefile

Log Message:
vax/boot: XXX: Silence GCC12 -Warray-bounds for autoconf.c at the moment

OK rin@ (from rin@)


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/vax/boot/boot/Makefile

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



CVS commit: src/sys/arch/vax/boot/boot

2024-09-29 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Sep 30 00:59:26 UTC 2024

Modified Files:
src/sys/arch/vax/boot/boot: Makefile

Log Message:
vax/boot: XXX: Silence GCC12 -Warray-bounds for autoconf.c at the moment

OK rin@ (from rin@)


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/vax/boot/boot/Makefile

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/vax/boot/boot/Makefile
diff -u src/sys/arch/vax/boot/boot/Makefile:1.46 src/sys/arch/vax/boot/boot/Makefile:1.47
--- src/sys/arch/vax/boot/boot/Makefile:1.46	Mon Mar 19 17:29:08 2018
+++ src/sys/arch/vax/boot/boot/Makefile	Mon Sep 30 00:59:25 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.46 2018/03/19 17:29:08 ragge Exp $
+#	$NetBSD: Makefile,v 1.47 2024/09/30 00:59:25 kalvisd Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -51,4 +51,6 @@ install:
 VERSIONFLAGS+=-n
 .include "${S}/conf/newvers_stand.mk"
 
+COPTS.autoconf.c+=	${CC_WNO_ARRAY_BOUNDS}
+
 .include 



CVS commit: src/sys/arch/vax/boot/boot

2024-09-29 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Sep 30 00:35:49 UTC 2024

Modified Files:
src/sys/arch/vax/boot/boot: boot.c

Log Message:
vax/boot: loadpcs: Silence GCC12 -Warray-bounds for 0-th page accesss

as done for evbppc:

http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/sys/arch/evbppc/wii/mainbus.c#rev1.4

(from rin@)
OK rin@


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/vax/boot/boot/boot.c

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/vax/boot/boot/boot.c
diff -u src/sys/arch/vax/boot/boot/boot.c:1.34 src/sys/arch/vax/boot/boot/boot.c:1.35
--- src/sys/arch/vax/boot/boot/boot.c:1.34	Sat Jun 11 06:42:27 2016
+++ src/sys/arch/vax/boot/boot/boot.c	Mon Sep 30 00:35:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.34 2016/06/11 06:42:27 dholland Exp $ */
+/*	$NetBSD: boot.c,v 1.35 2024/09/30 00:35:49 kalvisd Exp $ */
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
  * All rights reserved.
@@ -317,6 +317,14 @@ loadpcs(void)
 	 * Load PCS microcode 20 bits at a time.
 	 */
 	ip = (int *)PCS_PCSADDR;
+
+	/*
+	 * XXXGCC12
+	 * GCC2 blames pointer access to 0-th page, [0, 0xfff] as
+	 * -Warray-bounds. Just silence as it is harmless.
+	 */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
 	jp = (int *)1024;
 	for (i=j=0; j < PCS_MICRONUM * 4; i+=20, j++) {
 		extzv(i,*jp,*ip++,20);
@@ -326,6 +334,8 @@ loadpcs(void)
 	 * Enable PCS.
 	 */
 	i = *jp;		/* get 1st 20 bits of microcode again */
+#pragma GCC diagnostic pop
+
 	i &= 0xf;
 	i |= PCS_ENABLE;	/* reload these bits with PCS enable set */
 	*((int *)PCS_PCSADDR) = i;



CVS commit: src/sys/arch/vax/boot/boot

2024-09-29 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Sep 30 00:35:49 UTC 2024

Modified Files:
src/sys/arch/vax/boot/boot: boot.c

Log Message:
vax/boot: loadpcs: Silence GCC12 -Warray-bounds for 0-th page accesss

as done for evbppc:

http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/sys/arch/evbppc/wii/mainbus.c#rev1.4

(from rin@)
OK rin@


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/vax/boot/boot/boot.c

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



CVS commit: src/sys/arch/vax/vsa

2024-09-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 30 00:34:05 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: gpx.c

Log Message:
vax/gpx: Stop copy{in,out}(9) from/to 0-length buffers

Found by GCC12 -Wmaybe-uninitialized.

Authored by kalvisd@.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/vax/vsa/gpx.c

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/vax/vsa/gpx.c
diff -u src/sys/arch/vax/vsa/gpx.c:1.3 src/sys/arch/vax/vsa/gpx.c:1.4
--- src/sys/arch/vax/vsa/gpx.c:1.3	Sat Feb  3 16:21:25 2024
+++ src/sys/arch/vax/vsa/gpx.c	Mon Sep 30 00:34:04 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpx.c,v 1.3 2024/02/03 16:21:25 tsutsui Exp $ */
+/*	$NetBSD: gpx.c,v 1.4 2024/09/30 00:34:04 rin Exp $ */
 /*	$OpenBSD: gpx.c,v 1.25 2014/12/23 21:39:12 miod Exp $	*/
 /*
  * Copyright (c) 2006 Miodrag Vallat.
@@ -1147,6 +1147,9 @@ gpx_getcmap(struct gpx_screen *ss, struc
 	if (index >= colcount || count > colcount - index)
 		return EINVAL;
 
+	if (count == 0)
+		return 0;
+
 	/* extract reds */
 	c = ss->ss_cmap + 0 + index * 3;
 	for (i = count, r = ramp; i != 0; i--)



CVS commit: src/sys/arch/vax/vsa

2024-09-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 30 00:34:05 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: gpx.c

Log Message:
vax/gpx: Stop copy{in,out}(9) from/to 0-length buffers

Found by GCC12 -Wmaybe-uninitialized.

Authored by kalvisd@.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/vax/vsa/gpx.c

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



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

2024-09-14 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep 14 21:38:28 UTC 2024

Modified Files:
src/sys/arch/vax/include: qduser.h

Log Message:
s/programmming/programming/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/vax/include/qduser.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/vax/include/qduser.h
diff -u src/sys/arch/vax/include/qduser.h:1.5 src/sys/arch/vax/include/qduser.h:1.6
--- src/sys/arch/vax/include/qduser.h:1.5	Mon Oct  9 18:42:59 2006
+++ src/sys/arch/vax/include/qduser.h	Sat Sep 14 21:38:28 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: qduser.h,v 1.5 2006/10/09 18:42:59 oster Exp $	*/
+/*	$NetBSD: qduser.h,v 1.6 2024/09/14 21:38:28 andvar Exp $	*/
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
  * All rights reserved.
@@ -396,7 +396,7 @@ struct qdinput {
 **/
 
 /*---
-* LK201 programmming definitions  */
+* LK201 programming definitions  */
 
 #define LK_UPDOWN 	0x86		/* bits for setting lk201 modes */
 #define LK_AUTODOWN 	0x82



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

2024-09-14 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep 14 21:38:28 UTC 2024

Modified Files:
src/sys/arch/vax/include: qduser.h

Log Message:
s/programmming/programming/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/vax/include/qduser.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/vax/conf

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:12:47 UTC 2024

Modified Files:
src/sys/arch/vax/conf: GENERIC

Log Message:
vax: GENERIC: Enable some features useful for full ATF runs:

- PUFFS and putter
- crypto and swcrypto


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/arch/vax/conf/GENERIC

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/vax/conf/GENERIC
diff -u src/sys/arch/vax/conf/GENERIC:1.219 src/sys/arch/vax/conf/GENERIC:1.220
--- src/sys/arch/vax/conf/GENERIC:1.219	Sun Feb 12 14:50:42 2023
+++ src/sys/arch/vax/conf/GENERIC	Sat Jun 29 07:12:47 2024
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.219 2023/02/12 14:50:42 abs Exp $
+# $NetBSD: GENERIC,v 1.220 2024/06/29 07:12:47 rin Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/vax/conf/std.vax"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.219 $"
+#ident 		"GENERIC-$Revision: 1.220 $"
 
 # Here are all different supported CPU types listed.
 #options 	VAX8800		# VAX 8500, 8530, 8550, 8700, 8800
@@ -100,6 +100,7 @@ file-system 	UMAPFS
 file-system 	UNION
 file-system 	CD9660
 file-system	PTYFS		# /dev/pts/N support
+file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
 file-system	TMPFS		# Efficient memory file-system
 #file-system	UDF		# experimental - OSTA UDF CD/DVD file-system
 
@@ -283,6 +284,11 @@ wskbd*		at lkkbd? console ?
 lkms0		at dz0 line 1
 wsmouse*	at lkms?
 
+pseudo-device	crypto			# /dev/crypto device
+pseudo-device	swcrypto		# software crypto implementation
+
+pseudo-device	putter			# for puffs and pud
+
 #
 # accept filters
 pseudo-device   accf_data		# "dataready" accept filter



CVS commit: src/sys/arch/vax/conf

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:12:47 UTC 2024

Modified Files:
src/sys/arch/vax/conf: GENERIC

Log Message:
vax: GENERIC: Enable some features useful for full ATF runs:

- PUFFS and putter
- crypto and swcrypto


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/arch/vax/conf/GENERIC

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



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

2024-05-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 17 22:21:17 UTC 2024

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

Log Message:
G/C MDP_AST -- it's not referenced anywhere.


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

2024-05-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 17 22:21:17 UTC 2024

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

Log Message:
G/C MDP_AST -- it's not referenced anywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/vax/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/vax/include/proc.h
diff -u src/sys/arch/vax/include/proc.h:1.15 src/sys/arch/vax/include/proc.h:1.16
--- src/sys/arch/vax/include/proc.h:1.15	Sun Jul  3 02:18:20 2011
+++ src/sys/arch/vax/include/proc.h	Fri May 17 22:21:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.15 2011/07/03 02:18:20 matt Exp $	*/
+/*	$NetBSD: proc.h,v 1.16 2024/05/17 22:21:17 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1991 Regents of the University of California.
@@ -51,9 +51,6 @@ struct mdproc {
 
 };
 
-/* md_flags */
-#define	MDP_AST		0x0001	/* async trap pending */
-
 /* kernel stack params */
 #define	KSTACK_LOWEST_ADDR(l)	\
 	((char *)(l)->l_addr + (REDZONEADDR + VAX_NBPG))



CVS commit: src/sys/arch/vax

2024-05-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 17 21:37:07 UTC 2024

Modified Files:
src/sys/arch/vax/include: mcontext.h
src/sys/arch/vax/vax: machdep.c sig_machdep.c

Log Message:
Implement _UC_SETSTACK / _UC_CLRSTACK.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/include/mcontext.h
cvs rdiff -u -r1.199 -r1.200 src/sys/arch/vax/vax/machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/vax/vax/sig_machdep.c

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/vax/include/mcontext.h
diff -u src/sys/arch/vax/include/mcontext.h:1.10 src/sys/arch/vax/include/mcontext.h:1.11
--- src/sys/arch/vax/include/mcontext.h:1.10	Fri Dec 27 00:32:17 2019
+++ src/sys/arch/vax/include/mcontext.h	Fri May 17 21:37:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.10 2019/12/27 00:32:17 kamil Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.11 2024/05/17 21:37:07 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -65,7 +65,9 @@ typedef struct {
 } mcontext_t;
 
 /* Machine-dependent uc_flags */
-#define _UC_TLSBASE	0x0008
+#define	_UC_SETSTACK	0x0001
+#define	_UC_CLRSTACK	0x0002
+#define	_UC_TLSBASE	0x0008
 
 #define	_UC_MACHINE_SP(uc)	((uc)->uc_mcontext.__gregs[_REG_SP])
 #define	_UC_MACHINE_FP(uc)	((uc)->uc_mcontext.__gregs[_REG_FP])

Index: src/sys/arch/vax/vax/machdep.c
diff -u src/sys/arch/vax/vax/machdep.c:1.199 src/sys/arch/vax/vax/machdep.c:1.200
--- src/sys/arch/vax/vax/machdep.c:1.199	Tue Mar  5 14:15:36 2024
+++ src/sys/arch/vax/vax/machdep.c	Fri May 17 21:37:07 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.199 2024/03/05 14:15:36 thorpej Exp $	 */
+/* $NetBSD: machdep.c,v 1.200 2024/05/17 21:37:07 thorpej Exp $	 */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.199 2024/03/05 14:15:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.200 2024/05/17 21:37:07 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -696,6 +696,14 @@ cpu_setmcontext(struct lwp *l, const mco
 		lwp_setprivate(l, tlsbase);
 		tf->tf_sp += sizeof(tlsbase);
 	}
+
+	mutex_enter(l->l_proc->p_lock);
+	if (flags & _UC_SETSTACK)
+		l->l_sigstk.ss_flags |= SS_ONSTACK;
+	if (flags & _UC_CLRSTACK)
+		l->l_sigstk.ss_flags &= ~SS_ONSTACK;
+	mutex_exit(l->l_proc->p_lock);
+
 	return 0;
 }
 

Index: src/sys/arch/vax/vax/sig_machdep.c
diff -u src/sys/arch/vax/vax/sig_machdep.c:1.26 src/sys/arch/vax/vax/sig_machdep.c:1.27
--- src/sys/arch/vax/vax/sig_machdep.c:1.26	Mon Nov  1 05:07:16 2021
+++ src/sys/arch/vax/vax/sig_machdep.c	Fri May 17 21:37:07 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: sig_machdep.c,v 1.26 2021/11/01 05:07:16 thorpej Exp $	 */
+/* $NetBSD: sig_machdep.c,v 1.27 2024/05/17 21:37:07 thorpej Exp $	 */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.26 2021/11/01 05:07:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.27 2024/05/17 21:37:07 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -171,6 +171,8 @@ setupstack_siginfo3(const struct ksiginf
 	uc.uc_flags = _UC_SIGMASK;
 	uc.uc_sigmask = *mask;
 	uc.uc_link = l->l_ctxlink;
+	uc.uc_flags |= (l->l_sigstk.ss_flags & SS_ONSTACK)
+	? _UC_SETSTACK : _UC_CLRSTACK;
 	sendsig_reset(l, ksi->ksi_signo);
 	mutex_exit(p->p_lock);
 	cpu_getmcontext(l, &uc.uc_mcontext, &uc.uc_flags);



CVS commit: src/sys/arch/vax

2024-05-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 17 21:37:07 UTC 2024

Modified Files:
src/sys/arch/vax/include: mcontext.h
src/sys/arch/vax/vax: machdep.c sig_machdep.c

Log Message:
Implement _UC_SETSTACK / _UC_CLRSTACK.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/include/mcontext.h
cvs rdiff -u -r1.199 -r1.200 src/sys/arch/vax/vax/machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/vax/vax/sig_machdep.c

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



CVS commit: src/sys/arch/vax/vax

2024-04-15 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Tue Apr 16 00:03:30 UTC 2024

Modified Files:
src/sys/arch/vax/vax: unimpl_emul.S

Log Message:
vax/unimpl_emul.S: Initialise locations storing floating-point values with
a constant of the appropriate format


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/vax/vax/unimpl_emul.S

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

Modified files:

Index: src/sys/arch/vax/vax/unimpl_emul.S
diff -u src/sys/arch/vax/vax/unimpl_emul.S:1.4 src/sys/arch/vax/vax/unimpl_emul.S:1.5
--- src/sys/arch/vax/vax/unimpl_emul.S:1.4	Mon May 22 16:53:05 2017
+++ src/sys/arch/vax/vax/unimpl_emul.S	Tue Apr 16 00:03:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: unimpl_emul.S,v 1.4 2017/05/22 16:53:05 ragge Exp $	*/
+/*	$NetBSD: unimpl_emul.S,v 1.5 2024/04/16 00:03:30 kalvisd Exp $	*/
 
 /*
  * Copyright (c) 2001 Brandon Creighton.  All rights reserved.
@@ -683,7 +683,7 @@ emodd:	bsbw	touser
 	 * there aren't any bits left for the fraction.  Therefore we're
 	 * done here;  TMPFRAC1 is equal to TMPFRACTGT and TMPFRAC2 is 0.
 	 */
-	movq $0f0.0, TMPFRAC2
+	movq $0d0.0, TMPFRAC2
 	jmp 9f		/* we're done, move on */
 1:	
 	/*
@@ -727,7 +727,7 @@ emodd:	bsbw	touser
 	 * We are less than 1.0; TMPFRAC1 should be 0, and TMPFRAC2 should
 	 * be equal to TMPFRACTGT.
 	 */
-	movd $0f0.0, TMPFRAC1
+	movd $0d0.0, TMPFRAC1
 	movd TMPFRACTGT, TMPFRAC2
 9:			
 	/*
@@ -763,7 +763,7 @@ zeroexit:
 	bsbw getaddr_byte
 	movl $0x0, (%r0)
 	bsbw getaddr_byte
-	movd $0f0, (%r0)
+	movd $0d0, (%r0)
 	brw goback
 
 



CVS commit: src/sys/arch/vax/vax

2024-04-15 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Tue Apr 16 00:03:30 UTC 2024

Modified Files:
src/sys/arch/vax/vax: unimpl_emul.S

Log Message:
vax/unimpl_emul.S: Initialise locations storing floating-point values with
a constant of the appropriate format


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/vax/vax/unimpl_emul.S

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



CVS commit: src/sys/arch/vax/vsa

2024-02-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 17 17:41:43 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: ncr.c vsbus.c

Log Message:
Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
 https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.  Should be pulled up to netbsd-10 and -9.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/vax/vsa/ncr.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/vax/vsa/vsbus.c

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/vax/vsa/ncr.c
diff -u src/sys/arch/vax/vsa/ncr.c:1.51 src/sys/arch/vax/vsa/ncr.c:1.52
--- src/sys/arch/vax/vsa/ncr.c:1.51	Wed Dec 20 15:34:46 2023
+++ src/sys/arch/vax/vsa/ncr.c	Sat Feb 17 17:41:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ncr.c,v 1.51 2023/12/20 15:34:46 thorpej Exp $	*/
+/*	$NetBSD: ncr.c,v 1.52 2024/02/17 17:41:43 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ncr.c,v 1.51 2023/12/20 15:34:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ncr.c,v 1.52 2024/02/17 17:41:43 tsutsui Exp $");
 
 #include 
 #include 
@@ -66,6 +66,7 @@ __KERNEL_RCSID(0, "$NetBSD: ncr.c,v 1.51
 #include 
 #include 
 #include 
+#include 
 
 #include "ioconf.h"
 
@@ -208,6 +209,16 @@ si_vsbus_attach(device_t parent, device_
 	else
 		target = (clk_page[0xbc/2] >> tweak) & 7;
 
+	/*
+	 * Explicitly enable upto 128KB "Big DMA" on KA420.
+	 * (It looks KA420 firmware doesn't enable it on network boot)
+	 */
+#define STC_MODE_OFF	(KA420_STC_MODE - KA420_SCS_BASE)
+	if (vax_boardtype == VAX_BTYP_420) {
+		bus_space_write_1(ncr_sc->sc_regt, ncr_sc->sc_regh,
+		STC_MODE_OFF, 1);
+	}
+
 	aprint_normal("\n");
 	aprint_normal_dev(self, "NCR5380, SCSI ID %d\n", target);
 

Index: src/sys/arch/vax/vsa/vsbus.c
diff -u src/sys/arch/vax/vsa/vsbus.c:1.68 src/sys/arch/vax/vsa/vsbus.c:1.69
--- src/sys/arch/vax/vsa/vsbus.c:1.68	Mon Dec 12 18:22:32 2022
+++ src/sys/arch/vax/vsa/vsbus.c	Sat Feb 17 17:41:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vsbus.c,v 1.68 2022/12/12 18:22:32 jakllsch Exp $ */
+/*	$NetBSD: vsbus.c,v 1.69 2024/02/17 17:41:43 tsutsui Exp $ */
 /*
  * Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.68 2022/12/12 18:22:32 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.69 2024/02/17 17:41:43 tsutsui Exp $");
 
 #include "opt_cputype.h"
 
@@ -146,7 +146,6 @@ vsbus_attach(device_t parent, device_t s
 		} else {
 			dbase = KA420_DMA_BASE;
 			dsize = KA420_DMA_SIZE;
-			*(volatile char *)(sc->sc_vsregs + 0xe0) = 1; /* Big DMA */
 		}
 		sc->sc_dmasize = dsize;
 		sc->sc_dmaaddr = uvm_km_alloc(kernel_map, dsize, 0,



CVS commit: src/sys/arch/vax/vsa

2024-02-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 17 17:41:43 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: ncr.c vsbus.c

Log Message:
Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
 https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.  Should be pulled up to netbsd-10 and -9.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/vax/vsa/ncr.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/vax/vsa/vsbus.c

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



CVS commit: src/sys/arch/vax/vsa

2024-02-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb  3 16:35:10 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: smg.c

Log Message:
Misc cleanup.

- move function declarations after struct declarations and
  before global variables
- sort function declarations per actual implementation
- some KNF

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/vax/vsa/smg.c

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/vax/vsa/smg.c
diff -u src/sys/arch/vax/vsa/smg.c:1.66 src/sys/arch/vax/vsa/smg.c:1.67
--- src/sys/arch/vax/vsa/smg.c:1.66	Thu Jan 25 19:12:49 2024
+++ src/sys/arch/vax/vsa/smg.c	Sat Feb  3 16:35:10 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: smg.c,v 1.66 2024/01/25 19:12:49 tsutsui Exp $ */
+/*	$NetBSD: smg.c,v 1.67 2024/02/03 16:35:10 tsutsui Exp $ */
 /*	$OpenBSD: smg.c,v 1.28 2014/12/23 21:39:12 miod Exp $	*/
 /*
  * Copyright (c) 2006, Miodrag Vallat
@@ -117,7 +117,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smg.c,v 1.66 2024/01/25 19:12:49 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smg.c,v 1.67 2024/02/03 16:35:10 tsutsui Exp $");
 
 #include "dzkbd.h"
 #include "wsdisplay.h"
@@ -153,9 +153,6 @@ __KERNEL_RCSID(0, "$NetBSD: smg.c,v 1.66
 #define CUR_XBIAS	216	/* Add to cursor position */
 #define CUR_YBIAS	33
 
-static int	smg_match(device_t, cfdata_t, void *);
-static void	smg_attach(device_t, device_t, void *);
-
 struct	smg_screen {
 	struct rasops_info ss_ri;
 	uint8_t		*ss_addr;		/* frame buffer address */
@@ -166,15 +163,39 @@ struct	smg_screen {
 	uint16_t	ss_curmask[PCC_CURSOR_SIZE];
 };
 
-/* for console */
-static struct smg_screen smg_consscr;
-
 struct	smg_softc {
 	device_t sc_dev;
 	struct smg_screen *sc_scr;
 	int	sc_nscreens;
 };
 
+static int	smg_match(device_t, cfdata_t, void *);
+static void	smg_attach(device_t, device_t, void *);
+
+static int smg_setup_screen(struct smg_screen *);
+
+static int smg_ioctl(void *, void *, u_long, void *, int, struct lwp *);
+static paddr_t smg_mmap(void *, void *, off_t, int);
+static int smg_alloc_screen(void *, const struct wsscreen_descr *,
+void **, int *, int *, long *);
+static void smg_free_screen(void *, void *);
+static int smg_show_screen(void *, void *, int, void (*) (void *, int, int),
+void *);
+
+static int smg_getcursor(struct smg_screen *, struct wsdisplay_cursor *);
+static int smg_setcursor(struct smg_screen *, struct wsdisplay_cursor *);
+static void smg_updatecursor(struct smg_screen *, u_int);
+
+static void smg_putchar(void *, int, int, u_int, long);
+static void smg_cursor(void *, int, int, int);
+static void smg_blockmove(struct rasops_info *, u_int, u_int, u_int, u_int,
+u_int, int);
+static void smg_copycols(void *, int, int, int, int);
+static void smg_erasecols(void *, int, int, int, long);
+
+/* for console */
+static struct smg_screen smg_consscr;
+
 CFATTACH_DECL_NEW(smg, sizeof(struct smg_softc),
 smg_match, smg_attach, NULL, NULL);
 
@@ -191,14 +212,6 @@ static const struct wsscreen_list smg_sc
 	.screens = _smg_scrlist,
 };
 
-static int smg_ioctl(void *, void *, u_long, void *, int, struct lwp *);
-static paddr_t smg_mmap(void *, void *, off_t, int);
-static int smg_alloc_screen(void *, const struct wsscreen_descr *,
-void **, int *, int *, long *);
-static void smg_free_screen(void *, void *);
-static int smg_show_screen(void *, void *, int, void (*) (void *, int, int),
-void *);
-
 static const struct wsdisplay_accessops smg_accessops = {
 	.ioctl = smg_ioctl,
 	.mmap = smg_mmap,
@@ -208,18 +221,6 @@ static const struct wsdisplay_accessops 
 	.load_font = NULL
 };
 
-static void smg_putchar(void *, int, int, u_int, long);
-static void smg_cursor(void *, int, int, int);
-static void smg_blockmove(struct rasops_info *, u_int, u_int, u_int, u_int,
-u_int, int);
-static void smg_copycols(void *, int, int, int, int);
-static void smg_erasecols(void *, int, int, int, long);
-
-static int smg_getcursor(struct smg_screen *, struct wsdisplay_cursor *);
-static int smg_setup_screen(struct smg_screen *);
-static int smg_setcursor(struct smg_screen *, struct wsdisplay_cursor *);
-static void smg_updatecursor(struct smg_screen *, u_int);
-
 static int
 smg_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -843,7 +844,8 @@ smg_blockmove(struct rasops_info *ri, u_
 
 if (startmask) {
 	getandputrop(psrc, (sx & ALIGNMASK),
-	(dx & ALIGNMASK), nstart, pdst, rop);
+	(dx & ALIGNMASK), nstart, pdst,
+	rop);
 	pdst++;
 	if (srcStartOver)
 		psrc++;



CVS commit: src/sys/arch/vax/vsa

2024-02-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb  3 16:35:10 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: smg.c

Log Message:
Misc cleanup.

- move function declarations after struct declarations and
  before global variables
- sort function declarations per actual implementation
- some KNF

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/vax/vsa/smg.c

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



CVS commit: src/sys/arch/vax/vsa

2024-02-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb  3 16:21:25 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: gpx.c

Log Message:
Make local variables static.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/vax/vsa/gpx.c

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/vax/vsa/gpx.c
diff -u src/sys/arch/vax/vsa/gpx.c:1.2 src/sys/arch/vax/vsa/gpx.c:1.3
--- src/sys/arch/vax/vsa/gpx.c:1.2	Sat Feb  3 16:18:10 2024
+++ src/sys/arch/vax/vsa/gpx.c	Sat Feb  3 16:21:25 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpx.c,v 1.2 2024/02/03 16:18:10 tsutsui Exp $ */
+/*	$NetBSD: gpx.c,v 1.3 2024/02/03 16:21:25 tsutsui Exp $ */
 /*	$OpenBSD: gpx.c,v 1.25 2014/12/23 21:39:12 miod Exp $	*/
 /*
  * Copyright (c) 2006 Miodrag Vallat.
@@ -230,25 +230,25 @@ static void gpx_loadcmap(struct gpx_scre
 static void gpx_resetcmap(struct gpx_screen *);
 
 /* for console */
-struct gpx_screen gpx_consscr;
+static struct gpx_screen gpx_consscr;
 
 CFATTACH_DECL_NEW(gpx, sizeof(struct gpx_softc),
 gpx_match, gpx_attach, NULL, NULL);
 
-struct wsscreen_descr gpx_stdscreen = {
+static struct wsscreen_descr gpx_stdscreen = {
 	"std",
 };
 
-const struct wsscreen_descr *_gpx_scrlist[] = {
+static const struct wsscreen_descr *_gpx_scrlist[] = {
 	&gpx_stdscreen,
 };
 
-const struct wsscreen_list gpx_screenlist = {
+static const struct wsscreen_list gpx_screenlist = {
 	sizeof(_gpx_scrlist) / sizeof(struct wsscreen_descr *),
 	_gpx_scrlist,
 };
 
-const struct wsdisplay_accessops gpx_accessops = {
+static const struct wsdisplay_accessops gpx_accessops = {
 	.ioctl = gpx_ioctl,
 	.mmap = gpx_mmap,
 	.alloc_screen = gpx_alloc_screen,



CVS commit: src/sys/arch/vax/vsa

2024-02-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb  3 16:21:25 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: gpx.c

Log Message:
Make local variables static.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/vax/vsa/gpx.c

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



CVS commit: src/sys/arch/vax/vsa

2024-02-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb  3 16:18:10 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: gpx.c

Log Message:
Misc cleanup.

- move function declarations after struct declarations and
  before global variables
- sort function declarations per actual implementation
- explicitly denote 'static' for static functions
- some KNF

No functional change (though gcc generates different binary).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/vax/vsa/gpx.c

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/vax/vsa/gpx.c
diff -u src/sys/arch/vax/vsa/gpx.c:1.1 src/sys/arch/vax/vsa/gpx.c:1.2
--- src/sys/arch/vax/vsa/gpx.c:1.1	Mon Feb  6 13:13:05 2023
+++ src/sys/arch/vax/vsa/gpx.c	Sat Feb  3 16:18:10 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpx.c,v 1.1 2023/02/06 13:13:05 tsutsui Exp $ */
+/*	$NetBSD: gpx.c,v 1.2 2024/02/03 16:18:10 tsutsui Exp $ */
 /*	$OpenBSD: gpx.c,v 1.25 2014/12/23 21:39:12 miod Exp $	*/
 /*
  * Copyright (c) 2006 Miodrag Vallat.
@@ -178,9 +178,6 @@ struct	ramdac8 {
 	uint16_t	omapdata;
 };
 
-static int gpx_match(device_t, cfdata_t, void *);
-static void gpx_attach(device_t, device_t, void *);
-
 struct	gpx_screen {
 	struct rasops_info ss_ri;
 	int		ss_console;
@@ -195,15 +192,46 @@ struct	gpx_screen {
 #endif
 };
 
-/* for console */
-struct gpx_screen gpx_consscr;
-
 struct	gpx_softc {
 	device_t sc_dev;
 	struct gpx_screen *sc_scr;
 	int	sc_nscreens;
 };
 
+static int gpx_match(device_t, cfdata_t, void *);
+static void gpx_attach(device_t, device_t, void *);
+
+static int gpx_ioctl(void *, void *, u_long, void *, int, struct lwp *);
+static paddr_t gpx_mmap(void *, void *, off_t, int);
+static int gpx_alloc_screen(void *, const struct wsscreen_descr *,
+void **, int *, int *, long *);
+static void gpx_free_screen(void *, void *);
+static int gpx_show_screen(void *, void *, int,
+void (*) (void *, int, int), void *);
+
+static void gpx_putchar(void *, int, int, u_int, long);
+static void gpx_copycols(void *, int, int, int, int);
+static void gpx_erasecols(void *, int, int, int, long);
+static void gpx_copyrows(void *, int, int, int);
+static void gpx_eraserows(void *, int, int, long);
+static void gpx_do_cursor(struct rasops_info *);
+
+static int gpx_wait(struct gpx_screen *, int);
+static int gpx_viper_write(struct gpx_screen *, u_int, uint16_t);
+static void gpx_reset_viper(struct gpx_screen *);
+static void gpx_clear_screen(struct gpx_screen *);
+static int gpx_setup_screen(struct gpx_screen *);
+static void gpx_upload_font(struct gpx_screen *);
+static void gpx_copyrect(struct gpx_screen *, int, int, int, int, int, int);
+static void gpx_fillrect(struct gpx_screen *, int, int, int, int, long, u_int);
+static int gpx_getcmap(struct gpx_screen *, struct wsdisplay_cmap *);
+static int gpx_putcmap(struct gpx_screen *, struct wsdisplay_cmap *);
+static void gpx_loadcmap(struct gpx_screen *, int, int);
+static void gpx_resetcmap(struct gpx_screen *);
+
+/* for console */
+struct gpx_screen gpx_consscr;
+
 CFATTACH_DECL_NEW(gpx, sizeof(struct gpx_softc),
 gpx_match, gpx_attach, NULL, NULL);
 
@@ -220,14 +248,6 @@ const struct wsscreen_list gpx_screenlis
 	_gpx_scrlist,
 };
 
-static int gpx_ioctl(void *, void *, u_long, void *, int, struct lwp *);
-static paddr_t gpx_mmap(void *, void *, off_t, int);
-static int gpx_alloc_screen(void *, const struct wsscreen_descr *,
-void **, int *, int *, long *);
-static void gpx_free_screen(void *, void *);
-static int gpx_show_screen(void *, void *, int,
-void (*) (void *, int, int), void *);
-
 const struct wsdisplay_accessops gpx_accessops = {
 	.ioctl = gpx_ioctl,
 	.mmap = gpx_mmap,
@@ -237,31 +257,11 @@ const struct wsdisplay_accessops gpx_acc
 	.load_font = NULL
 };
 
-static void gpx_clear_screen(struct gpx_screen *);
-static void gpx_copyrect(struct gpx_screen *, int, int, int, int, int, int);
-static void gpx_fillrect(struct gpx_screen *, int, int, int, int, long, u_int);
-static int gpx_getcmap(struct gpx_screen *, struct wsdisplay_cmap *);
-static void gpx_loadcmap(struct gpx_screen *, int, int);
-static int gpx_putcmap(struct gpx_screen *, struct wsdisplay_cmap *);
-static void gpx_resetcmap(struct gpx_screen *);
-static void gpx_reset_viper(struct gpx_screen *);
-static int gpx_setup_screen(struct gpx_screen *);
-static void gpx_upload_font(struct gpx_screen *);
-static int gpx_viper_write(struct gpx_screen *, u_int, uint16_t);
-static int gpx_wait(struct gpx_screen *, int);
-
-static void gpx_copycols(void *, int, int, int, int);
-static void gpx_copyrows(void *, int, int, int);
-static void gpx_do_cursor(struct rasops_info *);
-static void gpx_erasecols(void *, int, int, int, long);
-static void gpx_eraserows(void *, int, int, long);
-static void gpx_putchar(void *, int, int, u_int, long);
-
 /*
  * Autoconf glue
  */
 
-int
+static int
 gpx_match(device_t pare

CVS commit: src/sys/arch/vax/vsa

2024-02-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb  3 16:18:10 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: gpx.c

Log Message:
Misc cleanup.

- move function declarations after struct declarations and
  before global variables
- sort function declarations per actual implementation
- explicitly denote 'static' for static functions
- some KNF

No functional change (though gcc generates different binary).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/vax/vsa/gpx.c

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



CVS commit: src/sys/arch/vax/vsa

2024-01-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Jan 25 19:12:49 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: smg.c

Log Message:
Fix mmap(2) address for smg(4) as other framebuffers.

Now X.org server can render onto framebuffer (but inverted bitorder).
Should be pulled up to netbsd-10 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/vax/vsa/smg.c

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/vax/vsa/smg.c
diff -u src/sys/arch/vax/vsa/smg.c:1.65 src/sys/arch/vax/vsa/smg.c:1.66
--- src/sys/arch/vax/vsa/smg.c:1.65	Sun Mar 26 15:12:34 2023
+++ src/sys/arch/vax/vsa/smg.c	Thu Jan 25 19:12:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: smg.c,v 1.65 2023/03/26 15:12:34 andvar Exp $ */
+/*	$NetBSD: smg.c,v 1.66 2024/01/25 19:12:49 tsutsui Exp $ */
 /*	$OpenBSD: smg.c,v 1.28 2014/12/23 21:39:12 miod Exp $	*/
 /*
  * Copyright (c) 2006, Miodrag Vallat
@@ -117,7 +117,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smg.c,v 1.65 2023/03/26 15:12:34 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smg.c,v 1.66 2024/01/25 19:12:49 tsutsui Exp $");
 
 #include "dzkbd.h"
 #include "wsdisplay.h"
@@ -475,7 +475,7 @@ smg_mmap(void *v, void *vs, off_t offset
 	if (offset >= SMSIZE || offset < 0)
 		return -1;
 
-	return SMADDR + offset;
+	return (SMADDR + offset) >> PGSHIFT;
 }
 
 static int



CVS commit: src/sys/arch/vax/vsa

2024-01-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Jan 25 19:12:49 UTC 2024

Modified Files:
src/sys/arch/vax/vsa: smg.c

Log Message:
Fix mmap(2) address for smg(4) as other framebuffers.

Now X.org server can render onto framebuffer (but inverted bitorder).
Should be pulled up to netbsd-10 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/vax/vsa/smg.c

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



CVS commit: src/sys/arch/vax/conf

2024-01-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Jan 17 16:33:56 UTC 2024

Modified Files:
src/sys/arch/vax/conf: files.vax

Log Message:
Add missed "rasops1" attribute to smg(4) rasops'fied a year ago.

This fixes silent boot failure on VS3100 with smg(4) framebuffer console.
Should be pulled up to netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/vax/conf/files.vax

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/vax/conf/files.vax
diff -u src/sys/arch/vax/conf/files.vax:1.126 src/sys/arch/vax/conf/files.vax:1.127
--- src/sys/arch/vax/conf/files.vax:1.126	Mon Feb  6 13:13:05 2023
+++ src/sys/arch/vax/conf/files.vax	Wed Jan 17 16:33:56 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.vax,v 1.126 2023/02/06 13:13:05 tsutsui Exp $
+#	$NetBSD: files.vax,v 1.127 2024/01/17 16:33:56 tsutsui Exp $
 #
 # new style config file for vax architecture
 #
@@ -186,7 +186,7 @@ file	arch/vax/vsa/ncr.c		si_vsbus
 include "dev/ata/files.ata"
 
 # Monochrome framebuffer on VS3100.
-device	smg: displaydev, wsemuldisplaydev
+device	smg: displaydev, wsemuldisplaydev, rasops1
 attach	smg at vsbus
 file	arch/vax/vsa/smg.c		smg needs-flag
 



CVS commit: src/sys/arch/vax/conf

2024-01-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Jan 17 16:33:56 UTC 2024

Modified Files:
src/sys/arch/vax/conf: files.vax

Log Message:
Add missed "rasops1" attribute to smg(4) rasops'fied a year ago.

This fixes silent boot failure on VS3100 with smg(4) framebuffer console.
Should be pulled up to netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/vax/conf/files.vax

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



CVS commit: src/sys/arch/vax/vax

2024-01-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 11 04:33:45 UTC 2024

Modified Files:
src/sys/arch/vax/vax: machdep.c

Log Message:
vax: set default RLIMIT_AS to the same as MAXDSIZ

this allows modern GCC to run without returning to the issues that
reported in PR#28379, and avoids a strange sort-of-invariant violation
where the rlimit for data equaled the rlimit for all address space, so
there is no room for text or stack etc.

ok ragge@

XXX: pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/vax/vax/machdep.c

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



CVS commit: src/sys/arch/vax/vax

2024-01-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 11 04:33:45 UTC 2024

Modified Files:
src/sys/arch/vax/vax: machdep.c

Log Message:
vax: set default RLIMIT_AS to the same as MAXDSIZ

this allows modern GCC to run without returning to the issues that
reported in PR#28379, and avoids a strange sort-of-invariant violation
where the rlimit for data equaled the rlimit for all address space, so
there is no room for text or stack etc.

ok ragge@

XXX: pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/vax/vax/machdep.c

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/vax/vax/machdep.c
diff -u src/sys/arch/vax/vax/machdep.c:1.197 src/sys/arch/vax/vax/machdep.c:1.198
--- src/sys/arch/vax/vax/machdep.c:1.197	Fri Jan  5 17:29:29 2024
+++ src/sys/arch/vax/vax/machdep.c	Thu Jan 11 04:33:45 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.197 2024/01/05 17:29:29 hans Exp $	 */
+/* $NetBSD: machdep.c,v 1.198 2024/01/11 04:33:45 mrg Exp $	 */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.197 2024/01/05 17:29:29 hans Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.198 2024/01/11 04:33:45 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -773,6 +773,6 @@ mm_md_readwrite(dev_t dev, struct uio *u
 void
 machdep_init(void)
 {
-	proc0.p_rlimit[RLIMIT_AS].rlim_cur = DFLDSIZ;
+	proc0.p_rlimit[RLIMIT_AS].rlim_cur = MAXDSIZ;
 	proc0.p_rlimit[RLIMIT_AS].rlim_max = MAXDSIZ;
 }



CVS commit: src/sys/arch/vax/vax

2024-01-05 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Fri Jan  5 17:29:29 UTC 2024

Modified Files:
src/sys/arch/vax/vax: machdep.c

Log Message:
Include leds.h to make /dev/leds work.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/vax/vax/machdep.c

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/vax/vax/machdep.c
diff -u src/sys/arch/vax/vax/machdep.c:1.196 src/sys/arch/vax/vax/machdep.c:1.197
--- src/sys/arch/vax/vax/machdep.c:1.196	Thu Jun 11 19:20:46 2020
+++ src/sys/arch/vax/vax/machdep.c	Fri Jan  5 17:29:29 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.196 2020/06/11 19:20:46 ad Exp $	 */
+/* $NetBSD: machdep.c,v 1.197 2024/01/05 17:29:29 hans Exp $	 */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.196 2020/06/11 19:20:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.197 2024/01/05 17:29:29 hans Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -130,6 +130,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include 
 #endif
 
+#include "leds.h"
 #include "smg.h"
 #include "ksyms.h"
 



CVS commit: src/sys/arch/vax/vax

2024-01-05 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Fri Jan  5 17:29:29 UTC 2024

Modified Files:
src/sys/arch/vax/vax: machdep.c

Log Message:
Include leds.h to make /dev/leds work.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/vax/vax/machdep.c

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



CVS commit: src/sys/arch/vax/vax

2023-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Dec 22 19:14:57 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
pmap_is_modified(): If we fall into the slow path and encounter a modified
page during PV list walk, set PG_M in the pvh_attrs to avoid falling into
the slow path again.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/arch/vax/vax/pmap.c

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/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.200 src/sys/arch/vax/vax/pmap.c:1.201
--- src/sys/arch/vax/vax/pmap.c:1.200	Fri Dec 22 17:55:49 2023
+++ src/sys/arch/vax/vax/pmap.c	Fri Dec 22 19:14:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.200 2023/12/22 17:55:49 thorpej Exp $	   */
+/*	$NetBSD: pmap.c,v 1.201 2023/12/22 19:14:57 thorpej Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.200 2023/12/22 17:55:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.201 2023/12/22 19:14:57 thorpej Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -1474,6 +1474,7 @@ pmap_is_modified(struct vm_page *pg)
 		if (pte[0].pg_m | pte[1].pg_m | pte[2].pg_m | pte[3].pg_m
 		| pte[4].pg_m | pte[5].pg_m | pte[6].pg_m | pte[7].pg_m) {
 			rv = true;
+			SET(pv->pv_attr, PG_M);
 			break;
 		}
 	} while ((pv = pv->pv_next) != NULL);



CVS commit: src/sys/arch/vax/vax

2023-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Dec 22 19:14:57 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
pmap_is_modified(): If we fall into the slow path and encounter a modified
page during PV list walk, set PG_M in the pvh_attrs to avoid falling into
the slow path again.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/arch/vax/vax/pmap.c

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



CVS commit: src/sys/arch/vax/vax

2023-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Dec 22 17:55:49 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
rmspace(): when a PT page is put back onto the free list, invalidate
it's VA in the TB.

rmptep(): Add a comment that the no TIBS is needed for newly-freed PT
pages here because all of the callers perform a TBIA.


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/sys/arch/vax/vax/pmap.c

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/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.199 src/sys/arch/vax/vax/pmap.c:1.200
--- src/sys/arch/vax/vax/pmap.c:1.199	Thu Dec 21 09:09:43 2023
+++ src/sys/arch/vax/vax/pmap.c	Fri Dec 22 17:55:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.199 2023/12/21 09:09:43 mrg Exp $	   */
+/*	$NetBSD: pmap.c,v 1.200 2023/12/22 17:55:49 thorpej Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.199 2023/12/21 09:09:43 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.200 2023/12/22 17:55:49 thorpej Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -633,6 +633,7 @@ rmspace(struct pmap *pm)
 		}
 		free_ptpstruct pte *)ptpp)->pg_pfn << VAX_PGSHIFT));
 		*ptpp = 0;
+		mtpr((vaddr_t)br, PR_TBIS);
 	}
 	lr = pm->pm_p1lr/NPTEPG;
 	for (i = lr; i < NPTEPERREG/NPTEPG; i++) {
@@ -647,6 +648,7 @@ rmspace(struct pmap *pm)
 		}
 		free_ptpstruct pte *)ptpp)->pg_pfn << VAX_PGSHIFT));
 		*ptpp = 0;
+		mtpr((vaddr_t)br, PR_TBIS);
 	}
 
 	if (pm->pm_p0lr != 0)
@@ -772,6 +774,7 @@ rmptep(struct pte *pte)
 #endif
 	free_ptpstruct pte *)ptpp)->pg_pfn << VAX_PGSHIFT));
 	*ptpp = 0;
+	/* N.B. callers all do a TBIA, so TBIS not needed here. */
 }
 
 static int



CVS commit: src/sys/arch/vax/vax

2023-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Dec 22 17:55:49 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
rmspace(): when a PT page is put back onto the free list, invalidate
it's VA in the TB.

rmptep(): Add a comment that the no TIBS is needed for newly-freed PT
pages here because all of the callers perform a TBIA.


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/sys/arch/vax/vax/pmap.c

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



CVS commit: src/sys/arch/vax/vax

2023-12-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Dec 21 09:09:43 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
fix locking botch: use mutex_spin_exit(), not _exit(), for PMAP_UNLOCK.

fixes LOCKDEBUG issue in first attempt to unlock it.

also call PMAP_UNLOCK in one non-fatal out of memory case.

XXX: pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/arch/vax/vax/pmap.c

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



CVS commit: src/sys/arch/vax/vax

2023-12-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Dec 21 09:09:43 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
fix locking botch: use mutex_spin_exit(), not _exit(), for PMAP_UNLOCK.

fixes LOCKDEBUG issue in first attempt to unlock it.

also call PMAP_UNLOCK in one non-fatal out of memory case.

XXX: pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/arch/vax/vax/pmap.c

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/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.198 src/sys/arch/vax/vax/pmap.c:1.199
--- src/sys/arch/vax/vax/pmap.c:1.198	Tue Oct 17 10:22:07 2023
+++ src/sys/arch/vax/vax/pmap.c	Thu Dec 21 09:09:43 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.198 2023/10/17 10:22:07 riastradh Exp $	   */
+/*	$NetBSD: pmap.c,v 1.199 2023/12/21 09:09:43 mrg Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.198 2023/10/17 10:22:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.199 2023/12/21 09:09:43 mrg Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -161,7 +161,7 @@ ptpinuse(void *pte)
 #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
 static kmutex_t pmap_lock;
 #define PMAP_LOCK	mutex_spin_enter(&pmap_lock);
-#define PMAP_UNLOCK	mutex_spin_enter(&pmap_lock);
+#define PMAP_UNLOCK	mutex_spin_exit(&pmap_lock);
 #else
 #define PMAP_LOCK
 #define PMAP_UNLOCK
@@ -1196,6 +1196,7 @@ pmap_enter(pmap_t pmap, vaddr_t v, paddr
 	return 0;
 
 growfail:
+	PMAP_UNLOCK;
 	if (flags & PMAP_CANFAIL)
 		return ENOMEM;
 	panic("usrptmap space leakage");



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

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Tue Dec 19 00:29:48 UTC 2023

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

Log Message:
vax: PR port-vax/55415

Remove VAX-specific workaround to force pre-emption, as it is now
no longer needed.

tested by oster@


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/vax/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/vax/include/cpu.h
diff -u src/sys/arch/vax/include/cpu.h:1.107 src/sys/arch/vax/include/cpu.h:1.108
--- src/sys/arch/vax/include/cpu.h:1.107	Sun Sep 10 00:15:52 2023
+++ src/sys/arch/vax/include/cpu.h	Tue Dec 19 00:29:48 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: cpu.h,v 1.107 2023/09/10 00:15:52 oster Exp $  */
+/*  $NetBSD: cpu.h,v 1.108 2023/12/19 00:29:48 kalvisd Exp $  */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden
@@ -156,15 +156,10 @@ extern int cpu_printfataltraps;
 #define	curcpu()		(curlwp->l_cpu + 0)
 #define	curlwp			((struct lwp *)mfpr(PR_SSP))
 #define	cpu_number()		(curcpu()->ci_cpuid)
-/* XXX RESCHED_REMOTE isn't the right flag name to be used here,
-but we need to set ci_want_resched to '1' to make things work 
-on vax.  See PR#55415 */
 #define	cpu_need_resched(ci, l, flags)		\
 	do {			\
 		struct pcb *pcb = lwp_getpcb(curlwp);		\
 		__USE(flags);	\
-		/* XXX RESCHED_REMOTE isn't the right flag */   \
-		(ci)->ci_want_resched = RESCHED_REMOTE;		\
 		pcb->P0LR = (pcb->P0LR & ~AST_MASK) | AST_ON;	\
 		mtpr(AST_OK,PR_ASTLVL);\
 	} while (/*CONSTCOND*/ 0)



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

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Tue Dec 19 00:29:48 UTC 2023

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

Log Message:
vax: PR port-vax/55415

Remove VAX-specific workaround to force pre-emption, as it is now
no longer needed.

tested by oster@


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

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Dec 18 22:40:01 UTC 2023

Modified Files:
src/sys/arch/vax/vax: subr.S

Log Message:
vax: preserve AST requests raised when handling software interrupts

PR port-vax/55415

On return from a software interrupt, if the software interrupt LWP
raised an AST request, copy the AST level from its PCB to the PCB
of the interrupted LWP.

Reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/vax/vax/subr.S

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

Modified files:

Index: src/sys/arch/vax/vax/subr.S
diff -u src/sys/arch/vax/vax/subr.S:1.42 src/sys/arch/vax/vax/subr.S:1.43
--- src/sys/arch/vax/vax/subr.S:1.42	Thu Feb 23 14:57:08 2023
+++ src/sys/arch/vax/vax/subr.S	Mon Dec 18 22:40:01 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr.S,v 1.42 2023/02/23 14:57:08 riastradh Exp $	   */
+/*	$NetBSD: subr.S,v 1.43 2023/12/18 22:40:01 kalvisd Exp $	   */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -319,7 +319,18 @@ softint_process:
 	movl	%r6,CI_CURLWP(%r8)
 	/* XXX store-before-load barrier -- see cpu_switchto */
 #endif
-
+	/* copy AST level from current LWP to pinned LWP, reset
+	   current AST level */
+	mfpr	$PR_SSP,%r4		/* current LWP */
+	movl	L_PCB(%r4),%r4		/* PCB address */
+	movl	P0LR(%r4),%r0		/* LR and ASTLVL field, current PCB */
+	movl	P0LR(%r3),%r1		/* same, pinned LWP */
+	cmpl	%r0,%r1
+	bgtru	1f			/* AST(current) >= AST(pinned) */
+	extv	$24,$3,%r0,%r0		/* ASTLVL field for current LWP */
+	insv	%r0,$24,$3,P0LR(%r3)	/* copy to pinned LWP */
+	insv	$4,$24,$3,P0LR(%r4)	/* reset AST for current LWP */
+1:
 	mtpr	PCB_PADDR(%r3),$PR_PCBB	/* restore PA of interrupted pcb */
 	ldpctx/* implicitly updates curlwp */
 	rei



CVS commit: src/sys/arch/vax/vax

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Dec 18 22:40:01 UTC 2023

Modified Files:
src/sys/arch/vax/vax: subr.S

Log Message:
vax: preserve AST requests raised when handling software interrupts

PR port-vax/55415

On return from a software interrupt, if the software interrupt LWP
raised an AST request, copy the AST level from its PCB to the PCB
of the interrupted LWP.

Reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/vax/vax/subr.S

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



CVS commit: src/sys/arch/vax/vax

2023-12-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Dec 17 18:39:02 UTC 2023

Modified Files:
src/sys/arch/vax/vax: ka780.c

Log Message:
Fix TRENDATA option build by moving TRENDATA code block with memlog() definition
over its usage in ka780_memerr() and making it static. Also return type is
changed to void and removed unnecessary break at the end of the method.

Finally fixed struct memlogtab initialization by adding missing braces around
each member in the array.

The code builds, but I am not sure weather it was fully finished.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/vax/vax/ka780.c

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/vax/vax/ka780.c
diff -u src/sys/arch/vax/vax/ka780.c:1.33 src/sys/arch/vax/vax/ka780.c:1.34
--- src/sys/arch/vax/vax/ka780.c:1.33	Sun Mar 25 08:13:20 2018
+++ src/sys/arch/vax/vax/ka780.c	Sun Dec 17 18:39:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ka780.c,v 1.33 2018/03/25 08:13:20 ragge Exp $ */
+/*	$NetBSD: ka780.c,v 1.34 2023/12/17 18:39:02 andvar Exp $ */
 /*-
  * Copyright (c) 1982, 1986, 1988 The Regents of the University of California.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ka780.c,v 1.33 2018/03/25 08:13:20 ragge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ka780.c,v 1.34 2023/12/17 18:39:02 andvar Exp $");
 
 #include 
 #include 
@@ -200,6 +200,55 @@ mem_sbi_attach(device_t parent, device_t
 	printf("\n");
 }
 
+#ifdef TRENDATA
+/*
+ * Figure out what chip to replace on Trendata boards.
+ * Assumes all your memory is Trendata or the non-Trendata
+ * memory never fails..
+ */
+const struct {
+	u_char	m_syndrome;
+	char	m_chip[4];
+} memlogtab[] = {
+	{0x01,	"C00"},	{0x02,	"C01"},	{0x04,	"C02"},	{0x08,	"C03"},
+	{0x10,	"C04"},	{0x19,	"L01"},	{0x1A,	"L02"},	{0x1C,	"L04"},
+	{0x1F,	"L07"},	{0x20,	"C05"},	{0x38,	"L00"},	{0x3B,	"L03"},
+	{0x3D,	"L05"},	{0x3E,	"L06"},	{0x40,	"C06"},	{0x49,	"L09"},
+	{0x4A,	"L10"},	{0x4c,	"L12"},	{0x4F,	"L15"},	{0x51,	"L17"},
+	{0x52,	"L18"},	{0x54,	"L20"},	{0x57,	"L23"},	{0x58,	"L24"},
+	{0x5B,	"L27"},	{0x5D,	"L29"},	{0x5E,	"L30"},	{0x68,	"L08"},
+	{0x6B,	"L11"},	{0x6D,	"L13"},	{0x6E,	"L14"},	{0x70,	"L16"},
+	{0x73,	"L19"},	{0x75,	"L21"},	{0x76,	"L22"},	{0x79,	"L25"},
+	{0x7A,	"L26"},	{0x7C,	"L28"},	{0x7F,	"L31"},	{0x80,	"C07"},
+	{0x89,	"U01"},	{0x8A,	"U02"},	{0x8C,	"U04"},	{0x8F,	"U07"},
+	{0x91,	"U09"},	{0x92,	"U10"},	{0x94,	"U12"},	{0x97,	"U15"},
+	{0x98,	"U16"},	{0x9B,	"U19"},	{0x9D,	"U21"},	{0x9E,	"U22"},
+	{0xA8,	"U00"},	{0xAB,	"U03"},	{0xAD,	"U05"},	{0xAE,	"U06"},
+	{0xB0,	"U08"},	{0xB3,	"U11"},	{0xB5,	"U13"},	{0xB6,	"U14"},
+	{0xB9,	"U17"},	{0xBA,	"U18"},	{0xBC,	"U20"},	{0xBF,	"U23"},
+	{0xC1,	"U25"},	{0xC2,	"U26"},	{0xC4,	"U28"},	{0xC7,	"U31"},
+	{0xE0,	"U24"},	{0xE3,	"U27"},	{0xE5,	"U29"},	{0xE6,	"U30"}
+};
+
+static void
+memlog(int m, struct mcr780 *mcr)
+{
+	int i;
+
+	for (i = 0; i < __arraycount(memlogtab); i++)
+		if ((u_char)(M780C_SYN(mcr)) == memlogtab[i].m_syndrome) {
+			printf(
+			"mcr%d: replace %s chip in %s bank of memory"
+			" board %d (0-15)\n",
+			m, memlogtab[i].m_chip,
+			(M780C_ADDR(mcr) & 0x8000) ? "upper" : "lower",
+			(M780C_ADDR(mcr) >> 16));
+			return;
+		}
+	printf("mcr%d: multiple errors, not traceable\n", m);
+}
+#endif /* TRENDATA */
+
 /* log crd errors */
 void
 ka780_memerr(void)
@@ -250,56 +299,6 @@ ka780_memerr(void)
 	}
 }
 
-#ifdef TRENDATA
-/*
- * Figure out what chip to replace on Trendata boards.
- * Assumes all your memory is Trendata or the non-Trendata
- * memory never fails..
- */
-const struct {
-	u_char	m_syndrome;
-	char	m_chip[4];
-} memlogtab[] = {
-	0x01,	"C00",	0x02,	"C01",	0x04,	"C02",	0x08,	"C03",
-	0x10,	"C04",	0x19,	"L01",	0x1A,	"L02",	0x1C,	"L04",
-	0x1F,	"L07",	0x20,	"C05",	0x38,	"L00",	0x3B,	"L03",
-	0x3D,	"L05",	0x3E,	"L06",	0x40,	"C06",	0x49,	"L09",
-	0x4A,	"L10",	0x4c,	"L12",	0x4F,	"L15",	0x51,	"L17",
-	0x52,	"L18",	0x54,	"L20",	0x57,	"L23",	0x58,	"L24",
-	0x5B,	"L27",	0x5D,	"L29",	0x5E,	"L30",	0x68,	"L08",
-	0x6B,	"L11",	0x6D,	"L13",	0x6E,	"L14",	0x70,	"L16",
-	0x73,	"L19",	0x75,	"L21",	0x76,	"L22",	0x79,	"L25",
-	0x7A,	"L26",	0x7C,	"L28",	0x7F,	"L31",	0x80,	"C07",
-	0x89,	"U01",	0x8A,	"U02",	0x8C,	"U04",	0x8F,	"U07",
-	0x91,	"U09",	0x92,	"U10",	0x94,	"U12",	0x97,	"U15",
-	0x98,	"U16",	0x9B,	"U19",	0x9D,	"U21",	0x9E,	"U22",
-	0xA8,	"U00",	0xAB,	"U03",	0xAD,	"U05",	0xAE,	"U06",
-	0xB0,	"U08",	0xB3,	"U11",	0xB5,	"U13",	0xB6,	"U14",
-	0xB9,	"U17",	0xBA,	"U18",	0xBC,	"U20",	0xBF,	"U23",
-	0xC1,	"U25",	0xC2,	"U26",	0xC4,	"U28",	0xC7,	"U31",
-	0xE0,	"U24",	0xE3,	"U27",	0xE5,	"U29",	0xE6,	"U30"
-};
-
-int
-memlog(int m, struct mcr780 *mcr)
-{
-	int i;
-
-	for (i = 0; i < __arraycount(memlogtab); i++)
-		if ((u_char)(M780C_SYN(mcr)) == memlogtab[i].m_syndrome) {
-			printf (
-	"mcr%d: replace %s chip in %s bank of memory board %d (0-15)\n",
-m,
-memlog

CVS commit: src/sys/arch/vax/vax

2023-12-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Dec 17 18:39:02 UTC 2023

Modified Files:
src/sys/arch/vax/vax: ka780.c

Log Message:
Fix TRENDATA option build by moving TRENDATA code block with memlog() definition
over its usage in ka780_memerr() and making it static. Also return type is
changed to void and removed unnecessary break at the end of the method.

Finally fixed struct memlogtab initialization by adding missing braces around
each member in the array.

The code builds, but I am not sure weather it was fully finished.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/vax/vax/ka780.c

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



CVS commit: src/sys/arch/vax/vax

2023-12-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Dec 17 15:06:34 UTC 2023

Modified Files:
src/sys/arch/vax/vax: crx.c

Log Message:
Fix format specifier for ka820port_ptr->csr.

Fixed CRXDEBUG build option for vax.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/vax/vax/crx.c

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/vax/vax/crx.c
diff -u src/sys/arch/vax/vax/crx.c:1.15 src/sys/arch/vax/vax/crx.c:1.16
--- src/sys/arch/vax/vax/crx.c:1.15	Fri Jul 25 08:10:35 2014
+++ src/sys/arch/vax/vax/crx.c	Sun Dec 17 15:06:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: crx.c,v 1.15 2014/07/25 08:10:35 dholland Exp $	*/
+/*	$NetBSD: crx.c,v 1.16 2023/12/17 15:06:33 andvar Exp $	*/
 /*
  * Copyright (c) 1988 Regents of the University of California.
  * All rights reserved.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: crx.c,v 1.15 2014/07/25 08:10:35 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crx.c,v 1.16 2023/12/17 15:06:33 andvar Exp $");
 
 #include 
 #include 
@@ -149,7 +149,7 @@ crxrw(dev_t dev, struct uio *uio, int fl
 #if	CRXDEBUG
 	printf("crxrw(csa%d): %s\n", 
 		rx50unit(dev), uio->uio_rw==UIO_READ?"read":"write");
-	printf("crxrw: ka820port = %x\n", ka820port_ptr->csr);
+	printf("crxrw: ka820port = %lx\n", ka820port_ptr->csr);
 #endif
 	/* enforce whole-sector I/O */
 	if ((uio->uio_offset & 511) || (uio->uio_resid & 511))
@@ -202,7 +202,7 @@ crxrw(dev_t dev, struct uio *uio, int fl
 #endif
 #if	CRXDEBUG
 		printf("crx: going off\n");
-		printf("crxrw: ka820port = %x\n", ka820port_ptr->csr);
+		printf("crxrw: ka820port = %lx\n", ka820port_ptr->csr);
 #endif
 		rxaddr->rxgo = 0;	/* start it up */
 		ka820port_ptr->csr |= KA820PORT_RXIRQ;
@@ -210,7 +210,7 @@ crxrw(dev_t dev, struct uio *uio, int fl
 		while ((rs->rs_flags & RS_DONE) == 0) {
 #if	CRXDEBUG
 			printf("crx: sleeping on I/O\n");
-			printf("crxopen: ka820port = %x\n", ka820port_ptr->csr);
+			printf("crxopen: ka820port = %lx\n", ka820port_ptr->csr);
 #endif
 			(void) tsleep(&rs->rs_blkno, PRIBIO, "crxrw", 0);
 		}



CVS commit: src/sys/arch/vax/vax

2023-12-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Dec 17 15:06:34 UTC 2023

Modified Files:
src/sys/arch/vax/vax: crx.c

Log Message:
Fix format specifier for ka820port_ptr->csr.

Fixed CRXDEBUG build option for vax.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/vax/vax/crx.c

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



CVS commit: src/sys/arch/vax/vax

2023-12-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Dec 17 14:54:49 UTC 2023

Modified Files:
src/sys/arch/vax/vax: bus_dma.c

Log Message:
Fix printf format specifier for size. Fixes DEBUG_DMA build option.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/vax/vax/bus_dma.c

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/vax/vax/bus_dma.c
diff -u src/sys/arch/vax/vax/bus_dma.c:1.39 src/sys/arch/vax/vax/bus_dma.c:1.40
--- src/sys/arch/vax/vax/bus_dma.c:1.39	Tue Oct 11 22:03:37 2022
+++ src/sys/arch/vax/vax/bus_dma.c	Sun Dec 17 14:54:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.39 2022/10/11 22:03:37 andvar Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.40 2023/12/17 14:54:49 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.39 2022/10/11 22:03:37 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.40 2023/12/17 14:54:49 andvar Exp $");
 
 #include 
 #include 
@@ -485,7 +485,7 @@ _bus_dmamem_unmap(bus_dma_tag_t t, void 
 {
 
 #ifdef DEBUG_DMA
-	printf("dmamem_unmap: t=%p kva=%p size=%x\n", t, kva, size);
+	printf("dmamem_unmap: t=%p kva=%p size=%lx\n", t, kva, size);
 #endif	/* DEBUG_DMA */
 #ifdef DIAGNOSTIC
 	if ((u_long)kva & PGOFSET)



CVS commit: src/sys/arch/vax/vax

2023-12-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Dec 17 14:54:49 UTC 2023

Modified Files:
src/sys/arch/vax/vax: bus_dma.c

Log Message:
Fix printf format specifier for size. Fixes DEBUG_DMA build option.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/vax/vax/bus_dma.c

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



CVS commit: src/sys/arch/vax

2023-12-02 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec  3 00:49:46 UTC 2023

Modified Files:
src/sys/arch/vax/include: sgmap.h
src/sys/arch/vax/vax: sgmap.c

Log Message:
Use vmem(9) rather than extent(9) to manage SGMAP space.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/vax/include/sgmap.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/vax/vax/sgmap.c

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/vax/include/sgmap.h
diff -u src/sys/arch/vax/include/sgmap.h:1.7 src/sys/arch/vax/include/sgmap.h:1.8
--- src/sys/arch/vax/include/sgmap.h:1.7	Sun Jul  5 02:03:36 2015
+++ src/sys/arch/vax/include/sgmap.h	Sun Dec  3 00:49:46 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: sgmap.h,v 1.7 2015/07/05 02:03:36 matt Exp $ */
+/* $NetBSD: sgmap.h,v 1.8 2023/12/03 00:49:46 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,21 +33,21 @@
 #ifndef	_VAX_SGMAP_H
 #define	_VAX_SGMAP_H
 
-#include 
+#include 
 #include 
 #include 
 
 /*
  * A VAX SGMAP's state information.  Nothing in the sgmap requires
- * locking[*], with the exception of the extent map.  Locking of the
- * extent map is handled within the extent manager itself.
+ * locking[*], with the exception of the vmem arena, which takes care
+ * of it on its own.
  *
  * [*] While the page table is a `global' resource, access to it is
- * controlled by the extent map; once a region has been allocated from
- * the map, that region is effectively `locked'.
+ * controlled by the arena; once a region has been allocated from
+ * the arena, that region is effectively `locked'.
  */
 struct vax_sgmap {
-	struct extent *aps_ex;		/* extent map to manage sgva space */
+	vmem_t *aps_arena;		/* arena to manage sgva space */
 	struct pte *aps_pt;		/* page table */
 	bus_addr_t aps_sgvabase;	/* base of the sgva space */
 	bus_size_t aps_sgvasize;	/* size of the sgva space */

Index: src/sys/arch/vax/vax/sgmap.c
diff -u src/sys/arch/vax/vax/sgmap.c:1.19 src/sys/arch/vax/vax/sgmap.c:1.20
--- src/sys/arch/vax/vax/sgmap.c:1.19	Thu Jul  7 06:55:39 2016
+++ src/sys/arch/vax/vax/sgmap.c	Sun Dec  3 00:49:46 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: sgmap.c,v 1.19 2016/07/07 06:55:39 msaitoh Exp $ */
+/* $NetBSD: sgmap.c,v 1.20 2023/12/03 00:49:46 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sgmap.c,v 1.19 2016/07/07 06:55:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sgmap.c,v 1.20 2023/12/03 00:49:46 thorpej Exp $");
 
 #include 
 #include 
@@ -89,16 +89,18 @@ vax_sgmap_init(bus_dma_tag_t t, struct v
 	}
 
 	/*
-	 * Create the extent map used to manage the virtual address
+	 * Create the arena used to manage the virtual address
 	 * space.
 	 */
-	sgmap->aps_ex = extent_create(name, sgvabase, sgvasize - 1,
-	NULL, 0, EX_NOWAIT|EX_NOCOALESCE);
-	if (sgmap->aps_ex == NULL) {
-		printf("unable to create extent map for sgmap `%s'\n", name);
-		goto die;
-	}
-
+	sgmap->aps_arena = vmem_create(name, sgvabase, sgvasize,
+   VAX_NBPG,	/* quantum */
+   NULL,		/* importfn */
+   NULL,		/* releasefn */
+   NULL,		/* source */
+   0,		/* qcache_max */
+   VM_SLEEP,
+   IPL_VM);
+	KASSERT(sgmap->aps_arena != NULL);
 	return;
  die:
 	panic("vax_sgmap_init");
@@ -131,9 +133,18 @@ vax_sgmap_alloc(bus_dmamap_t map, bus_si
 	(unsigned int)origlen, (unsigned int)len, (unsigned int)map->_dm_sgvalen, (unsigned int)map->_dm_boundary, 1);
 #endif
 
-	error = extent_alloc(sgmap->aps_ex, map->_dm_sgvalen, VAX_NBPG,
-	0, (flags & BUS_DMA_NOWAIT) ? EX_NOWAIT : EX_WAITOK,
-	&map->_dm_sgva);
+	const vm_flag_t vmflags = VM_BESTFIT |
+	((flags & BUS_DMA_NOWAIT) ? VM_NOSLEEP : VM_SLEEP);
+
+	error = vmem_xalloc(sgmap->aps_arena, map->_dm_sgvalen,
+			0,			/* alignment */
+			0,			/* phase */
+			map->_dm_boundary,	/* nocross */
+			VMEM_ADDR_MIN,	/* minaddr */
+			VMEM_ADDR_MAX,	/* maxaddr */
+			vmflags,
+			&map->_dm_sgva);
+
 #if DEBUG_SGMAP
 	printf("error %d _dm_sgva %lx\n", error, map->_dm_sgva);
 #endif
@@ -155,9 +166,7 @@ vax_sgmap_free(bus_dmamap_t map, struct 
 		panic("vax_sgmap_free: no sgva space to free");
 #endif
 
-	if (extent_free(sgmap->aps_ex, map->_dm_sgva, map->_dm_sgvalen,
-	EX_NOWAIT))
-		panic("vax_sgmap_free");
+	vmem_xfree(sgmap->aps_arena, map->_dm_sgva, map->_dm_sgvalen);
 
 	map->_dm_flags &= ~DMAMAP_HAS_SGMAP;
 }
@@ -165,7 +174,7 @@ vax_sgmap_free(bus_dmamap_t map, struct 
 int
 vax_sgmap_reserve(bus_addr_t ba, bus_size_t len, struct vax_sgmap *sgmap)
 {
-	return extent_alloc_region(sgmap->aps_ex, ba, len, EX_NOWAIT);
+	return vmem_xalloc_addr(sgmap->aps_arena, ba, len, VM_NOSLEEP);
 }
 
 int



CVS commit: src/sys/arch/vax

2023-12-02 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec  3 00:49:46 UTC 2023

Modified Files:
src/sys/arch/vax/include: sgmap.h
src/sys/arch/vax/vax: sgmap.c

Log Message:
Use vmem(9) rather than extent(9) to manage SGMAP space.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/vax/include/sgmap.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/vax/vax/sgmap.c

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



CVS commit: src/sys/arch/vax/vax

2023-10-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct 17 10:22:07 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
vax/pmap.c: Sort includes.  Nix traliing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/vax/vax/pmap.c

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



CVS commit: src/sys/arch/vax/vax

2023-10-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct 17 10:22:07 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
vax/pmap.c: Sort includes.  Nix traliing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/vax/vax/pmap.c

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/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.197 src/sys/arch/vax/vax/pmap.c:1.198
--- src/sys/arch/vax/vax/pmap.c:1.197	Mon Oct 16 17:04:38 2023
+++ src/sys/arch/vax/vax/pmap.c	Tue Oct 17 10:22:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.197 2023/10/16 17:04:38 martin Exp $	   */
+/*	$NetBSD: pmap.c,v 1.198 2023/10/17 10:22:07 riastradh Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,26 +25,27 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.197 2023/10/16 17:04:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.198 2023/10/17 10:22:07 riastradh Exp $");
 
-#include "opt_ddb.h"
 #include "opt_cputype.h"
+#include "opt_ddb.h"
+#include "opt_lockdebug.h"
 #include "opt_modular.h"
 #include "opt_multiprocessor.h"
-#include "opt_lockdebug.h"
 #include "opt_pipe.h"
 
 #include 
-#include 
+
+#include 
 #include 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -54,20 +55,20 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1
 #endif
 
 #include 
-#include 
-#include 
 #include 
+#include 
+#include 
 
 /* QDSS console mapping hack */
 #include "qd.h"
 void	qdearly(void);
 
-/* 
- * This code uses bitfield operators for most page table entries.  
+/*
+ * This code uses bitfield operators for most page table entries.
  */
 #define PROTSHIFT	27
 #define PROT_KW		(PG_KW >> PROTSHIFT)
-#define PROT_KR		(PG_KR >> PROTSHIFT) 
+#define PROT_KR		(PG_KR >> PROTSHIFT)
 #define PROT_RW		(PG_RW >> PROTSHIFT)
 #define PROT_RO		(PG_RO >> PROTSHIFT)
 #define PROT_URKW	(PG_URKW >> PROTSHIFT)
@@ -275,10 +276,10 @@ pmap_bootstrap(void)
 	usrptsize = (1024*1024*1024)/VAX_NBPG;	/* 1GB total VM */
 	if (vax_btop(usrptsize)* PPTESZ > avail_end/20)
 		usrptsize = (avail_end/(20 * PPTESZ)) * VAX_NBPG;
-		
+
 	kvmsize = calc_kvmsize(usrptsize);
 	/*
-	 * Ensure that not more than 1G is allocated, since that is 
+	 * Ensure that not more than 1G is allocated, since that is
 	 * max size of S0 space.
 	 * Also note that for full S0 space the SLR should be 0x20,
 	 * since the comparison in the vax microcode is >= SLR.
@@ -290,7 +291,7 @@ pmap_bootstrap(void)
 	/*
 	 * Virtual_* and avail_* is used for mapping of system page table.
 	 * The need for kernel virtual memory is linear dependent of the
-	 * amount of physical memory also, therefore sysptsize is 
+	 * amount of physical memory also, therefore sysptsize is
 	 * a variable here that is changed dependent of the physical
 	 * memory size.
 	 */
@@ -478,8 +479,8 @@ pmap_steal_memory(vsize_t size, vaddr_t 
  * is enabled. It is meant to do machine-specific allocations.
  * Here is the resource map for the user page tables inited.
  */
-void 
-pmap_init(void) 
+void
+pmap_init(void)
 {
 	/*
 	 * Create the extent map used to manage the page table space.
@@ -529,7 +530,7 @@ rmpage(pmap_t pm, int *br)
 		return; /* Forget mappings of IO space */
 
 	pv = pv_table + ((br[0] & PG_FRAME) >> LTOHPS);
-	if (((br[0] & PG_PROT) == PG_RW) && 
+	if (((br[0] & PG_PROT) == PG_RW) &&
 	((pv->pv_attr & PG_M) != PG_M))
 		pv->pv_attr |= br[0]|br[1]|br[2]|br[3]|br[4]|br[5]|br[6]|br[7];
 	pmap_decrement_stats(pm, (br[0] & PG_W) != 0);
@@ -565,10 +566,10 @@ update_pcbs(struct pmap *pm)
 		pcb->P0LR = pm->pm_p0lr | (pcb->P0LR & AST_MASK);
 		pcb->P1BR = pm->pm_p1br;
 		pcb->P1LR = pm->pm_p1lr;
-		
+
 	}
 
-	/* If curlwp uses this pmap update the regs too */ 
+	/* If curlwp uses this pmap update the regs too */
 	if (pm == curproc->p_vmspace->vm_map.pmap) {
 		mtpr((uintptr_t)pm->pm_p0br, PR_P0BR);
 		mtpr(pm->pm_p0lr, PR_P0LR);
@@ -773,7 +774,7 @@ rmptep(struct pte *pte)
 	*ptpp = 0;
 }
 
-static int 
+static int
 grow_p0(struct pmap *pm, int reqlen)
 {
 	vaddr_t nptespc;
@@ -781,7 +782,7 @@ grow_p0(struct pmap *pm, int reqlen)
 	int srclen, dstlen;
 	int inuse, len, p0lr;
 	u_long p0br;
- 
+
 	PMDEBUG(("grow_p0: pmap %p reqlen %d\n", pm, reqlen));
 
 	/* Get new pte space */
@@ -791,7 +792,7 @@ grow_p0(struct pmap *pm, int reqlen)
 	PMAP_UNLOCK;
 	nptespc = pmap_getusrptes(pm, len);
 	PMAP_LOCK;
- 
+
 	if (nptespc == 0)
 		return 0;
 	/*
@@ -826,7 +827,7 @@ grow_p1(struct pmap *pm, int len)
 {
 	vaddr_t nptespc, optespc;
 	int nlen, olen;
- 
+
 	PMDEBUG(("grow_p1: pm %p len %x\n", pm, len));
 
 	/* Get new pte space */
@@ -867,7 +868,7 @@ pmap_pinit(pmap_t pmap)
 {
 
 	/*
-	 * Do not allocate any pte's here, we don't know

CVS commit: src/sys/arch/vax/vax

2023-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 16 17:04:38 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
This now needs  to compile.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/vax/vax/pmap.c

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/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.196 src/sys/arch/vax/vax/pmap.c:1.197
--- src/sys/arch/vax/vax/pmap.c:1.196	Sun Mar 26 12:21:09 2023
+++ src/sys/arch/vax/vax/pmap.c	Mon Oct 16 17:04:38 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.196 2023/03/26 12:21:09 ragge Exp $	   */
+/*	$NetBSD: pmap.c,v 1.197 2023/10/16 17:04:38 martin Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.196 2023/03/26 12:21:09 ragge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.197 2023/10/16 17:04:38 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -41,6 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/arch/vax/vax

2023-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 16 17:04:38 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
This now needs  to compile.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/vax/vax/pmap.c

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



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

2023-09-09 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sun Sep 10 00:15:52 UTC 2023

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

Log Message:
With the overhaul of the scheduler code the semantics of
ci_want_resched have changed, and for some reason vax
still requires ci_want_resched set to 1 in order to do
preemption.  This commit contains a workaround for the
preemption issued discussed in PR#55415.

XXX pullup-10


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

2023-09-09 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sun Sep 10 00:15:52 UTC 2023

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

Log Message:
With the overhaul of the scheduler code the semantics of
ci_want_resched have changed, and for some reason vax
still requires ci_want_resched set to 1 in order to do
preemption.  This commit contains a workaround for the
preemption issued discussed in PR#55415.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/vax/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/vax/include/cpu.h
diff -u src/sys/arch/vax/include/cpu.h:1.106 src/sys/arch/vax/include/cpu.h:1.107
--- src/sys/arch/vax/include/cpu.h:1.106	Sun Dec 11 18:02:40 2022
+++ src/sys/arch/vax/include/cpu.h	Sun Sep 10 00:15:52 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: cpu.h,v 1.106 2022/12/11 18:02:40 oster Exp $  */
+/*  $NetBSD: cpu.h,v 1.107 2023/09/10 00:15:52 oster Exp $  */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden
@@ -156,10 +156,15 @@ extern int cpu_printfataltraps;
 #define	curcpu()		(curlwp->l_cpu + 0)
 #define	curlwp			((struct lwp *)mfpr(PR_SSP))
 #define	cpu_number()		(curcpu()->ci_cpuid)
+/* XXX RESCHED_REMOTE isn't the right flag name to be used here,
+but we need to set ci_want_resched to '1' to make things work 
+on vax.  See PR#55415 */
 #define	cpu_need_resched(ci, l, flags)		\
 	do {			\
 		struct pcb *pcb = lwp_getpcb(curlwp);		\
 		__USE(flags);	\
+		/* XXX RESCHED_REMOTE isn't the right flag */   \
+		(ci)->ci_want_resched = RESCHED_REMOTE;		\
 		pcb->P0LR = (pcb->P0LR & ~AST_MASK) | AST_ON;	\
 		mtpr(AST_OK,PR_ASTLVL);\
 	} while (/*CONSTCOND*/ 0)



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

2023-08-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 19:13:52 UTC 2023

Modified Files:
src/sys/arch/vax/include: uvax.h

Log Message:
s/VAXststions/VAXstations/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/vax/include/uvax.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/vax/include/uvax.h
diff -u src/sys/arch/vax/include/uvax.h:1.8 src/sys/arch/vax/include/uvax.h:1.9
--- src/sys/arch/vax/include/uvax.h:1.8	Mon May 22 17:12:11 2017
+++ src/sys/arch/vax/include/uvax.h	Thu Aug 10 19:13:52 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvax.h,v 1.8 2017/05/22 17:12:11 ragge Exp $ */
+/*	$NetBSD: uvax.h,v 1.9 2023/08/10 19:13:52 andvar Exp $ */
 /*
  * Copyright (c) 2002 Hugh Graham.
  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -55,7 +55,7 @@
 #define uVAX_CLKLANG	0360
 
 /*
- * Miscellaneous registers common on most VAXststions.
+ * Miscellaneous registers common on most VAXstations.
  */
 struct vs_cpu {
 	u_long	vc_hltcod;	/* 00 - Halt Code Register */



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

2023-08-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 19:13:52 UTC 2023

Modified Files:
src/sys/arch/vax/include: uvax.h

Log Message:
s/VAXststions/VAXstations/ in comment.


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

2023-07-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jul 11 11:48:46 UTC 2023

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

Log Message:
vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/vax/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/vax/include/intr.h
diff -u src/sys/arch/vax/include/intr.h:1.30 src/sys/arch/vax/include/intr.h:1.31
--- src/sys/arch/vax/include/intr.h:1.30	Tue Nov  2 11:26:05 2021
+++ src/sys/arch/vax/include/intr.h	Tue Jul 11 11:48:45 2023
@@ -1,4 +1,4 @@
-/* 	$NetBSD: intr.h,v 1.30 2021/11/02 11:26:05 ryo Exp $	*/
+/* 	$NetBSD: intr.h,v 1.31 2023/07/11 11:48:45 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1998 Matt Thomas.
@@ -65,6 +65,11 @@
 #define IST_EDGE	2	/* edge-triggered */
 #define IST_LEVEL	3	/* level-triggered */
 
+#if defined(_KERNEL) || defined(_KMEMUSER)
+typedef struct {
+	uint8_t _ipl;
+} ipl_cookie_t;
+#endif
 
 #ifdef _KERNEL
 typedef int ipl_t;
@@ -89,10 +94,6 @@ splx(ipl_t new_ipl)
 	return old_ipl;
 }
 
-typedef struct {
-	uint8_t _ipl;
-} ipl_cookie_t;
-
 static inline __always_inline ipl_cookie_t
 makeiplcookie(ipl_t ipl)
 {



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

2023-07-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jul 11 11:48:46 UTC 2023

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

Log Message:
vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).


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

2023-03-26 Thread Anders Magnusson
Module Name:src
Committed By:   ragge
Date:   Sun Mar 26 12:23:42 UTC 2023

Modified Files:
src/sys/arch/vax/include: trap.h

Log Message:
Change CASMAGIC to 0xFEDABABE so that it cannot accidentally end up in
valid kernel memory.  Due to the VARM accesses above S0 should always
give a ptelen trap.
Bug found by Kalvis Duckmanton.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/vax/include/trap.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/vax/include/trap.h
diff -u src/sys/arch/vax/include/trap.h:1.24 src/sys/arch/vax/include/trap.h:1.25
--- src/sys/arch/vax/include/trap.h:1.24	Sun Jul  3 02:18:20 2011
+++ src/sys/arch/vax/include/trap.h	Sun Mar 26 12:23:42 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: trap.h,v 1.24 2011/07/03 02:18:20 matt Exp $ */
+/*  $NetBSD: trap.h,v 1.25 2023/03/26 12:23:42 ragge Exp $ */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -74,7 +74,7 @@
 #define	AFLT_FLTUND	0xa	/* floating underflow */
 
 /* Used by RAS to detect an interrupted CAS */
-#define	CASMAGIC	0xBEDABABE /* high end of S0 space */
+#define	CASMAGIC	0xFEDABABE /* always invalid space */
 
 /* Trap's coming from user mode */
 #define	T_USER	0x100



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

2023-03-26 Thread Anders Magnusson
Module Name:src
Committed By:   ragge
Date:   Sun Mar 26 12:23:42 UTC 2023

Modified Files:
src/sys/arch/vax/include: trap.h

Log Message:
Change CASMAGIC to 0xFEDABABE so that it cannot accidentally end up in
valid kernel memory.  Due to the VARM accesses above S0 should always
give a ptelen trap.
Bug found by Kalvis Duckmanton.


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

2023-03-26 Thread Anders Magnusson
Module Name:src
Committed By:   ragge
Date:   Sun Mar 26 12:21:09 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
Ensure that the kernel do not try to allocate a S0 segment larger than 1G,
since the hardware prohibits that.


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/sys/arch/vax/vax/pmap.c

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/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.195 src/sys/arch/vax/vax/pmap.c:1.196
--- src/sys/arch/vax/vax/pmap.c:1.195	Sun Dec 11 18:02:40 2022
+++ src/sys/arch/vax/vax/pmap.c	Sun Mar 26 12:21:09 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.195 2022/12/11 18:02:40 oster Exp $	   */
+/*	$NetBSD: pmap.c,v 1.196 2023/03/26 12:21:09 ragge Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.195 2022/12/11 18:02:40 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.196 2023/03/26 12:21:09 ragge Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -276,6 +276,15 @@ pmap_bootstrap(void)
 		usrptsize = (avail_end/(20 * PPTESZ)) * VAX_NBPG;
 		
 	kvmsize = calc_kvmsize(usrptsize);
+	/*
+	 * Ensure that not more than 1G is allocated, since that is 
+	 * max size of S0 space.
+	 * Also note that for full S0 space the SLR should be 0x20,
+	 * since the comparison in the vax microcode is >= SLR.
+	 */
+#define	S0SPACE	(1*1024*1024*1024)
+	if (kvmsize > S0SPACE)
+		kvmsize = S0SPACE;
 	sysptsize = kvmsize >> VAX_PGSHIFT;
 	/*
 	 * Virtual_* and avail_* is used for mapping of system page table.



CVS commit: src/sys/arch/vax/vax

2023-03-26 Thread Anders Magnusson
Module Name:src
Committed By:   ragge
Date:   Sun Mar 26 12:21:09 UTC 2023

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
Ensure that the kernel do not try to allocate a S0 segment larger than 1G,
since the hardware prohibits that.


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/sys/arch/vax/vax/pmap.c

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



CVS commit: src/sys/arch/vax/vax

2023-02-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Feb 23 14:57:09 UTC 2023

Modified Files:
src/sys/arch/vax/vax: subr.S

Log Message:
vax: Note where cpu_switchto needs barriers.

PR kern/57240

Not sure vax has ever had working MULTIPROCESSOR, though, and I'm not
even sure how to spell store-before-load barriers on VAX, so no
functional change for now.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/vax/vax/subr.S

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

Modified files:

Index: src/sys/arch/vax/vax/subr.S
diff -u src/sys/arch/vax/vax/subr.S:1.41 src/sys/arch/vax/vax/subr.S:1.42
--- src/sys/arch/vax/vax/subr.S:1.41	Mon Oct 31 20:30:23 2022
+++ src/sys/arch/vax/vax/subr.S	Thu Feb 23 14:57:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr.S,v 1.41 2022/10/31 20:30:23 andvar Exp $	   */
+/*	$NetBSD: subr.S,v 1.42 2023/02/23 14:57:08 riastradh Exp $	   */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -315,7 +315,9 @@ softint_process:
 	movab	softint_exit,PCB_PC(%r3)/* do a quick exit */
 #ifdef MULTIPROCESSOR
 	movl	L_CPU(%r6),%r8
+	/* XXX store-before-store barrier -- see cpu_switchto */
 	movl	%r6,CI_CURLWP(%r8)
+	/* XXX store-before-load barrier -- see cpu_switchto */
 #endif
 
 	mtpr	PCB_PADDR(%r3),$PR_PCBB	/* restore PA of interrupted pcb */
@@ -338,7 +340,9 @@ softint_common:
 	movl	%r6,PCB_R6(%r3)		/* move old lwp into new pcb */
 	movl	%r1,PCB_R7(%r3)		/* move IPL into new pcb */
 #ifdef MULTIPROCESSOR
+	/* XXX store-before-store barrier -- see cpu_switchto */
 	movl	%r2,CI_CURLWP(%r8)	/* update ci_curlwp */
+	/* XXX store-before-load barrier -- see cpu_switchto */
 #endif
 
 	/*
@@ -404,7 +408,31 @@ JSBENTRY(Swtchto)
 #ifdef MULTIPROCESSOR
 	movl	L_CPU(%r0), %r8		/* get cpu_info of old lwp */
 	movl	%r8, L_CPU(%r1)		/* update cpu_info of new lwp */
+	/*
+	 * Issue barriers to coordinate mutex_exit on this CPU with
+	 * mutex_vector_enter on another CPU.
+	 *
+	 * 1. Any prior mutex_exit by oldlwp must be visible to other
+	 *CPUs before we set ci_curlwp := newlwp on this one,
+	 *requiring a store-before-store barrier.
+	 *
+	 * 2. ci_curlwp := newlwp must be visible on all other CPUs
+	 *before any subsequent mutex_exit by newlwp can even test
+	 *whether there might be waiters, requiring a
+	 *store-before-load barrier.
+	 *
+	 * See kern_mutex.c for details -- this is necessary for
+	 * adaptive mutexes to detect whether the lwp is on the CPU in
+	 * order to safely block without requiring atomic r/m/w in
+	 * mutex_exit.
+	 *
+	 * XXX I'm fuzzy on the memory model of VAX.  I would guess
+	 * it's TSO like x86 but I can't find a store-before-load
+	 * barrier, which is the only one TSO requires explicitly.
+	 */
+	/* XXX store-before-store barrier */
 	movl	%r1,CI_CURLWP(%r8)	/* update ci_curlwp */
+	/* XXX store-before-load barrier */
 #endif
 
 	mtpr	PCB_PADDR(%r3),$PR_PCBB	# set PA of new pcb



CVS commit: src/sys/arch/vax/vax

2023-02-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Feb 23 14:57:09 UTC 2023

Modified Files:
src/sys/arch/vax/vax: subr.S

Log Message:
vax: Note where cpu_switchto needs barriers.

PR kern/57240

Not sure vax has ever had working MULTIPROCESSOR, though, and I'm not
even sure how to spell store-before-load barriers on VAX, so no
functional change for now.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/vax/vax/subr.S

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



CVS commit: src/sys/arch/vax/conf

2023-02-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 11 06:02:56 UTC 2023

Modified Files:
src/sys/arch/vax/conf: GENERIC INSTALL

Log Message:
Add comments that "options VAX410" also supports VS3100/m30,m38,m40,m48.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/sys/arch/vax/conf/GENERIC
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/vax/conf/INSTALL

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



CVS commit: src/sys/arch/vax/conf

2023-02-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 11 06:02:56 UTC 2023

Modified Files:
src/sys/arch/vax/conf: GENERIC INSTALL

Log Message:
Add comments that "options VAX410" also supports VS3100/m30,m38,m40,m48.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/sys/arch/vax/conf/GENERIC
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/vax/conf/INSTALL

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/vax/conf/GENERIC
diff -u src/sys/arch/vax/conf/GENERIC:1.217 src/sys/arch/vax/conf/GENERIC:1.218
--- src/sys/arch/vax/conf/GENERIC:1.217	Mon Feb  6 13:13:05 2023
+++ src/sys/arch/vax/conf/GENERIC	Sat Feb 11 06:02:56 2023
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.217 2023/02/06 13:13:05 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.218 2023/02/11 06:02:56 tsutsui Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/vax/conf/std.vax"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.217 $"
+#ident 		"GENERIC-$Revision: 1.218 $"
 
 # Here are all different supported CPU types listed.
 #options 	VAX8800		# VAX 8500, 8530, 8550, 8700, 8800
@@ -36,7 +36,7 @@ options 	VAX650		# MV III, 3300, 3400, 3
 options 	VAX660		# VAX 4000/200
 options 	VAX670		# VAX 4000/300
 options 	VAX680		# VAX 4000/[45]00
-options 	VAX410		# VS 2000
+options 	VAX410		# VS 2000, VS 3100/m30,m38,m40,m48
 options 	VAX43		# VS 3100/76
 options 	VAX46		# VS 4000/60
 options 	VAX48		# VS 4000 VLC

Index: src/sys/arch/vax/conf/INSTALL
diff -u src/sys/arch/vax/conf/INSTALL:1.76 src/sys/arch/vax/conf/INSTALL:1.77
--- src/sys/arch/vax/conf/INSTALL:1.76	Mon Feb  6 13:13:05 2023
+++ src/sys/arch/vax/conf/INSTALL	Sat Feb 11 06:02:56 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.76 2023/02/06 13:13:05 tsutsui Exp $
+#	$NetBSD: INSTALL,v 1.77 2023/02/11 06:02:56 tsutsui Exp $
 #
 # INSTALL kernel; all supported devices but nothing fancy.
 #
@@ -19,7 +19,7 @@ options 	VAX650		# MV III, 3300, 3400, 3
 options 	VAX660		# VAX 4000/200
 options 	VAX670		# VAX 4000/300
 options 	VAX680		# VAX 4000/[45]00
-options 	VAX410		# VS 2000
+options 	VAX410		# VS 2000, VS 3100/m30,m38,m40,m48
 options 	VAX43		# VS 3100/76
 options 	VAX46		# VS 4000/60
 options 	VAX48		# VS 4000 VLC



CVS commit: src/sys/arch/vax

2023-02-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Feb  6 13:13:06 UTC 2023

Modified Files:
src/sys/arch/vax/conf: GENERIC INSTALL VAX780 files.vax
src/sys/arch/vax/include: qdreg.h
src/sys/arch/vax/vax: conf.c
src/sys/arch/vax/vsa: smg.c
Added Files:
src/sys/arch/vax/vsa: gpx.c

Log Message:
Add a support for gpx(4) color framebuffer found on VAXstation 3100.

Poted from OpenBSD/vax. Note smg(4) monochrome onboard framebuffer
driver is also changed attached only if gpx(4) is not installed
or flags 1 is specified in config files, as OpenBSD did.

Tested on my VAXstation 3100/m30 with and without 8bpp gpx(4).
Revied on port-vax@ and "Please go ahead!" from ragge@.
 https://mail-index.netbsd.org/port-vax/2023/01/thread1.html#004147

Worth to pullup to netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/arch/vax/conf/GENERIC
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/vax/conf/INSTALL
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/vax/conf/VAX780
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/vax/conf/files.vax
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/vax/include/qdreg.h
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/vax/vax/conf.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/vax/vsa/gpx.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/vax/vsa/smg.c

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/vax/conf/GENERIC
diff -u src/sys/arch/vax/conf/GENERIC:1.216 src/sys/arch/vax/conf/GENERIC:1.217
--- src/sys/arch/vax/conf/GENERIC:1.216	Thu Sep 29 10:10:10 2022
+++ src/sys/arch/vax/conf/GENERIC	Mon Feb  6 13:13:05 2023
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.216 2022/09/29 10:10:10 riastradh Exp $
+# $NetBSD: GENERIC,v 1.217 2023/02/06 13:13:05 tsutsui Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/vax/conf/std.vax"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.216 $"
+#ident 		"GENERIC-$Revision: 1.217 $"
 
 # Here are all different supported CPU types listed.
 #options 	VAX8800		# VAX 8500, 8530, 8550, 8700, 8800
@@ -185,6 +185,7 @@ si1		at vsbus0 csr 0x200c0180 # VS2000/3
 asc0		at vsbus0 csr 0x200c0080 # VS4000/60 (or VLC) SCSI-ctlr
 asc0		at vsbus0 csr 0x2680 # VS4000/90 and 4000/10x SCSI-ctlr
 smg0		at vsbus0 csr 0x200f # Small monochrome display ctlr.
+gpx0		at vsbus0 csr 0x3c00 # VS3100 GPX display option
 #clr0		at vsbus0 csr 0x3000 # 4- or 8-bitplans color graphics
 spx0		at vsbus0 csr 0x3800 # Low Cost SPX on VS4000/90.
 lcg0		at vsbus0 csr 0x21801000 # VS4000/60 (or VLC) graphics
@@ -271,6 +272,7 @@ uk*		at scsibus? target? lun?
 
 # VAXstation graphics support
 wsdisplay*	at smg0
+wsdisplay*	at gpx0
 wsdisplay*	at spx0
 wsdisplay*	at lcg0
 #wsdisplay*	at clr0

Index: src/sys/arch/vax/conf/INSTALL
diff -u src/sys/arch/vax/conf/INSTALL:1.75 src/sys/arch/vax/conf/INSTALL:1.76
--- src/sys/arch/vax/conf/INSTALL:1.75	Mon Jan 20 18:38:21 2020
+++ src/sys/arch/vax/conf/INSTALL	Mon Feb  6 13:13:05 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.75 2020/01/20 18:38:21 thorpej Exp $
+#	$NetBSD: INSTALL,v 1.76 2023/02/06 13:13:05 tsutsui Exp $
 #
 # INSTALL kernel; all supported devices but nothing fancy.
 #
@@ -139,6 +139,7 @@ si1		at vsbus0 csr 0x200c0180 # VS2000/3
 asc0		at vsbus0 csr 0x200c0080 # VS4000/60 (or VLC) SCSI-ctlr
 asc0		at vsbus0 csr 0x2680 # VS4000/90 and 4000/10x SCSI-ctlr
 smg0		at vsbus0 csr 0x200f # Small monochrome display ctlr.
+gpx0		at vsbus0 csr 0x3c00 # VS3100 GPX display option
 #clr0		at vsbus0 csr 0x3000 # 4- or 8-bitplans color graphics
 spx0		at vsbus0 csr 0x3800 # Low Cost SPX on VS4000/90.
 #lcg0		at vsbus0 csr 0x21801000 # VS4000/60 (or VLC) graphics
@@ -217,6 +218,7 @@ cd*		at scsibus? target? lun?
 
 # VAXstation graphics support
 wsdisplay*	at smg0
+wsdisplay*	at gpx0
 wsdisplay*	at spx0
 #wsdisplay*	at lcg0
 #wsdisplay*	at clr0

Index: src/sys/arch/vax/conf/VAX780
diff -u src/sys/arch/vax/conf/VAX780:1.33 src/sys/arch/vax/conf/VAX780:1.34
--- src/sys/arch/vax/conf/VAX780:1.33	Sun Aug  7 02:52:30 2022
+++ src/sys/arch/vax/conf/VAX780	Mon Feb  6 13:13:05 2023
@@ -1,4 +1,4 @@
-# $NetBSD: VAX780,v 1.33 2022/08/07 02:52:30 simonb Exp $
+# $NetBSD: VAX780,v 1.34 2023/02/06 13:13:05 tsutsui Exp $
 #
 # 11/780,750,730 machine description file
 # 
@@ -171,6 +171,7 @@ ubi0		at mainbus0		# 11/730 direct unibu
 #asc0		at vsbus0 csr 0x200c0080 # VS4000/60 (or VLC) SCSI-ctlr
 #asc0		at vsbus0 csr 0x2680 # VS4000/90 and 4000/10x SCSI-ctlr
 #smg0		at vsbus0 csr 0x200f # Small monochrome display ctlr.
+#gpx0		at vsbus0 csr 0x3c00 # VS3100 GPX display option
 #clr0		at vsbus0 csr 0x3000 # 4- or 8-bitplans color graphics
 #spx0		at vsbus0 csr 0x3800 # Low Cost SPX on VS4000/90.
 #lcg0		at vsbus0 csr 0x21801000 # VS4000/60 (or VLC) graphics
@@ -251,6 +252,7 @@ mt*		at mscpbus? drive?	# MSCP tape
 
 # VAX

CVS commit: src/sys/arch/vax

2023-02-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Feb  6 13:13:06 UTC 2023

Modified Files:
src/sys/arch/vax/conf: GENERIC INSTALL VAX780 files.vax
src/sys/arch/vax/include: qdreg.h
src/sys/arch/vax/vax: conf.c
src/sys/arch/vax/vsa: smg.c
Added Files:
src/sys/arch/vax/vsa: gpx.c

Log Message:
Add a support for gpx(4) color framebuffer found on VAXstation 3100.

Poted from OpenBSD/vax. Note smg(4) monochrome onboard framebuffer
driver is also changed attached only if gpx(4) is not installed
or flags 1 is specified in config files, as OpenBSD did.

Tested on my VAXstation 3100/m30 with and without 8bpp gpx(4).
Revied on port-vax@ and "Please go ahead!" from ragge@.
 https://mail-index.netbsd.org/port-vax/2023/01/thread1.html#004147

Worth to pullup to netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/arch/vax/conf/GENERIC
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/vax/conf/INSTALL
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/vax/conf/VAX780
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/vax/conf/files.vax
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/vax/include/qdreg.h
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/vax/vax/conf.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/vax/vsa/gpx.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/vax/vsa/smg.c

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



CVS commit: src/sys/arch/vax/boot

2023-01-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 29 17:00:12 UTC 2023

Modified Files:
src/sys/arch/vax/boot: Makefile.inc

Log Message:
Make a vax bootloader work on 8MB VAXen.

64KB (0x80 - 0x7f) is not enough for the bootloader itself
and more spaces are required for heap on loading a kernel.
 https://mail-index.netbsd.org/port-vax/2023/01/24/msg004149.html

"Go ahead" from ragge@.  Should be pulled up to netbsd-10 and netbsd-9.


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

2023-01-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 29 17:00:12 UTC 2023

Modified Files:
src/sys/arch/vax/boot: Makefile.inc

Log Message:
Make a vax bootloader work on 8MB VAXen.

64KB (0x80 - 0x7f) is not enough for the bootloader itself
and more spaces are required for heap on loading a kernel.
 https://mail-index.netbsd.org/port-vax/2023/01/24/msg004149.html

"Go ahead" from ragge@.  Should be pulled up to netbsd-10 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/vax/boot/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/vax/boot/Makefile.inc
diff -u src/sys/arch/vax/boot/Makefile.inc:1.18 src/sys/arch/vax/boot/Makefile.inc:1.19
--- src/sys/arch/vax/boot/Makefile.inc:1.18	Thu Mar 22 08:58:56 2018
+++ src/sys/arch/vax/boot/Makefile.inc	Sun Jan 29 17:00:12 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.18 2018/03/22 08:58:56 ragge Exp $
+#	$NetBSD: Makefile.inc,v 1.19 2023/01/29 17:00:12 tsutsui Exp $
 
 NOSSP=
 NOFORTIFY=
@@ -7,7 +7,7 @@ NODEBUG=
 
 .include 
 
-RELOC=0x7f
+RELOC=0x7d
 .PATH:	${.CURDIR}/../../vax ${.CURDIR}/../common
 
 CPPFLAGS+=-I.



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

2023-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 17:50:18 UTC 2023

Modified Files:
src/sys/arch/vax/include: math.h

Log Message:
mark unused arguments as such


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/vax/include/math.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/vax/include/math.h
diff -u src/sys/arch/vax/include/math.h:1.8 src/sys/arch/vax/include/math.h:1.9
--- src/sys/arch/vax/include/math.h:1.8	Thu Jul 27 08:15:59 2017
+++ src/sys/arch/vax/include/math.h	Tue Jan 24 12:50:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: math.h,v 1.8 2017/07/27 12:15:59 martin Exp $	*/
+/*	$NetBSD: math.h,v 1.9 2023/01/24 17:50:18 christos Exp $	*/
 
 #ifndef _VAX_MATH_H_
 #define _VAX_MATH_H_
@@ -11,8 +11,8 @@
 #define	__INFINITY	1.0E+39F
 #endif
 
-static __inline int __isinf(double __x) { return 0; }
-static __inline int __isnan(double __x) { return 0; }
+static __inline int __isinf(double __x __unused) { return 0; }
+static __inline int __isnan(double __x __unused) { return 0; }
 #define	__HAVE_INLINE___ISINF
 #define	__HAVE_INLINE___ISNAN
 



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

2023-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 17:50:18 UTC 2023

Modified Files:
src/sys/arch/vax/include: math.h

Log Message:
mark unused arguments as such


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/vax/include/math.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/vax/vsa

2023-01-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jan 13 19:45:45 UTC 2023

Modified Files:
src/sys/arch/vax/vsa: smg.c

Log Message:
Make sure to call wsfont_init(9) as other framebuffer drivers.

Otherwise wsfont_find(9) always fails and wsdisplay(4) is not attached.
XXX: still no output on the framebuffer console on my VAXstation 3100/m30


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/vax/vsa/smg.c

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



CVS commit: src/sys/arch/vax/vsa

2023-01-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jan 13 19:45:45 UTC 2023

Modified Files:
src/sys/arch/vax/vsa: smg.c

Log Message:
Make sure to call wsfont_init(9) as other framebuffer drivers.

Otherwise wsfont_find(9) always fails and wsdisplay(4) is not attached.
XXX: still no output on the framebuffer console on my VAXstation 3100/m30


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/vax/vsa/smg.c

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/vax/vsa/smg.c
diff -u src/sys/arch/vax/vsa/smg.c:1.61 src/sys/arch/vax/vsa/smg.c:1.62
--- src/sys/arch/vax/vsa/smg.c:1.61	Sat Aug  7 16:19:07 2021
+++ src/sys/arch/vax/vsa/smg.c	Fri Jan 13 19:45:45 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: smg.c,v 1.61 2021/08/07 16:19:07 thorpej Exp $ */
+/*	$NetBSD: smg.c,v 1.62 2023/01/13 19:45:45 tsutsui Exp $ */
 /*
  * Copyright (c) 1998 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smg.c,v 1.61 2021/08/07 16:19:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smg.c,v 1.62 2023/01/13 19:45:45 tsutsui Exp $");
 
 #include 
 #include 
@@ -241,6 +241,7 @@ smg_attach(device_t parent, device_t sel
 	callout_reset(&smg_cursor_ch, hz / 2, smg_crsr_blink, NULL);
 	curcmd = CUR_CMD_HSHI;
 	WRITECUR(CUR_CMD, curcmd);
+	wsfont_init();
 	if ((fcookie = wsfont_find(NULL, 8, 15, 0, WSDISPLAY_FONTORDER_R2L,
 	WSDISPLAY_FONTORDER_L2R, WSFONT_FIND_BITMAP)) < 0) {
 		aprint_error_dev(self, "could not find 8x15 font\n");
@@ -591,6 +592,7 @@ smgcninit(struct consdev *cndev)
 	curscr = &smg_conscreen;
 	wsdisplay_cnattach(&smg_stdscreen, &smg_conscreen, 0, 0, 0);
 	cn_tab->cn_pri = CN_INTERNAL;
+	wsfont_init();
 	if ((fcookie = wsfont_find(NULL, 8, 15, 0, WSDISPLAY_FONTORDER_R2L,
 	WSDISPLAY_FONTORDER_L2R, WSFONT_FIND_BITMAP)) < 0)
 	{



CVS commit: src/sys/arch/vax

2022-12-12 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Dec 12 18:22:32 UTC 2022

Modified Files:
src/sys/arch/vax/include: vsbus.h
src/sys/arch/vax/vsa: dz_vsbus.c vsbus.c vsbus_dma.c

Log Message:
vsbus vax: sprinkle volatile for register accesses


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/vax/include/vsbus.h
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/vax/vsa/dz_vsbus.c
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/vax/vsa/vsbus.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/vax/vsa/vsbus_dma.c

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/vax/include/vsbus.h
diff -u src/sys/arch/vax/include/vsbus.h:1.20 src/sys/arch/vax/include/vsbus.h:1.21
--- src/sys/arch/vax/include/vsbus.h:1.20	Mon May 22 17:12:11 2017
+++ src/sys/arch/vax/include/vsbus.h	Mon Dec 12 18:22:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vsbus.h,v 1.20 2017/05/22 17:12:11 ragge Exp $ */
+/*	$NetBSD: vsbus.h,v 1.21 2022/12/12 18:22:32 jakllsch Exp $ */
 /*
  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -73,9 +73,9 @@ struct	vsbus_attach_args {
 
 struct	vsbus_softc {
 	device_t sc_dev;
-	u_char	*sc_intmsk;	/* Mask register */
-	u_char	*sc_intclr;	/* Clear interrupt register */
-	u_char	*sc_intreq;	/* Interrupt request register */
+	volatile u_char	*sc_intmsk;	/* Mask register */
+	volatile u_char	*sc_intclr;	/* Clear interrupt register */
+	volatile u_char	*sc_intreq;	/* Interrupt request register */
 	u_char	sc_mask;	/* Interrupts to enable after autoconf */
 	vaddr_t	sc_vsregs;	/* Where the VS_REGS are mapped */
 	vaddr_t sc_dmaaddr;	/* Mass storage virtual DMA area */

Index: src/sys/arch/vax/vsa/dz_vsbus.c
diff -u src/sys/arch/vax/vsa/dz_vsbus.c:1.46 src/sys/arch/vax/vsa/dz_vsbus.c:1.47
--- src/sys/arch/vax/vsa/dz_vsbus.c:1.46	Sat Aug  7 16:19:07 2021
+++ src/sys/arch/vax/vsa/dz_vsbus.c	Mon Dec 12 18:22:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dz_vsbus.c,v 1.46 2021/08/07 16:19:07 thorpej Exp $ */
+/*	$NetBSD: dz_vsbus.c,v 1.47 2022/12/12 18:22:32 jakllsch Exp $ */
 /*
  * Copyright (c) 1998 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dz_vsbus.c,v 1.46 2021/08/07 16:19:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dz_vsbus.c,v 1.47 2022/12/12 18:22:32 jakllsch Exp $");
 
 #include 
 #include 
@@ -112,7 +112,7 @@ static int
 dz_vsbus_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct vsbus_attach_args * const va = aux;
-	struct ss_dz *dzP;
+	volatile struct ss_dz *dzP;
 	short i;
 
 #if VAX53 || VAX49 || VAXANY

Index: src/sys/arch/vax/vsa/vsbus.c
diff -u src/sys/arch/vax/vsa/vsbus.c:1.67 src/sys/arch/vax/vsa/vsbus.c:1.68
--- src/sys/arch/vax/vsa/vsbus.c:1.67	Sat Aug  7 16:19:07 2021
+++ src/sys/arch/vax/vsa/vsbus.c	Mon Dec 12 18:22:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vsbus.c,v 1.67 2021/08/07 16:19:07 thorpej Exp $ */
+/*	$NetBSD: vsbus.c,v 1.68 2022/12/12 18:22:32 jakllsch Exp $ */
 /*
  * Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.67 2021/08/07 16:19:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.68 2022/12/12 18:22:32 jakllsch Exp $");
 
 #include "opt_cputype.h"
 
@@ -146,7 +146,7 @@ vsbus_attach(device_t parent, device_t s
 		} else {
 			dbase = KA420_DMA_BASE;
 			dsize = KA420_DMA_SIZE;
-			*(char *)(sc->sc_vsregs + 0xe0) = 1; /* Big DMA */
+			*(volatile char *)(sc->sc_vsregs + 0xe0) = 1; /* Big DMA */
 		}
 		sc->sc_dmasize = dsize;
 		sc->sc_dmaaddr = uvm_km_alloc(kernel_map, dsize, 0,

Index: src/sys/arch/vax/vsa/vsbus_dma.c
diff -u src/sys/arch/vax/vsa/vsbus_dma.c:1.16 src/sys/arch/vax/vsa/vsbus_dma.c:1.17
--- src/sys/arch/vax/vsa/vsbus_dma.c:1.16	Tue Dec 14 23:31:17 2010
+++ src/sys/arch/vax/vsa/vsbus_dma.c	Mon Dec 12 18:22:32 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: vsbus_dma.c,v 1.16 2010/12/14 23:31:17 matt Exp $ */
+/* $NetBSD: vsbus_dma.c,v 1.17 2022/12/12 18:22:32 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vsbus_dma.c,v 1.16 2010/12/14 23:31:17 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vsbus_dma.c,v 1.17 2022/12/12 18:22:32 jakllsch Exp $");
 
 #define _VAX_BUS_DMA_PRIVATE
 
@@ -127,7 +127,7 @@ vsbus_dma_init(struct vsbus_softc *sc, u
 			"hw sgmap: error=%d", error);
 		}
 		memset(pte, 0, mapsize);
-		*(int *) (sc->sc_vsregs + 8) = segs->ds_addr;	/* set MAP BASE 0x2008008 */
+		*(volatile int *) (sc->sc_vsregs + 8) = segs->ds_addr;	/* set MAP BASE 0x2008008 */
 	} else {
 		pte = (struct pte *) vax_map_physmem(KA49_SCSIMAP, mapsize / VAX_NBPG);
 		for (nsegs = ptecnt; nsegs > 0; ) {



CVS commit: src/sys/arch/vax

2022-12-12 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Dec 12 18:22:32 UTC 2022

Modified Files:
src/sys/arch/vax/include: vsbus.h
src/sys/arch/vax/vsa: dz_vsbus.c vsbus.c vsbus_dma.c

Log Message:
vsbus vax: sprinkle volatile for register accesses


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/vax/include/vsbus.h
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/vax/vsa/dz_vsbus.c
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/vax/vsa/vsbus.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/vax/vsa/vsbus_dma.c

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



CVS commit: src/sys/arch/vax

2022-12-11 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sun Dec 11 18:02:40 UTC 2022

Modified Files:
src/sys/arch/vax/include: cpu.h pcb.h
src/sys/arch/vax/vax: pmap.c trap.c

Log Message:
Support save/restore of AST levels in the PCB for context switching.

Code written by ragge@ , tested by oster@.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/vax/include/cpu.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/vax/include/pcb.h
cvs rdiff -u -r1.194 -r1.195 src/sys/arch/vax/vax/pmap.c
cvs rdiff -u -r1.136 -r1.137 src/sys/arch/vax/vax/trap.c

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/vax/include/cpu.h
diff -u src/sys/arch/vax/include/cpu.h:1.105 src/sys/arch/vax/include/cpu.h:1.106
--- src/sys/arch/vax/include/cpu.h:1.105	Sat Aug 14 17:51:19 2021
+++ src/sys/arch/vax/include/cpu.h	Sun Dec 11 18:02:40 2022
@@ -1,4 +1,4 @@
-/*  $NetBSD: cpu.h,v 1.105 2021/08/14 17:51:19 ryo Exp $  */
+/*  $NetBSD: cpu.h,v 1.106 2022/12/11 18:02:40 oster Exp $  */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden
@@ -157,9 +157,11 @@ extern int cpu_printfataltraps;
 #define	curlwp			((struct lwp *)mfpr(PR_SSP))
 #define	cpu_number()		(curcpu()->ci_cpuid)
 #define	cpu_need_resched(ci, l, flags)		\
-	do {	\
-		__USE(flags);			\
-		mtpr(AST_OK,PR_ASTLVL);		\
+	do {			\
+		struct pcb *pcb = lwp_getpcb(curlwp);		\
+		__USE(flags);	\
+		pcb->P0LR = (pcb->P0LR & ~AST_MASK) | AST_ON;	\
+		mtpr(AST_OK,PR_ASTLVL);\
 	} while (/*CONSTCOND*/ 0)
 #define	cpu_proc_fork(x, y)	do { } while (/*CONSCOND*/0)
 
@@ -198,7 +200,12 @@ extern char vax_mp_tramp;
  * process as soon as possible.
  */
 
-#define cpu_signotify(l) mtpr(AST_OK,PR_ASTLVL)
+#define cpu_signotify(l)	\
+	do {			\
+		struct pcb *pcb = lwp_getpcb(l);		\
+		pcb->P0LR = (pcb->P0LR & ~AST_MASK) | AST_ON;	\
+		mtpr(AST_OK,PR_ASTLVL);\
+	} while (/*CONSTCOND*/ 0)
 
 
 /*
@@ -206,7 +213,13 @@ extern char vax_mp_tramp;
  * buffer pages are invalid.  On the hp300, request an ast to send us
  * through trap, marking the proc as needing a profiling tick.
  */
-#define cpu_need_proftick(l) do { (l)->l_pflag |= LP_OWEUPC; mtpr(AST_OK,PR_ASTLVL); } while (/*CONSTCOND*/ 0)
+#define cpu_need_proftick(l) 	\
+	do {			\
+		struct pcb *pcb = lwp_getpcb(l);		\
+		(l)->l_pflag |= LP_OWEUPC;			\
+		pcb->P0LR = (pcb->P0LR & ~AST_MASK) | AST_ON;	\
+		mtpr(AST_OK,PR_ASTLVL);\
+	} while (/*CONSTCOND*/ 0)
 
 /*
  * This defines the I/O device register space size in pages.

Index: src/sys/arch/vax/include/pcb.h
diff -u src/sys/arch/vax/include/pcb.h:1.15 src/sys/arch/vax/include/pcb.h:1.16
--- src/sys/arch/vax/include/pcb.h:1.15	Mon May 22 17:12:11 2017
+++ src/sys/arch/vax/include/pcb.h	Sun Dec 11 18:02:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcb.h,v 1.15 2017/05/22 17:12:11 ragge Exp $	*/
+/*	$NetBSD: pcb.h,v 1.16 2022/12/11 18:02:40 oster Exp $	*/
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -49,6 +49,7 @@ struct pcb {
 	long	P0LR;		/*  Page 0 Length Register*/
 	struct	pte *P1BR;	/*  Page 1 Base Register  */
 	long	P1LR;		/*  Page 1 Length Register*/
+	long	ASN;		/*  Address space number  */
 
 	/* Software registers, only used by kernel software */
 	void   *pcb_onfault;	/* Tells whether fault copy */
@@ -58,7 +59,8 @@ struct pcb {
 };
 
 #define	AST_MASK 0x0700
-#define	AST_PCB	 0x0400
+#define	AST_PCB	 0x0400	/* disable AST */
+#define	AST_ON	 0x0300	/* request AST */
 
 /* machine-specific core dump; save trapframe */
 struct	md_coredump {

Index: src/sys/arch/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.194 src/sys/arch/vax/vax/pmap.c:1.195
--- src/sys/arch/vax/vax/pmap.c:1.194	Fri Feb 11 17:26:55 2022
+++ src/sys/arch/vax/vax/pmap.c	Sun Dec 11 18:02:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.194 2022/02/11 17:26:55 riastradh Exp $	   */
+/*	$NetBSD: pmap.c,v 1.195 2022/12/11 18:02:40 oster Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.194 2022/02/11 17:26:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.195 2022/12/11 18:02:40 oster Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -552,7 +552,7 @@ update_pcbs(struct pmap *pm)
 	for (pcb = pm->pm_pcbs; pcb != NULL; pcb = pcb->pcb_pmnext) {
 		KASSERT(pcb->pcb_pm == pm);
 		pcb->P0BR = pm->pm_p0br;
-		pcb->P0LR = pm->pm_p0lr|AST_PCB;
+		pcb->P0LR = pm->pm_p0lr | (pcb->P0LR & AST_MASK);
 		pcb->P1BR = pm->pm_p1br;
 		pcb->P1LR = pm->pm_p1lr;
 		
@@ -561,7 +561,7 @@ update_pcbs(struct pmap *pm)
 	/* If curlwp uses this pmap update the regs too */ 
 	if (pm == curproc->p_vmspace->vm_map.pmap) {
 		mtpr((uintptr_t)pm->pm_p0br, PR_P0BR);
-		mtpr(pm->pm_p0lr|AST_PCB, PR_P0LR);
+		mtpr(pm->pm_p0lr, PR_P0

CVS commit: src/sys/arch/vax

2022-12-11 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sun Dec 11 18:02:40 UTC 2022

Modified Files:
src/sys/arch/vax/include: cpu.h pcb.h
src/sys/arch/vax/vax: pmap.c trap.c

Log Message:
Support save/restore of AST levels in the PCB for context switching.

Code written by ragge@ , tested by oster@.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/vax/include/cpu.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/vax/include/pcb.h
cvs rdiff -u -r1.194 -r1.195 src/sys/arch/vax/vax/pmap.c
cvs rdiff -u -r1.136 -r1.137 src/sys/arch/vax/vax/trap.c

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



CVS commit: src/sys/arch/vax/vsa

2022-12-10 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Dec 10 19:50:43 UTC 2022

Modified Files:
src/sys/arch/vax/vsa: lcg.c

Log Message:
Don't let compiler optimize out the framebuffer probe in lcg_match() by
using keyword volatile.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/vsa/lcg.c

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/vax/vsa/lcg.c
diff -u src/sys/arch/vax/vsa/lcg.c:1.10 src/sys/arch/vax/vsa/lcg.c:1.11
--- src/sys/arch/vax/vsa/lcg.c:1.10	Wed Jul  6 12:33:41 2022
+++ src/sys/arch/vax/vsa/lcg.c	Sat Dec 10 19:50:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lcg.c,v 1.10 2022/07/06 12:33:41 andvar Exp $ */
+/*	$NetBSD: lcg.c,v 1.11 2022/12/10 19:50:43 jakllsch Exp $ */
 /*
  * LCG accelerated framebuffer driver
  * Copyright (c) 2003, 2004 Blaz Antonic
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lcg.c,v 1.10 2022/07/06 12:33:41 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lcg.c,v 1.11 2022/12/10 19:50:43 jakllsch Exp $");
 
 #define LCG_NO_ACCEL
 
@@ -433,7 +433,7 @@ lcg_match(struct device *parent, struct 
 {
 	struct vsbus_softc *sc = device_private(parent);
 	struct vsbus_attach_args *va = aux;
-	char *ch = (char *)va->va_addr;
+	volatile char * const ch = (char *)va->va_addr;
 
 	if ((vax_boardtype != VAX_BTYP_46) && (vax_boardtype != VAX_BTYP_48))
 		return 0;



CVS commit: src/sys/arch/vax/vsa

2022-12-10 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Dec 10 19:50:43 UTC 2022

Modified Files:
src/sys/arch/vax/vsa: lcg.c

Log Message:
Don't let compiler optimize out the framebuffer probe in lcg_match() by
using keyword volatile.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/vsa/lcg.c

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



CVS commit: src/sys/arch/vax/uba

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Oct 27 00:00:25 UTC 2022

Modified Files:
src/sys/arch/vax/uba: qvaux.c

Log Message:
vax/qvaux(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/vax/uba/qvaux.c

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/vax/uba/qvaux.c
diff -u src/sys/arch/vax/uba/qvaux.c:1.4 src/sys/arch/vax/uba/qvaux.c:1.5
--- src/sys/arch/vax/uba/qvaux.c:1.4	Sat Aug  7 16:19:07 2021
+++ src/sys/arch/vax/uba/qvaux.c	Thu Oct 27 00:00:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: qvaux.c,v 1.4 2021/08/07 16:19:07 thorpej Exp $	*/
+/*	$NetBSD: qvaux.c,v 1.5 2022/10/27 00:00:25 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -548,7 +548,7 @@ qvauxopen(dev_t dev, int flag, int mode,
 	/* Use DMBIS and *not* DMSET or else we clobber incoming bits */
 	if (qvauxmctl(sc, line, DML_DTR, DMBIS) & DML_DCD)
 		tp->t_state |= TS_CARR_ON;
-	mutex_spin_enter(&tty_lock);
+	ttylock(tp);
 	while (!(flag & O_NONBLOCK) && !(tp->t_cflag & CLOCAL) &&
 	   !(tp->t_state & TS_CARR_ON)) {
 		tp->t_wopen++;
@@ -557,7 +557,7 @@ qvauxopen(dev_t dev, int flag, int mode,
 		if (error)
 			break;
 	}
-	mutex_spin_exit(&tty_lock);
+	ttyunlock(tp);
 	if (error)
 		return (error);
 	return ((*tp->t_linesw->l_open)(dev, tp));



CVS commit: src/sys/arch/vax/uba

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Oct 27 00:00:25 UTC 2022

Modified Files:
src/sys/arch/vax/uba: qvaux.c

Log Message:
vax/qvaux(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/vax/uba/qvaux.c

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



CVS commit: src/sys/arch/vax/boot

2022-04-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Apr 25 15:06:34 UTC 2022

Modified Files:
src/sys/arch/vax/boot/boot: rom.c vaxstand.h
src/sys/arch/vax/boot/xxboot: bootxx.c

Log Message:
libsa now needs ioctl support to handle media with large sectors.
Provide dummy functions.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/boot/boot/rom.c \
src/sys/arch/vax/boot/boot/vaxstand.h
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/vax/boot/xxboot/bootxx.c

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/vax/boot/boot/rom.c
diff -u src/sys/arch/vax/boot/boot/rom.c:1.10 src/sys/arch/vax/boot/boot/rom.c:1.11
--- src/sys/arch/vax/boot/boot/rom.c:1.10	Mon May 22 16:59:32 2017
+++ src/sys/arch/vax/boot/boot/rom.c	Mon Apr 25 15:06:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rom.c,v 1.10 2017/05/22 16:59:32 ragge Exp $ */
+/*	$NetBSD: rom.c,v 1.11 2022/04/25 15:06:34 mlelstv Exp $ */
 /*
  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -102,3 +102,8 @@ romstrategy (void *f, int func, daddr_t 
 	return 0;
 }
 
+int
+romioctl(struct open_file *f, u_long cmd, void *data)
+{
+	return ENOTTY;
+}
Index: src/sys/arch/vax/boot/boot/vaxstand.h
diff -u src/sys/arch/vax/boot/boot/vaxstand.h:1.10 src/sys/arch/vax/boot/boot/vaxstand.h:1.11
--- src/sys/arch/vax/boot/boot/vaxstand.h:1.10	Mon Mar 19 15:43:45 2018
+++ src/sys/arch/vax/boot/boot/vaxstand.h	Mon Apr 25 15:06:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vaxstand.h,v 1.10 2018/03/19 15:43:45 ragge Exp $ */
+/*	$NetBSD: vaxstand.h,v 1.11 2022/04/25 15:06:34 mlelstv Exp $ */
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -58,7 +58,8 @@ int	ctuopen(struct open_file *, int, int
 int	tmscpopen(struct open_file *, int, int, int, int),
 	tmscpstrategy(void *, int, daddr_t, size_t, void *, size_t *);
 int	romopen(struct open_file *, int, int, int, int),
-	romstrategy(void *, int, daddr_t, size_t, void *, size_t *);
+	romstrategy(void *, int, daddr_t, size_t, void *, size_t *),
+	romioctl(struct open_file *, u_long, void *);
 int	mfmopen(struct open_file *, int, int, int, int),
 	mfmstrategy(void *, int, daddr_t, size_t, void *, size_t *);
 int	sdopen(struct open_file *),

Index: src/sys/arch/vax/boot/xxboot/bootxx.c
diff -u src/sys/arch/vax/boot/xxboot/bootxx.c:1.38 src/sys/arch/vax/boot/xxboot/bootxx.c:1.39
--- src/sys/arch/vax/boot/xxboot/bootxx.c:1.38	Tue May  1 07:03:47 2018
+++ src/sys/arch/vax/boot/xxboot/bootxx.c	Mon Apr 25 15:06:34 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: bootxx.c,v 1.38 2018/05/01 07:03:47 ragge Exp $ */
+/* $NetBSD: bootxx.c,v 1.39 2022/04/25 15:06:34 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -298,6 +298,12 @@ romstrategy(void *sc, int func, daddr_t 
 	return 0;
 }
 
+int
+romioctl(struct open_file *f, u_long cmd, void *data)
+{
+	return ENOTTY;
+}
+
 /*
  * The 11/750 boot ROM for Massbus disks doesn't seen to have layout info
  * for all RP disks (not RP07 at least) so therefore a very small and dumb



CVS commit: src/sys/arch/vax/boot

2022-04-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Apr 25 15:06:34 UTC 2022

Modified Files:
src/sys/arch/vax/boot/boot: rom.c vaxstand.h
src/sys/arch/vax/boot/xxboot: bootxx.c

Log Message:
libsa now needs ioctl support to handle media with large sectors.
Provide dummy functions.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/boot/boot/rom.c \
src/sys/arch/vax/boot/boot/vaxstand.h
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/vax/boot/xxboot/bootxx.c

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



CVS commit: src/sys/arch/vax/vax

2022-03-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Mar  3 06:28:26 UTC 2022

Modified Files:
src/sys/arch/vax/vax: autoconf.c ka6400.c ka820.c ka88.c multicpu.c

Log Message:
vax: Use device_set_private.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/vax/vax/autoconf.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/vax/vax/ka6400.c \
src/sys/arch/vax/vax/ka88.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/vax/vax/ka820.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/vax/vax/multicpu.c

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/vax/vax/autoconf.c
diff -u src/sys/arch/vax/vax/autoconf.c:1.99 src/sys/arch/vax/vax/autoconf.c:1.100
--- src/sys/arch/vax/vax/autoconf.c:1.99	Sat Aug  7 16:19:07 2021
+++ src/sys/arch/vax/vax/autoconf.c	Thu Mar  3 06:28:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.99 2021/08/07 16:19:07 thorpej Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.100 2022/03/03 06:28:26 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.99 2021/08/07 16:19:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.100 2022/03/03 06:28:26 riastradh Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_cputype.h"
@@ -173,7 +173,7 @@ cpu_mainbus_attach(device_t parent, devi
 
 	KASSERT(device_private(self) == NULL);
 	ci = curcpu();
-	self->dv_private = ci;
+	device_set_private(self, ci);
 	ci->ci_dev = self;
 	ci->ci_cpuid = device_unit(self);
 

Index: src/sys/arch/vax/vax/ka6400.c
diff -u src/sys/arch/vax/vax/ka6400.c:1.20 src/sys/arch/vax/vax/ka6400.c:1.21
--- src/sys/arch/vax/vax/ka6400.c:1.20	Sun Dec  1 15:34:46 2019
+++ src/sys/arch/vax/vax/ka6400.c	Thu Mar  3 06:28:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ka6400.c,v 1.20 2019/12/01 15:34:46 ad Exp $	*/
+/*	$NetBSD: ka6400.c,v 1.21 2022/03/03 06:28:26 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ka6400.c,v 1.20 2019/12/01 15:34:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ka6400.c,v 1.21 2022/03/03 06:28:26 riastradh Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -146,7 +146,7 @@ ka6400_attach(device_t parent, device_t 
 	mtpr(0, PR_VPSR); /* Can't use vector processor */
 
 	ci = curcpu();
-	self->dv_private = ci;
+	device_set_private(self, ci);
 	ci->ci_dev = self;
 	ci->ci_cpuid = device_unit(self);
 	ci->ci_slotid = xa->xa_nodenr;
Index: src/sys/arch/vax/vax/ka88.c
diff -u src/sys/arch/vax/vax/ka88.c:1.20 src/sys/arch/vax/vax/ka88.c:1.21
--- src/sys/arch/vax/vax/ka88.c:1.20	Sun Dec  1 15:34:46 2019
+++ src/sys/arch/vax/vax/ka88.c	Thu Mar  3 06:28:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ka88.c,v 1.20 2019/12/01 15:34:46 ad Exp $	*/
+/*	$NetBSD: ka88.c,v 1.21 2022/03/03 06:28:26 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ka88.c,v 1.20 2019/12/01 15:34:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ka88.c,v 1.21 2022/03/03 06:28:26 riastradh Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -149,7 +149,7 @@ ka88_cpu_attach(device_t parent, device_
 		return;
 	}
 	ci = curcpu();
-	self->dv_private = ci;
+	device_set_private(self, ci);
 	ci->ci_dev = self;
 	ci->ci_cpuid = device_unit(self);
 	ci->ci_slotid = na->na_slot;

Index: src/sys/arch/vax/vax/ka820.c
diff -u src/sys/arch/vax/vax/ka820.c:1.57 src/sys/arch/vax/vax/ka820.c:1.58
--- src/sys/arch/vax/vax/ka820.c:1.57	Sun Dec  1 15:34:46 2019
+++ src/sys/arch/vax/vax/ka820.c	Thu Mar  3 06:28:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ka820.c,v 1.57 2019/12/01 15:34:46 ad Exp $	*/
+/*	$NetBSD: ka820.c,v 1.58 2022/03/03 06:28:26 riastradh Exp $	*/
 /*
  * Copyright (c) 1988 Regents of the University of California.
  * All rights reserved.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ka820.c,v 1.57 2019/12/01 15:34:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ka820.c,v 1.58 2022/03/03 06:28:26 riastradh Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -169,8 +169,8 @@ ka820_attach(device_t parent, device_t s
 #endif
 
 	ci = curcpu();
-	self->dv_private = ci;	/* eww. but curcpu() is already too */
-/* entrenched to change */
+	device_set_private(self, ci);	/* eww. but curcpu() is already too */
+	/* entrenched to change */
 	ci->ci_slotid = ba->ba_nodenr;
 	ci->ci_cpuid = device_unit(self);
 	ci->ci_dev = self;

Index: src/sys/arch/vax/vax/multicpu.c
diff -u src/sys/arch/vax/vax/multicpu.c:1.36 src/sys/arch/vax/vax/multicpu.c:1.37
--- src/sys/arch/vax/vax/multicpu.c:1.36	Sat Nov 21 22:37:11 2020
+++ src/sys/arch/vax/vax/multicpu.c	Thu Mar  3 06:28:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: multicpu.c,v 1.36 2020/11/21 22:37:11 thorpej Exp $	*/
+/*	$NetBSD: multicpu.c,v 1.37 2022/03/03 06:28:2

CVS commit: src/sys/arch/vax/vax

2022-03-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Mar  3 06:28:26 UTC 2022

Modified Files:
src/sys/arch/vax/vax: autoconf.c ka6400.c ka820.c ka88.c multicpu.c

Log Message:
vax: Use device_set_private.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/vax/vax/autoconf.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/vax/vax/ka6400.c \
src/sys/arch/vax/vax/ka88.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/vax/vax/ka820.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/vax/vax/multicpu.c

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



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

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

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

Log Message:
vax: __cpu_simple_lock audit.

Fix missing "memory" asm clobber so the compiler can't reorder memory
access around __cpu_simple_lock/lock_try/unlock.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/vax/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/vax/include/lock.h
diff -u src/sys/arch/vax/include/lock.h:1.33 src/sys/arch/vax/include/lock.h:1.34
--- src/sys/arch/vax/include/lock.h:1.33	Sat Feb 12 17:17:53 2022
+++ src/sys/arch/vax/include/lock.h	Sun Feb 13 13:42:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.33 2022/02/12 17:17:53 riastradh Exp $	*/
+/*	$NetBSD: lock.h,v 1.34 2022/02/13 13:42:21 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2000 Ludd, University of Lule}, Sweden.
@@ -84,7 +84,7 @@ __cpu_simple_lock_try(__cpu_simple_lock_
 	__asm __volatile ("clrl %0;bbssi $0,%1,1f;incl %0;1:"
 		: "=&r"(ret)
 		: "m"(*__alp)
-		: "cc");
+		: "cc", "memory");
 #endif
 
 	return ret;
@@ -107,7 +107,7 @@ __cpu_simple_lock(__cpu_simple_lock_t *_
 	__asm __volatile ("1:bbssi $0,%0,1b"
 		: /* No outputs */
 		: "m"(*__alp)
-		: "cc");
+		: "cc", "memory");
 #endif /* _HARDKERNEL && MULTIPROCESSOR */
 }
 
@@ -124,7 +124,7 @@ __cpu_simple_unlock(__cpu_simple_lock_t 
 	__asm __volatile ("bbcci $0,%0,1f;1:"
 		: /* No output */
 		: "m"(*__alp)
-		: "cc");
+		: "cc", "memory");
 #endif
 }
 



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

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

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

Log Message:
vax: __cpu_simple_lock audit.

Fix missing "memory" asm clobber so the compiler can't reorder memory
access around __cpu_simple_lock/lock_try/unlock.


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

2022-02-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 11 17:26:56 UTC 2022

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
vax: Remove a vestige from before the device_t/softc split.

Verified MicroVAX 4000/96 still boots.

cpu0 at mainbus0: KA49, NVAX, 10KB L1 cache, 256KB L2 cache


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/sys/arch/vax/vax/pmap.c

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/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.193 src/sys/arch/vax/vax/pmap.c:1.194
--- src/sys/arch/vax/vax/pmap.c:1.193	Tue Oct 12 08:36:28 2021
+++ src/sys/arch/vax/vax/pmap.c	Fri Feb 11 17:26:55 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.193 2021/10/12 08:36:28 andvar Exp $	   */
+/*	$NetBSD: pmap.c,v 1.194 2022/02/11 17:26:55 riastradh Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.193 2021/10/12 08:36:28 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.194 2022/02/11 17:26:55 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -397,8 +397,7 @@ pmap_bootstrap(void)
 	ci = (struct cpu_info *) scratch;
 	lwp0.l_cpu = ci;
 	ci->ci_istack = istack;
-	memset(ci, 0, sizeof(struct cpu_info) + sizeof(struct device));
-	ci->ci_dev = (void *)(ci + 1);
+	memset(ci, 0, sizeof(*ci));
 #if defined(MULTIPROCESSOR)
 	ci->ci_curlwp = &lwp0;
 	ci->ci_flags = CI_MASTERCPU|CI_RUNNING;



CVS commit: src/sys/arch/vax/vax

2022-02-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 11 17:26:56 UTC 2022

Modified Files:
src/sys/arch/vax/vax: pmap.c

Log Message:
vax: Remove a vestige from before the device_t/softc split.

Verified MicroVAX 4000/96 still boots.

cpu0 at mainbus0: KA49, NVAX, 10KB L1 cache, 256KB L2 cache


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/sys/arch/vax/vax/pmap.c

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



CVS commit: src/sys/arch/vax/vax

2021-12-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Dec  5 03:01:59 UTC 2021

Modified Files:
src/sys/arch/vax/vax: subr.S

Log Message:
s/implictily/implicitly/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/vax/vax/subr.S

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

Modified files:

Index: src/sys/arch/vax/vax/subr.S
diff -u src/sys/arch/vax/vax/subr.S:1.39 src/sys/arch/vax/vax/subr.S:1.40
--- src/sys/arch/vax/vax/subr.S:1.39	Mon Oct  4 20:25:20 2021
+++ src/sys/arch/vax/vax/subr.S	Sun Dec  5 03:01:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr.S,v 1.39 2021/10/04 20:25:20 andvar Exp $	   */
+/*	$NetBSD: subr.S,v 1.40 2021/12/05 03:01:59 msaitoh Exp $	   */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -319,7 +319,7 @@ softint_process:
 #endif
 
 	mtpr	PCB_PADDR(%r3),$PR_PCBB	/* restore PA of interrupted pcb */
-	ldpctx/* implictily updates curlwp */
+	ldpctx/* implicitly updates curlwp */
 	rei
 
 



CVS commit: src/sys/arch/vax/vax

2021-12-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Dec  5 03:01:59 UTC 2021

Modified Files:
src/sys/arch/vax/vax: subr.S

Log Message:
s/implictily/implicitly/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/vax/vax/subr.S

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



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

2021-10-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Oct 29 04:13:39 UTC 2021

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

Log Message:
Define __HAVE_STRUCT_SIGCONTEXT regardless of its current visibility.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/vax/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/vax/include/signal.h
diff -u src/sys/arch/vax/include/signal.h:1.22 src/sys/arch/vax/include/signal.h:1.23
--- src/sys/arch/vax/include/signal.h:1.22	Thu Oct 28 11:13:27 2021
+++ src/sys/arch/vax/include/signal.h	Fri Oct 29 04:13:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.22 2021/10/28 11:13:27 christos Exp $	*/
+/*	$NetBSD: signal.h,v 1.23 2021/10/29 04:13:39 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
@@ -40,6 +40,8 @@
 #include 
 #include 
 
+#define	__HAVE_STRUCT_SIGCONTEXT
+
 /* VAX versioned its sigcontext trampoline ABI (Sept 2002). */
 #define __SIGTRAMP_SIGCONTEXT_VERSION_MAX	2
 #define __SIGTRAMP_SIGCONTEXT_VERSION		2
@@ -70,7 +72,6 @@ struct sigcontext13 {
 	int	sc_ps;			/* psl to restore */
 };
 
-#define	__HAVE_STRUCT_SIGCONTEXT
 struct sigcontext {
 	int	sc_onstack;		/* sigstack state to restore */
 	int	__sc_mask13;		/* signal mask to restore (old style) */



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

2021-10-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Oct 29 04:13:39 UTC 2021

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

Log Message:
Define __HAVE_STRUCT_SIGCONTEXT regardless of its current visibility.


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

2021-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 28 11:13:27 UTC 2021

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

Log Message:
The genassym code in libc also needs struct sigcontext13


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/vax/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/vax/include/signal.h
diff -u src/sys/arch/vax/include/signal.h:1.21 src/sys/arch/vax/include/signal.h:1.22
--- src/sys/arch/vax/include/signal.h:1.21	Wed Oct 27 01:18:51 2021
+++ src/sys/arch/vax/include/signal.h	Thu Oct 28 07:13:27 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.21 2021/10/27 05:18:51 thorpej Exp $	*/
+/*	$NetBSD: signal.h,v 1.22 2021/10/28 11:13:27 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
@@ -59,7 +59,7 @@ typedef int sig_atomic_t;
  * to the handler to allow it to restore state properly if
  * a non-standard exit is performed.
  */
-#if defined(_KERNEL)
+#if defined(_LIBC) || defined(_KERNEL)
 struct sigcontext13 {
 	int	sc_onstack;		/* sigstack state to restore */
 	int	sc_mask;		/* signal mask to restore (old style) */
@@ -69,9 +69,7 @@ struct sigcontext13 {
 	int	sc_pc;			/* pc to restore */
 	int	sc_ps;			/* psl to restore */
 };
-#endif /* _KERNEL */
 
-#if defined(_LIBC) || defined(_KERNEL)
 #define	__HAVE_STRUCT_SIGCONTEXT
 struct sigcontext {
 	int	sc_onstack;		/* sigstack state to restore */



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

2021-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 28 11:13:27 UTC 2021

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

Log Message:
The genassym code in libc also needs struct sigcontext13


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

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

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

Log Message:
Make sigcontext13 visible only to _KERNEL.  Make sigcontext visible only
to _LIBC and _KERNEL.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/vax/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/vax/include/signal.h
diff -u src/sys/arch/vax/include/signal.h:1.18 src/sys/arch/vax/include/signal.h:1.19
--- src/sys/arch/vax/include/signal.h:1.18	Tue Oct 26 16:16:35 2021
+++ src/sys/arch/vax/include/signal.h	Wed Oct 27 01:13:22 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: signal.h,v 1.18 2021/10/26 16:16:35 christos Exp $   */
+/*  $NetBSD: signal.h,v 1.19 2021/10/27 01:13:22 thorpej Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
@@ -36,9 +36,6 @@
 #ifndef _VAX_SIGNAL_H_
 #define _VAX_SIGNAL_H_
 
-#define __SIGTRAMP_SIGCONTEXT_VERSION	2
-#define __SIGTRAMP_SIGINFO_VERSION	3
-
 #include 
 #include 
 #include 
@@ -54,7 +51,7 @@ typedef int sig_atomic_t;
  * to the handler to allow it to restore state properly if
  * a non-standard exit is performed.
  */
-#if defined(__LIBC12_SOURCE__) || defined(_KERNEL)
+#if defined(_KERNEL)
 struct sigcontext13 {
 	int	sc_onstack;		/* sigstack state to restore */
 	int	sc_mask;		/* signal mask to restore (old style) */
@@ -64,8 +61,9 @@ struct sigcontext13 {
 	int	sc_pc;			/* pc to restore */
 	int	sc_ps;			/* psl to restore */
 };
-#endif /* __LIBC12_SOURCE__ || _KERNEL */
+#endif /* _KERNEL */
 
+#if defined(_LIBC) || defined(_KERNEL)
 #define	__HAVE_STRUCT_SIGCONTEXT
 struct sigcontext {
 	int	sc_onstack;		/* sigstack state to restore */
@@ -77,6 +75,7 @@ struct sigcontext {
 	int	sc_ps;			/* psl to restore */
 	sigset_t sc_mask;		/* signal mask to restore (new style) */
 };
+#endif /* _LIBC || _KERNEL */
 
 #ifdef _KERNEL
 #define sendsig_sigcontext	sendsig_sighelper



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

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

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

Log Message:
Make sigcontext13 visible only to _KERNEL.  Make sigcontext visible only
to _LIBC and _KERNEL.


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

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



  1   2   >