CVS commit: src/common/lib/libc/arch/aarch64/atomic

2021-08-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug  8 07:17:18 UTC 2021

Modified Files:
src/common/lib/libc/arch/aarch64/atomic: __aarch64_lse.S

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S

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

Modified files:

Index: src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S
diff -u src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S:1.1 src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S:1.2
--- src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S:1.1	Tue Apr 27 09:14:24 2021
+++ src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S	Sun Aug  8 07:17:18 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: __aarch64_lse.S,v 1.1 2021/04/27 09:14:24 skrll Exp $ */
+/* $NetBSD: __aarch64_lse.S,v 1.2 2021/08/08 07:17:18 skrll Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -204,4 +204,3 @@ ENTRY_NP(INSN_FUNC)
 2:	b	1b
 END(INSN_FUNC)
 #endif
-



CVS commit: [netbsd-9] src/sys/external/bsd/drm2/linux

2021-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug  8 10:00:16 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/linux [netbsd-9]: linux_reservation.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1327):

sys/external/bsd/drm2/linux/linux_reservation.c: revision 1.13
sys/external/bsd/drm2/linux/linux_reservation.c: revision 1.14

drm: Release fence if we're about to return too.

Should fix another fence leak.

XXX pullup-9

 -

drm: Plug another fence leak.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.11.8.1 -r1.11.8.2 \
src/sys/external/bsd/drm2/linux/linux_reservation.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/external/bsd/drm2/linux/linux_reservation.c
diff -u src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11.8.1 src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11.8.2
--- src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11.8.1	Thu Jul  8 11:23:28 2021
+++ src/sys/external/bsd/drm2/linux/linux_reservation.c	Sun Aug  8 10:00:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_reservation.c,v 1.11.8.1 2021/07/08 11:23:28 martin Exp $	*/
+/*	$NetBSD: linux_reservation.c,v 1.11.8.2 2021/08/08 10:00:16 martin Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.11.8.1 2021/07/08 11:23:28 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.11.8.2 2021/08/08 10:00:16 martin Exp $");
 
 #include 
 #include 
@@ -794,9 +794,9 @@ wait:
 	KASSERT(fence != NULL);
 	rcu_read_unlock();
 	ret = fence_wait_timeout(fence, intr, timeout);
+	fence_put(fence);
 	if (ret <= 0)
 		return ret;
-	fence_put(fence);
 	KASSERT(ret <= timeout);
 	timeout = ret;
 	goto top;
@@ -1003,6 +1003,7 @@ top:
 		 * assume the event is not ready.
 		 */
 		if (!claimed || callback) {
+			fence_put(fence);
 			revents = 0;
 			break;
 		}



CVS commit: [netbsd-9] src

2021-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug  8 10:11:40 UTC 2021

Modified Files:
src/lib/libc/compiler_rt [netbsd-9]: Makefile.inc
src/lib/libm/compiler_rt [netbsd-9]: Makefile.inc
src/sys/external/bsd/compiler_rt/dist/lib/builtins [netbsd-9]: adddf3.c
addsf3.c ashldi3.c ashrdi3.c comparedf2.c comparesf2.c divdf3.c
divsf3.c divsi3.c extendhfsf2.c extendsfdf2.c fixdfdi.c fixdfsi.c
fixsfdi.c fixsfsi.c fixunsdfdi.c fixunsdfsi.c fixunssfdi.c
fixunssfsi.c floatdidf.c floatdisf.c floatsidf.c floatsisf.c
floatundidf.c floatundisf.c floatunsidf.c floatunsisf.c int_lib.h
lshrdi3.c muldf3.c muldi3.c mulsf3.c negdf2.c negsf2.c subdf3.c
subsf3.c truncdfhf2.c truncdfsf2.c truncsfhf2.c udivsi3.c
src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm [netbsd-9]:
aeabi_cdcmpeq_check_nan.c aeabi_cfcmpeq_check_nan.c aeabi_div0.c
aeabi_drsub.c aeabi_frsub.c
src/sys/lib/libkern [netbsd-9]: Makefile.compiler-rt
Added Files:
src/sys/external/bsd/compiler_rt [netbsd-9]: abi.mk

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1328):

sys/external/bsd/compiler_rt/dist/lib/builtins/negsf2.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/muldf3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfhf2.c: revision 
1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/negsf2.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/muldf3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.3

sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmpeq_check_nan.c: 
revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfhf2.c: revision 
1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.4
sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.5
sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c: revision 1.2
sys/external/bsd/compiler_rt/abi.mk: revision 1.1
sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsisf.c: revision 
1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c: revision 
1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsisf.c: revision 
1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c: revision 
1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.4
sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfsf2.c: revision 
1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/subdf3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.5
sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c: revision 1.3
sys/lib/libkern/Makefile.compiler-rt: revision 1.13
sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfsf2.c: revision 
1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/subdf3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.6
sys/external/bsd/compiler_rt/dist/lib/builtins/lshrdi3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatsisf.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c: revision 
1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/lshrdi3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatsisf.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c: revision 
1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsidf.c: revision 
1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsidf.c: revision 
1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_frsub.c: 
revision 1.2
lib/libm/compiler_rt/Makefile.inc: revision 1.11
sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c: revision 
1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatsidf.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c: revision 
1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c: revision 1.2
sys/external

CVS commit: [netbsd-9] src

2021-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug  8 10:22:04 UTC 2021

Modified Files:
src/lib/libc/arch/arm/gen [netbsd-9]: swapcontext.S
src/lib/libc/arch/arm/sys [netbsd-9]: __clone.S
src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm [netbsd-9]:
aeabi_cfcmp.S divmodsi4.S divsi3.S modsi3.S

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1329):

lib/libc/arch/arm/gen/swapcontext.S: revision 1.18
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S: revision 
1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S: revision 
1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S: 
revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S: 
revision 1.3
lib/libc/arch/arm/sys/__clone.S: revision 1.10
lib/libc/arch/arm/sys/__clone.S: revision 1.11
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S: revision 
1.2
lib/libc/arch/arm/sys/__clone.S: revision 1.12
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S: revision 
1.3
lib/libc/arch/arm/sys/__clone.S: revision 1.13
lib/libc/arch/arm/sys/__clone.S: revision 1.14
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S: 
revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S: 
revision 1.3
lib/libc/arch/arm/gen/swapcontext.S: revision 1.16
lib/libc/arch/arm/gen/swapcontext.S: revision 1.17

Align sp to 8-byte boundary as required by EABI.

This is especially important for non-leaf functions; GCC optimizes codes
based on assumption that sp is aligned properly.

