CVS commit: src/sys/arch/powerpc/booke

2023-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  7 12:09:13 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c

Log Message:
Spaces to TAB


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/booke/booke_pmap.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/booke_pmap.c
diff -u src/sys/arch/powerpc/booke/booke_pmap.c:1.36 src/sys/arch/powerpc/booke/booke_pmap.c:1.37
--- src/sys/arch/powerpc/booke/booke_pmap.c:1.36	Wed Oct 26 07:35:20 2022
+++ src/sys/arch/powerpc/booke/booke_pmap.c	Fri Apr  7 12:09:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_pmap.c,v 1.36 2022/10/26 07:35:20 skrll Exp $	*/
+/*	$NetBSD: booke_pmap.c,v 1.37 2023/04/07 12:09:13 skrll Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,7 @@
 #define __PMAP_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.36 2022/10/26 07:35:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.37 2023/04/07 12:09:13 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -406,7 +406,7 @@ bool
 pmap_md_tlb_check_entry(void *ctx, vaddr_t va, tlb_asid_t asid, pt_entry_t pte)
 {
 	pmap_t pm = ctx;
-struct pmap_asid_info * const pai = PMAP_PAI(pm, curcpu()->ci_tlb_info);
+	struct pmap_asid_info * const pai = PMAP_PAI(pm, curcpu()->ci_tlb_info);
 
 	if (asid != pai->pai_asid)
 		return true;



CVS commit: src/sys/arch/powerpc/booke

2023-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  7 12:09:13 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c

Log Message:
Spaces to TAB


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/booke/booke_pmap.c

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



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

2023-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  7 11:08:31 UTC 2023

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

Log Message:
lint: reduce clutter in parsing preprocessor lines

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/usr.bin/xlint/lint1/lex.c

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



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

2023-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  7 11:08:31 UTC 2023

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

Log Message:
lint: reduce clutter in parsing preprocessor lines

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/usr.bin/xlint/lint1/lex.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/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.156 src/usr.bin/xlint/lint1/lex.c:1.157
--- src/usr.bin/xlint/lint1/lex.c:1.156	Wed Apr  5 20:17:30 2023
+++ src/usr.bin/xlint/lint1/lex.c	Fri Apr  7 11:08:31 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.156 2023/04/05 20:17:30 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.157 2023/04/07 11:08:31 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: lex.c,v 1.156 2023/04/05 20:17:30 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.157 2023/04/07 11:08:31 rillig Exp $");
 #endif
 
 #include 
@@ -940,21 +940,19 @@ parse_line_directive_flags(const char *p
 	*is_system = false;
 
 	while (*p != '\0') {
-		const char *word_start, *word_end;
-
 		while (ch_isspace(*p))
 			p++;
 
-		word_start = p;
+		const char *word = p;
 		while (*p != '\0' && !ch_isspace(*p))
 			p++;
-		word_end = p;
+		size_t len = (size_t)(p - word);
 
-		if (word_end - word_start == 1 && word_start[0] == '1')
+		if (len == 1 && word[0] == '1')
 			*is_begin = true;
-		if (word_end - word_start == 1 && word_start[0] == '2')
+		if (len == 1 && word[0] == '2')
 			*is_end = true;
-		if (word_end - word_start == 1 && word_start[0] == '3')
+		if (len == 1 && word[0] == '3')
 			*is_system = true;
 		/* Flag '4' is only interesting for C++. */
 	}



CVS commit: src/bin/sh

2023-04-07 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Apr  7 10:42:28 UTC 2023

Modified Files:
src/bin/sh: memalloc.c

Log Message:
Remove an end of file trailing blank line that served no purpose.

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/bin/sh/memalloc.c

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



CVS commit: src/bin/sh

2023-04-07 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Apr  7 10:42:28 UTC 2023

Modified Files:
src/bin/sh: memalloc.c

