CVS commit: src/sys/arch/alpha/alpha

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jul 21 01:52:28 UTC 2022

Modified Files:
src/sys/arch/alpha/alpha: db_trace.c

Log Message:
Rename functions in previous in preparation for future changes.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/alpha/alpha/db_trace.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/alpha/alpha/db_trace.c
diff -u src/sys/arch/alpha/alpha/db_trace.c:1.31 src/sys/arch/alpha/alpha/db_trace.c:1.32
--- src/sys/arch/alpha/alpha/db_trace.c:1.31	Wed Jul 20 17:03:10 2022
+++ src/sys/arch/alpha/alpha/db_trace.c	Thu Jul 21 01:52:28 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: db_trace.c,v 1.31 2022/07/20 17:03:10 thorpej Exp $ */
+/* $NetBSD: db_trace.c,v 1.32 2022/07/21 01:52:28 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.31 2022/07/20 17:03:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.32 2022/07/21 01:52:28 thorpej Exp $");
 
 #include 
 #include 
@@ -166,7 +166,7 @@ do {	\
 }
 
 static bool
-sym_is_trapsymbol(vaddr_t v)
+db_alpha_sym_is_trapsymbol(vaddr_t v)
 {
 	int i;
 
@@ -177,13 +177,13 @@ sym_is_trapsymbol(vaddr_t v)
 }
 
 static bool
-sym_is_backstop(vaddr_t v)
+db_alpha_sym_is_backstop(vaddr_t v)
 {
 	return v == (vaddr_t)&alpha_kthread_backstop;
 }
 
 static const char *
-trap_description(vaddr_t v)
+db_alpha_trap_description(vaddr_t v)
 {
 	int i;
 
@@ -194,7 +194,7 @@ trap_description(vaddr_t v)
 }
 
 static bool
-trap_is_syscall(vaddr_t v)
+db_alpha_trap_is_syscall(vaddr_t v)
 {
 	return v == (vaddr_t)&XentSys;
 }
@@ -288,7 +288,7 @@ db_stack_trace_print(db_expr_t addr, boo
 		 * backstop, then we are at the root of the call
 		 * graph.
 		 */