Mostly fix broken earmv5 userland compiled by GCC10 due to alignment
faults in ld.elf_so, where {ld,st}rd are used for [sp, #8x].

No regression for ATF is observed for earmv[67]{,hf}{,eb}.

Align sp to 8-byte boundary as required by EABI.
IIUC, this change only affects libc compiled for ``Thumb-mode userland'',
which we've not officially supported yet.

Fix previous. For Thumb-1:
- sp cannot be manipulated directly
- {add,sub}s should be used instead of {add,sub}

Trailing whitespace

The _INVOKE_CERROR macro deals with thumb so simplify the code (at the
expense of a couple more instructions).

Do previous differently by pushing even number of registers and remove
strange r7 usage.

Do previous differtly by pushing two registers in the same way as the
_INVOKE_CERROR macro


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.2.1 src/lib/libc/arch/arm/gen/swapcontext.S
cvs rdiff -u -r1.9 -r1.9.28.1 src/lib/libc/arch/arm/sys/__clone.S
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.26.1 \
src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.22.1 \
src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S \
src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S \
src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S

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

Modified files:

Index: src/lib/libc/arch/arm/gen/swapcontext.S
diff -u src/lib/libc/arch/arm/gen/swapcontext.S:1.15 src/lib/libc/arch/arm/gen/swapcontext.S:1.15.2.1
--- src/lib/libc/arch/arm/gen/swapcontext.S:1.15	Wed Nov 21 21:01:41 2018
+++ src/lib/libc/arch/arm/gen/swapcontext.S	Sun Aug  8 10:22:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.15 2018/11/21 21:01:41 skrll Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.15.2.1 2021/08/08 10:22:04 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-RCSID("$NetBSD: swapcontext.S,v 1.15 2018/11/21 21:01:41 skrll Exp $")
+RCSID("$NetBSD: swapcontext.S,v 1.15.2.1 2021/08/08 10:22:04 martin Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 ENTRY(swapcontext)
@@ -84,9 +84,9 @@ ENTRY(swapcontext)
 #if !defined(__thumb__) || defined(_ARM_ARCH_T2)
 	b	PLT_SYM(_C_LABEL(setcontext))
 #else
-	push	{lr}
+	push	{r3, lr}
 	bl	PLT_SYM(_C_LABEL(setcontext))
-	pop	{pc}
+	pop	{r3, pc}
 #endif
 #if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
 	.cfi_endproc

Index: src/lib/libc/arch/arm/sys/__clone.S
diff -u src/lib/libc/arch/arm/sys/__clone.S:1.9 src/lib/libc/arch/arm/sys/__clone.S:1.9.28.1
--- src/lib/libc/arch/arm/sys/__clone.S:1.9	Sat Nov 30 20:20:42 2013
+++ src/lib/libc/arch/arm/sys/__clone.S	Sun Aug  8 10:22:04 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: __clone.S,v 1.9 2013/11/30 20:20:42 joerg Exp $ */
+/* $NetBSD: __clone.S,v 1.9.28.1 2021/08/08 10:22:04 martin Exp $ */
 
 /*
  * Copyright (c) 2001 Christopher Gilbert
@@ -55,21 +55,17 @@ ENTRY(__clone)
 
 	/* place the func and its arg onto the child's stack */
 #if !defined(__thumb__) || defined(_ARM_ARCH_T2)
-	stmfd	r1!, {r0, r3} 
+	stmfd	r1!, {r0, r3}
 #else
 	subs	r1, r1, #8
-	stmia	r1!, 

CVS commit: [netbsd-9] src/doc

2021-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug  8 10:23:51 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Tickets #1327 - #1329


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.19 -r1.1.2.20 src/doc/CHANGES-9.3

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

Modified files:

Index: src/doc/CHANGES-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.19 src/doc/CHANGES-9.3:1.1.2.20
--- src/doc/CHANGES-9.3:1.1.2.19	Tue Aug  3 16:14:21 2021
+++ src/doc/CHANGES-9.3	Sun Aug  8 10:23:51 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.19 2021/08/03 16:14:21 snj Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.20 2021/08/08 10:23:51 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -394,3 +394,72 @@ share/man/man4/man4.x86/amdccp.4		1.1
 	Add a man page for amdccp(4)
 	[nia, ticket #1326]
 
+sys/external/bsd/drm2/linux/linux_reservation.c	1.13,1.14
+
+	drm: fix more drm memory leaks.
+	[riastradh, ticket #1327]
+
+lib/libc/compiler_rt/Makefile.inc		1.40
+lib/libm/compiler_rt/Makefile.inc		1.11
+sys/external/bsd/compiler_rt/abi.mk		1.1
+sys/external/bsd/compiler_rt/dist/lib/builtins/adddf3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/addsf3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cdcmpeq_check_nan.c 1.2
+sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmpeq_check_nan.c 1.2
+sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_div0.c 1.2
+sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_drsub.c 1.2
+sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_frsub.c 1.2
+sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/comparedf2.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/divsf3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/extendsfdf2.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfdi.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfdi.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfsi.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfdi.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfdi.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfsi.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c 1.3-1.5
+sys/external/bsd/compiler_rt/dist/lib/builtins/floatdisf.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/floatsidf.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/floatsisf.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/floatundidf.c 1.3,1.4
+sys/external/bsd/compiler_rt/dist/lib/builtins/floatundisf.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsidf.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsisf.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h 1.2-1.6
+sys/external/bsd/compiler_rt/dist/lib/builtins/lshrdi3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/muldf3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/muldi3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/mulsf3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/negdf2.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/negsf2.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/subdf3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/subsf3.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfhf2.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfsf2.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/truncsfhf2.c 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/udivsi3.c 1.2,1.3
+sys/lib/libkern/Makefile.compiler-rt		1.13
+
+	arm: PR 55897: fix various complex arithmetics issues by cherry
+	picking the relevant upstream changes.
+	[skrll, ticket #1328]
+
+lib/libc/arch/arm/gen/swapcontext.S		1.16-1.18
+lib/libc/arch/arm/sys/__clone.S			1.10-1.14
+sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S 1.2,1.3
+sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S 1.2,1.3
+
+	arm: align stack pointer to 8-byte boundary as required by EABI.
+	[skrll, ticket #1329]
+



CVS commit: src/sys/arch/arm/acpi

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 10:28:26 UTC 2021

Modified Files:
src/sys/arch/arm/acpi: acpi_machdep.c

Log Message:
arm: ACPI: Add support for simple sharing of platform interrupts

Allow sharing of platform interrupts provided that the type, ipl, and
mpsafe-ness are the same.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/acpi/acpi_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/arm/acpi/acpi_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_machdep.c:1.24 src/sys/arch/arm/acpi/acpi_machdep.c:1.25
--- src/sys/arch/arm/acpi/acpi_machdep.c:1.24	Sat Aug  7 18:40:45 2021
+++ src/sys/arch/arm/acpi/acpi_machdep.c	Sun Aug  8 10:28:26 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.24 2021/08/07 18:40:45 jmcneill Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.25 2021/08/08 10:28:26 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "pci.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.24 2021/08/07 18:40:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.25 2021/08/08 10:28:26 jmcneill Exp $");
 
 #include 
 #include 
@@ -63,6 +63,27 @@ extern struct bus_space arm_generic_bs_t
 extern struct arm32_bus_dma_tag acpi_coherent_dma_tag;
 extern struct arm32_bus_dma_tag arm_generic_dma_tag;
 
+struct acpi_intrhandler {
+	int(*ah_fn)(void *);
+	void*ah_arg;
+	TAILQ_ENTRY(acpi_intrhandler)	ah_list;
+};
+
+struct acpi_intrvec {
+	intai_irq;
+	intai_ipl;
+	intai_type;
+	boolai_mpsafe;
+	intai_refcnt;
+	void*ai_arg;
+	void*ai_ih;
+	TAILQ_HEAD(, acpi_intrhandler)	ai_handlers;
+	TAILQ_ENTRY(acpi_intrvec)	ai_list;
+};
+
+static TAILQ_HEAD(, acpi_intrvec) acpi_intrvecs =
+TAILQ_HEAD_INITIALIZER(acpi_intrvecs);
+
 bus_dma_tag_t	arm_acpi_dma32_tag(struct acpi_softc *, struct acpi_devnode *);
 bus_dma_tag_t	arm_acpi_dma64_tag(struct acpi_softc *, struct acpi_devnode *);
 
@@ -256,28 +277,128 @@ acpi_md_OsDisableInterrupt(void)
 	cpsid(I32_bit);
 }
 
+static struct acpi_intrvec *
+acpi_md_intr_lookup(int irq)
+{
+	struct acpi_intrvec *ai;
+
+	TAILQ_FOREACH(ai, &acpi_intrvecs, ai_list) {
+		if (ai->ai_irq == irq) {
+			return ai;
+		}
+	}
+
+	return NULL;
+}
+
+static int
+acpi_md_intr(void *arg)
+{
+	struct acpi_intrvec *ai = arg;
+	struct acpi_intrhandler *ah;
+	int rv = 0;
+
+	TAILQ_FOREACH(ah, &ai->ai_handlers, ah_list) {
+		rv += ah->ah_fn(ah->ah_arg);
+	}
+
+	return rv;
+}
+
 void *
 acpi_md_intr_establish(uint32_t irq, int ipl, int type, int (*handler)(void *), void *arg, bool mpsafe, const char *xname)
 {
-	return intr_establish_xname(irq, ipl, type | (mpsafe ? IST_MPSAFE : 0), handler, arg, xname);
+	struct acpi_intrvec *ai;
+	struct acpi_intrhandler *ah;
+
+	ai = acpi_md_intr_lookup(irq);
+	if (ai == NULL) {
+		ai = kmem_zalloc(sizeof(*ai), KM_SLEEP);
+		ai->ai_refcnt = 0;
+		ai->ai_irq = irq;
+		ai->ai_ipl = ipl;
+		ai->ai_type = type;
+		ai->ai_mpsafe = mpsafe;
+		ai->ai_arg = arg;
+		TAILQ_INIT(&ai->ai_handlers);
+		if (arg == NULL) {
+			ai->ai_ih = intr_establish_xname(irq, ipl,
+			type | (mpsafe ? IST_MPSAFE : 0), handler, NULL,
+			xname);
+		} else {
+			ai->ai_ih = intr_establish_xname(irq, ipl,
+			type | (mpsafe ? IST_MPSAFE : 0), acpi_md_intr, ai,
+			xname);
+		}
+		if (ai->ai_ih == NULL) {
+			kmem_free(ai, sizeof(*ai));
+			return NULL;
+		}
+		TAILQ_INSERT_TAIL(&acpi_intrvecs, ai, ai_list);
+	} else {
+		if (ai->ai_arg == NULL) {
+			printf("ACPI: cannot share irq with NULL arg\n");
+			return NULL;
+		}
+		if (ai->ai_ipl != ipl) {
+			printf("ACPI: cannot share irq with different ipl\n");
+			return NULL;
+		}
+		if (ai->ai_type != type) {
+			printf("ACPI: cannot share edge and level interrupts\n");
+			return NULL;
+		}
+		if (ai->ai_mpsafe != mpsafe) {
+			printf("ACPI: cannot share between mpsafe/non-mpsafe\n");
+			return NULL;
+		}
+	}
+
+	ai->ai_refcnt++;
+
+	ah = kmem_zalloc(sizeof(*ah), KM_SLEEP);
+	ah->ah_fn = handler;
+	ah->ah_arg = arg;
+	TAILQ_INSERT_TAIL(&ai->ai_handlers, ah, ah_list);
+
+	return ai->ai_ih;
 }
 
 void
-acpi_md_intr_mask(void *ih)
+acpi_md_intr_disestablish(void *ih)
 {
-	intr_mask(ih);
+	struct acpi_intrvec *ai;
+	struct acpi_intrhandler *ah;
+
+	TAILQ_FOREACH(ai, &acpi_intrvecs, ai_list) {
+		if (ai->ai_ih == ih) {
+			KASSERT(ai->ai_refcnt > 0);
+			if (ai->ai_refcnt > 1) {
+panic("%s: cannot disestablish shared irq", __func__);
+			}
+
+			TAILQ_REMOVE(&acpi_intrvecs, ai, ai_list);
+			ah = TAILQ_FIRST(&ai->ai_handlers);
+			kmem_free(ah, sizeof(*ah));
+			intr_disestablish(ai->ai_ih);
+			kmem_free(ai, sizeof(*ai));
+			return;
+		}
+	}
+
+	panic("%s: interrupt not established", __func__);
 }
 
 void
-acpi_md_intr_unmask(void *ih)
+acpi_md_intr_mask(void *ih)
 {
-	intr_unmask(ih);
+	intr_mask(ih);
 }
 
 void
-acpi_md_intr_disestablish(void 

CVS commit: src/sys/arch/arm/broadcom

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 10:32:27 UTC 2021

Modified Files:
src/sys/arch/arm/broadcom: files.bcm2835
Added Files:
src/sys/arch/arm/broadcom: bcm2838_emmc2_acpi.c

Log Message:
bcm2838: Add ACPI support for the EMMC2 SDHCI controller.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2838_emmc2_acpi.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/arm/broadcom/files.bcm2835

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/arm/broadcom/files.bcm2835
diff -u src/sys/arch/arm/broadcom/files.bcm2835:1.40 src/sys/arch/arm/broadcom/files.bcm2835:1.41
--- src/sys/arch/arm/broadcom/files.bcm2835:1.40	Wed Mar 10 11:03:48 2021
+++ src/sys/arch/arm/broadcom/files.bcm2835	Sun Aug  8 10:32:26 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.bcm2835,v 1.40 2021/03/10 11:03:48 mlelstv Exp $
+#	$NetBSD: files.bcm2835,v 1.41 2021/08/08 10:32:26 jmcneill Exp $
 #
 # Configuration info for Broadcom BCM2835 ARM Peripherals
 #
@@ -67,6 +67,8 @@ file	arch/arm/broadcom/bcm2835_emmc.c	bc
 ifdef acpinodebus
 attach	sdhc at acpinodebus with bcmemmc_acpi
 file	arch/arm/broadcom/bcm2835_emmc_acpi.c	bcmemmc_acpi
+attach	sdhc at acpinodebus with bcmemmc2_acpi
+file	arch/arm/broadcom/bcm2838_emmc2_acpi.c	bcmemmc2_acpi
 endif
 
 # SD Host Controller (BCM2835_SDHOST_BASE)

Added files:

Index: src/sys/arch/arm/broadcom/bcm2838_emmc2_acpi.c
diff -u /dev/null src/sys/arch/arm/broadcom/bcm2838_emmc2_acpi.c:1.1
--- /dev/null	Sun Aug  8 10:32:27 2021
+++ src/sys/arch/arm/broadcom/bcm2838_emmc2_acpi.c	Sun Aug  8 10:32:26 2021
@@ -0,0 +1,164 @@
+/*	$NetBSD: bcm2838_emmc2_acpi.c,v 1.1 2021/08/08 10:32:26 jmcneill Exp $	*/
+
+/*
+ * Copyright (c) 2021 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: bcm2838_emmc2_acpi.c,v 1.1 2021/08/08 10:32:26 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define _COMPONENT	ACPI_RESOURCE_COMPONENT
+ACPI_MODULE_NAME	("bcmemmc2_acpi")
+
+static int	bcmemmc2_acpi_match(device_t, cfdata_t, void *);
+static void	bcmemmc2_acpi_attach(device_t, device_t, void *);
+static void	bcmemmc2_acpi_attach1(device_t);
+
+static const char * const compatible[] = {
+	"BRCME88C",
+	NULL
+};
+
+struct bcmemmc2_acpi_softc {
+	struct sdhc_softc sc;
+	bus_space_tag_t sc_memt;
+	bus_space_handle_t sc_memh;
+	bus_size_t sc_memsize;
+	void *sc_ih;
+	struct sdhc_host *sc_hosts[1];
+};
+
+CFATTACH_DECL_NEW(bcmemmc2_acpi, sizeof(struct bcmemmc2_acpi_softc),
+bcmemmc2_acpi_match, bcmemmc2_acpi_attach, NULL, NULL);
+
+static int
+bcmemmc2_acpi_match(device_t parent, cfdata_t match, void *opaque)
+{
+	struct acpi_attach_args *aa = opaque;
+
+	if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
+		return 0;
+
+	return acpi_match_hid(aa->aa_node->ad_devinfo, compatible);
+}
+
+static void
+bcmemmc2_acpi_attach(device_t parent, device_t self, void *opaque)
+{
+	struct bcmemmc2_acpi_softc *sc = device_private(self);
+	struct acpi_attach_args *aa = opaque;
+	struct acpi_resources res;
+	struct acpi_mem *mem;
+	struct acpi_irq *irq;
+	ACPI_STATUS rv;
+
+	sc->sc.sc_dev = self;
+	sc->sc.sc_dmat = aa->aa_dmat;
+	sc->sc.sc_host = sc->sc_hosts;
+	sc->sc_memt = aa->aa_memt;
+
+	rv = acpi_resource_parse(self, aa->aa_node->ad_handle, "_CRS",
+	&res, &acpi_resource_parse_ops_default);
+	if (ACPI_FAILURE(rv))
+		return;
+
+	mem = acpi_res_mem(&res, 0);
+	irq = acpi_res_irq(&res, 0);
+	if (mem == NULL || irq == NULL) {
+		aprint_error_dev(self, "incomplete resources\n");
+		goto cleanup;
+	}
+	if (mem->ar_length == 0) {
+		aprint_error_dev(self, "zero length memory resou

CVS commit: src/usr.bin/xlint/lint1

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 10:41:34 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: emit1.c

Log Message:
lint: condense code for writing the .ln files

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/xlint/lint1/emit1.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/emit1.c
diff -u src/usr.bin/xlint/lint1/emit1.c:1.47 src/usr.bin/xlint/lint1/emit1.c:1.48
--- src/usr.bin/xlint/lint1/emit1.c:1.47	Sat Jul 31 19:52:44 2021
+++ src/usr.bin/xlint/lint1/emit1.c	Sun Aug  8 10:41:34 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.47 2021/07/31 19:52:44 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.48 2021/08/08 10:41:34 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit1.c,v 1.47 2021/07/31 19:52:44 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.48 2021/08/08 10:41:34 rillig Exp $");
 #endif
 
 #include "lint1.h"
@@ -227,26 +227,19 @@ outsym(const sym_t *sym, scl_t sc, def_t
 
 	/* flags */
 
-	switch (def) {
-	case DEF:
-		/* defined */
-		outchar('d');
-		break;
-	case TDEF:
-		/* tentative defined */
-		outchar('t');
-		break;
-	case DECL:
-		/* declared */
-		outchar('e');
-		break;
-	default:
-		lint_assert(/*CONSTCOND*/false);
+	if (def == DEF)
+		outchar('d');	/* defined */
+	else if (def == TDEF)
+		outchar('t');	/* tentative defined */
+	else {
+		lint_assert(def == DECL);
+		outchar('e');	/* declared */
 	}
+
 	if (llibflg && def != DECL) {
 		/*
-		 * mark it as used so we get no warnings from lint2 about
-		 * unused symbols in libraries.
+		 * mark it as used so lint2 does not complain about
+		 * unused symbols in libraries
 		 */
 		outchar('u');
 	}
@@ -327,8 +320,7 @@ outfdef(const sym_t *fsym, const pos_t *
 	outchar('d');
 
 	if (rval)
-		/* has return value */
-		outchar('r');
+		outchar('r');	/* has return value */
 
 	if (llibflg)
 		/*
@@ -338,8 +330,7 @@ outfdef(const sym_t *fsym, const pos_t *
 		outchar('u');
 
 	if (osdef)
-		/* old style function definition */
-		outchar('o');
+		outchar('o');	/* old style function definition */
 
 	if (fsym->s_inline)
 		outchar('i');



CVS commit: src/sbin/devpubd/hooks

2021-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug  8 10:48:35 UTC 2021

Modified Files:
src/sbin/devpubd/hooks: 02-wedgenames

Log Message:
Fix obvious editor mishap in previous


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sbin/devpubd/hooks/02-wedgenames

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

Modified files:

Index: src/sbin/devpubd/hooks/02-wedgenames
diff -u src/sbin/devpubd/hooks/02-wedgenames:1.7 src/sbin/devpubd/hooks/02-wedgenames:1.8
--- src/sbin/devpubd/hooks/02-wedgenames:1.7	Thu Aug  5 12:52:47 2021
+++ src/sbin/devpubd/hooks/02-wedgenames	Sun Aug  8 10:48:35 2021
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: 02-wedgenames,v 1.7 2021/08/05 12:52:47 kre Exp $
+# $NetBSD: 02-wedgenames,v 1.8 2021/08/08 10:48:35 martin Exp $
 #
 # Try to maintain symlinks to wedge devices
 #
@@ -160,4 +160,4 @@ for device do
 		esac
 		;;
 	esac
-ce-attach
+done



CVS commit: src/sys/arch/arm/broadcom

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 10:59:27 UTC 2021

Modified Files:
src/sys/arch/arm/broadcom: bcm2838_emmc2_acpi.c

Log Message:
disable DMA for now...


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/broadcom/bcm2838_emmc2_acpi.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/arm/broadcom/bcm2838_emmc2_acpi.c
diff -u src/sys/arch/arm/broadcom/bcm2838_emmc2_acpi.c:1.1 src/sys/arch/arm/broadcom/bcm2838_emmc2_acpi.c:1.2
--- src/sys/arch/arm/broadcom/bcm2838_emmc2_acpi.c:1.1	Sun Aug  8 10:32:26 2021
+++ src/sys/arch/arm/broadcom/bcm2838_emmc2_acpi.c	Sun Aug  8 10:59:27 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2838_emmc2_acpi.c,v 1.1 2021/08/08 10:32:26 jmcneill Exp $	*/
+/*	$NetBSD: bcm2838_emmc2_acpi.c,v 1.2 2021/08/08 10:59:27 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2021 Jared McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2838_emmc2_acpi.c,v 1.1 2021/08/08 10:32:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2838_emmc2_acpi.c,v 1.2 2021/08/08 10:59:27 jmcneill Exp $");
 
 #include 
 #include 
@@ -119,8 +119,10 @@ bcmemmc2_acpi_attach(device_t parent, de
 	 * disable UHS modes.
 	 */
 	sc->sc.sc_flags = SDHC_FLAG_32BIT_ACCESS |
+#if notyet
 			  SDHC_FLAG_USE_DMA |
 			  SDHC_FLAG_USE_ADMA2 |
+#endif
 			  SDHC_FLAG_NO_1_8_V;
 
 	sc->sc_ih = acpi_intr_establish(self,



CVS commit: src/tests/usr.bin/xlint

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 11:07:20 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: emit.c emit.exp-ln
src/tests/usr.bin/xlint/lint2: read_printf.ln

Log Message:
tests/lint: test passing of printf-like strings between lint1 and lint2


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/emit.c \
src/tests/usr.bin/xlint/lint1/emit.exp-ln
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/read_printf.ln

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/emit.c
diff -u src/tests/usr.bin/xlint/lint1/emit.c:1.1 src/tests/usr.bin/xlint/lint1/emit.c:1.2
--- src/tests/usr.bin/xlint/lint1/emit.c:1.1	Sun Apr 18 20:02:56 2021
+++ src/tests/usr.bin/xlint/lint1/emit.c	Sun Aug  8 11:07:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: emit.c,v 1.1 2021/04/18 20:02:56 rillig Exp $	*/
+/*	$NetBSD: emit.c,v 1.2 2021/08/08 11:07:19 rillig Exp $	*/
 # 3 "emit.c"
 
 /*
@@ -144,3 +144,22 @@ void taking_varargs(const char *, ...);
  * it.
  */
 static int static_function(void);			/* expect: declared */
+
+void my_printf(const char *, ...);
+
+/*
+ * String literals that occur in function calls are written to the .ln file,
+ * just in case they are related to a printf-like or scanf-like function.
+ *
+ * In this example, the various strings are not format strings, they just
+ * serve to cover the code that escapes character literals (outqchar in
+ * lint1) and reads them back into characters (inpqstrg in lint2).
+ */
+void
+cover_outqchar(void)
+{
+	my_printf("%s", "%");
+	my_printf("%s", "%s");
+	my_printf("%s", "%%");
+	my_printf("%s", "%\a %\b %\f %\n %\r %\t %\v %\177");
+}
Index: src/tests/usr.bin/xlint/lint1/emit.exp-ln
diff -u src/tests/usr.bin/xlint/lint1/emit.exp-ln:1.1 src/tests/usr.bin/xlint/lint1/emit.exp-ln:1.2
--- src/tests/usr.bin/xlint/lint1/emit.exp-ln:1.1	Sun Jun 27 09:22:31 2021
+++ src/tests/usr.bin/xlint/lint1/emit.exp-ln	Sun Aug  8 11:07:19 2021
@@ -50,3 +50,9 @@ Semit.c
 136d0.135e33taking_struct_union_enum_typedefsF3sT214struct_typedefuT213union_typedefeT212enum_typedefV
 138d0.138e14taking_varargsF2PcCEV
 146d0.146es15static_functionF0I
+148d0.148e9my_printfF2PcCEV
+161c0.161s2"%"i9my_printff2PcCPCV
+162c0.162s2"%s"i9my_printff2PcCPCV
+163c0.163s2"%%"i9my_printff2PcCPCV
+164c0.164s2"%\a%\b%\f%\n%\r%\t%\v%\177"i9my_printff2PcCPCV
+159d0.159d14cover_outqcharF0V

Index: src/tests/usr.bin/xlint/lint2/read_printf.ln
diff -u src/tests/usr.bin/xlint/lint2/read_printf.ln:1.1 src/tests/usr.bin/xlint/lint2/read_printf.ln:1.2
--- src/tests/usr.bin/xlint/lint2/read_printf.ln:1.1	Sat Aug  7 23:52:32 2021
+++ src/tests/usr.bin/xlint/lint2/read_printf.ln	Sun Aug  8 11:07:19 2021
@@ -1,4 +1,4 @@
-# $NetBSD: read_printf.ln,v 1.1 2021/08/07 23:52:32 rillig Exp $
+# $NetBSD: read_printf.ln,v 1.2 2021/08/08 11:07:19 rillig Exp $
 #
 # Test reading of declarations and usage of printf-like functions.
 
@@ -33,3 +33,9 @@ Sprintf-use.c
 # Argument 3 is a negative integer.
 # Argument 4 has no further interesting properties.
 13c0.13 s2"" n3 i 9my_printf f4 PcC PC I PcV V
+
+# See tests/lint1/emit.c, function cover_outqchar.
+161c0.161 s2"%" i 9my_printf f2 PcC PC V
+162c0.162 s2"%s"i 9my_printf f2 PcC PC V
+163c0.163 s2"%%" i 9my_printf f2 PcC PC V
+164c0.164 s2"%\a%\b%\f%\n%\r%\t%\v%\177" i 9my_printf f2 PcC PC V



CVS commit: src/sys/dev/sdmmc

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 11:11:29 UTC 2021

Modified Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
Use SMBIOS system product instead of the string "netbsd,generic-acpi"
for firmware loading on ACPI systems.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/sdmmc/if_bwfm_sdio.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/dev/sdmmc/if_bwfm_sdio.c
diff -u src/sys/dev/sdmmc/if_bwfm_sdio.c:1.26 src/sys/dev/sdmmc/if_bwfm_sdio.c:1.27
--- src/sys/dev/sdmmc/if_bwfm_sdio.c:1.26	Mon Jun 21 03:17:59 2021
+++ src/sys/dev/sdmmc/if_bwfm_sdio.c	Sun Aug  8 11:11:29 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwfm_sdio.c,v 1.26 2021/06/21 03:17:59 christos Exp $ */
+/* $NetBSD: if_bwfm_sdio.c,v 1.27 2021/08/08 11:11:29 jmcneill Exp $ */
 /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -592,10 +592,17 @@ bwfm_fdt_find_phandle(device_t self, dev
 static const char *
 bwfm_fdt_get_model(void)
 {
+	const char *model;
 	int phandle;
 
 	phandle = OF_finddevice("/");
-	return fdtbus_get_string_index(phandle, "compatible", 0);
+	model = fdtbus_get_string_index(phandle, "compatible", 0);
+	if (model == NULL ||
+	(model != NULL && strcmp(model, "netbsd,generic-acpi") == 0)) {
+		model = pmf_get_platform("system-product");
+	}
+
+	return model;
 }
 
 static int



CVS commit: src/usr.bin/xlint/lint2

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 11:56:36 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: Makefile chk.c read.c

Log Message:
lint: force strict bool mode

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/xlint/lint2/Makefile
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/xlint/lint2/chk.c
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/xlint/lint2/read.c

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

Modified files:

Index: src/usr.bin/xlint/lint2/Makefile
diff -u src/usr.bin/xlint/lint2/Makefile:1.20 src/usr.bin/xlint/lint2/Makefile:1.21
--- src/usr.bin/xlint/lint2/Makefile:1.20	Sun Apr 18 22:51:24 2021
+++ src/usr.bin/xlint/lint2/Makefile	Sun Aug  8 11:56:35 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20 2021/04/18 22:51:24 rillig Exp $
+#	$NetBSD: Makefile,v 1.21 2021/08/08 11:56:35 rillig Exp $
 
 NOMAN=		# defined
 
@@ -7,6 +7,7 @@ SRCS=		main2.c hash.c read.c mem.c mem2.
 		inittyp.c tyname.c
 BINDIR=		/usr/libexec
 CPPFLAGS+=	-I${.CURDIR}
+LINTFLAGS+=	-T		# strict bool mode
 
 COPTS.msg.c+=	${${ACTIVE_CC} == "clang":? -Wno-format-nonliteral :}
 

Index: src/usr.bin/xlint/lint2/chk.c
diff -u src/usr.bin/xlint/lint2/chk.c:1.42 src/usr.bin/xlint/lint2/chk.c:1.43
--- src/usr.bin/xlint/lint2/chk.c:1.42	Fri Apr  2 12:16:50 2021
+++ src/usr.bin/xlint/lint2/chk.c	Sun Aug  8 11:56:35 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: chk.c,v 1.42 2021/04/02 12:16:50 rillig Exp $ */
+/* $NetBSD: chk.c,v 1.43 2021/08/08 11:56:35 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: chk.c,v 1.42 2021/04/02 12:16:50 rillig Exp $");
+__RCSID("$NetBSD: chk.c,v 1.43 2021/08/08 11:56:35 rillig Exp $");
 #endif
 
 #include 
@@ -1085,9 +1085,9 @@ chkrvu(hte_t *hte, sym_t *def)
 		 * but for now I don't want to be bothered by this warnings
 		 * which are almost always useless.
 		 */
-		if (hflag == 0)
+		if (!hflag)
 			return;
-		if (hflag == 1 && bsearch(hte->h_name, ignorelist,
+		if (hflag && bsearch(hte->h_name, ignorelist,
 		__arraycount(ignorelist), sizeof(ignorelist[0]),
 		(int (*)(const void *, const void *))strcmp) != NULL)
 			return;
@@ -1340,7 +1340,7 @@ eqargs(type_t *tp1, type_t *tp2, bool *d
 
 	while (*a1 != NULL && *a2 != NULL) {
 
-		if (eqtype(*a1, *a2, true, false, false, dowarn) == 0)
+		if (!eqtype(*a1, *a2, true, false, false, dowarn))
 			return false;
 
 		a1++;

Index: src/usr.bin/xlint/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.48 src/usr.bin/xlint/lint2/read.c:1.49
--- src/usr.bin/xlint/lint2/read.c:1.48	Thu Aug  5 06:54:16 2021
+++ src/usr.bin/xlint/lint2/read.c	Sun Aug  8 11:56:35 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.48 2021/08/05 06:54:16 rillig Exp $ */
+/* $NetBSD: read.c,v 1.49 2021/08/08 11:56:35 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.48 2021/08/05 06:54:16 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.49 2021/08/08 11:56:35 rillig Exp $");
 #endif
 
 #include 
@@ -402,7 +402,7 @@ decldef(pos_t *posp, const char *cp)
 			sym.s_def = DECL;
 			break;
 		case 'i':
-			if (sym.s_inline != NODECL)
+			if (sym.s_inline)
 inperr("inline %c", c);
 			sym.s_inline = true;
 			break;



CVS commit: src/usr.bin/make

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 12:00:30 UTC 2021

Modified Files:
src/usr.bin/make: var.c

Log Message:
make: remove redundant initialization in ApplyModifier_Order

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.945 -r1.946 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.945 src/usr.bin/make/var.c:1.946
--- src/usr.bin/make/var.c:1.945	Sat Jul 31 09:30:17 2021
+++ src/usr.bin/make/var.c	Sun Aug  8 12:00:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.945 2021/07/31 09:30:17 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.946 2021/08/08 12:00:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.945 2021/07/31 09:30:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.946 2021/08/08 12:00:30 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -3355,7 +3355,7 @@ ApplyModifier_Order(const char **pp, Mod
 {
 	const char *mod = *pp;
 	Words words;
-	int (*cmp)(const void *, const void *) = NULL;
+	int (*cmp)(const void *, const void *);
 
 	if (IsDelimiter(mod[1], ch) || mod[1] == '\0') {
 		cmp = str_cmp_asc;



CVS commit: src/sys/arch/arm/acpi

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 12:09:52 UTC 2021

Modified Files:
src/sys/arch/arm/acpi: acpi_pci_machdep.c

Log Message:
Install the shared PCI INTx interrupt handler at IPL_VM to workaround a
possible interrupt storm at boot. Need to revisit this.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/acpi/acpi_pci_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/arm/acpi/acpi_pci_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.19 src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.20
--- src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.19	Sat Aug  7 21:27:53 2021
+++ src/sys/arch/arm/acpi/acpi_pci_machdep.c	Sun Aug  8 12:09:52 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci_machdep.c,v 1.19 2021/08/07 21:27:53 jmcneill Exp $ */
+/* $NetBSD: acpi_pci_machdep.c,v 1.20 2021/08/08 12:09:52 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018, 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.19 2021/08/07 21:27:53 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.20 2021/08/08 12:09:52 jmcneill Exp $");
 
 #include 
 #include 
@@ -536,7 +536,7 @@ acpi_pci_md_intr_establish(void *v, pci_
 		pi->pi_pic.pic_ops = &acpi_pci_pic_ops;
 		pi->pi_irqbase = pic_add(&pi->pi_pic, PIC_IRQBASE_ALLOC);
 		TAILQ_INSERT_TAIL(&acpi_pci_intrs, pi, pi_list);
-		pi->pi_ih = intr_establish_xname(irq, IPL_SCHED, IST_LEVEL | IST_MPSAFE,
+		pi->pi_ih = intr_establish_xname(irq, IPL_VM, IST_LEVEL | IST_MPSAFE,
 		pic_handle_intr, &pi->pi_pic, device_xname(ap->ap_dev));
 	}
 	if (pi->pi_ih == NULL)



CVS commit: src/sys/dev/pci

2021-08-08 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sun Aug  8 12:17:37 UTC 2021

Modified Files:
src/sys/dev/pci: radeonfb.c

Log Message:
radeonfb: use BUS_SPACE_MAP_PREFETCHABLE for the framebuffer mapping

Makes the driver work on cia(4) based alpha machines, which can only
do dense access to linear mappings with prefetch. ok macallan@


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/dev/pci/radeonfb.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/dev/pci/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.116 src/sys/dev/pci/radeonfb.c:1.117
--- src/sys/dev/pci/radeonfb.c:1.116	Sat Aug  7 16:19:14 2021
+++ src/sys/dev/pci/radeonfb.c	Sun Aug  8 12:17:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.116 2021/08/07 16:19:14 thorpej Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.117 2021/08/08 12:17:37 tnn Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.116 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.117 2021/08/08 12:17:37 tnn Exp $");
 
 #include 
 #include 
@@ -799,7 +799,8 @@ radeonfb_attach(device_t parent, device_
 
 	sc->sc_memt = pa->pa_memt;
 	if (bus_space_map(sc->sc_memt, sc->sc_memaddr, sc->sc_memsz,
-		BUS_SPACE_MAP_LINEAR, &sc->sc_memh) != 0) {
+		BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE,
+		&sc->sc_memh) != 0) {
 		sc->sc_memsz = 0;
 		aprint_error("%s: Unable to map frame buffer\n", XNAME(sc));
 		goto error;
@@ -1098,7 +1099,8 @@ radeonfb_map(struct radeonfb_softc *sc)
 			return;
 		}
 		if (bus_space_map(sc->sc_memt, sc->sc_memaddr, sc->sc_memsz,
-		BUS_SPACE_MAP_LINEAR, &sc->sc_memh) != 0) {
+		BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE,
+		&sc->sc_memh) != 0) {
 			sc->sc_memsz = 0;
 			aprint_error_dev(sc->sc_dev,
 			"Unable to map frame buffer\n");



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

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 12:31:43 UTC 2021

Modified Files:
src/sys/arch/evbarm/conf: std.generic64

Log Message:
Enable options PCI_SMCCC on 64-bit Arm.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/std.generic64

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/evbarm/conf/std.generic64
diff -u src/sys/arch/evbarm/conf/std.generic64:1.13 src/sys/arch/evbarm/conf/std.generic64:1.14
--- src/sys/arch/evbarm/conf/std.generic64:1.13	Tue Sep  8 17:39:04 2020
+++ src/sys/arch/evbarm/conf/std.generic64	Sun Aug  8 12:31:42 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: std.generic64,v 1.13 2020/09/08 17:39:04 jakllsch Exp $
+#	$NetBSD: std.generic64,v 1.14 2021/08/08 12:31:42 jmcneill Exp $
 #
 #	generic NetBSD/evbarm64 with FDT support
 
@@ -19,6 +19,7 @@ options 	FPU_VFP
 options 	MODULAR
 options 	MODULAR_DEFAULT_AUTOLOAD
 options 	PCI_NETBSD_CONFIGURE
+options 	PCI_SMCCC		# Arm PCI Conf Access Firmware Interface
 options 	_ARM32_NEED_BUS_DMA_BOUNCE
 options 	__HAVE_GENERIC_CPU_INITCLOCKS
 options 	__HAVE_PCI_CONF_HOOK



CVS commit: src/doc

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 12:35:44 UTC 2021

Modified Files:
src/doc: CHANGES

Log Message:
evbarm: Add support for Arm PCI Configuration Space Access Firmware
Interface (DEN0115).
evbarm: Add support for Broadcom BCM2838 EMMC2 in ACPI mode, as found
on the Raspberry Pi 4.
evbarm: Add support for shared ACPI platform interrupts.


To generate a diff of this commit:
cvs rdiff -u -r1.2817 -r1.2818 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2817 src/doc/CHANGES:1.2818
--- src/doc/CHANGES:1.2817	Tue Aug  3 09:25:43 2021
+++ src/doc/CHANGES	Sun Aug  8 12:35:43 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2817 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2818 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -390,3 +390,9 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	kernel: Tie the maximum file lock per unprivilegied uid to 
 		kern.maxfiles [manu 20210727]
 	evbppc: Switch ibm4xx to generic evbppc kernel modules. [rin 20210803]
+	evbarm: Add support for Arm PCI Configuration Space Access Firmware
+		Interface (DEN0115). [jmcneill 20210808]
+	evbarm: Add support for Broadcom BCM2838 EMMC2 in ACPI mode, as found
+		on the Raspberry Pi 4. [jmcneill 20210808]
+	evbarm: Add support for shared ACPI platform interrupts.
+		[jmcneill 20210808]



CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 13:19:51 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: accept.sh c99_bool_strict_suppressed.c

Log Message:
tests/lint: clean up accept.sh, document test for removed assertion


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/accept.sh
cvs rdiff -u -r1.3 -r1.4 \
src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/accept.sh
diff -u src/tests/usr.bin/xlint/lint1/accept.sh:1.4 src/tests/usr.bin/xlint/lint1/accept.sh:1.5
--- src/tests/usr.bin/xlint/lint1/accept.sh:1.4	Thu Aug  5 06:34:43 2021
+++ src/tests/usr.bin/xlint/lint1/accept.sh	Sun Aug  8 13:19:51 2021
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: accept.sh,v 1.4 2021/08/05 06:34:43 rillig Exp $
+# $NetBSD: accept.sh,v 1.5 2021/08/08 13:19:51 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -36,6 +36,7 @@ set -eu
 . './t_integration.sh'
 
 for pattern in "$@"; do
+	# shellcheck disable=SC2231
 	for test in *$pattern*.c; do
 		base=${test%.*}
 		cfile="$base.c"
@@ -45,7 +46,7 @@ for pattern in "$@"; do
 
 		configure_test_case "$cfile"
 		# shellcheck disable=SC2154
-		if [ $skip = yes ]; then
+		if [ "$skip" = yes ]; then
 			continue
 		fi
 
@@ -93,4 +94,5 @@ for pattern in "$@"; do
 	done
 done
 
+# shellcheck disable=SC2035
 lua '../check-expect.lua' *.c

Index: src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c
diff -u src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c:1.3 src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c:1.4
--- src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c:1.3	Mon Jul  5 19:02:14 2021
+++ src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c	Sun Aug  8 13:19:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: c99_bool_strict_suppressed.c,v 1.3 2021/07/05 19:02:14 rillig Exp $	*/
+/*	$NetBSD: c99_bool_strict_suppressed.c,v 1.4 2021/08/08 13:19:51 rillig Exp $	*/
 # 3 "c99_bool_strict_suppressed.c"
 
 /*
@@ -9,12 +9,13 @@
  * This can result in assertion failures later.  One such assertion has been
  * there since at least 1995, at the beginning of expr(), ensuring that the
  * expression is either non-null or an error message has been _printed_.
- * In 1995 it was not possible to suppress error messages, which means that
+ * In 1995, it was not possible to suppress error messages, which means that
  * the number of printed errors equaled the number of occurred errors.
  *
  * In err.c 1.12 from 2000-07-06, the option -X was added, allowing to
  * suppress individual error messages.  That commit did not mention any
- * interaction with the assertion in expr().
+ * interaction with the assertion in expr().  The assertion was removed in
+ * tree.c 1.305 from 2021-07-04.
  */
 
 /* lint1-extra-flags: -T -X 107,330,331,332,333 */



CVS commit: src/tests/usr.bin/xlint/lint2

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 13:22:22 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint2: Makefile

Log Message:
tests/lint: mips64 is not a 64-bit platform

See usr.bin/xlint/arch/mips64/targparam.h.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint2/Makefile

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

Modified files:

Index: src/tests/usr.bin/xlint/lint2/Makefile
diff -u src/tests/usr.bin/xlint/lint2/Makefile:1.4 src/tests/usr.bin/xlint/lint2/Makefile:1.5
--- src/tests/usr.bin/xlint/lint2/Makefile:1.4	Sun Aug  8 00:02:02 2021
+++ src/tests/usr.bin/xlint/lint2/Makefile	Sun Aug  8 13:22:22 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2021/08/08 00:02:02 rillig Exp $
+# $NetBSD: Makefile,v 1.5 2021/08/08 13:22:22 rillig Exp $
 
 NOMAN=		yes
 
@@ -16,8 +16,8 @@ FILESDIR=	${TESTSDIR}
 TESTS+=		msg_${msg}
 .endfor
 TESTS+=		read
-.if ${MACHINE_ARCH:M*64}	# close enough to "is a 64-bit platform"
-TESTS+=		read_lp64
+.if ${MACHINE_ARCH:M*64} && !${MACHINE_ARCH:Mmips64*}
+TESTS+=		read_lp64	# only on 64-bit platforms
 .endif
 TESTS+=		read_printf
 



CVS commit: src/usr.bin/xlint/xlint

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 13:34:57 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: xlint.c

Log Message:
lint: make memory management in xlint simpler

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/xlint/xlint/xlint.c

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

Modified files:

Index: src/usr.bin/xlint/xlint/xlint.c
diff -u src/usr.bin/xlint/xlint/xlint.c:1.64 src/usr.bin/xlint/xlint/xlint.c:1.65
--- src/usr.bin/xlint/xlint/xlint.c:1.64	Sun Aug  1 18:13:53 2021
+++ src/usr.bin/xlint/xlint/xlint.c	Sun Aug  8 13:34:57 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.64 2021/08/01 18:13:53 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.65 2021/08/08 13:34:57 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: xlint.c,v 1.64 2021/08/01 18:13:53 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.65 2021/08/08 13:34:57 rillig Exp $");
 #endif
 
 #include 
@@ -347,13 +347,10 @@ main(int argc, char *argv[])
 	if ((tmp = getenv("TMPDIR")) == NULL || (len = strlen(tmp)) == 0) {
 		tmpdir = xstrdup(_PATH_TMP);
 	} else {
-		char *p = xmalloc(len + 2);
-		(void)sprintf(p, "%s%s", tmp, tmp[len - 1] == '/' ? "" : "/");
-		tmpdir = p;
+		tmpdir = concat2(tmp, tmp[len - 1] == '/' ? "" : "/");
 	}
 
-	cppout = xmalloc(strlen(tmpdir) + sizeof("lint0.XX"));
-	(void)sprintf(cppout, "%slint0.XX", tmpdir);
+	cppout = concat2(tmpdir, "lint0.XX");
 	cppoutfd = mkstemp(cppout);
 	if (cppoutfd == -1) {
 		warn("can't make temp");
@@ -516,8 +513,7 @@ main(int argc, char *argv[])
 usage();
 			Cflag = true;
 			appstrg(&l2flags, concat2("-C", optarg));
-			p2out = xmalloc(sizeof("llib-l.ln") + strlen(optarg));
-			(void)sprintf(p2out, "llib-l%s.ln", optarg);
+			p2out = xasprintf("llib-l%s.ln", optarg);
 			freelst(&deflibs);
 			break;
 
@@ -534,8 +530,7 @@ main(int argc, char *argv[])
 		case 'I':
 		case 'M':
 		case 'U':
-			(void)sprintf(flgbuf, "-%c", c);
-			appstrg(&cflags, concat2(flgbuf, optarg));
+			appstrg(&cflags, xasprintf("-%c%s", c, optarg));
 			break;
 
 		case 'l':
@@ -744,17 +739,14 @@ fname(const char *name)
 	/* run lint1 */
 
 	if (!Bflag) {
-		pathname = xmalloc(strlen(PATH_LIBEXEC) + sizeof("/lint1") +
-		strlen(target_prefix));
-		(void)sprintf(pathname, "%s/%slint1", PATH_LIBEXEC,
-		target_prefix);
+		pathname = xasprintf("%s/%slint1",
+		PATH_LIBEXEC, target_prefix);
 	} else {
 		/*
 		 * XXX Unclear whether we should be using target_prefix
 		 * XXX here.  --thor...@wasabisystems.com
 		 */
-		pathname = xmalloc(strlen(libexec_path) + sizeof("/lint1"));
-		(void)sprintf(pathname, "%s/lint1", libexec_path);
+		pathname = concat2(libexec_path, "/lint1");
 	}
 
 	appcstrg(&args, pathname);
@@ -882,17 +874,13 @@ lint2(void)
 	args = xcalloc(1, sizeof(*args));
 
 	if (!Bflag) {
-		path = xmalloc(strlen(PATH_LIBEXEC) + sizeof("/lint2") +
-		strlen(target_prefix));
-		(void)sprintf(path, "%s/%slint2", PATH_LIBEXEC,
-		target_prefix);
+		path = xasprintf("%s/%slint2", PATH_LIBEXEC, target_prefix);
 	} else {
 		/*
 		 * XXX Unclear whether we should be using target_prefix
 		 * XXX here.  --thor...@wasabisystems.com
 		 */
-		path = xmalloc(strlen(libexec_path) + sizeof("/lint2"));
-		(void)sprintf(path, "%s/lint2", libexec_path);
+		path = concat2(libexec_path, "/lint2");
 	}
 
 	appcstrg(&args, path);



CVS commit: src/sys/arch/arm/arm

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 13:43:09 UTC 2021

Modified Files:
src/sys/arch/arm/arm: smccc.c

Log Message:
fix armv7 build


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/arm/smccc.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/arm/arm/smccc.c
diff -u src/sys/arch/arm/arm/smccc.c:1.2 src/sys/arch/arm/arm/smccc.c:1.3
--- src/sys/arch/arm/arm/smccc.c:1.2	Sat Aug  7 21:21:49 2021
+++ src/sys/arch/arm/arm/smccc.c	Sun Aug  8 13:43:09 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: smccc.c,v 1.2 2021/08/07 21:21:49 jmcneill Exp $ */
+/* $NetBSD: smccc.c,v 1.3 2021/08/08 13:43:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2021 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smccc.c,v 1.2 2021/08/07 21:21:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smccc.c,v 1.3 2021/08/08 13:43:09 jmcneill Exp $");
 
 #include 
 #include 
@@ -35,6 +35,12 @@ __KERNEL_RCSID(0, "$NetBSD: smccc.c,v 1.
 #include 
 #include 
 
+#if defined(__arm__)
+#define	SMCCC_ARCH_ATTRIBUTE  __attribute__ ((target("arch=armv7ve")))
+#else
+#define	SMCCC_ARCH_ATTRIBUTE
+#endif
+
 /* Minimum supported PSCI version for SMCCC discovery */
 #define	PSCI_VERSION_1_0	0x1
 
@@ -89,7 +95,7 @@ smccc_version(void)
  *
  *	Generic call interface for SMC/HVC calls.
  */
-int
+SMCCC_ARCH_ATTRIBUTE int
 smccc_call(uint32_t fid,
 register_t arg1, register_t arg2, register_t arg3, register_t arg4,
 register_t *res0, register_t *res1, register_t *res2, register_t *res3)



CVS commit: src/usr.bin/xlint/xlint

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 14:05:33 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: xlint.c

Log Message:
lint: make data flow in findlibs simpler

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/xlint/xlint/xlint.c

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

Modified files:

Index: src/usr.bin/xlint/xlint/xlint.c
diff -u src/usr.bin/xlint/xlint/xlint.c:1.65 src/usr.bin/xlint/xlint/xlint.c:1.66
--- src/usr.bin/xlint/xlint/xlint.c:1.65	Sun Aug  8 13:34:57 2021
+++ src/usr.bin/xlint/xlint/xlint.c	Sun Aug  8 14:05:33 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.65 2021/08/08 13:34:57 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.66 2021/08/08 14:05:33 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: xlint.c,v 1.65 2021/08/08 13:34:57 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.66 2021/08/08 14:05:33 rillig Exp $");
 #endif
 
 #include 
@@ -821,37 +821,40 @@ runchild(const char *path, char *const *
 }
 
 static void
-findlibs(char *const *liblst)
+findlib(const char *lib)
 {
-	int	i, k;
-	const	char *lib, *path;
-	char	*lfn;
-	size_t	len;
+	char *const *dir;
+	char *lfn;
 
-	lfn = NULL;
+	for (dir = libsrchpath; *dir != NULL; dir++) {
+		lfn = xasprintf("%s/llib-l%s.ln", *dir, lib);
+		if (rdok(lfn))
+			goto found;
+		free(lfn);
 
-	for (i = 0; (lib = liblst[i]) != NULL; i++) {
-		for (k = 0; (path = libsrchpath[k]) != NULL; k++) {
-			len = strlen(path) + strlen(lib);
-			lfn = xrealloc(lfn, len + sizeof("/llib-l.ln"));
-			(void)sprintf(lfn, "%s/llib-l%s.ln", path, lib);
-			if (rdok(lfn))
-break;
-			lfn = xrealloc(lfn, len + sizeof("/lint/llib-l.ln"));
-			(void)sprintf(lfn, "%s/lint/llib-l%s.ln", path, lib);
-			if (rdok(lfn))
-break;
-		}
-		if (path != NULL) {
-			appstrg(&l2libs, concat2("-l", lfn));
-		} else {
-			warnx("cannot find llib-l%s.ln", lib);
-		}
+		lfn = xasprintf("%s/lint/llib-l%s.ln", *dir, lib);
+		if (rdok(lfn))
+			goto found;
+		free(lfn);
 	}
 
+	warnx("cannot find llib-l%s.ln", lib);
+	return;
+
+found:
+	appstrg(&l2libs, concat2("-l", lfn));
 	free(lfn);
 }
 
+static void
+findlibs(char *const *liblst)
+{
+	char *const *p;
+
+	for (p = liblst; *p != NULL; p++)
+		findlib(*p);
+}
+
 static bool
 rdok(const char *path)
 {



CVS commit: src/usr.bin/xlint/xlint

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 15:03:48 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: xlint.c

Log Message:
lint: rename functions for handling string lists

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/xlint/xlint/xlint.c

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

Modified files:

Index: src/usr.bin/xlint/xlint/xlint.c
diff -u src/usr.bin/xlint/xlint/xlint.c:1.66 src/usr.bin/xlint/xlint/xlint.c:1.67
--- src/usr.bin/xlint/xlint/xlint.c:1.66	Sun Aug  8 14:05:33 2021
+++ src/usr.bin/xlint/xlint/xlint.c	Sun Aug  8 15:03:47 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.66 2021/08/08 14:05:33 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.67 2021/08/08 15:03:47 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: xlint.c,v 1.66 2021/08/08 14:05:33 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.67 2021/08/08 15:03:47 rillig Exp $");
 #endif
 
 #include 
@@ -128,15 +128,10 @@ static	const	char *currfn;
 #endif
 static const char target_prefix[] = TARGET_PREFIX;
 
-static	void	appstrg(char ***, char *);
-static	void	appcstrg(char ***, const char *);
-static	void	applst(char ***, char *const *);
-static	void	freelst(char ***);
 static	char	*concat2(const char *, const char *);
 static	char	*concat3(const char *, const char *, const char *);
 static	void	terminate(int) __attribute__((__noreturn__));
 static	const	char *lbasename(const char *, int);
-static	void	appdef(char ***, const char *);
 static	void	usage(void);
 static	void	fname(const char *);
 static	void	runchild(const char *, char *const *, const char *, int);
@@ -145,12 +140,17 @@ static	bool	rdok(const char *);
 static	void	lint2(void);
 static	void	cat(char *const *, const char *);
 
-/*
- * Some functions to deal with lists of strings.
- * Take care that we get no surprises in case of asynchronous signals.
- */
+static char **
+list_new(void)
+{
+	char **list;
+
+	list = xcalloc(1, sizeof(*list));
+	return list;
+}
+
 static void
-appstrg(char ***lstp, char *s)
+list_add(char ***lstp, char *s)
 {
 	char	**lst, **olst;
 	int	i;
@@ -165,14 +165,14 @@ appstrg(char ***lstp, char *s)
 }
 
 static void
-appcstrg(char ***lstp, const char *s)
+list_add_copy(char ***lstp, const char *s)
 {
 
-	appstrg(lstp, xstrdup(s));
+	list_add(lstp, xstrdup(s));
 }
 
 static void
-applst(char ***destp, char *const *src)
+list_add_all(char ***destp, char *const *src)
 {
 	int	i, k;
 	char	**dest, **odest;
@@ -190,7 +190,15 @@ applst(char ***destp, char *const *src)
 }
 
 static void
-freelst(char ***lstp)
+list_add_defines(char ***lstp, const char *def)
+{
+
+	list_add(lstp, concat2("-D__", def));
+	list_add(lstp, concat3("-D__", def, "__"));
+}
+
+static void
+list_free(char ***lstp)
 {
 	char	*s;
 	int	i;
@@ -208,21 +216,21 @@ static void
 pass_to_lint1(const char *opt)
 {
 
-	appcstrg(&l1flags, opt);
+	list_add_copy(&l1flags, opt);
 }
 
 static void
 pass_to_lint2(const char *opt)
 {
 
-	appcstrg(&l2flags, opt);
+	list_add_copy(&l2flags, opt);
 }
 
 static void
 pass_to_cpp(const char *opt)
 {
 
-	appcstrg(&cflags, opt);
+	list_add_copy(&cflags, opt);
 }
 
 static char *
@@ -303,14 +311,6 @@ lbasename(const char *strg, int delim)
 	return *cp1 == '\0' ? cp2 : cp1;
 }
 
-static void
-appdef(char ***lstp, const char *def)
-{
-
-	appstrg(lstp, concat2("-D__", def));
-	appstrg(lstp, concat3("-D__", def, "__"));
-}
-
 static void __attribute__((noreturn))
 usage(void)
 {
@@ -357,16 +357,16 @@ main(int argc, char *argv[])
 		terminate(-1);
 	}
 
-	p1out = xcalloc(1, sizeof(*p1out));
-	p2in = xcalloc(1, sizeof(*p2in));
-	cflags = xcalloc(1, sizeof(*cflags));
-	lcflags = xcalloc(1, sizeof(*lcflags));
-	l1flags = xcalloc(1, sizeof(*l1flags));
-	l2flags = xcalloc(1, sizeof(*l2flags));
-	l2libs = xcalloc(1, sizeof(*l2libs));
-	deflibs = xcalloc(1, sizeof(*deflibs));
-	libs = xcalloc(1, sizeof(*libs));
-	libsrchpath = xcalloc(1, sizeof(*libsrchpath));
+	p1out = list_new();
+	p2in = list_new();
+	cflags = list_new();
+	lcflags = list_new();
+	l1flags = list_new();
+	l2flags = list_new();
+	l2libs = list_new();
+	deflibs = list_new();
+	libs = list_new();
+	libsrchpath = list_new();
 
 	pass_to_cpp("-E");
 	pass_to_cpp("-x");
@@ -388,9 +388,9 @@ main(int argc, char *argv[])
 	pass_to_cpp("-D__LINT__");
 	pass_to_cpp("-Dlint");		/* XXX don't def. with -s */
 
-	appdef(&cflags, "lint");
+	list_add_defines(&cflags, "lint");
 
-	appcstrg(&deflibs, "c");
+	list_add_copy(&deflibs, "c");
 
 	if (signal(SIGHUP, terminate) == SIG_IGN)
 		(void)signal(SIGHUP, SIG_IGN);
@@ -442,15 +442,15 @@ main(int argc, char *argv[])
 			break;
 
 		case 'n':
-			freelst(&deflibs);
+			list_free(&deflibs);
 			break;
 
 		case 'p':
 			pass_to_lint1("-p");
 			pass_to_lint2("-p");
 			if (*deflibs != NULL) {
-fr

CVS commit: src/usr.bin/xlint/xlint

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 15:06:44 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: xlint.c

Log Message:
lint: inline list_add_defines

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/xlint/xlint/xlint.c

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

Modified files:

Index: src/usr.bin/xlint/xlint/xlint.c
diff -u src/usr.bin/xlint/xlint/xlint.c:1.67 src/usr.bin/xlint/xlint/xlint.c:1.68
--- src/usr.bin/xlint/xlint/xlint.c:1.67	Sun Aug  8 15:03:47 2021
+++ src/usr.bin/xlint/xlint/xlint.c	Sun Aug  8 15:06:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.67 2021/08/08 15:03:47 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.68 2021/08/08 15:06:44 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: xlint.c,v 1.67 2021/08/08 15:03:47 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.68 2021/08/08 15:06:44 rillig Exp $");
 #endif
 
 #include 
@@ -129,7 +129,6 @@ static	const	char *currfn;
 static const char target_prefix[] = TARGET_PREFIX;
 
 static	char	*concat2(const char *, const char *);
-static	char	*concat3(const char *, const char *, const char *);
 static	void	terminate(int) __attribute__((__noreturn__));
 static	const	char *lbasename(const char *, int);
 static	void	usage(void);
@@ -190,14 +189,6 @@ list_add_all(char ***destp, char *const 
 }
 
 static void
-list_add_defines(char ***lstp, const char *def)
-{
-
-	list_add(lstp, concat2("-D__", def));
-	list_add(lstp, concat3("-D__", def, "__"));
-}
-
-static void
 list_free(char ***lstp)
 {
 	char	*s;
@@ -245,19 +236,6 @@ concat2(const char *s1, const char *s2)
 	return s;
 }
 
-static char *
-concat3(const char *s1, const char *s2, const char *s3)
-{
-	char	*s;
-
-	s = xmalloc(strlen(s1) + strlen(s2) + strlen(s3) + 1);
-	(void)strcpy(s, s1);
-	(void)strcat(s, s2);
-	(void)strcat(s, s3);
-
-	return s;
-}
-
 /*
  * Clean up after a signal.
  */
@@ -387,8 +365,8 @@ main(int argc, char *argv[])
 	pass_to_cpp("-Wcomment");
 	pass_to_cpp("-D__LINT__");
 	pass_to_cpp("-Dlint");		/* XXX don't def. with -s */
-
-	list_add_defines(&cflags, "lint");
+	pass_to_cpp("-D__lint");
+	pass_to_cpp("-D__lint__");
 
 	list_add_copy(&deflibs, "c");
 



CVS commit: src/sys/dev/fdt

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 15:23:42 UTC 2021

Modified Files:
src/sys/dev/fdt: fdt_regulator.c

Log Message:
fdt: regulator: pre-allocate regulator handle

Workaround for PR# port-evbarm/54664


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/fdt/fdt_regulator.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/dev/fdt/fdt_regulator.c
diff -u src/sys/dev/fdt/fdt_regulator.c:1.8 src/sys/dev/fdt/fdt_regulator.c:1.9
--- src/sys/dev/fdt/fdt_regulator.c:1.8	Mon May 27 23:18:33 2019
+++ src/sys/dev/fdt/fdt_regulator.c	Sun Aug  8 15:23:42 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_regulator.c,v 1.8 2019/05/27 23:18:33 jmcneill Exp $ */
+/* $NetBSD: fdt_regulator.c,v 1.9 2021/08/08 15:23:42 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_regulator.c,v 1.8 2019/05/27 23:18:33 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_regulator.c,v 1.9 2021/08/08 15:23:42 jmcneill Exp $");
 
 #include 
 #include 
@@ -37,6 +37,9 @@ __KERNEL_RCSID(0, "$NetBSD: fdt_regulato
 #include 
 #include 
 
+#define	REGULATOR_TO_RC(_reg)	\
+	container_of((_reg), struct fdtbus_regulator_controller, rc_reg)
+
 struct fdtbus_regulator_controller {
 	device_t rc_dev;
 	int rc_phandle;
@@ -44,6 +47,8 @@ struct fdtbus_regulator_controller {
 
 	u_int rc_enable_ramp_delay;
 
+	struct fdtbus_regulator rc_reg;	/* handle returned by acquire() */
+
 	LIST_ENTRY(fdtbus_regulator_controller) rc_next;
 };
 
@@ -60,6 +65,7 @@ fdtbus_register_regulator_controller(dev
 	rc->rc_dev = dev;
 	rc->rc_phandle = phandle;
 	rc->rc_funcs = funcs;
+	rc->rc_reg.reg_rc = rc;
 
 	of_getprop_uint32(phandle, "regulator-enable-ramp-delay", &rc->rc_enable_ramp_delay);
 
@@ -85,7 +91,6 @@ struct fdtbus_regulator *
 fdtbus_regulator_acquire(int phandle, const char *prop)
 {
 	struct fdtbus_regulator_controller *rc;
-	struct fdtbus_regulator *reg;
 	int regulator_phandle;
 	int error;
 
@@ -105,26 +110,21 @@ fdtbus_regulator_acquire(int phandle, co
 		return NULL;
 	}
 
-	reg = kmem_alloc(sizeof(*reg), KM_SLEEP);
-	reg->reg_rc = rc;
-
-	return reg;
+	return &rc->rc_reg;
 }
 
 void
 fdtbus_regulator_release(struct fdtbus_regulator *reg)
 {
-	struct fdtbus_regulator_controller *rc = reg->reg_rc;
+	struct fdtbus_regulator_controller *rc = REGULATOR_TO_RC(reg);
 
 	rc->rc_funcs->release(rc->rc_dev);
-
-	kmem_free(reg, sizeof(*reg));
 }
 
 int
 fdtbus_regulator_enable(struct fdtbus_regulator *reg)
 {
-	struct fdtbus_regulator_controller *rc = reg->reg_rc;
+	struct fdtbus_regulator_controller *rc = REGULATOR_TO_RC(reg);
 	int error;
 
 	error = rc->rc_funcs->enable(rc->rc_dev, true);
@@ -140,7 +140,7 @@ fdtbus_regulator_enable(struct fdtbus_re
 int
 fdtbus_regulator_disable(struct fdtbus_regulator *reg)
 {
-	struct fdtbus_regulator_controller *rc = reg->reg_rc;
+	struct fdtbus_regulator_controller *rc = REGULATOR_TO_RC(reg);
 
 	if (of_hasprop(rc->rc_phandle, "regulator-always-on"))
 		return EIO;
@@ -152,7 +152,7 @@ int
 fdtbus_regulator_set_voltage(struct fdtbus_regulator *reg, u_int min_uvol,
 u_int max_uvol)
 {
-	struct fdtbus_regulator_controller *rc = reg->reg_rc;
+	struct fdtbus_regulator_controller *rc = REGULATOR_TO_RC(reg);
 
 	if (rc->rc_funcs->set_voltage == NULL)
 		return EINVAL;
@@ -163,7 +163,7 @@ fdtbus_regulator_set_voltage(struct fdtb
 int
 fdtbus_regulator_get_voltage(struct fdtbus_regulator *reg, u_int *puvol)
 {
-	struct fdtbus_regulator_controller *rc = reg->reg_rc;
+	struct fdtbus_regulator_controller *rc = REGULATOR_TO_RC(reg);
 
 	if (rc->rc_funcs->get_voltage == NULL)
 		return EINVAL;
@@ -175,7 +175,7 @@ int
 fdtbus_regulator_supports_voltage(struct fdtbus_regulator *reg, u_int min_uvol,
 u_int max_uvol)
 {
-	struct fdtbus_regulator_controller *rc = reg->reg_rc;
+	struct fdtbus_regulator_controller *rc = REGULATOR_TO_RC(reg);
 	u_int uvol;
 
 	if (rc->rc_funcs->set_voltage == NULL)



CVS commit: src/usr.bin/xlint/xlint

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 15:29:24 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: lint.1 xlint.c

Log Message:
lint: remove dead code for reading from stdin

Since xlint.c 1.27 from 2002-01-31, it has not been possible to read
from stdin anymore.  Apparently nobody missed this feature in the last
19 years.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/xlint/xlint/lint.1
cvs rdiff -u -r1.68 -r1.69 src/usr.bin/xlint/xlint/xlint.c

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

Modified files:

Index: src/usr.bin/xlint/xlint/lint.1
diff -u src/usr.bin/xlint/xlint/lint.1:1.44 src/usr.bin/xlint/xlint/lint.1:1.45
--- src/usr.bin/xlint/xlint/lint.1:1.44	Sun May  2 21:05:42 2021
+++ src/usr.bin/xlint/xlint/lint.1	Sun Aug  8 15:29:24 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: lint.1,v 1.44 2021/05/02 21:05:42 rillig Exp $
+.\" $NetBSD: lint.1,v 1.45 2021/08/08 15:29:24 rillig Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
 .\" Copyright (c) 1994, 1995 Jochen Pohl
@@ -167,22 +167,6 @@ At this point, if a complaint stems not 
 but from one of its included files, the source filename will be
 printed followed by a question mark.
 .Pp
-The special input file name
-.Dq Pa -
-causes
-.Nm
-to take input from standard input (until end of file) and process
-it as if it were a
-.Pa \&.c
-file.
-If the
-.Fl i
-flag is given and
-.Dq Pa -
-is named as one of the input files, the
-.Fl o
-flag must also be specified to provide an output file name.
-.Pp
 .Sy Options
 .Bl -tag -width XoXoutputfileXXX
 .It Fl Ac11

Index: src/usr.bin/xlint/xlint/xlint.c
diff -u src/usr.bin/xlint/xlint/xlint.c:1.68 src/usr.bin/xlint/xlint/xlint.c:1.69
--- src/usr.bin/xlint/xlint/xlint.c:1.68	Sun Aug  8 15:06:44 2021
+++ src/usr.bin/xlint/xlint/xlint.c	Sun Aug  8 15:29:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.68 2021/08/08 15:06:44 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.69 2021/08/08 15:29:24 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: xlint.c,v 1.68 2021/08/08 15:06:44 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.69 2021/08/08 15:29:24 rillig Exp $");
 #endif
 
 #include 
@@ -634,10 +634,8 @@ fname(const char *name)
 	char	**args, *ofn, *pathname;
 	const char *CC;
 	size_t	len;
-	bool	is_stdin;
 	int	fd;
 
-	is_stdin = strcmp(name, "-") == 0;
 	bn = lbasename(name, '/');
 	suff = lbasename(bn, '.');
 
@@ -648,15 +646,14 @@ fname(const char *name)
 		return;
 	}
 
-	if (!is_stdin && strcmp(suff, "c") != 0 &&
+	if (strcmp(suff, "c") != 0 &&
 	(strncmp(bn, "llib-l", 6) != 0 || bn != suff)) {
 		warnx("unknown file type: %s", name);
 		return;
 	}
 
 	if (!iflag || !first)
-		(void)printf("%s:\n",
-		is_stdin ? "{standard input}" : Fflag ? name : bn);
+		(void)printf("%s:\n", Fflag ? name : bn);
 
 	/* build the name of the output file of lint1 */
 	if (oflag) {
@@ -664,10 +661,6 @@ fname(const char *name)
 		outputfn = NULL;
 		oflag = false;
 	} else if (iflag) {
-		if (is_stdin) {
-			warnx("-i not supported without -o for standard input");
-			return;
-		}
 		len = bn == suff ? strlen(bn) : (size_t)((suff - 1) - bn);
 		ofn = xasprintf("%.*s.ln", (int)len, bn);
 	} else {



CVS commit: src/usr.bin/xlint/xlint

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 15:59:32 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: lint.1

Log Message:
lint: update and proofread manual page


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/xlint/xlint/lint.1

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

Modified files:

Index: src/usr.bin/xlint/xlint/lint.1
diff -u src/usr.bin/xlint/xlint/lint.1:1.45 src/usr.bin/xlint/xlint/lint.1:1.46
--- src/usr.bin/xlint/xlint/lint.1:1.45	Sun Aug  8 15:29:24 2021
+++ src/usr.bin/xlint/xlint/lint.1	Sun Aug  8 15:59:32 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: lint.1,v 1.45 2021/08/08 15:29:24 rillig Exp $
+.\" $NetBSD: lint.1,v 1.46 2021/08/08 15:59:32 rillig Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
 .\" Copyright (c) 1994, 1995 Jochen Pohl
@@ -30,7 +30,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd Apr 14, 2021
+.Dd Aug 08, 2021
 .Dt LINT 1
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Nm
 .Op Fl abceFgHhPprTVvwxz
 .Op Fl i | Fl nu
-.Op Fl S | Fl s | Fl t
+.Op Fl S | Fl s | Fl t | Fl Ac11
 .Op Fl B Ar directory
 .Op Fl D Ar name Ns Op =def
 .Op Fl d Ar directory
@@ -51,12 +51,11 @@
 .Op Fl o Ar outputfile
 .Op Fl U Ar name
 .Op Fl X Ar id Ns Op ,id ...
-.Op Fl Ac11
 .Op Fl Z Ar cpparg
 .Ar
 .Nm lint
 .Op Fl abceFgHhprTVvwz
-.Op Fl S | Fl s | Fl t
+.Op Fl S | Fl s | Fl t | Fl Ac11
 .Fl C Ar library
 .Op Fl B Ar directory
 .Op Fl D Ar name Ns Op =def
@@ -73,8 +72,8 @@
 attempts to detect features of the named C program files
 that are likely to be bugs, to be non-portable, or to be
 wasteful.
-It also performs stricter type checking than does the C compiler.
-The list of errors
+It also performs stricter type checking than traditional pre-C90 C compilers.
+The list of errors and warnings that
 .Nm
 produces are enumerated in
 .Xr lint 7 .
@@ -98,11 +97,11 @@ variables declared and not used, and log
 with constant values.
 Function calls are checked for
 inconsistencies, such as calls to functions that return
-values in some places and not in others, functions called
-with varying numbers of arguments, function calls that
+values in some places and not in others, non-prototype functions called
+with varying numbers of arguments, non-prototype function calls that
 pass arguments of a type other than the type the function
-expects to receive, functions whose values are not used,
-and calls to functions not returning values that use
+expects to receive, functions whose return values are not used,
+and calls to non-prototype functions not returning values that nevertheless use
 the non-existent return value of the function.
 .Pp
 Filename arguments ending with
@@ -159,16 +158,17 @@ files are ignored.
 When the
 .Fl i
 option is
-.Em omitted
+.Em omitted ,
 the second pass of
 .Nm
-checks this list of files for mutual compatibility.
+checks this list of files for mutual compatibility
+but always exits successfully.
 At this point, if a complaint stems not from a given source file,
 but from one of its included files, the source filename will be
 printed followed by a question mark.
 .Pp
 .Sy Options
-.Bl -tag -width XoXoutputfileXXX
+.Bl -tag -width XXoutputfile
 .It Fl Ac11
 Allow features from C11, C99 and C90.
 .It Fl a
@@ -233,11 +233,10 @@ instead of
 as the default place to find include files.
 .It Fl e
 Complain about unusual operations on
-.Sy enum Ns -Types
+.Sy enum Ns types
 and combinations of
-.Sy enum Ns -
-and
-.Sy integer Ns -Types .
+.Sy enum
+and integer types .
 .It Fl F
 Print pathnames of files.
 .Nm
@@ -266,7 +265,7 @@ and
 .Sy inline
 are always available).
 .It Fl H
-If a complaint stems from an included file
+If a complaint stems from an included file,
 .Nm
 prints the name of the included file instead of the source file name
 followed by a question mark.
@@ -302,7 +301,7 @@ Include the lint library
 Pass
 .Fl MD
 to
-.Xr cpp 1
+.Xr cpp 1 ,
 causing cpp to create files containing dependency information for
 each source file.
 .It Fl n
@@ -318,7 +317,7 @@ The
 option simply saves this file in the named output file.
 If the
 .Fl i
-option is also used the files are not checked for compatibility.
+option is also used, the files are not checked for compatibility.
 To produce a
 .Pa llib-l Ns Ar library Ns Pa \&.ln
 without extraneous messages, use of the
@@ -329,11 +328,11 @@ The
 option is useful if the source file(s) for the lint library
 are just external interfaces.
 .It Fl P
-Enable more portability warnings: Enum comparisons, sign extension issues
+Enable more portability warnings: enum comparisons, sign extension issues
 when assigning to wider integer types, overflow warnings when assigning
 to wider types.
 .It Fl p
-Attempt to check portability of code to other dialects of C.
+Attempt to check portability of c

CVS commit: src/usr.bin/xlint/xlint

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 16:11:08 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: xlint.c

Log Message:
lint: rename list_free to list_clear

The previous name suggested that the function would free the list
itself, which it doesn't.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/xlint/xlint/xlint.c

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

Modified files:

Index: src/usr.bin/xlint/xlint/xlint.c
diff -u src/usr.bin/xlint/xlint/xlint.c:1.69 src/usr.bin/xlint/xlint/xlint.c:1.70
--- src/usr.bin/xlint/xlint/xlint.c:1.69	Sun Aug  8 15:29:24 2021
+++ src/usr.bin/xlint/xlint/xlint.c	Sun Aug  8 16:11:08 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.69 2021/08/08 15:29:24 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.70 2021/08/08 16:11:08 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: xlint.c,v 1.69 2021/08/08 15:29:24 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.70 2021/08/08 16:11:08 rillig Exp $");
 #endif
 
 #include 
@@ -189,7 +189,7 @@ list_add_all(char ***destp, char *const 
 }
 
 static void
-list_free(char ***lstp)
+list_clear(char ***lstp)
 {
 	char	*s;
 	int	i;
@@ -420,14 +420,14 @@ main(int argc, char *argv[])
 			break;
 
 		case 'n':
-			list_free(&deflibs);
+			list_clear(&deflibs);
 			break;
 
 		case 'p':
 			pass_to_lint1("-p");
 			pass_to_lint2("-p");
 			if (*deflibs != NULL) {
-list_free(&deflibs);
+list_clear(&deflibs);
 list_add_copy(&deflibs, "c");
 			}
 			break;
@@ -443,7 +443,7 @@ main(int argc, char *argv[])
 		case 's':
 			if (tflag)
 usage();
-			list_free(&lcflags);
+			list_clear(&lcflags);
 			list_add_copy(&lcflags, "-trigraphs");
 			list_add_copy(&lcflags, "-Wtrigraphs");
 			list_add_copy(&lcflags, "-pedantic");
@@ -471,7 +471,7 @@ main(int argc, char *argv[])
 		case 't':
 			if (sflag)
 usage();
-			list_free(&lcflags);
+			list_clear(&lcflags);
 			list_add_copy(&lcflags, "-traditional");
 			list_add_copy(&lcflags, "-Wtraditional");
 			list_add(&lcflags, concat2("-D", MACHINE));
@@ -492,7 +492,7 @@ main(int argc, char *argv[])
 			Cflag = true;
 			list_add(&l2flags, concat2("-C", optarg));
 			p2out = xasprintf("llib-l%s.ln", optarg);
-			list_free(&deflibs);
+			list_clear(&deflibs);
 			break;
 
 		case 'd':
@@ -705,7 +705,7 @@ fname(const char *name)
 
 	runchild(pathname, args, cppout, cppoutfd);
 	free(pathname);
-	list_free(&args);
+	list_clear(&args);
 
 	/* run lint1 */
 
@@ -727,7 +727,7 @@ fname(const char *name)
 
 	runchild(pathname, args, ofn, -1);
 	free(pathname);
-	list_free(&args);
+	list_clear(&args);
 
 	list_add_copy(&p2in, ofn);
 	free(ofn);
@@ -864,7 +864,7 @@ lint2(void)
 
 	runchild(path, args, p2out, -1);
 	free(path);
-	list_free(&args);
+	list_clear(&args);
 	free(args);
 }
 



CVS commit: src/share/man/man9

2021-08-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Aug  8 16:12:10 UTC 2021

Modified Files:
src/share/man/man9: autoconf.9

Log Message:
change othersize to otherwise. I believe this is what was meant in the context.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/share/man/man9/autoconf.9

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

Modified files:

Index: src/share/man/man9/autoconf.9
diff -u src/share/man/man9/autoconf.9:1.34 src/share/man/man9/autoconf.9:1.35
--- src/share/man/man9/autoconf.9:1.34	Sat Aug  7 20:41:17 2021
+++ src/share/man/man9/autoconf.9	Sun Aug  8 16:12:10 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: autoconf.9,v 1.34 2021/08/07 20:41:17 uwe Exp $
+.\" $NetBSD: autoconf.9,v 1.35 2021/08/08 16:12:10 andvar Exp $
 .\"
 .\" Copyright (c) 2001, 2002, 2021 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -334,7 +334,7 @@ Invokes the driver's match function acco
 The
 .Fn config_probe
 function returns a nonzero integer to indicate a successful probe
-and a value of 0 othersize.
+and a value of 0 otherwise.
 Unlike
 .Fn config_match ,
 the return value of



CVS commit: src/usr.bin/xlint/xlint

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 16:19:18 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: xlint.c

Log Message:
lint: group global variables by the subprocess

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/xlint/xlint/xlint.c

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

Modified files:

Index: src/usr.bin/xlint/xlint/xlint.c
diff -u src/usr.bin/xlint/xlint/xlint.c:1.70 src/usr.bin/xlint/xlint/xlint.c:1.71
--- src/usr.bin/xlint/xlint/xlint.c:1.70	Sun Aug  8 16:11:08 2021
+++ src/usr.bin/xlint/xlint/xlint.c	Sun Aug  8 16:19:18 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.70 2021/08/08 16:11:08 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.71 2021/08/08 16:19:18 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: xlint.c,v 1.70 2021/08/08 16:11:08 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.71 2021/08/08 16:19:18 rillig Exp $");
 #endif
 
 #include 
@@ -61,38 +61,30 @@ __RCSID("$NetBSD: xlint.c,v 1.70 2021/08
 
 #define DEFAULT_PATH		_PATH_DEFPATH
 
-/* directory for temporary files */
-static	const	char *tmpdir;
-
-/* path name for cpp output */
-static	char	*cppout;
-
-/* file descriptor for cpp output */
-static	int	cppoutfd = -1;
-
-/* files created by 1st pass */
-static	char	**p1out;
-
-/* input files for 2nd pass (without libraries) */
-static	char	**p2in;
-
-/* library which will be created by 2nd pass */
-static	char	*p2out;
+/* Parameters for the C preprocessor. */
+static struct {
+	char	**flags;	/* flags always passed */
+	char	**lcflags;	/* flags, controlled by sflag/tflag */
+	char	*outfile;	/* path name for preprocessed C source */
+	int	outfd;		/* file descriptor for outfile */
+} cpp = { NULL, NULL, NULL, -1 };
+
+/* Parameters for lint1, which checks an isolated translation unit. */
+static struct {
+	char	**flags;
+	char	**outfiles;
+} lint1;
+
+/* Parameters for lint2, which performs cross-translation-unit checks. */
+static struct {
+	char	**flags;
+	char	**infiles;	/* input files (without libraries) */
+	char	**inlibs;	/* input libraries */
+	char	*outlib;	/* output library that will be created */
+} lint2;
 
-/* flags always passed to cc(1) */
-static	char	**cflags;
-
-/* flags for cc(1), controlled by sflag/tflag */
-static	char	**lcflags;
-
-/* flags for lint1 */
-static	char	**l1flags;
-
-/* flags for lint2 */
-static	char	**l2flags;
-
-/* libraries for lint2 */
-static	char	**l2libs;
+/* directory for temporary files */
+static	const char *tmpdir;
 
 /* default libraries */
 static	char	**deflibs;
@@ -136,7 +128,7 @@ static	void	fname(const char *);
 static	void	runchild(const char *, char *const *, const char *, int);
 static	void	findlibs(char *const *);
 static	bool	rdok(const char *);
-static	void	lint2(void);
+static	void	run_lint2(void);
 static	void	cat(char *const *, const char *);
 
 static char **
@@ -207,21 +199,21 @@ static void
 pass_to_lint1(const char *opt)
 {
 
-	list_add_copy(&l1flags, opt);
+	list_add_copy(&lint1.flags, opt);
 }
 
 static void
 pass_to_lint2(const char *opt)
 {
 
-	list_add_copy(&l2flags, opt);
+	list_add_copy(&lint2.flags, opt);
 }
 
 static void
 pass_to_cpp(const char *opt)
 {
 
-	list_add_copy(&cflags, opt);
+	list_add_copy(&cpp.flags, opt);
 }
 
 static char *
@@ -244,23 +236,23 @@ terminate(int signo)
 {
 	int	i;
 
-	if (cppoutfd != -1)
-		(void)close(cppoutfd);
-	if (cppout != NULL) {
+	if (cpp.outfd != -1)
+		(void)close(cpp.outfd);
+	if (cpp.outfile != NULL) {
 		if (signo != 0 && getenv("LINT_KEEP_CPPOUT_ON_ERROR") != NULL)
 			printf("lint: preprocessor output kept in %s\n",
-			cppout);
+			cpp.outfile);
 		else
-			(void)remove(cppout);
+			(void)remove(cpp.outfile);
 	}
 
-	if (p1out != NULL) {
-		for (i = 0; p1out[i] != NULL; i++)
-			(void)remove(p1out[i]);
+	if (lint1.outfiles != NULL) {
+		for (i = 0; lint1.outfiles[i] != NULL; i++)
+			(void)remove(lint1.outfiles[i]);
 	}
 
-	if (p2out != NULL)
-		(void)remove(p2out);
+	if (lint2.outlib != NULL)
+		(void)remove(lint2.outlib);
 
 	if (currfn != NULL)
 		(void)remove(currfn);
@@ -328,20 +320,20 @@ main(int argc, char *argv[])
 		tmpdir = concat2(tmp, tmp[len - 1] == '/' ? "" : "/");
 	}
 
-	cppout = concat2(tmpdir, "lint0.XX");
-	cppoutfd = mkstemp(cppout);
-	if (cppoutfd == -1) {
+	cpp.outfile = concat2(tmpdir, "lint0.XX");
+	cpp.outfd = mkstemp(cpp.outfile);
+	if (cpp.outfd == -1) {
 		warn("can't make temp");
 		terminate(-1);
 	}
 
-	p1out = list_new();
-	p2in = list_new();
-	cflags = list_new();
-	lcflags = list_new();
-	l1flags = list_new();
-	l2flags = list_new();
-	l2libs = list_new();
+	lint1.outfiles = list_new();
+	lint2.infiles = list_new();
+	cpp.flags = list_new();
+	cpp.lcflags = list_new();
+	lint1.flags = list_new();
+	lint2.flags = list_new();
+	lint2.inli

CVS commit: src/sys/dev/sdmmc

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 16:23:37 UTC 2021

Modified Files:
src/sys/dev/sdmmc: if_bwfm_sdio.h

Log Message:
Fixup bwfm(4) register bit regarding SDIO device suspend/resume.

>From OpenBSD if_bwfm_sdio.h r1.3


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/sdmmc/if_bwfm_sdio.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/dev/sdmmc/if_bwfm_sdio.h
diff -u src/sys/dev/sdmmc/if_bwfm_sdio.h:1.2 src/sys/dev/sdmmc/if_bwfm_sdio.h:1.3
--- src/sys/dev/sdmmc/if_bwfm_sdio.h:1.2	Thu Oct  3 10:53:34 2019
+++ src/sys/dev/sdmmc/if_bwfm_sdio.h	Sun Aug  8 16:23:37 2021
@@ -79,7 +79,7 @@
 #define  BWFM_SDIO_FUNC1_WAKEUPCTRL_HTWAIT		(1 << 1)
 #define BWFM_SDIO_FUNC1_SLEEPCSR		0x1001F
 #define  BWFM_SDIO_FUNC1_SLEEPCSR_KSO		(1 << 0)
-#define  BWFM_SDIO_FUNC1_SLEEPCSR_DEVON		(1 << 2)
+#define  BWFM_SDIO_FUNC1_SLEEPCSR_DEVON		(1 << 1)
 
 #define BWFM_SDIO_SB_OFT_ADDR_PAGE		0x08000
 #define BWFM_SDIO_SB_OFT_ADDR_MASK		0x07FFF



CVS commit: src/tests/usr.bin/xlint/lint2

2021-08-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug  8 16:35:15 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint2: Makefile t_lint2.sh

Log Message:
tests/lint: include but don't run read_lp64 on 32-bit platforms

The lint1 tests are all in the machine-independent file list, which
makes it easier to manage them.  At run time, some of them are skipped
based on platform characteristics.  Do the same for the lint2 tests.

Having the lint2 test named read_lp64 as the only machine-dependent test
would complicate things.

The build for i386 had failed because the files for read_lp64 were
listed in distrib/sets/lists/tests/mi but were not actually installed.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint2/Makefile
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint2/t_lint2.sh

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

Modified files:

Index: src/tests/usr.bin/xlint/lint2/Makefile
diff -u src/tests/usr.bin/xlint/lint2/Makefile:1.5 src/tests/usr.bin/xlint/lint2/Makefile:1.6
--- src/tests/usr.bin/xlint/lint2/Makefile:1.5	Sun Aug  8 13:22:22 2021
+++ src/tests/usr.bin/xlint/lint2/Makefile	Sun Aug  8 16:35:15 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2021/08/08 13:22:22 rillig Exp $
+# $NetBSD: Makefile,v 1.6 2021/08/08 16:35:15 rillig Exp $
 
 NOMAN=		yes
 
@@ -6,7 +6,7 @@ NOMAN=		yes
 
 TESTSDIR=	${TESTSBASE}/usr.bin/xlint/lint2
 
-TESTS_SH=		t_lint2
+TESTS_SH=	t_lint2
 
 FILESDIR=	${TESTSDIR}
 
@@ -16,9 +16,7 @@ FILESDIR=	${TESTSDIR}
 TESTS+=		msg_${msg}
 .endfor
 TESTS+=		read
-.if ${MACHINE_ARCH:M*64} && !${MACHINE_ARCH:Mmips64*}
-TESTS+=		read_lp64	# only on 64-bit platforms
-.endif
+TESTS+=		read_lp64
 TESTS+=		read_printf
 
 FILES+=		${TESTS:=.ln} ${TESTS:=.exp}

Index: src/tests/usr.bin/xlint/lint2/t_lint2.sh
diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.4 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.5
--- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.4	Sun Aug  8 00:02:02 2021
+++ src/tests/usr.bin/xlint/lint2/t_lint2.sh	Sun Aug  8 16:35:15 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_lint2.sh,v 1.4 2021/08/08 00:02:02 rillig Exp $
+# $NetBSD: t_lint2.sh,v 1.5 2021/08/08 16:35:15 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -51,6 +51,15 @@ atf_init_test_cases()
 	# shellcheck disable=SC2013
 	for i in $(cd "$(atf_get_srcdir)" && echo *.ln); do
 		i=${i%.ln}
+
+		case "$i" in
+		*lp64*)
+			case "$(uname -p)" in
+			*64) ;;
+			*) continue
+			esac
+		esac
+
 		eval "${i}_head() { std_head; }"
 		eval "${i}_body() { std_body '$i'; }"
 		atf_add_test_case "$i"



CVS commit: src/usr.bin/xlint/xlint

2021-08-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug  8 16:53:54 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: lint.1

Log Message:
Fix Dd argument.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/xlint/xlint/lint.1

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

Modified files:

Index: src/usr.bin/xlint/xlint/lint.1
diff -u src/usr.bin/xlint/xlint/lint.1:1.46 src/usr.bin/xlint/xlint/lint.1:1.47
--- src/usr.bin/xlint/xlint/lint.1:1.46	Sun Aug  8 15:59:32 2021
+++ src/usr.bin/xlint/xlint/lint.1	Sun Aug  8 16:53:53 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: lint.1,v 1.46 2021/08/08 15:59:32 rillig Exp $
+.\" $NetBSD: lint.1,v 1.47 2021/08/08 16:53:53 wiz Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
 .\" Copyright (c) 1994, 1995 Jochen Pohl
@@ -30,7 +30,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd Aug 08, 2021
+.Dd August 8, 2021
 .Dt LINT 1
 .Os
 .Sh NAME



CVS commit: src/sys/arch/arm/broadcom

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 18:43:21 UTC 2021

Modified Files:
src/sys/arch/arm/broadcom: files.bcm2835
Added Files:
src/sys/arch/arm/broadcom: bcm2835_com_acpi.c

Log Message:
broadcom: ACPI: Add support for mini UART in ACPI mode.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_com_acpi.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/arm/broadcom/files.bcm2835

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/arm/broadcom/files.bcm2835
diff -u src/sys/arch/arm/broadcom/files.bcm2835:1.41 src/sys/arch/arm/broadcom/files.bcm2835:1.42
--- src/sys/arch/arm/broadcom/files.bcm2835:1.41	Sun Aug  8 10:32:26 2021
+++ src/sys/arch/arm/broadcom/files.bcm2835	Sun Aug  8 18:43:21 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.bcm2835,v 1.41 2021/08/08 10:32:26 jmcneill Exp $
+#	$NetBSD: files.bcm2835,v 1.42 2021/08/08 18:43:21 jmcneill Exp $
 #
 # Configuration info for Broadcom BCM2835 ARM Peripherals
 #
@@ -60,6 +60,11 @@ file	arch/arm/broadcom/bcm2835_aux.c		bc
 attach	com at fdt with bcmcom
 file	arch/arm/broadcom/bcm2835_com.c		bcmcom
 
+ifdef acpinodebus
+attach	com at acpinodebus with bcmcom_acpi
+file	arch/arm/broadcom/bcm2835_com_acpi.c	bcmcom_acpi
+endif
+
 # External Mass Media Controller (BCM2835_EMMC_BASE)
 attach	sdhc at fdt with bcmemmc
 file	arch/arm/broadcom/bcm2835_emmc.c	bcmemmc

Added files:

Index: src/sys/arch/arm/broadcom/bcm2835_com_acpi.c
diff -u /dev/null src/sys/arch/arm/broadcom/bcm2835_com_acpi.c:1.1
--- /dev/null	Sun Aug  8 18:43:21 2021
+++ src/sys/arch/arm/broadcom/bcm2835_com_acpi.c	Sun Aug  8 18:43:21 2021
@@ -0,0 +1,168 @@
+/* $NetBSD: bcm2835_com_acpi.c,v 1.1 2021/08/08 18:43:21 jmcneill Exp $ */
+
+/*
+ * Copyright (c) 2021 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_com_acpi.c,v 1.1 2021/08/08 18:43:21 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+static int	bcmcom_acpi_match(device_t, cfdata_t , void *);
+static void	bcmcom_acpi_attach(device_t, device_t, void *);
+
+static u_int	bcmcom_acpi_get_clockrate(device_t);
+
+struct vcmbox_clockrate_request {
+	struct vcprop_buffer_hdr	vb_hdr;
+	struct vcprop_tag_clockrate	vbt_clockrate;
+	struct vcprop_tag end;
+} __packed;
+
+CFATTACH_DECL_NEW(bcmcom_acpi, sizeof(struct com_softc), bcmcom_acpi_match,
+bcmcom_acpi_attach, NULL, NULL);
+
+static const struct device_compatible_entry compat_data[] = {
+	{ .compat = "BCM2836",		.value = COM_TYPE_BCMAUXUART },
+	DEVICE_COMPAT_EOL
+};
+
+static int
+bcmcom_acpi_match(device_t parent, cfdata_t match, void *aux)
+{
+	struct acpi_attach_args *aa = aux;
+
+	return acpi_compatible_match(aa, compat_data);
+}
+
+static void
+bcmcom_acpi_attach(device_t parent, device_t self, void *aux)
+{
+	struct com_softc *sc = device_private(self);
+	struct acpi_attach_args *aa = aux;
+	const struct device_compatible_entry *dce;
+	struct acpi_resources res;
+	struct acpi_mem *mem;
+	struct acpi_irq *irq;
+	bus_space_tag_t iot;
+	bus_space_handle_t ioh;
+	bus_addr_t base;
+	bus_size_t size;
+	ACPI_STATUS rv;
+	void *ih;
+
+	sc->sc_dev = self;
+
+	rv = acpi_resource_parse(sc->sc_dev, aa->aa_node->ad_handle, "_CRS",
+	&res, &acpi_resource_parse_ops_default);
+	if (ACPI_FAILURE(rv)) {
+		return;
+	}
+
+	mem = acpi_res_mem(&res, 0);
+	if (mem == NULL) {
+		aprint_error_dev(self, "couldn't find mem resource\n");
+		goto cleanup;
+	}
+
+	iot = aa->aa_memt;
+	base = mem->ar_base;
+	size = mem->ar_length;
+
+	irq = acpi_res_irq(&res, 0);
+	if (irq == NULL) {
+		aprint_error_dev(self, "couldn't find irq

CVS commit: src/sys/arch/arm/broadcom

2021-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  8 18:55:12 UTC 2021

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_com_acpi.c

Log Message:
Adjust register base and size


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/broadcom/bcm2835_com_acpi.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/arm/broadcom/bcm2835_com_acpi.c
diff -u src/sys/arch/arm/broadcom/bcm2835_com_acpi.c:1.1 src/sys/arch/arm/broadcom/bcm2835_com_acpi.c:1.2
--- src/sys/arch/arm/broadcom/bcm2835_com_acpi.c:1.1	Sun Aug  8 18:43:21 2021
+++ src/sys/arch/arm/broadcom/bcm2835_com_acpi.c	Sun Aug  8 18:55:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_com_acpi.c,v 1.1 2021/08/08 18:43:21 jmcneill Exp $ */
+/* $NetBSD: bcm2835_com_acpi.c,v 1.2 2021/08/08 18:55:12 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2021 Jared McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_com_acpi.c,v 1.1 2021/08/08 18:43:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_com_acpi.c,v 1.2 2021/08/08 18:55:12 jmcneill Exp $");
 
 #include 
 #include 
@@ -100,8 +100,8 @@ bcmcom_acpi_attach(device_t parent, devi
 	}
 
 	iot = aa->aa_memt;
-	base = mem->ar_base;
-	size = mem->ar_length;
+	base = mem->ar_base + 0x40;
+	size = mem->ar_length - 0x40;
 
 	irq = acpi_res_irq(&res, 0);
 	if (irq == NULL) {



CVS commit: src/sys/arch

2021-08-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug  8 19:28:09 UTC 2021

Modified Files:
src/sys/arch/aarch64/include: cpu.h
src/sys/arch/arm/include: cpu.h
src/sys/arch/arm/pic: pic.c

Log Message:
Re-apply

Move 'struct pic_pending' from percpu to struct cpu_info. Saves a few
instructions in splx.

There is(/was) no need to use atomic operations on the percpu / cpu_info
members, so don't.

Finally removng the use of percpu should help avoid problems with "late"
attaching cpus.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/arm/include/cpu.h
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/arm/pic/pic.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/aarch64/include/cpu.h
diff -u src/sys/arch/aarch64/include/cpu.h:1.36 src/sys/arch/aarch64/include/cpu.h:1.37
--- src/sys/arch/aarch64/include/cpu.h:1.36	Sat May 29 06:54:20 2021
+++ src/sys/arch/aarch64/include/cpu.h	Sun Aug  8 19:28:08 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.36 2021/05/29 06:54:20 skrll Exp $ */
+/* $NetBSD: cpu.h,v 1.37 2021/08/08 19:28:08 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -104,6 +104,9 @@ struct cpu_info {
 	int ci_hwpl;		/* current hardware priority */
 	volatile u_int ci_softints;
 	volatile u_int ci_intr_depth;
+	volatile uint32_t ci_blocked_pics;
+	volatile uint32_t ci_pending_pics;
+	volatile uint32_t ci_pending_ipls;
 
 	int ci_kfpu_spl;
 

Index: src/sys/arch/arm/include/cpu.h
diff -u src/sys/arch/arm/include/cpu.h:1.117 src/sys/arch/arm/include/cpu.h:1.118
--- src/sys/arch/arm/include/cpu.h:1.117	Sat Mar 27 12:15:08 2021
+++ src/sys/arch/arm/include/cpu.h	Sun Aug  8 19:28:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.117 2021/03/27 12:15:08 jmcneill Exp $	*/
+/*	$NetBSD: cpu.h,v 1.118 2021/08/08 19:28:08 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -190,6 +190,9 @@ struct cpu_info {
 
 	volatile u_int	ci_intr_depth;	/* */
 	volatile u_int	ci_softints;
+	volatile uint32_t ci_blocked_pics;
+	volatile uint32_t ci_pending_pics;
+	volatile uint32_t ci_pending_ipls;
 
 	lwp_t *		ci_lastlwp;	/* last lwp */
 

Index: src/sys/arch/arm/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.70 src/sys/arch/arm/pic/pic.c:1.71
--- src/sys/arch/arm/pic/pic.c:1.70	Sat Mar 27 12:15:09 2021
+++ src/sys/arch/arm/pic/pic.c	Sun Aug  8 19:28:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic.c,v 1.70 2021/03/27 12:15:09 jmcneill Exp $	*/
+/*	$NetBSD: pic.c,v 1.71 2021/08/08 19:28:08 skrll Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.70 2021/03/27 12:15:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.71 2021/08/08 19:28:08 skrll Exp $");
 
 #include 
 #include 
@@ -65,37 +65,15 @@ __KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.70
  * come from the same CPU.  In other words, interrupts from a single PIC will
  * not be distributed among multiple CPUs.
  */
-struct pic_pending {
-	volatile uint32_t blocked_pics;
-	volatile uint32_t pending_pics;
-	volatile uint32_t pending_ipls;
-};
 static uint32_t
 	pic_find_pending_irqs_by_ipl(struct pic_softc *, size_t, uint32_t, int);
 static struct pic_softc *
-	pic_list_find_pic_by_pending_ipl(struct pic_pending *, uint32_t);
+	pic_list_find_pic_by_pending_ipl(struct cpu_info *, uint32_t);
 static void
-	pic_deliver_irqs(struct pic_pending *, struct pic_softc *, int, void *);
+	pic_deliver_irqs(struct cpu_info *, struct pic_softc *, int, void *);
 static void
-	pic_list_deliver_irqs(struct pic_pending *, register_t, int, void *);
+	pic_list_deliver_irqs(struct cpu_info *, register_t, int, void *);
 
-#ifdef MULTIPROCESSOR
-percpu_t *pic_pending_percpu;
-static struct pic_pending *
-pic_pending_get(void)
-{
-	return percpu_getref(pic_pending_percpu);
-}
-static void
-pic_pending_put(struct pic_pending *pend)
-{
-	percpu_putref(pic_pending_percpu);
-}
-#else
-struct pic_pending pic_pending;
-#define	pic_pending_get()	(&pic_pending)
-#define	pic_pending_put(pend)	__nothing
-#endif /* MULTIPROCESSOR */
 #endif /* __HAVE_PIC_PENDING_INTRS */
 
 struct pic_softc *pic_list[PIC_MAXPICS];
@@ -264,15 +242,14 @@ void
 pic_mark_pending_source(struct pic_softc *pic, struct intrsource *is)
 {
 	const uint32_t ipl_mask = __BIT(is->is_ipl);
+	struct cpu_info * const ci = curcpu();
 
 	atomic_or_32(&pic->pic_pending_irqs[is->is_irq >> 5],
 	__BIT(is->is_irq & 0x1f));
 
 	atomic_or_32(&pic->pic_pending_ipls, ipl_mask);
-	struct pic_pending *pend = pic_pending_get();
-	atomic_or_32(&pend->pending_ipls, ipl_mask);
-	atomic_or_32(&pend->pending_pics, __BIT(pic->pic_id));
-	pic_pending_put(pend);
+	ci->ci_pending_ipls |= ipl_mask;
+	ci->ci_pending_pics |= __BIT(pic->pic_id);
 }
 
 void
@@ -288,9 +265,10 

CVS commit: src

2021-08-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Aug  8 20:50:12 UTC 2021

Modified Files:
src/bin/sh: var.c
src/sys/dev/usb: umidi.c

Log Message:
s/varable/variable s/explictly/explicitly/ s/proerly/properly/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/bin/sh/var.c
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/usb/umidi.c

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

Modified files:

Index: src/bin/sh/var.c
diff -u src/bin/sh/var.c:1.78 src/bin/sh/var.c:1.79
--- src/bin/sh/var.c:1.78	Thu Feb 14 11:15:24 2019
+++ src/bin/sh/var.c	Sun Aug  8 20:50:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.78 2019/02/14 11:15:24 kre Exp $	*/
+/*	$NetBSD: var.c,v 1.79 2021/08/08 20:50:12 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: var.c,v 1.78 2019/02/14 11:15:24 kre Exp $");
+__RCSID("$NetBSD: var.c,v 1.79 2021/08/08 20:50:12 andvar Exp $");
 #endif
 #endif /* not lint */
 
@@ -197,7 +197,7 @@ static void export_usage(const char *) _
 STATIC int makespecial(const char *);
 
 /*
- * Initialize the varable symbol tables and import the environment
+ * Initialize the variable symbol tables and import the environment
  */
 
 #ifdef mkinit
@@ -1248,7 +1248,7 @@ unsetvar(const char *s, int unexport)
 
 
 /*
- * Returns true if the two strings specify the same varable.  The first
+ * Returns true if the two strings specify the same viarable.  The first
  * variable name is terminated by '='; the second may be terminated by
  * either '=' or '\0'.
  */
@@ -1570,7 +1570,7 @@ get_random(struct var *vp)
 
 			/*
 			 * initialisation (without pre-seeding),
-			 * or explictly requesting a truly random seed.
+			 * or explicitly requesting a truly random seed.
 			 */
 			INTOFF;
 			fd = open("/dev/urandom", 0);

Index: src/sys/dev/usb/umidi.c
diff -u src/sys/dev/usb/umidi.c:1.83 src/sys/dev/usb/umidi.c:1.84
--- src/sys/dev/usb/umidi.c:1.83	Wed Jan 20 22:46:33 2021
+++ src/sys/dev/usb/umidi.c	Sun Aug  8 20:50:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: umidi.c,v 1.83 2021/01/20 22:46:33 jdolecek Exp $	*/
+/*	$NetBSD: umidi.c,v 1.84 2021/08/08 20:50:12 andvar Exp $	*/
 
 /*
  * Copyright (c) 2001, 2012, 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.83 2021/01/20 22:46:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.84 2021/08/08 20:50:12 andvar Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1388,7 +1388,7 @@ close_in_jack(struct umidi_jack *jack)
 			 * We have to drop the (interrupt) lock so that
 			 * the USB thread lock can be safely taken by
 			 * the abort operation.  This is safe as this
-			 * either closing or dying will be set proerly.
+			 * either closing or dying will be set properly.
 			 */
 			mutex_exit(&sc->sc_lock);
 			usbd_abort_pipe(jack->endpoint->pipe);
@@ -1525,7 +1525,7 @@ deactivate_all_mididevs(struct umidi_sof
  *  Otherwise:
  *  - support a DISPLAY_BASE_CN quirk (add the value to each internal cable
  *number for display)
- *  - support an array quirk explictly giving a char * for each jack.
+ *  - support an array quirk explicitly giving a char * for each jack.
  * For now, you get 0-based cable numbers. If there are multiple endpoints and
  * the CNs are not globally unique, each is shown with its associated endpoint
  * address in hex also. That should not be necessary when using iJack values



CVS commit: src

2021-08-08 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Aug  8 20:54:49 UTC 2021

Modified Files:
src/lib/libc/net: getpeereid.c
src/lib/libc/rpc: svc_vc.c
src/lib/libc/sys: getsockopt.2
src/lib/libperfuse: perfuse.c
src/regress/sys/kern/unfdpass: unfdpass.c
src/share/man/man4: unix.4
src/sys/kern: uipc_usrreq.c
src/sys/sys: un.h
src/tests/net/net: t_unix.c
src/usr.sbin/perfused: msg.c
src/usr.sbin/sdpd: server.c

Log Message:
introduce a SOL_LOCAL for unix-domain socket level socket options
as an alias of the current 0 used for these options, as in FreeBSD.

reviewed by many.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/net/getpeereid.c
cvs rdiff -u -r1.34 -r1.35 src/lib/libc/rpc/svc_vc.c
cvs rdiff -u -r1.41 -r1.42 src/lib/libc/sys/getsockopt.2
cvs rdiff -u -r1.42 -r1.43 src/lib/libperfuse/perfuse.c
cvs rdiff -u -r1.11 -r1.12 src/regress/sys/kern/unfdpass/unfdpass.c
cvs rdiff -u -r1.26 -r1.27 src/share/man/man4/unix.4
cvs rdiff -u -r1.200 -r1.201 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.59 -r1.60 src/sys/sys/un.h
cvs rdiff -u -r1.24 -r1.25 src/tests/net/net/t_unix.c
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/perfused/msg.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sdpd/server.c

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

Modified files:

Index: src/lib/libc/net/getpeereid.c
diff -u src/lib/libc/net/getpeereid.c:1.3 src/lib/libc/net/getpeereid.c:1.4
--- src/lib/libc/net/getpeereid.c:1.3	Fri Feb 16 19:21:49 2018
+++ src/lib/libc/net/getpeereid.c	Sun Aug  8 20:54:48 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: getpeereid.c,v 1.3 2018/02/16 19:21:49 christos Exp $ */
+/* $NetBSD: getpeereid.c,v 1.4 2021/08/08 20:54:48 nia Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getpeereid.c,v 1.3 2018/02/16 19:21:49 christos Exp $");
+__RCSID("$NetBSD: getpeereid.c,v 1.4 2021/08/08 20:54:48 nia Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -57,7 +57,7 @@ getpeereid(int s, uid_t *euid, gid_t *eg
 	}
 
 	len = sizeof(cred);
-	if (getsockopt(s, 0, LOCAL_PEEREID, &cred, &len) == -1)
+	if (getsockopt(s, SOL_LOCAL, LOCAL_PEEREID, &cred, &len) == -1)
 		return -1;
 
 	if (euid != NULL)

Index: src/lib/libc/rpc/svc_vc.c
diff -u src/lib/libc/rpc/svc_vc.c:1.34 src/lib/libc/rpc/svc_vc.c:1.35
--- src/lib/libc/rpc/svc_vc.c:1.34	Tue Nov 10 20:56:20 2015
+++ src/lib/libc/rpc/svc_vc.c	Sun Aug  8 20:54:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: svc_vc.c,v 1.34 2015/11/10 20:56:20 christos Exp $	*/
+/*	$NetBSD: svc_vc.c,v 1.35 2021/08/08 20:54:48 nia Exp $	*/
 
 /*
  * Copyright (c) 2010, Oracle America, Inc.
@@ -37,7 +37,7 @@
 static char *sccsid = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)svc_tcp.c	2.2 88/08/01 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: svc_vc.c,v 1.34 2015/11/10 20:56:20 christos Exp $");
+__RCSID("$NetBSD: svc_vc.c,v 1.35 2021/08/08 20:54:48 nia Exp $");
 #endif
 #endif
 
@@ -178,8 +178,8 @@ svc_vc_create(int fd, u_int sendsize, u_
 	 * We want to be able to check credentials on local sockets.
 	 */
 	if (sslocal.ss_family == AF_LOCAL)
-		if (setsockopt(fd, 0, LOCAL_CREDS, &one, (socklen_t)sizeof one)
-		== -1)
+		if (setsockopt(fd, SOL_LOCAL, LOCAL_CREDS, &one,
+		(socklen_t)sizeof one) == -1)
 			goto cleanup_svc_vc_create;
 
 	xprt->xp_ltaddr.maxlen = xprt->xp_ltaddr.len = sslocal.ss_len;

Index: src/lib/libc/sys/getsockopt.2
diff -u src/lib/libc/sys/getsockopt.2:1.41 src/lib/libc/sys/getsockopt.2:1.42
--- src/lib/libc/sys/getsockopt.2:1.41	Thu May  9 09:09:38 2019
+++ src/lib/libc/sys/getsockopt.2	Sun Aug  8 20:54:48 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getsockopt.2,v 1.41 2019/05/09 09:09:38 wiz Exp $
+.\"	$NetBSD: getsockopt.2,v 1.42 2021/08/08 20:54:48 nia Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)getsockopt.2	8.4 (Berkeley) 5/2/95
 .\"
-.Dd May 8, 2019
+.Dd August 7, 2021
 .Dt GETSOCKOPT 2
 .Os
 .Sh NAME
@@ -55,10 +55,6 @@ and
 manipulate the
 .Em options
 associated with a socket.
-Options may exist at multiple
-protocol levels; they are always present at the uppermost
-.Dq socket
-level.
 .Pp
 When manipulating socket options the level at which the
 option resides and the name of the option must be specified.
@@ -69,6 +65,7 @@ is specified as
 To manipulate options at any
 other level the protocol number of the appropriate protocol
 controlling the option is supplied.
+Options may exist at multiple protocol levels.
 For example, to indicate that an option is to be interpreted by the
 .Tn TCP
 protocol,

Index: src/lib/libperfuse/perfuse.c
diff -u src/lib/libperfuse/perfuse.c:1.42 src/lib/libperfuse/perfuse.c:1.43
--- src/lib/libperfuse/perfuse.c:1.42	Wed Apr 17 

CVS commit: src/sys/modules/examples

2021-08-08 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug  8 20:55:33 UTC 2021

Modified Files:
src/sys/modules/examples: Makefile

Log Message:
Add ddbping example module to SUBDIR list.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/modules/examples/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/modules/examples/Makefile
diff -u src/sys/modules/examples/Makefile:1.11 src/sys/modules/examples/Makefile:1.12
--- src/sys/modules/examples/Makefile:1.11	Thu Apr 30 00:48:10 2020
+++ src/sys/modules/examples/Makefile	Sun Aug  8 20:55:33 2021
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile,v 1.11 2020/04/30 00:48:10 christos Exp $
+#	$NetBSD: Makefile,v 1.12 2021/08/08 20:55:33 uwe Exp $
 
 .include 
 
 SUBDIR+=	current_time
+SUBDIR+=	ddbping
 SUBDIR+=	executor
 SUBDIR+=	fopsmapper		# Needs an additional helper program
 SUBDIR+=	hello



CVS commit: src/usr.sbin/perfused

2021-08-08 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Aug  8 20:56:54 UTC 2021

Modified Files:
src/usr.sbin/perfused: perfused.c

Log Message:
perfused: use SOL_LOCAL


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/perfused/perfused.c

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

Modified files:

Index: src/usr.sbin/perfused/perfused.c
diff -u src/usr.sbin/perfused/perfused.c:1.25 src/usr.sbin/perfused/perfused.c:1.26
--- src/usr.sbin/perfused/perfused.c:1.25	Fri Dec 12 09:58:39 2014
+++ src/usr.sbin/perfused/perfused.c	Sun Aug  8 20:56:54 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfused.c,v 1.25 2014/12/12 09:58:39 manu Exp $ */
+/*  $NetBSD: perfused.c,v 1.26 2021/08/08 20:56:54 nia Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -125,7 +125,7 @@ get_mount_info(int fd, struct perfuse_mo
 	 * We do not need peer creds beyond this point
 	 */
 	opt = 0;
-	if (setsockopt(fd, 0, LOCAL_CREDS, &opt, sizeof(opt)) != 0)
+	if (setsockopt(fd, SOL_LOCAL, LOCAL_CREDS, &opt, sizeof(opt)) != 0)
 		DWARN("%s: setsockopt LOCAL_CREDS failed", __func__);
 
 #ifdef PERFUSE_DEBUG



CVS commit: src/sys/dev/pci/cxgb

2021-08-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Aug  8 20:57:09 UTC 2021

Modified Files:
src/sys/dev/pci/cxgb: cxgb_offload.c

Log Message:
s/propely/properly/


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/cxgb/cxgb_offload.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/dev/pci/cxgb/cxgb_offload.c
diff -u src/sys/dev/pci/cxgb/cxgb_offload.c:1.6 src/sys/dev/pci/cxgb/cxgb_offload.c:1.7
--- src/sys/dev/pci/cxgb/cxgb_offload.c:1.6	Fri Dec 27 09:22:20 2019
+++ src/sys/dev/pci/cxgb/cxgb_offload.c	Sun Aug  8 20:57:09 2021
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cxgb_offload.c,v 1.6 2019/12/27 09:22:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cxgb_offload.c,v 1.7 2021/08/08 20:57:09 andvar Exp $");
 
 #include 
 #include 
@@ -516,7 +516,7 @@ cxgb_insert_tid(struct toedev *tdev, str
 }
 
 /*
- * Populate a TID_RELEASE WR.  The mbuf must be already propely sized.
+ * Populate a TID_RELEASE WR.  The mbuf must be already properly sized.
  */
 static inline void
 mk_tid_release(struct mbuf *m, unsigned int tid)



CVS commit: src/sys/dev/raidframe

2021-08-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Aug  8 21:45:53 UTC 2021

Modified Files:
src/sys/dev/raidframe: rf_parityscan.c

Log Message:
s/arry/array/


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/raidframe/rf_parityscan.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/dev/raidframe/rf_parityscan.c
diff -u src/sys/dev/raidframe/rf_parityscan.c:1.37 src/sys/dev/raidframe/rf_parityscan.c:1.38
--- src/sys/dev/raidframe/rf_parityscan.c:1.37	Fri Jul 23 00:54:45 2021
+++ src/sys/dev/raidframe/rf_parityscan.c	Sun Aug  8 21:45:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_parityscan.c,v 1.37 2021/07/23 00:54:45 oster Exp $	*/
+/*	$NetBSD: rf_parityscan.c,v 1.38 2021/08/08 21:45:53 andvar Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  /
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_parityscan.c,v 1.37 2021/07/23 00:54:45 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_parityscan.c,v 1.38 2021/08/08 21:45:53 andvar Exp $");
 
 #include 
 
@@ -50,7 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_paritysca
 
 /*
  *
- * walk through the entire arry and write new parity.  This works by
+ * walk through the entire array and write new parity.  This works by
  * creating two DAGs, one to read a stripe of data and one to write
  * new parity.  The first is executed, the data is xored together, and
  * then the second is executed.  To avoid constantly building and



CVS commit: src

2021-08-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Aug  8 21:50:10 UTC 2021

Modified Files:
src/sys/stand/efiboot: version
src/usr.sbin/sysinst: disklabel.c disks.c

Log Message:
s/partion/partition/ s/arrray/array/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/stand/efiboot/version
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.73 -r1.74 src/usr.sbin/sysinst/disks.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/stand/efiboot/version
diff -u src/sys/stand/efiboot/version:1.27 src/sys/stand/efiboot/version:1.28
--- src/sys/stand/efiboot/version:1.27	Mon Jun 21 11:11:33 2021
+++ src/sys/stand/efiboot/version	Sun Aug  8 21:50:10 2021
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.27 2021/06/21 11:11:33 jmcneill Exp $
+$NetBSD: version,v 1.28 2021/08/08 21:50:10 andvar Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE EFI BOOTLOADER HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -25,7 +25,7 @@ is taken as the current.
 2.2:	Remove support for storing settings in EFI env vars.
 2.3:	EFI RT and GOP support for devicetree mode.
 2.4:	Add ISO9660 support.
-2.5:	Recognize the EFI system partion as fstype MSDOS.
+2.5:	Recognize the EFI system partition as fstype MSDOS.
 2.6:	Disable ACPI support when booting big endian kernels.
 2.7:	Add basic support for booting from RAID1 volumes.
 2.8:	Add bi-endian disklabel and FFS support.

Index: src/usr.sbin/sysinst/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.43 src/usr.sbin/sysinst/disklabel.c:1.44
--- src/usr.sbin/sysinst/disklabel.c:1.43	Sun Jan 31 22:45:46 2021
+++ src/usr.sbin/sysinst/disklabel.c	Sun Aug  8 21:50:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.43 2021/01/31 22:45:46 rillig Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.44 2021/08/08 21:50:10 andvar Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@ struct disklabel_disk_partitions {
  */
 size_t dl_maxpart;
 
-/* index into this arrray is the type code */
+/* index into this array is the type code */
 static struct part_type_desc dl_types[__arraycount(fstypenames)-1];
 
 struct dl_custom_ptype {
@@ -241,7 +241,7 @@ disklabel_parts_read(const char *disk, d
 
 		if (dlstart < start || dlend > (start+len)) {
 			/*
-			 * Kernel assumes different outer partion
+			 * Kernel assumes different outer partition
 			 * (probably not yet written back to disk)
 			 * so this label is invalid.
 			 */
@@ -332,7 +332,7 @@ disklabel_parts_read(const char *disk, d
 			break;
 		}
 		if (!found_real_part) {
-			/* no partion there yet */
+			/* no partition there yet */
 no_valid_label:
 			free(parts);
 			return NULL;

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.73 src/usr.sbin/sysinst/disks.c:1.74
--- src/usr.sbin/sysinst/disks.c:1.73	Wed Jul 14 18:56:05 2021
+++ src/usr.sbin/sysinst/disks.c	Sun Aug  8 21:50:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.73 2021/07/14 18:56:05 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.74 2021/08/08 21:50:10 andvar Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -2522,7 +2522,7 @@ free_selected_partitions(struct selected
 		/* remove from list before testing for other instances */
 		selected->selection[i].parts = NULL;
 
-		/* if this is the secondary partion set, the parent owns it */
+		/* if this is the secondary partition set, the parent owns it */
 		if (parts->parent != NULL)
 			continue;
 



CVS commit: src/sys/modules/lua

2021-08-08 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Aug  8 22:26:32 UTC 2021

Modified Files:
src/sys/modules/lua: lua.c

Log Message:
Fix LIST operations, found by strictly-aligned CPUs, i.e., ARMv5 and IBM403:
- Initialize LIST_HEAD.
- Use LIST_FOREACH_SAFE() where necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/modules/lua/lua.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/modules/lua/lua.c
diff -u src/sys/modules/lua/lua.c:1.26 src/sys/modules/lua/lua.c:1.27
--- src/sys/modules/lua/lua.c:1.26	Sat Aug  7 04:19:31 2021
+++ src/sys/modules/lua/lua.c	Sun Aug  8 22:26:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua.c,v 1.26 2021/08/07 04:19:31 rin Exp $ */
+/*	$NetBSD: lua.c,v 1.27 2021/08/08 22:26:32 rin Exp $ */
 
 /*
  * Copyright (c) 2011 - 2017 by Marc Balmer .
@@ -74,8 +74,10 @@ static bool	lua_bytecode_on = false;
 static int	lua_verbose;
 static int	lua_max_instr;
 
-static LIST_HEAD(, lua_state)	lua_states;
-static LIST_HEAD(, lua_module)	lua_modules;
+static LIST_HEAD(, lua_state)	lua_states =
+LIST_HEAD_INITIALIZER(lua_states);
+static LIST_HEAD(, lua_module)	lua_modules =
+LIST_HEAD_INITIALIZER(lua_modules);
 
 static int lua_match(device_t, cfdata_t, void *);
 static void lua_attach(device_t, device_t, void *);
@@ -723,7 +725,7 @@ kluaL_newstate(const char *name, const c
 void
 klua_close(klua_State *K)
 {
-	struct lua_state *s;
+	struct lua_state *s, *ns;
 	struct lua_softc *sc;
 	struct lua_module *m;
 	int error = 0;
@@ -747,7 +749,7 @@ klua_close(klua_State *K)
 	if (error)
 		return;		/* Nothing we can do... */
 
-	LIST_FOREACH(s, &lua_states, lua_next)
+	LIST_FOREACH_SAFE(s, &lua_states, lua_next, ns)
 		if (s->K == K) {
 			LIST_REMOVE(s, lua_next);
 			LIST_FOREACH(m, &s->lua_modules, mod_next)



CVS commit: src/doc

2021-08-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Aug  9 00:32:51 UTC 2021

Modified Files:
src/doc: BRANCHES

Log Message:
thorpej-i2c-spi-conf -> thorpej-i2c-spi-conf2.


To generate a diff of this commit:
cvs rdiff -u -r1.362 -r1.363 src/doc/BRANCHES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.362 src/doc/BRANCHES:1.363
--- src/doc/BRANCHES:1.362	Sat Aug  7 16:21:02 2021
+++ src/doc/BRANCHES	Mon Aug  9 00:32:51 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.362 2021/08/07 16:21:02 thorpej Exp $
+#	$NetBSD: BRANCHES,v 1.363 2021/08/09 00:32:51 thorpej Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -777,12 +777,22 @@ Notes:		Re-based version of thorpej-fute
 
 Branch:		thorpej-i2c-spi-conf
 Description:	Improve device tree-based I2C and SPI enumeration.
-Status:		Active
+Status:		Abandoned
 Start Date:	Sun April 25, 2021
-End Date:
+End Date:	Sun Aug 8, 2021
 Base Tag:	thorpej-i2c-spi-conf-base
 Maintainer:	Jason Thorpe 
 Scope:		src/sys
+Notes:		Changes ported forward to thorpej-i2c-spi-conf2.
+
+Branch:		thorpej-i2c-spi-conf2
+Description:	Improve device tree-based I2C and SPI enumeration.
+Status:		Active
+Start Date:	Sun Aug 8, 2021
+End Date:
+Base Tag:	thorpej-i2c-spi-conf2-base
+Maintainer:	Jason Thorpe 
+Scope:		src/sys
 Notes:
 
 Branch:  	wrstuden-fixsa



CVS commit: [thorpej-i2c-spi-conf2] src/sys/dev/i2c

2021-08-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Aug  9 00:57:56 UTC 2021

Modified Files:
src/sys/dev/i2c [thorpej-i2c-spi-conf2]: i2cmux.c

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.6.2.1 -r1.6.2.2 src/sys/dev/i2c/i2cmux.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/dev/i2c/i2cmux.c
diff -u src/sys/dev/i2c/i2cmux.c:1.6.2.1 src/sys/dev/i2c/i2cmux.c:1.6.2.2
--- src/sys/dev/i2c/i2cmux.c:1.6.2.1	Mon Aug  9 00:30:09 2021
+++ src/sys/dev/i2c/i2cmux.c	Mon Aug  9 00:57:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2cmux.c,v 1.6.2.1 2021/08/09 00:30:09 thorpej Exp $	*/
+/*	$NetBSD: i2cmux.c,v 1.6.2.2 2021/08/09 00:57:56 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2cmux.c,v 1.6.2.1 2021/08/09 00:30:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2cmux.c,v 1.6.2.2 2021/08/09 00:57:56 thorpej Exp $");
 
 #include 
 #include 
@@ -151,7 +151,7 @@ iicmux_attach_bus(struct iicmux_softc * 
 	locs[I2CBUSCF_BUS] = bus->busidx;
 
 	config_found(sc->sc_dev, &iba, iicbus_print_multi,
-	CFARGS(.subatch = config_stdsubmatch,
+	CFARGS(.submatch = config_stdsubmatch,
 		   .locators = locs,
 		   .devhandle = devhandle));
 }



CVS commit: [thorpej-i2c-spi-conf2] src/sys/dev/i2c

2021-08-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Aug  9 01:09:41 UTC 2021

Modified Files:
src/sys/dev/i2c [thorpej-i2c-spi-conf2]: i2c.c

Log Message:
In iic_close(), mark the "sc" variable as __diagused.


To generate a diff of this commit:
cvs rdiff -u -r1.80.2.1 -r1.80.2.2 src/sys/dev/i2c/i2c.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/dev/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.80.2.1 src/sys/dev/i2c/i2c.c:1.80.2.2
--- src/sys/dev/i2c/i2c.c:1.80.2.1	Mon Aug  9 00:30:09 2021
+++ src/sys/dev/i2c/i2c.c	Mon Aug  9 01:09:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.80.2.1 2021/08/09 00:30:09 thorpej Exp $	*/
+/*	$NetBSD: i2c.c,v 1.80.2.2 2021/08/09 01:09:41 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.80.2.1 2021/08/09 00:30:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.80.2.2 2021/08/09 01:09:41 thorpej Exp $");
 
 #include 
 #include 
@@ -954,7 +954,8 @@ iic_open(dev_t dev, int flag, int fmt, l
 static int
 iic_close(dev_t dev, int flag, int fmt, lwp_t *l)
 {
-	struct iic_softc *sc = device_lookup_private(&iic_cd, minor(dev));;
+	struct iic_softc *sc __diagused =
+	device_lookup_private(&iic_cd, minor(dev));;
 
 	KASSERT(iic_refcnt != 0);
 	KASSERT(sc != NULL);



CVS commit: [thorpej-i2c-spi-conf2] src/sys/arch/macppc/dev

2021-08-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Aug  9 01:16:01 UTC 2021

Modified Files:
src/sys/arch/macppc/dev [thorpej-i2c-spi-conf2]: fcu.c

Log Message:
Adapt to thorpej-i2c-spi-conf2: ia->ia_cookie is gone.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.8.1 src/sys/arch/macppc/dev/fcu.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/macppc/dev/fcu.c
diff -u src/sys/arch/macppc/dev/fcu.c:1.4 src/sys/arch/macppc/dev/fcu.c:1.4.8.1
--- src/sys/arch/macppc/dev/fcu.c:1.4	Fri Jul 30 22:07:14 2021
+++ src/sys/arch/macppc/dev/fcu.c	Mon Aug  9 01:16:01 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: fcu.c,v 1.4 2021/07/30 22:07:14 macallan Exp $ */
+/* $NetBSD: fcu.c,v 1.4.8.1 2021/08/09 01:16:01 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.4 2021/07/30 22:07:14 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.4.8.1 2021/08/09 01:16:01 thorpej Exp $");
 
 #include 
 #include 
@@ -198,8 +198,10 @@ fcu_attach(device_t parent, device_t sel
 	/* round up sensors */
 	int ch;
 
+	int const phandle = devhandle_to_of(device_handle(self));
+
 	sc->sc_nsensors = 0;
-	ch = OF_child(ia->ia_cookie);
+	ch = OF_child(phandle);
 	while (ch != 0) {
 		char type[32], descr[32];
 		uint32_t reg;



CVS commit: [thorpej-i2c-spi-conf2] src/sys/dev/ic

2021-08-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Aug  9 01:29:52 UTC 2021

Modified Files:
src/sys/dev/ic [thorpej-i2c-spi-conf2]: pcf8584.c pcf8584var.h

Log Message:
Port over the changes from thorpej-i2c-spi-conf to thorpej-i2c-spi-conf2,
which is based on a newer HEAD revision.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.2.1 src/sys/dev/ic/pcf8584.c
cvs rdiff -u -r1.6 -r1.6.22.1 src/sys/dev/ic/pcf8584var.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/dev/ic/pcf8584.c
diff -u src/sys/dev/ic/pcf8584.c:1.19 src/sys/dev/ic/pcf8584.c:1.19.2.1
--- src/sys/dev/ic/pcf8584.c:1.19	Sat Aug  7 16:19:12 2021
+++ src/sys/dev/ic/pcf8584.c	Mon Aug  9 01:29:52 2021
@@ -1,7 +1,36 @@
-/*	$NetBSD: pcf8584.c,v 1.19 2021/08/07 16:19:12 thorpej Exp $	*/
+/*	$NetBSD: pcf8584.c,v 1.19.2.1 2021/08/09 01:29:52 thorpej Exp $	*/
 /*	$OpenBSD: pcf8584.c,v 1.9 2007/10/20 18:46:21 kettenis Exp $ */
 
 /*
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
  * Copyright (c) 2006 David Gwynne 
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -20,7 +49,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -30,6 +59,8 @@
 #include 
 #include 
 
+#include "locators.h"
+
 /* Internal registers */
 #define PCF8584_S0		0x00
 #define PCF8584_S1		0x01
@@ -37,8 +68,6 @@
 #define PCF8584_S3		0x03
 
 void		pcfiic_init(struct pcfiic_softc *);
-int		pcfiic_i2c_acquire_bus(void *, int);
-void		pcfiic_i2c_release_bus(void *, int);
 int		pcfiic_i2c_exec(void *, i2c_op_t, i2c_addr_t, const void *,
 		size_t, void *, size_t, int);
 
@@ -49,7 +78,6 @@ int		pcfiic_recv(struct pcfiic_softc *, 
 
 u_int8_t	pcfiic_read(struct pcfiic_softc *, bus_size_t);
 void		pcfiic_write(struct pcfiic_softc *, bus_size_t, u_int8_t);
-void		pcfiic_choose_bus(struct pcfiic_softc *, u_int8_t);
 int		pcfiic_wait_BBN(struct pcfiic_softc *);
 int		pcfiic_wait_pin(struct pcfiic_softc *, volatile u_int8_t *);
 
@@ -71,10 +99,12 @@ pcfiic_init(struct pcfiic_softc *sc)
 }
 
 void
-pcfiic_attach(struct pcfiic_softc *sc, i2c_addr_t addr, u_int8_t clock,
+pcfiic_attach(struct pcfiic_softc *sc, i2c_addr_t addr, uint8_t clock,
 int swapregs)
 {
-	struct i2cbus_attach_args		iba;
+	struct i2cbus_attach_args iba;
+	struct pcfiic_channel *ch;
+	int i;
 
 	if (swapregs) {
 		sc->sc_regmap[PCF8584_S1] = PCF8584_S0;
@@ -90,16 +120,39 @@ pcfiic_attach(struct pcfiic_softc *sc, i
 
 	printf("\n");
 
-	if (sc->sc_master)
-		pcfiic_choose_bus(sc, 0);
+	if (sc->sc_channels == NULL) {
+		KASSERT(sc->sc_nchannels == 0);
+		ch = kmem_alloc(sizeof(*sc->sc_channels), KM_SLEEP);
+		ch->ch_channel = 0;
+		ch->ch_devhandle = device_handle(sc->sc_dev);
 
-	iic_tag_init(&sc->sc_i2c);
-	sc->sc_i2c.ic_cookie = sc;
-	sc->sc_i2c.ic_exec = pcfiic_i2c_exec;
-
-	bzero(&iba, sizeof(iba));
-	iba.iba_tag = &sc->sc_i2c;
-	config_found(sc->sc_dev, &iba, iicbus_print, CFARGS_NONE);
+		sc->sc_channels = ch;
+		sc->sc_nchannels = 1;
+	} else {
+		KASSERT(sc->sc_nchannels != 0);
+	}
+
+	for (i = 0; i < sc->sc_nchannels; i++) {
+		int locs[I2CBUSCF_NLOCS];
+
+		ch = &sc->sc_channels[i];
+		ch->ch_sc = sc;
+		iic_tag_init(&ch->ch_i2c);
+		ch->ch_i2c.ic_cookie = ch;
+		ch->ch_i2c.ic_exec = pcfiic_i2c_exec;
+		ch->ch_i2c.ic_acquire_bus = sc->sc_acquire_bus;
+		ch->ch_i2c.ic_release_bus = sc->sc_release_bus;
+
+		locs[I2CBUSCF_BUS] = ch->ch_i2c.ic_channel;
+
+		memset(&

CVS commit: src/sys/dev/acpi

2021-08-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Aug  9 04:06:21 UTC 2021

Added Files:
src/sys/dev/acpi: acpi_i2c.h

Log Message:
Fix CVS eff-up.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.4 src/sys/dev/acpi/acpi_i2c.h

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

Added files:

Index: src/sys/dev/acpi/acpi_i2c.h
diff -u /dev/null src/sys/dev/acpi/acpi_i2c.h:1.4
--- /dev/null	Mon Aug  9 04:06:21 2021
+++ src/sys/dev/acpi/acpi_i2c.h	Mon Aug  9 04:06:21 2021
@@ -0,0 +1,38 @@
+/* $NetBSD: acpi_i2c.h,v 1.4 2021/08/09 04:06:21 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 2017 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Manuel Bouyer.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#ifndef _SYS_DEV_ACPI_ACPI_I2C_H
+#define _SYS_DEV_ACPI_ACPI_I2C_H
+#include 
+
+prop_array_t acpi_enter_i2c_devs(device_t, struct acpi_devnode *);
+#endif /*  _SYS_DEV_ACPI_ACPI_I2C_H */



CVS commit: src/sys/arch/macppc/dev

2021-08-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Aug  9 04:07:29 UTC 2021

Added Files:
src/sys/arch/macppc/dev: smuiic.c smuiicvar.h

Log Message:
Fix CVS eff-up.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.10 src/sys/arch/macppc/dev/smuiic.c
cvs rdiff -u -r0 -r1.3 src/sys/arch/macppc/dev/smuiicvar.h

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

Added files:

Index: src/sys/arch/macppc/dev/smuiic.c
diff -u /dev/null src/sys/arch/macppc/dev/smuiic.c:1.10
--- /dev/null	Mon Aug  9 04:07:29 2021
+++ src/sys/arch/macppc/dev/smuiic.c	Mon Aug  9 04:07:29 2021
@@ -0,0 +1,135 @@
+/*	$NetBSD: smuiic.c,v 1.10 2021/08/09 04:07:29 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 2013 Phileas Fogg
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+struct smuiic_softc {
+	device_t sc_dev;
+	int sc_node;
+	struct i2c_controller *sc_i2c;
+};
+
+static int smuiic_match(device_t, struct cfdata *, void *);
+static void smuiic_attach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(smuiic, sizeof(struct smuiic_softc),
+smuiic_match, smuiic_attach, NULL, NULL);
+
+static int
+smuiic_match(device_t parent, struct cfdata *cf, void *aux)
+{
+	struct smu_iicbus_confargs *ca = aux;
+
+	if (strcmp(ca->ca_name, "i2c-bus") == 0)
+		return 5;
+	if (strcmp(ca->ca_name, "i2c") == 0)
+		return 5;
+	
+	return 0;
+}
+
+static void
+smuiic_attach(device_t parent, device_t self, void *aux)
+{
+	struct smu_iicbus_confargs *ca = aux;
+	struct smuiic_softc *sc = device_private(self);
+	struct i2cbus_attach_args iba;
+	prop_dictionary_t dict = device_properties(self);
+	int devs, devc;
+	uint32_t addr;
+	char compat[256];
+	prop_array_t cfg;
+	prop_dictionary_t dev;
+	prop_data_t data;
+	char name[32], descr[32], num[8];
+
+	sc->sc_dev = self;
+	sc->sc_node = ca->ca_node;
+	sc->sc_i2c = ca->ca_tag;
+	printf("\n");
+
+	cfg = prop_array_create();
+	prop_dictionary_set(dict, "i2c-child-devices", cfg);
+	prop_object_release(cfg);
+
+	/* look for i2c devices */
+	devs = OF_child(sc->sc_node);
+	while (devs != 0) {
+		if (OF_getprop(devs, "name", name, 256) <= 0)
+			goto skip;
+		if (OF_getprop(devs, "compatible",
+		compat, 256) <= 0)
+			goto skip;
+		if (OF_getprop(devs, "reg", &addr, 4) <= 0)
+			goto skip;
+		addr = (addr & 0xff) >> 1;
+		dev = prop_dictionary_create();
+		prop_dictionary_set_string(dev, "name", name);
+		data = prop_data_create_copy(compat, strlen(compat)+1);
+		prop_dictionary_set(dev, "compatible", data);
+		prop_object_release(data);
+		prop_dictionary_set_uint32(dev, "addr", addr);
+		prop_dictionary_set_uint64(dev, "cookie", devs);
+		devc = OF_child(devs);
+		while (devc != 0) {
+			int reg;
+			if (OF_getprop(devc, "reg", ®, 4) < 4) goto nope;
+			if (OF_getprop(devc, "location", descr, 32) <= 0)
+goto nope;
+			printf("found '%s' at %02x\n", descr, reg);
+			snprintf(num, 7, "s%02x", reg);
+			prop_dictionary_set_string(dev, num, descr);
+		nope:
+			devc = OF_peer(devc);
+		}
+		prop_array_add(cfg, dev);
+		prop_object_release(dev);
+	skip:
+		devs = OF_peer(devs);
+	}
+
+	memset(&iba, 0, sizeof(iba));
+	iba.iba_tag = sc->sc_i2c;
+
+	config_found(sc->sc_dev, &iba, iicbus_print, CFARGS_NONE);
+}

Index: src/sys/arch/macppc/dev/smuiicvar.h
diff -u /dev/null src/sys/arch/macppc/dev/smuiicvar.h:1.3
--- /dev/null	Mon Aug  9 04:07:29 2021
+++ src/sys/arch/macppc/dev/smuiicvar.h	Mon Aug  9 04:07:29 2021
@@ -0,0 +1,38 @@
+/*-
+ * Copyright (c) 2013 Phileas Fogg
+ * All rights reserved.