Log Message:
Remove an end of file trailing blank line that served no purpose.

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/bin/sh/memalloc.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/memalloc.c
diff -u src/bin/sh/memalloc.c:1.38 src/bin/sh/memalloc.c:1.39
--- src/bin/sh/memalloc.c:1.38	Fri Apr  7 10:34:13 2023
+++ src/bin/sh/memalloc.c	Fri Apr  7 10:42:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: memalloc.c,v 1.38 2023/04/07 10:34:13 kre Exp $	*/
+/*	$NetBSD: memalloc.c,v 1.39 2023/04/07 10:42:28 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)memalloc.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: memalloc.c,v 1.38 2023/04/07 10:34:13 kre Exp $");
+__RCSID("$NetBSD: memalloc.c,v 1.39 2023/04/07 10:42:28 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -402,4 +402,3 @@ ststrcat(size_t *lp, ...)
 
 	return str;
 }
-



CVS commit: src/bin/sh

2023-04-07 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Apr  7 10:34:13 UTC 2023

Modified Files:
src/bin/sh: eval.c histedit.c jobs.c jobs.h main.c memalloc.c mktokens
mystring.c output.c parser.c show.c
src/bin/sh/funcs: dirs popd pushd

Log Message:
The great shell trailing whitespace cleanup of 2023...
Inspired by private e-mail comments from mouse@

NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/bin/sh/eval.c
cvs rdiff -u -r1.65 -r1.66 src/bin/sh/histedit.c
cvs rdiff -u -r1.117 -r1.118 src/bin/sh/jobs.c
cvs rdiff -u -r1.25 -r1.26 src/bin/sh/jobs.h
cvs rdiff -u -r1.89 -r1.90 src/bin/sh/main.c
cvs rdiff -u -r1.37 -r1.38 src/bin/sh/memalloc.c
cvs rdiff -u -r1.14 -r1.15 src/bin/sh/mktokens
cvs rdiff -u -r1.19 -r1.20 src/bin/sh/mystring.c
cvs rdiff -u -r1.40 -r1.41 src/bin/sh/output.c
cvs rdiff -u -r1.179 -r1.180 src/bin/sh/parser.c
cvs rdiff -u -r1.54 -r1.55 src/bin/sh/show.c
cvs rdiff -u -r1.8 -r1.9 src/bin/sh/funcs/dirs src/bin/sh/funcs/popd \
src/bin/sh/funcs/pushd

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/eval.c
diff -u src/bin/sh/eval.c:1.188 src/bin/sh/eval.c:1.189
--- src/bin/sh/eval.c:1.188	Wed Jan  5 15:25:44 2022
+++ src/bin/sh/eval.c	Fri Apr  7 10:34:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.188 2022/01/05 15:25:44 kre Exp $	*/
+/*	$NetBSD: eval.c,v 1.189 2023/04/07 10:34:13 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.188 2022/01/05 15:25:44 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.189 2023/04/07 10:34:13 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -96,7 +96,7 @@ STATIC int funcnest;		/* depth of functi
 STATIC int builtin_flags;	/* evalcommand flags for builtins */
 /*
  * Base function nesting level inside a dot command.  Set to 0 initially
- * and to (funcnest + 1) before every dot command to enable 
+ * and to (funcnest + 1) before every dot command to enable
  *   1) detection of being in a file sourced by a dot command and
  *   2) counting of function nesting in that file for the implementation
  *  of the return command.
@@ -1398,7 +1398,7 @@ evalcommand(union node *cmd, int flgs, s
 	default:
 		VXTRACE(DBG_EVAL, ("normal command%s:  ", vforked?" VF":""),
 		trargs(argv));
-		redirect(cmd->ncmd.redirect, 
+		redirect(cmd->ncmd.redirect,
 		(vforked ? REDIR_VFORK : 0) | REDIR_KEEP);
 		if (!vforked)
 			for (sp = varlist.list ; sp ; sp = sp->next)

Index: src/bin/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.65 src/bin/sh/histedit.c:1.66
--- src/bin/sh/histedit.c:1.65	Mon Aug 22 17:33:11 2022
+++ src/bin/sh/histedit.c	Fri Apr  7 10:34:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: histedit.c,v 1.65 2022/08/22 17:33:11 kre Exp $	*/
+/*	$NetBSD: histedit.c,v 1.66 2023/04/07 10:34:13 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.65 2022/08/22 17:33:11 kre Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.66 2023/04/07 10:34:13 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -189,7 +189,7 @@ bad:
 el_set(el, EL_EDITOR, "emacs");
 			VTRACE(DBG_HISTORY, ("reading $EDITRC\n"));
 			el_source(el, lookupvar("EDITRC"));
-			el_set(el, EL_BIND, "^I", 
+			el_set(el, EL_BIND, "^I",
 			tabcomplete ? "rl-complete" : "ed-insert", NULL);
 			INTON;
 		}

Index: src/bin/sh/jobs.c
diff -u src/bin/sh/jobs.c:1.117 src/bin/sh/jobs.c:1.118
--- src/bin/sh/jobs.c:1.117	Sun Oct 30 01:46:16 2022
+++ src/bin/sh/jobs.c	Fri Apr  7 10:34:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.117 2022/10/30 01:46:16 kre Exp $	*/
+/*	$NetBSD: jobs.c,v 1.118 2023/04/07 10:34:13 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c	8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.117 2022/10/30 01:46:16 kre Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.118 2023/04/07 10:34:13 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -857,7 +857,7 @@ waitcmd(int argc, char **argv)
 			 * (eg: a child of the executable that exec'd us)
 			 * Simply go back and start all over again
 			 * (this is rare).
-			 */ 
+			 */
 			if (job == NULL)
 continue;
 