-		if (sym_is_backstop(symval)) {
+		if (db_alpha_sym_is_backstop(symval)) {
 			(*pr)("--- kernel thread backstop ---\n");
 			break;
 		}
@@ -328,13 +328,13 @@ db_stack_trace_print(db_expr_t addr, boo
 		 * If we are in a trap vector, frame points to a
 		 * trapframe.
 		 */
-		if (sym_is_trapsymbol(symval)) {
+		if (db_alpha_sym_is_trapsymbol(symval)) {
 			tf = (struct trapframe *)frame;
 
-			(*pr)("--- %s", trap_description(symval));
+			(*pr)("--- %s", db_alpha_trap_description(symval));
 
 			tfps = tf->tf_regs[FRAME_PS];
-			if (trap_is_syscall(symval))
+			if (db_alpha_trap_is_syscall(symval))
 decode_syscall(tf->tf_regs[FRAME_V0], p, pr);
 			if ((tfps & ALPHA_PSL_IPL_MASK) != last_ipl) {
 last_ipl = tfps & ALPHA_PSL_IPL_MASK;



CVS commit: src/sys/arch/alpha/alpha

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jul 21 01:52:28 UTC 2022

Modified Files:
src/sys/arch/alpha/alpha: db_trace.c

Log Message:
Rename functions in previous in preparation for future changes.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/alpha/alpha/db_trace.c

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



CVS import: xsrc/external/mit/libxcvt/dist

2022-07-20 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Wed Jul 20 23:15:32 UTC 2022

Update of /cvsroot/xsrc/external/mit/libxcvt/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv21845

Log Message:
initial import of libxcvt-0.1.2

Status:

Vendor Tag: xorg
Release Tags:   libxcvt-0-1-2

U xsrc/external/mit/libxcvt/dist/.gitlab-ci.yml
U xsrc/external/mit/libxcvt/dist/COPYING
U xsrc/external/mit/libxcvt/dist/README.md
U xsrc/external/mit/libxcvt/dist/meson.build
U xsrc/external/mit/libxcvt/dist/.gitlab-ci/ci.template
U xsrc/external/mit/libxcvt/dist/.gitlab-ci/config.yml
U xsrc/external/mit/libxcvt/dist/.gitlab-ci/meson-build.sh
U xsrc/external/mit/libxcvt/dist/cvt/cvt.c
U xsrc/external/mit/libxcvt/dist/cvt/meson.build
U xsrc/external/mit/libxcvt/dist/include/meson.build
U xsrc/external/mit/libxcvt/dist/include/libxcvt/libxcvt.h
U xsrc/external/mit/libxcvt/dist/include/libxcvt/libxcvt_mode.h
U xsrc/external/mit/libxcvt/dist/include/libxcvt/meson.build
U xsrc/external/mit/libxcvt/dist/lib/libxcvt.c
U xsrc/external/mit/libxcvt/dist/lib/meson.build
U xsrc/external/mit/libxcvt/dist/man/cvt.man
U xsrc/external/mit/libxcvt/dist/man/meson.build

No conflicts created by this import



CVS import: xsrc/external/mit/libxcvt/dist

2022-07-20 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Wed Jul 20 23:15:32 UTC 2022

Update of /cvsroot/xsrc/external/mit/libxcvt/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv21845

Log Message:
initial import of libxcvt-0.1.2

Status:

Vendor Tag: xorg
Release Tags:   libxcvt-0-1-2

U xsrc/external/mit/libxcvt/dist/.gitlab-ci.yml
U xsrc/external/mit/libxcvt/dist/COPYING
U xsrc/external/mit/libxcvt/dist/README.md
U xsrc/external/mit/libxcvt/dist/meson.build
U xsrc/external/mit/libxcvt/dist/.gitlab-ci/ci.template
U xsrc/external/mit/libxcvt/dist/.gitlab-ci/config.yml
U xsrc/external/mit/libxcvt/dist/.gitlab-ci/meson-build.sh
U xsrc/external/mit/libxcvt/dist/cvt/cvt.c
U xsrc/external/mit/libxcvt/dist/cvt/meson.build
U xsrc/external/mit/libxcvt/dist/include/meson.build
U xsrc/external/mit/libxcvt/dist/include/libxcvt/libxcvt.h
U xsrc/external/mit/libxcvt/dist/include/libxcvt/libxcvt_mode.h
U xsrc/external/mit/libxcvt/dist/include/libxcvt/meson.build
U xsrc/external/mit/libxcvt/dist/lib/libxcvt.c
U xsrc/external/mit/libxcvt/dist/lib/meson.build
U xsrc/external/mit/libxcvt/dist/man/cvt.man
U xsrc/external/mit/libxcvt/dist/man/meson.build

No conflicts created by this import



CVS commit: src/sys/dev/i2c

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 22:58:35 UTC 2022

Modified Files:
src/sys/dev/i2c: pcai2cmux.c

Log Message:
Improve error reporting.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/pcai2cmux.c

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



CVS commit: src/sys/dev/i2c

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 22:58:35 UTC 2022

Modified Files:
src/sys/dev/i2c: pcai2cmux.c

Log Message:
Improve error reporting.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/pcai2cmux.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/pcai2cmux.c
diff -u src/sys/dev/i2c/pcai2cmux.c:1.8 src/sys/dev/i2c/pcai2cmux.c:1.9
--- src/sys/dev/i2c/pcai2cmux.c:1.8	Wed Jan 27 02:29:48 2021
+++ src/sys/dev/i2c/pcai2cmux.c	Wed Jul 20 22:58:35 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcai2cmux.c,v 1.8 2021/01/27 02:29:48 thorpej Exp $	*/
+/*	$NetBSD: pcai2cmux.c,v 1.9 2022/07/20 22:58:35 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcai2cmux.c,v 1.8 2021/01/27 02:29:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcai2cmux.c,v 1.9 2022/07/20 22:58:35 thorpej Exp $");
 
 /*
  * Driver for NXP PCA954x / PCA984x I2C switches and multiplexers.
@@ -278,8 +278,14 @@ pcaiicmux_acquire_bus(struct iicmux_bus 
 {
 	struct pcaiicmux_softc * const sc = bus->mux->sc_mux_data;
 	struct pcaiicmux_bus_info * const bus_info = bus->bus_data;
+	int error;
 
-	return pcaiicmux_write(sc, bus_info->enable_value, flags);
+	error = pcaiicmux_write(sc, bus_info->enable_value, flags);
+	if (error) {
+		printf("%s: %s: pcaiicmux_write failed (error = %d)\n",
+		device_xname(sc->sc_iicmux.sc_dev), __func__, error);
+	}
+	return error;
 }
 
 static void
@@ -288,7 +294,14 @@ pcaiicmux_release_bus(struct iicmux_bus 
 	struct pcaiicmux_softc * const sc = bus->mux->sc_mux_data;
 
 	if (sc->sc_idle_disconnect) {
-		(void) pcaiicmux_write(sc, 0, flags);
+		int error;
+
+		error = pcaiicmux_write(sc, 0, flags);
+		if (error) {
+			printf("%s: %s: pcaiicmux_write failed (error = %d)\n",
+			device_xname(sc->sc_iicmux.sc_dev), __func__,
+			error);
+		}
 	}
 }
 
@@ -371,14 +384,16 @@ pcaiicmux_attach(device_t parent, device
 	sc->sc_cur_value = -1;
 	error = iic_acquire_bus(ia->ia_tag, 0);
 	if (error) {
-		aprint_error_dev(self, "failed to acquire I2C bus\n");
+		aprint_error_dev(self,
+		"failed to acquire I2C bus (error = %d)\n", error);
 		return;
 	}
 	error = pcaiicmux_write(sc, 0, 0);
 	iic_release_bus(ia->ia_tag, 0);
 	if (error) {
 		aprint_error_dev(self,
-		"failed to set mux to disconnected state\n");
+		"failed to set mux to disconnected state (error = %d)\n",
+		error);
 		return;
 	}
 



CVS commit: src/sys/dev/ic

2022-07-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 20 18:48:41 UTC 2022

Modified Files:
src/sys/dev/ic: dwc_eqos.c

Log Message:
When we init the hardware's rx/tx ring configuration we need to
adjust our internal state, as this implicitly resets the current
descriptor pointer.
Previously "ifconfig eqos0 down; ifconfig eqos0 up" made the interface
non-functional.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/dwc_eqos.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/ic/dwc_eqos.c
diff -u src/sys/dev/ic/dwc_eqos.c:1.6 src/sys/dev/ic/dwc_eqos.c:1.7
--- src/sys/dev/ic/dwc_eqos.c:1.6	Sat Apr 16 23:20:47 2022
+++ src/sys/dev/ic/dwc_eqos.c	Wed Jul 20 18:48:41 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_eqos.c,v 1.6 2022/04/16 23:20:47 jmcneill Exp $ */
+/* $NetBSD: dwc_eqos.c,v 1.7 2022/07/20 18:48:41 martin Exp $ */
 
 /*-
  * Copyright (c) 2022 Jared McNeill 
@@ -33,7 +33,7 @@
 #include "opt_net_mpsafe.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.6 2022/04/16 23:20:47 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.7 2022/07/20 18:48:41 martin Exp $");
 
 #include 
 #include 
@@ -510,7 +510,13 @@ eqos_reset(struct eqos_softc *sc)
 static void
 eqos_init_rings(struct eqos_softc *sc, int qid)
 {
-	sc->sc_tx.queued = 0;
+	/*
+	 * We reset the rings paddr, this implicitly resets
+	 * the hardwares current descriptor pointer.
+	 * Adjust our internal state accordingly.
+	 */
+	sc->sc_tx.cur = sc->sc_tx.next = sc->sc_tx.queued = 0;
+	sc->sc_rx.cur = sc->sc_rx.next = sc->sc_rx.queued = 0;
 
 	WR4(sc, GMAC_DMA_CHAN0_TX_BASE_ADDR_HI,
 	(uint32_t)(sc->sc_tx.desc_ring_paddr >> 32));



CVS commit: src/sys/dev/ic

2022-07-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 20 18:48:41 UTC 2022

Modified Files:
src/sys/dev/ic: dwc_eqos.c

Log Message:
When we init the hardware's rx/tx ring configuration we need to
adjust our internal state, as this implicitly resets the current
descriptor pointer.
Previously "ifconfig eqos0 down; ifconfig eqos0 up" made the interface
non-functional.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/dwc_eqos.c

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



CVS commit: src/sys/arch/alpha/alpha

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 18:25:10 UTC 2022

Modified Files:
src/sys/arch/alpha/alpha: locore.s

Log Message:
Fix a couple of nits with savectx():
- Note that this function is only used by dumpsys().
- Don't safe the PS word; there isn't actually a spot for it in the PCB.
- Don't bother returning anything; savectx() is declared void.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/arch/alpha/alpha/locore.s

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

Modified files:

Index: src/sys/arch/alpha/alpha/locore.s
diff -u src/sys/arch/alpha/alpha/locore.s:1.141 src/sys/arch/alpha/alpha/locore.s:1.142
--- src/sys/arch/alpha/alpha/locore.s:1.141	Thu Jul 22 15:48:40 2021
+++ src/sys/arch/alpha/alpha/locore.s	Wed Jul 20 18:25:10 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.141 2021/07/22 15:48:40 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.142 2022/07/20 18:25:10 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2019 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.141 2021/07/22 15:48:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.142 2022/07/20 18:25:10 thorpej Exp $");
 
 #include "assym.h"
 
@@ -651,13 +651,10 @@ LEAF(restorefpstate, 1)
  * sanely be used for curlwp iff cpu_switchto won't be called again, e.g.
  * if called from boot().)
  *
+ * N.B. this is actually only used by dumpsys().
+ *
  * Arguments:
  *	a0	'struct pcb *' of the process that needs its context saved
- *
- * Return:
- *	v0	0.  (note that for child processes, it seems
- *		like savectx() returns 1, because the return address
- *		in the PCB is set to the return address from savectx().)
  */
 
 LEAF(savectx, 1)
@@ -672,10 +669,6 @@ LEAF(savectx, 1)
 	stq	s5, PCB_CONTEXT+(5 * 8)(a0)
 	stq	s6, PCB_CONTEXT+(6 * 8)(a0)
 	stq	ra, PCB_CONTEXT+(7 * 8)(a0)	/* store ra */
-	call_pal PAL_OSF1_rdps			/* NOTE: doesn't kill a0 */
-	stq	v0, PCB_CONTEXT+(8 * 8)(a0)	/* store ps, for ipl */
-
-	mov	zero, v0
 	RET
 	END(savectx)
 



CVS commit: src/sys/arch/alpha/alpha

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 18:25:10 UTC 2022

Modified Files:
src/sys/arch/alpha/alpha: locore.s

Log Message:
Fix a couple of nits with savectx():
- Note that this function is only used by dumpsys().
- Don't safe the PS word; there isn't actually a spot for it in the PCB.
- Don't bother returning anything; savectx() is declared void.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/arch/alpha/alpha/locore.s

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



CVS commit: src/sys/arch/alpha/alpha

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 17:03:11 UTC 2022

Modified Files:
src/sys/arch/alpha/alpha: db_trace.c

Log Message:
Localize direct refernces to kernel symbols into functions.  NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/alpha/alpha/db_trace.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/alpha/alpha/db_trace.c
diff -u src/sys/arch/alpha/alpha/db_trace.c:1.30 src/sys/arch/alpha/alpha/db_trace.c:1.31
--- src/sys/arch/alpha/alpha/db_trace.c:1.30	Sat Jul 24 21:31:32 2021
+++ src/sys/arch/alpha/alpha/db_trace.c	Wed Jul 20 17:03:10 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: db_trace.c,v 1.30 2021/07/24 21:31:32 andvar Exp $ */
+/* $NetBSD: db_trace.c,v 1.31 2022/07/20 17:03:10 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.30 2021/07/24 21:31:32 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.31 2022/07/20 17:03:10 thorpej Exp $");
 
 #include 
 #include 
@@ -165,15 +165,38 @@ do {	\
 	}
 }
 
-static int
+static bool
 sym_is_trapsymbol(vaddr_t v)
 {
 	int i;
 
 	for (i = 0; special_symbols[i].ss_val != 0; ++i)
 		if (v == special_symbols[i].ss_val)
-			return 1;
-	return 0;
+			return true;
+	return false;
+}
+
+static bool
+sym_is_backstop(vaddr_t v)
+{
+	return v == (vaddr_t)&alpha_kthread_backstop;
+}
+
+static const char *
+trap_description(vaddr_t v)
+{
+	int i;
+
+	for (i = 0; special_symbols[i].ss_val != 0; ++i)
+		if (v == special_symbols[i].ss_val)
+			return special_symbols[i].ss_note;
+	return "(? trap ?)";
+}
+
+static bool
+trap_is_syscall(vaddr_t v)
+{
+	return v == (vaddr_t)&XentSys;
 }
 
 static void
@@ -191,7 +214,6 @@ db_stack_trace_print(db_expr_t addr, boo
 	struct prologue_info pi;
 	db_expr_t diff;
 	db_sym_t sym;
-	int i;
 	u_long tfps;
 	const char *symname;
 	struct pcb *pcbp;
@@ -266,7 +288,7 @@ db_stack_trace_print(db_expr_t addr, boo
 		 * backstop, then we are at the root of the call
 		 * graph.
 		 */
-		if (symval == (vaddr_t)&alpha_kthread_backstop) {
+		if (sym_is_backstop(symval)) {
 			(*pr)("--- kernel thread backstop ---\n");
 			break;
 		}
@@ -309,13 +331,10 @@ db_stack_trace_print(db_expr_t addr, boo
 		if (sym_is_trapsymbol(symval)) {
 			tf = (struct trapframe *)frame;
 
-			for (i = 0; special_symbols[i].ss_val != 0; ++i)
-if (symval == special_symbols[i].ss_val)
-	(*pr)("--- %s",
-	special_symbols[i].ss_note);
+			(*pr)("--- %s", trap_description(symval));
 
 			tfps = tf->tf_regs[FRAME_PS];
-			if (symval == (vaddr_t)&XentSys)
+			if (trap_is_syscall(symval))
 decode_syscall(tf->tf_regs[FRAME_V0], p, pr);
 			if ((tfps & ALPHA_PSL_IPL_MASK) != last_ipl) {
 last_ipl = tfps & ALPHA_PSL_IPL_MASK;



CVS commit: src/sys/arch/alpha/alpha

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 17:03:11 UTC 2022

Modified Files:
src/sys/arch/alpha/alpha: db_trace.c

Log Message:
Localize direct refernces to kernel symbols into functions.  NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/alpha/alpha/db_trace.c

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



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

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 15:52:47 UTC 2022

Modified Files:
src/sys/arch/alpha/include: alpha_cpu.h

Log Message:
Make alpha_wmb() actually a WMB rather than an MB (all uses of
alpha_wmb() have been audited and fixed-up as necessary).


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/alpha/include/alpha_cpu.h

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

Modified files:

Index: src/sys/arch/alpha/include/alpha_cpu.h
diff -u src/sys/arch/alpha/include/alpha_cpu.h:1.55 src/sys/arch/alpha/include/alpha_cpu.h:1.56
--- src/sys/arch/alpha/include/alpha_cpu.h:1.55	Tue Nov  2 11:26:03 2021
+++ src/sys/arch/alpha/include/alpha_cpu.h	Wed Jul 20 15:52:47 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: alpha_cpu.h,v 1.55 2021/11/02 11:26:03 ryo Exp $ */
+/* $NetBSD: alpha_cpu.h,v 1.56 2022/07/20 15:52:47 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996 Carnegie-Mellon University.
@@ -377,7 +377,7 @@ alpha_rpcc(void)
 }
 
 #define	alpha_mb()	__asm volatile("mb" : : : "memory")
-#define	alpha_wmb()	__asm volatile("mb" : : : "memory")	/* XXX */
+#define	alpha_wmb()	__asm volatile("wmb" : : : "memory")
 
 #if defined(_KERNEL) || defined(_STANDALONE)
 



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

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 15:52:47 UTC 2022

Modified Files:
src/sys/arch/alpha/include: alpha_cpu.h

Log Message:
Make alpha_wmb() actually a WMB rather than an MB (all uses of
alpha_wmb() have been audited and fixed-up as necessary).


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/alpha/include/alpha_cpu.h

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



CVS commit: src/sys

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 15:45:28 UTC 2022

Modified Files:
src/sys/arch/alpha/include: tc_machdep.h
src/sys/dev/tc: pxg.c stic.c

Log Message:
In the Alpha tc_syncbus(), we need to issue a MB because WMB does not
order reads with respect to writes.  Remove now-redundant tc_wmb()
calls before tc_syncbus().

NFC on MIPS other than removing a redundant wbflush() (tc_wmb() followed
by tc_syncbus()).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/alpha/include/tc_machdep.h
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/tc/pxg.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/tc/stic.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/alpha/include/tc_machdep.h
diff -u src/sys/arch/alpha/include/tc_machdep.h:1.7 src/sys/arch/alpha/include/tc_machdep.h:1.8
--- src/sys/arch/alpha/include/tc_machdep.h:1.7	Thu Jun 22 16:46:52 2017
+++ src/sys/arch/alpha/include/tc_machdep.h	Wed Jul 20 15:45:28 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tc_machdep.h,v 1.7 2017/06/22 16:46:52 flxd Exp $ */
+/* $NetBSD: tc_machdep.h,v 1.8 2022/07/20 15:45:28 thorpej Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -71,6 +71,11 @@ typedef int32_t		tc_offset_t;
 #define	tc_syncbus()			\
 do {\
 	volatile uint32_t no_optimize;	\
+	/*\
+	 * WMB does not order reads with respect to writes, so a	\
+	 * MB is required here.		\
+	 */\
+	alpha_mb();			\
 	no_optimize =	 		\
 	*(volatile uint32_t *)ALPHA_PHYS_TO_K0SEG(0x0001f0080220); \
 	__USE(no_optimize);		\

Index: src/sys/dev/tc/pxg.c
diff -u src/sys/dev/tc/pxg.c:1.36 src/sys/dev/tc/pxg.c:1.37
--- src/sys/dev/tc/pxg.c:1.36	Sun Nov 10 21:16:37 2019
+++ src/sys/dev/tc/pxg.c	Wed Jul 20 15:45:28 2022
@@ -1,4 +1,4 @@
-/* 	$NetBSD: pxg.c,v 1.36 2019/11/10 21:16:37 chs Exp $	*/
+/* 	$NetBSD: pxg.c,v 1.37 2022/07/20 15:45:28 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxg.c,v 1.36 2019/11/10 21:16:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxg.c,v 1.37 2022/07/20 15:45:28 thorpej Exp $");
 
 #include 
 #include 
@@ -164,7 +164,6 @@ pxg_attach(device_t parent, device_t sel
 
 	/* Start the i860. */
 	si->si_slotbase[PXG_I860_START_OFFSET >> 2] = 1;
-	tc_wmb();
 	tc_syncbus();
 	DELAY(4);
 #endif
@@ -208,7 +207,6 @@ pxg_init(struct stic_info *si)
 	slot[PXG_I860_RESET_OFFSET >> 2] = 0;
 	tc_wmb();
 	slot[PXG_HOST_INTR_OFFSET >> 2] = 0;
-	tc_wmb();
 	tc_syncbus();
 	DELAY(4);
 

Index: src/sys/dev/tc/stic.c
diff -u src/sys/dev/tc/stic.c:1.58 src/sys/dev/tc/stic.c:1.59
--- src/sys/dev/tc/stic.c:1.58	Wed May 18 13:56:32 2022
+++ src/sys/dev/tc/stic.c	Wed Jul 20 15:45:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: stic.c,v 1.58 2022/05/18 13:56:32 andvar Exp $	*/
+/*	$NetBSD: stic.c,v 1.59 2022/07/20 15:45:28 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.58 2022/05/18 13:56:32 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.59 2022/07/20 15:45:28 thorpej Exp $");
 
 #include 
 #include 
@@ -288,7 +288,6 @@ stic_init(struct stic_info *si)
 
 	/* Now reset the VDAC. */
 	*si->si_vdac_reset = 0;
-	tc_wmb();
 	tc_syncbus();
 	DELAY(1000);
 
@@ -358,13 +357,11 @@ stic_reset(struct stic_info *si)
 	 * Initialize the interface chip registers.
 	 */
 	sr->sr_sticsr = 0x0030;	/* Get the STIC's attention. */
-	tc_wmb();
 	tc_syncbus();
 	DELAY(2000);			/* wait 2ms for STIC to respond. */
 	sr->sr_sticsr = 0x;	/* Hit the STIC's csr again... */
 	tc_wmb();
 	sr->sr_buscsr = 0x;	/* and bash its bus-access csr. */
-	tc_wmb();
 	tc_syncbus();			/* Blam! */
 	DELAY(2);			/* wait until the stic recovers... */
 
@@ -402,7 +399,6 @@ stic_reset(struct stic_info *si)
 	sr->sr_ipdvint =
 	STIC_INT_WE | STIC_INT_P | STIC_INT_E_EN | STIC_INT_V_EN;
 	sr->sr_sticsr = 8;
-	tc_wmb();
 	tc_syncbus();
 }
 



CVS commit: src/sys

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 15:45:28 UTC 2022

Modified Files:
src/sys/arch/alpha/include: tc_machdep.h
src/sys/dev/tc: pxg.c stic.c

Log Message:
In the Alpha tc_syncbus(), we need to issue a MB because WMB does not
order reads with respect to writes.  Remove now-redundant tc_wmb()
calls before tc_syncbus().

NFC on MIPS other than removing a redundant wbflush() (tc_wmb() followed
by tc_syncbus()).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/alpha/include/tc_machdep.h
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/tc/pxg.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/tc/stic.c

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



CVS commit: src/sys/dev/tc

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 14:19:39 UTC 2022

Modified Files:
src/sys/dev/tc: zs_ioasic.c

Log Message:
No need to test for __alpha__ || alpha ... just one will suffice.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/tc/zs_ioasic.c

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



CVS commit: src/sys/dev/tc

2022-07-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 20 14:19:39 UTC 2022

Modified Files:
src/sys/dev/tc: zs_ioasic.c

Log Message:
No need to test for __alpha__ || alpha ... just one will suffice.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/tc/zs_ioasic.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/tc/zs_ioasic.c
diff -u src/sys/dev/tc/zs_ioasic.c:1.45 src/sys/dev/tc/zs_ioasic.c:1.46
--- src/sys/dev/tc/zs_ioasic.c:1.45	Sat May 28 10:36:23 2022
+++ src/sys/dev/tc/zs_ioasic.c	Wed Jul 20 14:19:38 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: zs_ioasic.c,v 1.45 2022/05/28 10:36:23 andvar Exp $ */
+/* $NetBSD: zs_ioasic.c,v 1.46 2022/07/20 14:19:38 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs_ioasic.c,v 1.45 2022/05/28 10:36:23 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs_ioasic.c,v 1.46 2022/07/20 14:19:38 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -73,7 +73,7 @@ __KERNEL_RCSID(0, "$NetBSD: zs_ioasic.c,
 
 #include 
 
-#if defined(__alpha__) || defined(alpha)
+#if defined(__alpha__)
 #include 
 #endif
 #if defined(pmax)
@@ -113,7 +113,7 @@ int zs_def_cflag = (TTYDEF_CFLAG & ~(CSI
 
 /* The layout of this is hardware-dependent (padding, order). */
 struct zshan {
-#if defined(__alpha__) || defined(alpha)
+#if defined(__alpha__)
 	volatile u_int	zc_csr;		/* ctrl,status, and indirect access */
 	u_int		zc_pad0;
 	volatile u_int	zc_data;	/* data */
@@ -158,7 +158,7 @@ zs_ioasic_get_chan_addr(tc_addr_t zsaddr
 	struct zsdevice *addr;
 	struct zshan *zc;
 
-#if defined(__alpha__) || defined(alpha)
+#if defined(__alpha__)
 	addr = (struct zsdevice *)TC_DENSE_TO_SPARSE(zsaddr);
 #endif
 #if defined(pmax)
@@ -343,7 +343,7 @@ zs_ioasic_attach(device_t parent, device
 	/* master interrupt control (enable) */
 	zs_write_reg(zs->zsc_cs[0], 9, zs_ioasic_init_reg[9]);
 	zs_write_reg(zs->zsc_cs[1], 9, zs_ioasic_init_reg[9]);
-#if defined(__alpha__) || defined(alpha)
+#if defined(__alpha__)
 	/* ioasic interrupt enable */
 	*(volatile u_int *)(ioasic_base + IOASIC_IMSK) |=
 		IOASIC_INTR_SCC_1 | IOASIC_INTR_SCC_0;
@@ -394,7 +394,7 @@ zs_ioasic_submatch(device_t parent, cfda
 		else if (systype == DS_MAXINE)
 			return (0);
 #endif
-#if defined(__alpha__) || defined(alpha)
+#if defined(__alpha__)
 		else if (cputype == ST_DEC_3000_300)
 			return (0);
 #endif
@@ -719,7 +719,7 @@ zs_ioasic_cninit(tc_addr_t ioasic_addr, 
 	 * Compute the physical address of the chip, "map" it via
 	 * K0SEG, and then get the address of the actual channel.
 	 */
-#if defined(__alpha__) || defined(alpha)
+#if defined(__alpha__)
 	zs_addr = ALPHA_PHYS_TO_K0SEG(ioasic_addr + zs_offset);
 #endif
 #if defined(pmax)



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

2022-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jul 20 10:07:49 UTC 2022

Modified Files:
src/sys/arch/mips/mips: cpu_subr.c locore_octeon.S

Log Message:
mips: Fix cpuids synchronization at boot.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mips/mips/cpu_subr.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mips/mips/locore_octeon.S

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

Modified files:

Index: src/sys/arch/mips/mips/cpu_subr.c
diff -u src/sys/arch/mips/mips/cpu_subr.c:1.61 src/sys/arch/mips/mips/cpu_subr.c:1.62
--- src/sys/arch/mips/mips/cpu_subr.c:1.61	Mon Mar 28 12:38:58 2022
+++ src/sys/arch/mips/mips/cpu_subr.c	Wed Jul 20 10:07:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.61 2022/03/28 12:38:58 riastradh Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.62 2022/07/20 10:07:49 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.61 2022/03/28 12:38:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.62 2022/07/20 10:07:49 riastradh Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -273,10 +273,12 @@ cpu_attach_common(device_t self, struct 
 	if (ci != &cpu_info_store) {
 		/*
 		 * Tail insert this onto the list of cpu_info's.
+		 * atomic_store_release matches PTR_L/SYNC_ACQ in
+		 * locore_octeon.S (XXX what about non-Octeon?).
 		 */
 		KASSERT(cpuid_infos[ci->ci_cpuid] == NULL);
-		cpuid_infos[ci->ci_cpuid] = ci;
-		membar_producer();
+		atomic_store_release(&cpuid_infos[ci->ci_cpuid], ci);
+		membar_producer(); /* Cavium sync plunger */
 	}
 	KASSERT(cpuid_infos[ci->ci_cpuid] != NULL);
 	evcnt_attach_dynamic(&ci->ci_evcnt_synci_activate_rqst,

Index: src/sys/arch/mips/mips/locore_octeon.S
diff -u src/sys/arch/mips/mips/locore_octeon.S:1.13 src/sys/arch/mips/mips/locore_octeon.S:1.14
--- src/sys/arch/mips/mips/locore_octeon.S:1.13	Tue Jul 28 00:35:38 2020
+++ src/sys/arch/mips/mips/locore_octeon.S	Wed Jul 20 10:07:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_octeon.S,v 1.13 2020/07/28 00:35:38 simonb Exp $	*/
+/*	$NetBSD: locore_octeon.S,v 1.14 2022/07/20 10:07:49 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-RCSID("$NetBSD: locore_octeon.S,v 1.13 2020/07/28 00:35:38 simonb Exp $")
+RCSID("$NetBSD: locore_octeon.S,v 1.14 2022/07/20 10:07:49 riastradh Exp $")
 
 #include "cpunode.h"			/* for NWDOG */
 #include "opt_cputype.h"
@@ -37,7 +37,7 @@ RCSID("$NetBSD: locore_octeon.S,v 1.13 2
 #include 
 #include 
 
-RCSID("$NetBSD: locore_octeon.S,v 1.13 2020/07/28 00:35:38 simonb Exp $")
+RCSID("$NetBSD: locore_octeon.S,v 1.14 2022/07/20 10:07:49 riastradh Exp $")
 
 #include "assym.h"
 
@@ -141,8 +141,10 @@ NESTED_NOPROFILE(octeon_cpu_spinup, 0, r
 	PTR_LA	a1, _C_LABEL(cpuid_infos)
 	dsll	v0, s0, PTR_SCALESHIFT	# cpunum -> array index
 	PTR_ADD	t0, a1, v0		# add to array start
-1:	sync
-	PTR_L	a1, (t0)		# get cpu_info pointer
+1:	PTR_L	a1, (t0)		# get cpu_info pointer
+	SYNC_ACQ			# PTR_L/SYNC_ACQ matches
+	#   atomic_store_release in
+	#   cpu_attach_common
 	beqz	a1, 1b			# loop until non-NULL
 	 nop
 



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

2022-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jul 20 10:07:49 UTC 2022

Modified Files:
src/sys/arch/mips/mips: cpu_subr.c locore_octeon.S

Log Message:
mips: Fix cpuids synchronization at boot.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mips/mips/cpu_subr.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mips/mips/locore_octeon.S

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



CVS commit: src/sys

2022-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jul 20 10:01:11 UTC 2022

Modified Files:
src/sys/arch/arm/nxp: files.imx
src/sys/arch/arm/rockchip: files.rockchip
src/sys/arch/arm/sunxi: files.sunxi
src/sys/arch/arm/ti: files.ti
src/sys/conf: files
src/sys/dev/fdt: files.fdt
src/sys/dev/i2c: files.i2c

Log Message:
drm: Use CPPFLAGS.drmkms in all local drm drivers too.

This way we don't pollute the NetBSD kernel namespace with all the
Linux compat shim definitions needed to build drm, except for the
local drm drivers that need the API.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/files.imx
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/rockchip/files.rockchip
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/ti/files.ti
cvs rdiff -u -r1.1298 -r1.1299 src/sys/conf/files
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/fdt/files.fdt
cvs rdiff -u -r1.122 -r1.123 src/sys/dev/i2c/files.i2c

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/nxp/files.imx
diff -u src/sys/arch/arm/nxp/files.imx:1.1 src/sys/arch/arm/nxp/files.imx:1.2
--- src/sys/arch/arm/nxp/files.imx:1.1	Wed Dec 23 14:42:38 2020
+++ src/sys/arch/arm/nxp/files.imx	Wed Jul 20 10:01:10 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: files.imx,v 1.1 2020/12/23 14:42:38 skrll Exp $
+#	$NetBSD: files.imx,v 1.2 2022/07/20 10:01:10 riastradh Exp $
 #
 # Configuration info for the Freescale i.MX6
 #
@@ -150,3 +150,4 @@ file	arch/arm/nxp/imx6_pwm.c			imxpwm_fd
 # HDMI TX (Designware based)
 attach	dwhdmi at fdt with imx6_dwhdmi
 file	arch/arm/nxp/imx6_dwhdmi.c		imx6_dwhdmi
+makeoptions	imx6_dwhdmi	"CPPFLAGS.imx6_dwhdmi"+="${CPPFLAGS.drmkms}"

Index: src/sys/arch/arm/rockchip/files.rockchip
diff -u src/sys/arch/arm/rockchip/files.rockchip:1.25 src/sys/arch/arm/rockchip/files.rockchip:1.26
--- src/sys/arch/arm/rockchip/files.rockchip:1.25	Fri Nov 12 22:02:08 2021
+++ src/sys/arch/arm/rockchip/files.rockchip	Wed Jul 20 10:01:11 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: files.rockchip,v 1.25 2021/11/12 22:02:08 jmcneill Exp $
+#	$NetBSD: files.rockchip,v 1.26 2022/07/20 10:01:11 riastradh Exp $
 #
 # Configuration info for Rockchip family SoCs
 #
@@ -116,27 +116,32 @@ define	rkfbbus { }
 device	rkdrm: drmkms, ddc_read_edid, rkfbbus
 attach	rkdrm at fdt with rk_drm
 file	arch/arm/rockchip/rk_drm.c		rk_drm
+makeoptions	rk_drm	"CPPFLAGS.rk_drm"+="${CPPFLAGS.drmkms}"
 
 # DRM framebuffer console
 device	rkfb: rkfbbus, drmfb, wsemuldisplaydev
 attach	rkfb at rkfbbus with rk_fb
 file	arch/arm/rockchip/rk_fb.c		rk_fb
+makeoptions	rk_fb	"CPPFLAGS.rk_fb"+="${CPPFLAGS.drmkms}"
 
 # Visual Output Processor
 device	rkvop: drmkms
 attach	rkvop at fdt with rk_vop
 file	arch/arm/rockchip/rk_vop.c		rk_vop
+makeoptions	rk_vop	"CPPFLAGS.rk_vop"+="${CPPFLAGS.drmkms}"
 
 # HDMI TX (Designware based)
 attach	dwhdmi at fdt with rk_dwhdmi
 file	arch/arm/rockchip/rk_dwhdmi.c		rk_dwhdmi
+makeoptions	rk_dwhdmi	"CPPFLAGS.rk_dwhdmi"+="${CPPFLAGS.drmkms}"
 
 # DP/eDP (Analogix-based)
 attach	anxdp at fdt with rk_anxdp
 file	arch/arm/rockchip/rk_anxdp.c		rk_anxdp
+makeoptions	rk_anxdp	"CPPFLAGS.rk_anxdp"+="${CPPFLAGS.drmkms}"
 
 # I2S/PCM controller
-device	rki2s	
+device	rki2s
 attach  rki2s at fdt with rk_i2s
 filearch/arm/rockchip/rk_i2s.c		rk_i2s
 

Index: src/sys/arch/arm/sunxi/files.sunxi
diff -u src/sys/arch/arm/sunxi/files.sunxi:1.71 src/sys/arch/arm/sunxi/files.sunxi:1.72
--- src/sys/arch/arm/sunxi/files.sunxi:1.71	Tue Jun 28 05:19:03 2022
+++ src/sys/arch/arm/sunxi/files.sunxi	Wed Jul 20 10:01:11 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunxi,v 1.71 2022/06/28 05:19:03 skrll Exp $
+#	$NetBSD: files.sunxi,v 1.72 2022/07/20 10:01:11 riastradh Exp $
 #
 # Configuration info for Allwinner sunxi family SoCs
 #
@@ -342,26 +342,31 @@ file	arch/arm/sunxi/sunxi_de2_ccu.c		sun
 device	sunximixer: drmkms
 attach	sunximixer at fdt with sunxi_mixer
 file	arch/arm/sunxi/sunxi_mixer.c		sunxi_mixer
+makeoptions	sunxi_mixer	"CPPFLAGS.sunxi_mixer"+="${CPPFLAGS.drmkms}"
 
 # DE2 timing controller
 device	sunxilcdc: drmkms
 attach	sunxilcdc at fdt with sunxi_lcdc
 file	arch/arm/sunxi/sunxi_lcdc.c		sunxi_lcdc
+makeoptions	sunxi_lcdc	"CPPFLAGS.sunxi_lcdc"+="${CPPFLAGS.drmkms}"
 
 # Display Pipeline
 define	sunxifbbus { }
 device	sunxidrm: drmkms, ddc_read_edid, sunxifbbus
 attach	sunxidrm at fdt with sunxi_drm
 file	arch/arm/sunxi/sunxi_drm.c		sunxi_drm
+makeoptions	sunxi_drm	"CPPFLAGS.sunxi_drm"+="${CPPFLAGS.drmkms}"
 
 # DRM framebuffer console
 device	sunxifb: sunxifbbus, drmfb, wsemuldisplaydev
 attach	sunxifb at sunxifbbus with sunxi_fb
 file	arch/arm/sunxi/sunxi_fb.c		sunxi_fb
+makeoptions	sunxi_fb	"CPPFLAGS.sunxi_fb"+="${CPPFLAGS.drmkms}"
 
 # Allwinner HDMI (Designware based)
 attach	dwhdmi at fdt with sunxi_dwhdmi
 file	arch/arm/sunxi/sunxi_dwhdmi.c		sunxi_dwh

CVS commit: src/sys

2022-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jul 20 10:01:11 UTC 2022

Modified Files:
src/sys/arch/arm/nxp: files.imx
src/sys/arch/arm/rockchip: files.rockchip
src/sys/arch/arm/sunxi: files.sunxi
src/sys/arch/arm/ti: files.ti
src/sys/conf: files
src/sys/dev/fdt: files.fdt
src/sys/dev/i2c: files.i2c

Log Message:
drm: Use CPPFLAGS.drmkms in all local drm drivers too.

This way we don't pollute the NetBSD kernel namespace with all the
Linux compat shim definitions needed to build drm, except for the
local drm drivers that need the API.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/files.imx
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/rockchip/files.rockchip
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/ti/files.ti
cvs rdiff -u -r1.1298 -r1.1299 src/sys/conf/files
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/fdt/files.fdt
cvs rdiff -u -r1.122 -r1.123 src/sys/dev/i2c/files.i2c

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



CVS commit: src/sys/external/bsd/drm2/drm

2022-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jul 20 10:01:01 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/drm: files.drmkms

Log Message:
drm: Keep drm include flags in CPPFLAGS.drmkms after all.

Failures from this are much more obvious to debug than files with
missing #ifdefs, which sometimes lead to build failures but could
also just lead to silent miscompilation.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/external/bsd/drm2/drm/files.drmkms

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/drm/files.drmkms
diff -u src/sys/external/bsd/drm2/drm/files.drmkms:1.78 src/sys/external/bsd/drm2/drm/files.drmkms:1.79
--- src/sys/external/bsd/drm2/drm/files.drmkms:1.78	Wed Jul 20 01:38:24 2022
+++ src/sys/external/bsd/drm2/drm/files.drmkms	Wed Jul 20 10:01:01 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: files.drmkms,v 1.78 2022/07/20 01:38:24 riastradh Exp $
+#	$NetBSD: files.drmkms,v 1.79 2022/07/20 10:01:01 riastradh Exp $
 
 version	20180827
 
@@ -17,15 +17,15 @@ define	drmkms: drmkms_linux, drmkms_i2c,
 makeoptions 	drmkms	"COPTS.drmkms"+="-fwrapv"
 
 # Overrides first.
-makeoptions 	drmkms	CPPFLAGS+="-I$S/external/bsd/drm2/include"
-makeoptions 	drmkms	CPPFLAGS+="-I$S/external/bsd/drm2/include/drm"
+makeoptions 	drmkms	"CPPFLAGS.drmkms"+="-I$S/external/bsd/drm2/include"
+makeoptions 	drmkms	"CPPFLAGS.drmkms"+="-I$S/external/bsd/drm2/include/drm"
 
-makeoptions 	drmkms	CPPFLAGS+="-I$S/external/bsd/common/include"
+makeoptions 	drmkms	"CPPFLAGS.drmkms"+="-I$S/external/bsd/common/include"
 
 # Then upstream.
-makeoptions 	drmkms	CPPFLAGS+="-I$S/external/bsd/drm2/dist/include"
-makeoptions 	drmkms	CPPFLAGS+="-I$S/external/bsd/drm2/dist/include/drm"
-makeoptions 	drmkms	CPPFLAGS+="-I$S/external/bsd/drm2/dist/include/uapi"
+makeoptions 	drmkms	"CPPFLAGS.drmkms"+="-I$S/external/bsd/drm2/dist/include"
+makeoptions 	drmkms	"CPPFLAGS.drmkms"+="-I$S/external/bsd/drm2/dist/include/drm"
+makeoptions 	drmkms	"CPPFLAGS.drmkms"+="-I$S/external/bsd/drm2/dist/include/uapi"
 
 makeoptions	drmkms	"CPPFLAGS.drmkms"+="-D__KERNEL__"
 



CVS commit: src/sys/external/bsd/drm2/drm

2022-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jul 20 10:01:01 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/drm: files.drmkms

Log Message:
drm: Keep drm include flags in CPPFLAGS.drmkms after all.

Failures from this are much more obvious to debug than files with
missing #ifdefs, which sometimes lead to build failures but could
also just lead to silent miscompilation.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/external/bsd/drm2/drm/files.drmkms

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