@@ -894,9 +894,8 @@ waitcmd(int argc, char **argv)
 	 * (that is, no pid args)
 	 */
 	snprintf(idstring, sizeof idstring,
-	"%d", job->ps[ job->nprocs ? 
-		job->nprocs-1 :
-		0 ].pid);
+	"%d", job->ps[ job->nprocs ?
+		job->nprocs-1 : 0 ].pid);
 	fpid = idstring;
 }
 VTRACE(DBG_WAIT, (" (for %s)", fpid));

Index: src/bin/sh/jobs.h
diff -u src/bin/sh/jobs.h:1.25 src/bin/sh/jobs.h:1.26
--- src/bin/sh/jobs.h:1.25	Sat Sep 11 20:43:32 2021
+++ src/bin/sh/jobs.h	Fri Apr  7 10:34:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.h,v 

CVS commit: src/bin/sh

2023-04-07 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Apr  7 10:34:13 UTC 2023

Modified Files:
src/bin/sh: eval.c histedit.c jobs.c jobs.h main.c memalloc.c mktokens
mystring.c output.c parser.c show.c
src/bin/sh/funcs: dirs popd pushd

Log Message:
The great shell trailing whitespace cleanup of 2023...
Inspired by private e-mail comments from mouse@

NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/bin/sh/eval.c
cvs rdiff -u -r1.65 -r1.66 src/bin/sh/histedit.c
cvs rdiff -u -r1.117 -r1.118 src/bin/sh/jobs.c
cvs rdiff -u -r1.25 -r1.26 src/bin/sh/jobs.h
cvs rdiff -u -r1.89 -r1.90 src/bin/sh/main.c
cvs rdiff -u -r1.37 -r1.38 src/bin/sh/memalloc.c
cvs rdiff -u -r1.14 -r1.15 src/bin/sh/mktokens
cvs rdiff -u -r1.19 -r1.20 src/bin/sh/mystring.c
cvs rdiff -u -r1.40 -r1.41 src/bin/sh/output.c
cvs rdiff -u -r1.179 -r1.180 src/bin/sh/parser.c
cvs rdiff -u -r1.54 -r1.55 src/bin/sh/show.c
cvs rdiff -u -r1.8 -r1.9 src/bin/sh/funcs/dirs src/bin/sh/funcs/popd \
src/bin/sh/funcs/pushd

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



CVS commit: src/sys/dev/usb

2023-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Apr  7 09:39:48 UTC 2023

Modified Files:
src/sys/dev/usb: xhci.c xhcivar.h

Log Message:
xhci(4): Defer root intr xfers while polling.

Root intr xfers require taking adaptive locks, which is forbidden
while polling.

This is not great -- any USB transfer completion callbacks might try
to take adaptive locks, not just uhub_intr, and that will always
causes trouble.  We get lucky with ukbd_intr because it's not
MP-safe, so it relies only on the kernel lock (a spin lock) anyway.
But this change brings xhci in line with ehci.

PR kern/57326

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/usb/xhcivar.h

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



CVS commit: src/sys/dev/usb

2023-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Apr  7 09:39:48 UTC 2023

Modified Files:
src/sys/dev/usb: xhci.c xhcivar.h

Log Message:
xhci(4): Defer root intr xfers while polling.

Root intr xfers require taking adaptive locks, which is forbidden
while polling.

This is not great -- any USB transfer completion callbacks might try
to take adaptive locks, not just uhub_intr, and that will always
causes trouble.  We get lucky with ukbd_intr because it's not
MP-safe, so it relies only on the kernel lock (a spin lock) anyway.
But this change brings xhci in line with ehci.

PR kern/57326

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/usb/xhcivar.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/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.175 src/sys/dev/usb/xhci.c:1.176
--- src/sys/dev/usb/xhci.c:1.175	Tue Oct 11 11:01:17 2022
+++ src/sys/dev/usb/xhci.c	Fri Apr  7 09:39:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.175 2022/10/11 11:01:17 msaitoh Exp $	*/
+/*	$NetBSD: xhci.c,v 1.176 2023/04/07 09:39:48 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.175 2022/10/11 11:01:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.176 2023/04/07 09:39:48 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2351,11 +2351,15 @@ xhci_rhpsc(struct xhci_softc * const sc,
 	KASSERT(xfer->ux_status == USBD_IN_PROGRESS);
 
 	uint8_t *p = xfer->ux_buf;
-	memset(p, 0, xfer->ux_length);
+	if (!xhci_polling_p(sc) || !sc->sc_intrxfer_deferred[bn])
+		memset(p, 0, xfer->ux_length);
 	p[rhp / NBBY] |= 1 << (rhp % NBBY);
 	xfer->ux_actlen = xfer->ux_length;
 	xfer->ux_status = USBD_NORMAL_COMPLETION;
-	usb_transfer_complete(xfer);
+	if (xhci_polling_p(sc))
+		sc->sc_intrxfer_deferred[bn] = true;
+	else
+		usb_transfer_complete(xfer);
 }
 
 /* Process Transfer Events */
@@ -2619,7 +2623,7 @@ xhci_softintr(void *v)
 	struct xhci_softc * const sc = XHCI_BUS2SC(bus);
 	struct xhci_ring * const er = sc->sc_er;
 	struct xhci_trb *trb;
-	int i, j, k;
+	int i, j, k, bn;
 
 	XHCIHIST_FUNC();
 
@@ -2630,6 +2634,20 @@ xhci_softintr(void *v)
 
 	XHCIHIST_CALLARGS("er: xr_ep %jd xr_cs %jd", i, j, 0, 0);
 
+	/*
+	 * Handle deferred root intr xfer, in case we just switched off
+	 * polling.  It's not safe to complete root intr xfers while
+	 * polling -- too much kernel machinery gets involved.
+	 */
+	if (!xhci_polling_p(sc)) {
+		for (bn = 0; bn < 2; bn++) {
+			if (__predict_false(sc->sc_intrxfer_deferred[bn])) {
+sc->sc_intrxfer_deferred[bn] = false;
+usb_transfer_complete(sc->sc_intrxfer[bn]);
+			}
+		}
+	}
+
 	while (1) {
 		usb_syncmem(>xr_dma, XHCI_TRB_SIZE * i, XHCI_TRB_SIZE,
 		BUS_DMASYNC_POSTREAD);

Index: src/sys/dev/usb/xhcivar.h
diff -u src/sys/dev/usb/xhcivar.h:1.22 src/sys/dev/usb/xhcivar.h:1.23
--- src/sys/dev/usb/xhcivar.h:1.22	Tue Oct 11 09:18:22 2022
+++ src/sys/dev/usb/xhcivar.h	Fri Apr  7 09:39:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhcivar.h,v 1.22 2022/10/11 09:18:22 msaitoh Exp $	*/
+/*	$NetBSD: xhcivar.h,v 1.23 2023/04/07 09:39:48 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -121,7 +121,7 @@ struct xhci_softc {
 	int *sc_rhportmap[2];
 	int sc_rhportcount[2];
 	struct usbd_xfer *sc_intrxfer[2];
-
+	bool sc_intrxfer_deferred[2];
 
 	struct xhci_slot * sc_slots;
 



CVS commit: src/sys

2023-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  7 08:55:31 UTC 2023

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c
src/sys/arch/arm/acpi: acpi_platform.c
src/sys/arch/arm/altera: cycv_platform.c
src/sys/arch/arm/amlogic: meson_platform.c
src/sys/arch/arm/apple: apple_platform.c
src/sys/arch/arm/arm32: arm32_machdep.c
src/sys/arch/arm/broadcom: bcm283x_platform.c
src/sys/arch/arm/fdt: arm_fdt.c arm_fdtvar.h arm_platform.c
src/sys/arch/arm/nvidia: tegra_platform.c
src/sys/arch/arm/nxp: imx6_platform.c
src/sys/arch/arm/rockchip: rk_platform.c
src/sys/arch/arm/samsung: exynos_platform.c
src/sys/arch/arm/sunxi: sunxi_platform.c
src/sys/arch/arm/ti: am3_platform.c omap3_platform.c
src/sys/arch/arm/vexpress: vexpress_platform.c
src/sys/arch/arm/xilinx: zynq_platform.c
src/sys/arch/evbarm/fdt: fdt_bus_machdep.c fdt_machdep.c
src/sys/dev/fdt: fdtvar.h files.fdt
Added Files:
src/sys/dev/fdt: fdt_platform.c

Log Message:
Rename ARM_PLATFORM to FDT_PLATFORM and make it available outside arm.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/acpi/acpi_platform.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/altera/cycv_platform.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/amlogic/meson_platform.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/apple/apple_platform.c
cvs rdiff -u -r1.145 -r1.146 src/sys/arch/arm/arm32/arm32_machdep.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/arm/broadcom/bcm283x_platform.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/fdt/arm_fdt.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/fdt/arm_fdtvar.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/fdt/arm_platform.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/nvidia/tegra_platform.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nxp/imx6_platform.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/rockchip/rk_platform.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/samsung/exynos_platform.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/sunxi/sunxi_platform.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/ti/am3_platform.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/ti/omap3_platform.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/vexpress/vexpress_platform.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/xilinx/zynq_platform.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/fdt/fdt_bus_machdep.c
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/evbarm/fdt/fdt_machdep.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fdt_platform.c
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/fdt/fdtvar.h
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/fdt/files.fdt

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/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.66 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.67
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.66	Fri Aug 19 08:17:32 2022
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Fri Apr  7 08:55:29 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.66 2022/08/19 08:17:32 ryo Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.67 2023/04/07 08:55:29 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.66 2022/08/19 08:17:32 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.67 2023/04/07 08:55:29 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_cpuoptions.h"
@@ -74,6 +74,7 @@ __KERNEL_RCSID(1, "$NetBSD: aarch64_mach
 #include 
 
 #include 
+#include 
 #include 
 
 #ifdef VERBOSE_INIT_ARM
@@ -677,9 +678,9 @@ cpu_startup(void)
 	consinit();
 
 #ifdef FDT
-	const struct arm_platform * const plat = arm_fdt_platform();
-	if (plat->ap_startup != NULL)
-		plat->ap_startup();
+	const struct fdt_platform * const plat = fdt_platform_find();
+	if (plat->fp_startup != NULL)
+		plat->fp_startup();
 #endif
 
 	/*

Index: src/sys/arch/arm/acpi/acpi_platform.c
diff -u src/sys/arch/arm/acpi/acpi_platform.c:1.35 src/sys/arch/arm/acpi/acpi_platform.c:1.36
--- src/sys/arch/arm/acpi/acpi_platform.c:1.35	Tue Jan 24 06:56:40 2023
+++ src/sys/arch/arm/acpi/acpi_platform.c	Fri Apr  7 08:55:29 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_platform.c,v 1.35 2023/01/24 06:56:40 mlelstv Exp $ */
+/* $NetBSD: acpi_platform.c,v 1.36 2023/04/07 08:55:29 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.35 2023/01/24 06:56:40 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.36 2023/04/07 08:55:29 skrll Exp $");
 
 #include 
 #include 
@@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_platfor
 #include 
 
 

CVS commit: src/sys

2023-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  7 08:55:31 UTC 2023

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c
src/sys/arch/arm/acpi: acpi_platform.c
src/sys/arch/arm/altera: cycv_platform.c
src/sys/arch/arm/amlogic: meson_platform.c
src/sys/arch/arm/apple: apple_platform.c
src/sys/arch/arm/arm32: arm32_machdep.c
src/sys/arch/arm/broadcom: bcm283x_platform.c
src/sys/arch/arm/fdt: arm_fdt.c arm_fdtvar.h arm_platform.c
src/sys/arch/arm/nvidia: tegra_platform.c
src/sys/arch/arm/nxp: imx6_platform.c
src/sys/arch/arm/rockchip: rk_platform.c
src/sys/arch/arm/samsung: exynos_platform.c
src/sys/arch/arm/sunxi: sunxi_platform.c
src/sys/arch/arm/ti: am3_platform.c omap3_platform.c
src/sys/arch/arm/vexpress: vexpress_platform.c
src/sys/arch/arm/xilinx: zynq_platform.c
src/sys/arch/evbarm/fdt: fdt_bus_machdep.c fdt_machdep.c
src/sys/dev/fdt: fdtvar.h files.fdt
Added Files:
src/sys/dev/fdt: fdt_platform.c

Log Message:
Rename ARM_PLATFORM to FDT_PLATFORM and make it available outside arm.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/acpi/acpi_platform.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/altera/cycv_platform.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/amlogic/meson_platform.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/apple/apple_platform.c
cvs rdiff -u -r1.145 -r1.146 src/sys/arch/arm/arm32/arm32_machdep.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/arm/broadcom/bcm283x_platform.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/fdt/arm_fdt.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/fdt/arm_fdtvar.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/fdt/arm_platform.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/nvidia/tegra_platform.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nxp/imx6_platform.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/rockchip/rk_platform.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/samsung/exynos_platform.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/sunxi/sunxi_platform.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/ti/am3_platform.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/ti/omap3_platform.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/vexpress/vexpress_platform.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/xilinx/zynq_platform.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/fdt/fdt_bus_machdep.c
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/evbarm/fdt/fdt_machdep.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fdt_platform.c
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/fdt/fdtvar.h
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/fdt/files.fdt

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



CVS commit: src/sys/netinet

2023-04-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Apr  7 06:44:08 UTC 2023

Modified Files:
src/sys/netinet: ip_carp.c

Log Message:
Select virtual address as sender if backing interface is anonymous.
Use correct scope for IPv6.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/netinet/ip_carp.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/netinet/ip_carp.c
diff -u src/sys/netinet/ip_carp.c:1.118 src/sys/netinet/ip_carp.c:1.119
--- src/sys/netinet/ip_carp.c:1.118	Sun Mar 26 10:32:38 2023
+++ src/sys/netinet/ip_carp.c	Fri Apr  7 06:44:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_carp.c,v 1.118 2023/03/26 10:32:38 mlelstv Exp $	*/
+/*	$NetBSD: ip_carp.c,v 1.119 2023/04/07 06:44:08 mlelstv Exp $	*/
 /*	$OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.118 2023/03/26 10:32:38 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.119 2023/04/07 06:44:08 mlelstv Exp $");
 
 /*
  * TODO:
@@ -1091,6 +1091,8 @@ carp_send_ad(void *v)
 		_s = pserialize_read_enter();
 		ifa = ifaof_ifpforaddr(, sc->sc_carpdev);
 		if (ifa == NULL)
+			ifa = ifaof_ifpforaddr(, >sc_if);
+		if (ifa == NULL)
 			ip->ip_src.s_addr = 0;
 		else
 			ip->ip_src.s_addr =
@@ -1142,6 +1144,7 @@ carp_send_ad(void *v)
 	if (sc->sc_naddrs6) {
 		struct ip6_hdr *ip6;
 		struct ifaddr *ifa;
+		struct ifnet *ifp;
 		int _s;
 
 		MGETHDR(m, M_DONTWAIT, MT_HEADER);
@@ -1168,7 +1171,12 @@ carp_send_ad(void *v)
 		memset(, 0, sizeof(sa));
 		sa.sa_family = AF_INET6;
 		_s = pserialize_read_enter();
-		ifa = ifaof_ifpforaddr(, sc->sc_carpdev);
+		ifp = sc->sc_carpdev;
+		ifa = ifaof_ifpforaddr(, ifp);
+		if (ifa == NULL) {	/* This should never happen with IPv6 */
+			ifp = >sc_if;
+			ifa = ifaof_ifpforaddr(, ifp);
+		}
 		if (ifa == NULL)	/* This should never happen with IPv6 */
 			memset(>ip6_src, 0, sizeof(struct in6_addr));
 		else
@@ -1179,7 +1187,7 @@ carp_send_ad(void *v)
 
 		ip6->ip6_dst.s6_addr16[0] = htons(0xff02);
 		ip6->ip6_dst.s6_addr8[15] = 0x12;
-		if (in6_setscope(>ip6_dst, >sc_if, NULL) != 0) {
+		if (in6_setscope(>ip6_dst, ifp, NULL) != 0) {
 			if_statinc(>sc_if, if_oerrors);
 			m_freem(m);
 			CARP_LOG(sc, ("in6_setscope failed"));



CVS commit: src/sys/netinet

2023-04-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Apr  7 06:44:08 UTC 2023

Modified Files:
src/sys/netinet: ip_carp.c

Log Message:
Select virtual address as sender if backing interface is anonymous.
Use correct scope for IPv6.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/netinet/ip_carp.c

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