CVS commit: [thorpej-i2c-spi-conf] src/sys/dev/ofw
Module Name:src Committed By: thorpej Date: Sun Aug 8 01:06:57 UTC 2021 Modified Files: src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c Log Message: If OFW_I2C_ALLOW_MISSING_COMPATIBLE_PROPERTY, ensure that clist_size is not negative for the call to kmem_tmpbuf_alloc(). To generate a diff of this commit: cvs rdiff -u -r1.1.6.8 -r1.1.6.9 src/sys/dev/ofw/ofw_i2c_subr.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/ofw/ofw_i2c_subr.c diff -u src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.8 src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.9 --- src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.8 Tue May 18 01:24:39 2021 +++ src/sys/dev/ofw/ofw_i2c_subr.c Sun Aug 8 01:06:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_i2c_subr.c,v 1.1.6.8 2021/05/18 01:24:39 thorpej Exp $ */ +/* $NetBSD: ofw_i2c_subr.c,v 1.1.6.9 2021/08/08 01:06:57 thorpej Exp $ */ /* * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.8 2021/05/18 01:24:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.9 2021/08/08 01:06:57 thorpej Exp $"); #include #include @@ -149,11 +149,13 @@ of_i2c_enumerate_devices(device_t dev, d } clist_size = OF_getproplen(node, "compatible"); -#ifndef OFW_I2C_ALLOW_MISSING_COMPATIBLE_PROPERTY if (clist_size <= 0) { +#ifndef OFW_I2C_ALLOW_MISSING_COMPATIBLE_PROPERTY continue; - } +#else + clist_size = 0; #endif + } clist = kmem_tmpbuf_alloc(clist_size, compat_buf, sizeof(compat_buf), KM_SLEEP); if (OF_getprop(node, "compatible", clist, clist_size) <
CVS commit: src/sys/arch
Module Name:src Committed By: thorpej Date: Sun Aug 8 00:53:39 UTC 2021 Modified Files: src/sys/arch/macppc/include: types.h src/sys/arch/sparc64/include: types.h Log Message: Define preprocessor symbols (__HAVE_OPENFIRMWARE_VARIANT_AAPL and __HAVE_OPENFIRMWARE_VARIANT_SUNW) that lets generic OpenFirmware code deal with differences / quirks among implementation variants. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/macppc/include/types.h cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sparc64/include/types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/macppc/include/types.h diff -u src/sys/arch/macppc/include/types.h:1.14 src/sys/arch/macppc/include/types.h:1.15 --- src/sys/arch/macppc/include/types.h:1.14 Sun Jul 17 23:23:53 2011 +++ src/sys/arch/macppc/include/types.h Sun Aug 8 00:53:39 2021 @@ -1,5 +1,6 @@ -/* $NetBSD: types.h,v 1.14 2011/07/17 23:23:53 dyoung Exp $ */ +/* $NetBSD: types.h,v 1.15 2021/08/08 00:53:39 thorpej Exp $ */ #include #define __HAVE_NEW_STYLE_BUS_H +#define __HAVE_OPENFIRMWARE_VARIANT_AAPL Index: src/sys/arch/sparc64/include/types.h diff -u src/sys/arch/sparc64/include/types.h:1.28 src/sys/arch/sparc64/include/types.h:1.29 --- src/sys/arch/sparc64/include/types.h:1.28 Sat Apr 6 03:06:27 2019 +++ src/sys/arch/sparc64/include/types.h Sun Aug 8 00:53:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.28 2019/04/06 03:06:27 thorpej Exp $*/ +/* $NetBSD: types.h,v 1.29 2021/08/08 00:53:39 thorpej Exp $*/ #ifndef _SPARC64_TYPES_H_ #define _SPARC64_TYPES_H_ @@ -11,5 +11,6 @@ #define __HAVE_COMPAT_NETBSD32 #define __HAVE_UCAS_FULL +#define __HAVE_OPENFIRMWARE_VARIANT_SUNW #endif
CVS commit: src
Module Name:src Committed By: rillig Date: Sun Aug 8 00:02:03 UTC 2021 Modified Files: src/distrib/sets/lists/tests: mi src/tests/usr.bin/xlint/lint2: Makefile t_lint2.sh Log Message: tests/lint: make list of tests simpler Since the file /usr/tests/usr.bin/xlint/lint2/tests has only been in the file set for a few minutes, it is not marked as obsolete but simply removed. To generate a diff of this commit: cvs rdiff -u -r1.1107 -r1.1108 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint2/Makefile \ 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/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.1107 src/distrib/sets/lists/tests/mi:1.1108 --- src/distrib/sets/lists/tests/mi:1.1107 Sat Aug 7 23:52:32 2021 +++ src/distrib/sets/lists/tests/mi Sun Aug 8 00:02:02 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1107 2021/08/07 23:52:32 rillig Exp $ +# $NetBSD: mi,v 1.1108 2021/08/08 00:02:02 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -7071,7 +7071,6 @@ ./usr/tests/usr.bin/xlint/lint2/read_printf.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint2/read_printf.ln tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint2/t_lint2tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/xlint/lint2/teststests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/ztesttests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/ztest/Atffile tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/ztest/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua Index: src/tests/usr.bin/xlint/lint2/Makefile diff -u src/tests/usr.bin/xlint/lint2/Makefile:1.3 src/tests/usr.bin/xlint/lint2/Makefile:1.4 --- src/tests/usr.bin/xlint/lint2/Makefile:1.3 Sat Aug 7 23:52:32 2021 +++ src/tests/usr.bin/xlint/lint2/Makefile Sun Aug 8 00:02:02 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2021/08/07 23:52:32 rillig Exp $ +# $NetBSD: Makefile,v 1.4 2021/08/08 00:02:02 rillig Exp $ NOMAN= yes @@ -22,11 +22,6 @@ TESTS+= read_lp64 TESTS+= read_printf FILES+= ${TESTS:=.ln} ${TESTS:=.exp} -FILES+= tests - -realall: tests -tests: - printf '%s\n' ${TESTS} > ${.TARGET} # Note: only works for adding tests. # To remove a test, the $$mi file must be edited manually. Index: src/tests/usr.bin/xlint/lint2/t_lint2.sh diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.3 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.4 --- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.3 Sat Aug 7 23:52:32 2021 +++ src/tests/usr.bin/xlint/lint2/t_lint2.sh Sun Aug 8 00:02:02 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_lint2.sh,v 1.3 2021/08/07 23:52:32 rillig Exp $ +# $NetBSD: t_lint2.sh,v 1.4 2021/08/08 00:02:02 rillig Exp $ # # Copyright (c) 2021 The NetBSD Foundation, Inc. # All rights reserved. @@ -49,7 +49,8 @@ std_body() atf_init_test_cases() { # shellcheck disable=SC2013 - for i in $(cat "$(atf_get_srcdir)/tests"); do + for i in $(cd "$(atf_get_srcdir)" && echo *.ln); do + i=${i%.ln} eval "${i}_head() { std_head; }" eval "${i}_body() { std_body '$i'; }" atf_add_test_case "$i"
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Aug 7 23:52:32 UTC 2021 Modified Files: src/distrib/sets/lists/tests: mi src/tests/usr.bin/xlint/lint2: Makefile t_lint2.sh Added Files: src/tests/usr.bin/xlint/lint2: read_lp64.exp read_lp64.ln read_printf.exp read_printf.ln Log Message: tests/lint: test reading of 128-bit integer types and printf To generate a diff of this commit: cvs rdiff -u -r1.1106 -r1.1107 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/Makefile \ src/tests/usr.bin/xlint/lint2/t_lint2.sh cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint2/read_lp64.exp \ src/tests/usr.bin/xlint/lint2/read_lp64.ln \ src/tests/usr.bin/xlint/lint2/read_printf.exp \ 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/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.1106 src/distrib/sets/lists/tests/mi:1.1107 --- src/distrib/sets/lists/tests/mi:1.1106 Sat Aug 7 21:24:13 2021 +++ src/distrib/sets/lists/tests/mi Sat Aug 7 23:52:32 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1106 2021/08/07 21:24:13 rillig Exp $ +# $NetBSD: mi,v 1.1107 2021/08/07 23:52:32 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -7066,7 +7066,12 @@ ./usr/tests/usr.bin/xlint/lint2/msg_018.ln tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint2/read.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint2/read.lntests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint2/read_lp64.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint2/read_lp64.ln tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint2/read_printf.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint2/read_printf.ln tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint2/t_lint2tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint2/teststests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/ztesttests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/ztest/Atffile tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/ztest/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua Index: src/tests/usr.bin/xlint/lint2/Makefile diff -u src/tests/usr.bin/xlint/lint2/Makefile:1.2 src/tests/usr.bin/xlint/lint2/Makefile:1.3 --- src/tests/usr.bin/xlint/lint2/Makefile:1.2 Sat Aug 7 21:24:14 2021 +++ src/tests/usr.bin/xlint/lint2/Makefile Sat Aug 7 23:52:32 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2021/08/07 21:24:14 rillig Exp $ +# $NetBSD: Makefile,v 1.3 2021/08/07 23:52:32 rillig Exp $ NOMAN= yes @@ -13,9 +13,20 @@ FILESDIR= ${TESTSDIR} .for msg in \ 000 001 002 003 004 005 006 007 008 009 \ 010 011 012 013 014 015 016 017 018 -FILES+= msg_${msg}.exp msg_${msg}.ln +TESTS+= msg_${msg} .endfor -FILES+= read.exp read.ln +TESTS+= read +.if ${MACHINE_ARCH:M*64} # close enough to "is a 64-bit platform" +TESTS+= read_lp64 +.endif +TESTS+= read_printf + +FILES+= ${TESTS:=.ln} ${TESTS:=.exp} +FILES+= tests + +realall: tests +tests: + printf '%s\n' ${TESTS} > ${.TARGET} # Note: only works for adding tests. # To remove a test, the $$mi file must be edited manually. Index: src/tests/usr.bin/xlint/lint2/t_lint2.sh diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.2 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.3 --- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.2 Sat Aug 7 21:24:14 2021 +++ src/tests/usr.bin/xlint/lint2/t_lint2.sh Sat Aug 7 23:52:32 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_lint2.sh,v 1.2 2021/08/07 21:24:14 rillig Exp $ +# $NetBSD: t_lint2.sh,v 1.3 2021/08/07 23:52:32 rillig Exp $ # # Copyright (c) 2021 The NetBSD Foundation, Inc. # All rights reserved. @@ -37,8 +37,8 @@ std_body() # shellcheck disable=SC2155 local srcdir="$(atf_get_srcdir)" - # remove comments and empty lines from the .ln file - sed -e '/^#/d' -e '/^$/d' -e 's,[[:space:]]*#.*,,' \ + # remove comments and whitespace from the .ln file + sed -e '/^#/d' -e '/^$/d' -e 's,#.*,,' -e 's,[[:space:]],,g' \ < "$srcdir/$1.ln" \ > "$1.ln" @@ -48,7 +48,8 @@ std_body() atf_init_test_cases() { - for i in $(printf 'msg_%03d\n' $(seq 0 18)) "read"; do + # shellcheck disable=SC2013 + for i in $(cat "$(atf_get_srcdir)/tests"); do eval "${i}_head() { std_head; }" eval "${i}_body() { std_body '$i'; }" atf_add_test_case "$i" Added files: Index: src/tests/usr.bin/xlint/lint2/read_lp64.ln diff -u /dev/null src/tests/usr.bin/xlint/lint2/read_lp64.ln:1.1 --- /dev/null Sat Aug 7 23:52:32 2021 +++ src/tests/usr.bin/xlint/lint2/read_lp64.ln Sat Aug 7 23:52:32 2021 @@ -0,0 +1,10 @@ +# $NetBSD: read_lp64.ln,v 1.1 2021/08/07 23:52:32 rillig Exp $ +# +# Cover reading of 128-bit inte
CVS commit: src/tests/dev/scsipi/libscsitest
Module Name:src Committed By: cjep Date: Sat Aug 7 22:05:26 UTC 2021 Modified Files: src/tests/dev/scsipi/libscsitest: scsitest.c Log Message: Convert the test to cfargs. OK @thorpej. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/dev/scsipi/libscsitest/scsitest.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/dev/scsipi/libscsitest/scsitest.c diff -u src/tests/dev/scsipi/libscsitest/scsitest.c:1.4 src/tests/dev/scsipi/libscsitest/scsitest.c:1.5 --- src/tests/dev/scsipi/libscsitest/scsitest.c:1.4 Sun Apr 25 05:33:20 2021 +++ src/tests/dev/scsipi/libscsitest/scsitest.c Sat Aug 7 22:05:26 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: scsitest.c,v 1.4 2021/04/25 05:33:20 thorpej Exp $ */ +/* $NetBSD: scsitest.c,v 1.5 2021/08/07 22:05:26 cjep Exp $ */ /* * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: scsitest.c,v 1.4 2021/04/25 05:33:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsitest.c,v 1.5 2021/08/07 22:05:26 cjep Exp $"); #include #include @@ -256,6 +256,5 @@ scsitest_attach(device_t parent, device_ sc->sc_channel.chan_adapter = &sc->sc_adapter; config_found(self, &sc->sc_channel, scsiprint, - CFARG_IATTR, "scsi", - CFARG_EOL); + CFARGS(.iattr = "scsi")); }
CVS commit: src/sys/arch/arm/acpi
Module Name:src Committed By: jmcneill Date: Sat Aug 7 21:27:53 UTC 2021 Modified Files: src/sys/arch/arm/acpi: acpi_pci_machdep.c acpi_pci_machdep.h acpipchb.c files.acpi Added Files: src/sys/arch/arm/acpi: acpi_pci_smccc.c Log Message: arm: acpi: Add support for SMCCC based PCI config access. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/acpi/acpi_pci_machdep.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/acpi/acpi_pci_machdep.h cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/acpi/acpi_pci_smccc.c cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/acpi/acpipchb.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/acpi/files.acpi 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.18 src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.19 --- src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.18 Wed Jun 17 06:45:09 2020 +++ src/sys/arch/arm/acpi/acpi_pci_machdep.c Sat Aug 7 21:27:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_pci_machdep.c,v 1.18 2020/06/17 06:45:09 thorpej Exp $ */ +/* $NetBSD: acpi_pci_machdep.c,v 1.19 2021/08/07 21:27:53 jmcneill Exp $ */ /*- * Copyright (c) 2018, 2020 The NetBSD Foundation, Inc. @@ -29,10 +29,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_pci.h" + #define _INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.18 2020/06/17 06:45:09 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.19 2021/08/07 21:27:53 jmcneill Exp $"); #include #include @@ -60,6 +62,10 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_pci_mac #include #include +#ifdef PCI_SMCCC +#include +#endif + #include struct acpi_pci_prt { @@ -94,7 +100,7 @@ struct acpi_pci_intr { static TAILQ_HEAD(, acpi_pci_intr) acpi_pci_intrs = TAILQ_HEAD_INITIALIZER(acpi_pci_intrs); -static const struct acpi_pci_quirk acpi_pci_quirks[] = { +static const struct acpi_pci_quirk acpi_pci_mcfg_quirks[] = { /* OEM ID OEM Table ID Revision Seg Func */ { "AMAZON", "GRAVITON", 0, -1, acpi_pci_graviton_init }, { "ARMLTD", "ARMN1SDP", 0x20181101, 0, acpi_pci_n1sdp_init }, @@ -102,6 +108,13 @@ static const struct acpi_pci_quirk acpi_ { "NXP ", "LX2160 ", 0, -1, acpi_pci_layerscape_gen4_init }, }; +#ifdef PCI_SMCCC +static const struct acpi_pci_quirk acpi_pci_smccc_quirk = { + .q_segment = -1, + .q_init = acpi_pci_smccc_init, +}; +#endif + pci_chipset_tag_t acpi_pci_md_get_chipset_tag(struct acpi_softc *, int, int); static void acpi_pci_md_attach_hook(device_t, device_t, @@ -554,11 +567,19 @@ acpi_pci_md_find_quirk(int seg) u_int n; rv = AcpiGetTable(ACPI_SIG_MCFG, 0, (ACPI_TABLE_HEADER **)&mcfg); - if (ACPI_FAILURE(rv)) + if (ACPI_FAILURE(rv)) { +#ifdef PCI_SMCCC + uint32_t ver = pci_smccc_version(); + aprint_debug("%s: SMCCC version %#x\n", __func__, ver); + if (PCI_SMCCC_SUCCESS(ver)) { + return &acpi_pci_smccc_quirk; + } +#endif return NULL; + } - for (n = 0; n < __arraycount(acpi_pci_quirks); n++) { - const struct acpi_pci_quirk *q = &acpi_pci_quirks[n]; + for (n = 0; n < __arraycount(acpi_pci_mcfg_quirks); n++) { + const struct acpi_pci_quirk *q = &acpi_pci_mcfg_quirks[n]; if (memcmp(q->q_oemid, mcfg->Header.OemId, ACPI_OEM_ID_SIZE) == 0 && memcmp(q->q_oemtableid, mcfg->Header.OemTableId, ACPI_OEM_TABLE_ID_SIZE) == 0 && q->q_oemrevision == mcfg->Header.OemRevision && @@ -589,6 +610,7 @@ acpi_pci_md_get_chipset_tag(struct acpi_ pct->pct_ap.ap_pc.pc_intr_v = &pct->pct_ap; pct->pct_ap.ap_seg = seg; pct->pct_ap.ap_bus = bbn; + pct->pct_ap.ap_maxbus = -1; pct->pct_ap.ap_bst = acpi_softc->sc_memt; q = acpi_pci_md_find_quirk(seg); Index: src/sys/arch/arm/acpi/acpi_pci_machdep.h diff -u src/sys/arch/arm/acpi/acpi_pci_machdep.h:1.7 src/sys/arch/arm/acpi/acpi_pci_machdep.h:1.8 --- src/sys/arch/arm/acpi/acpi_pci_machdep.h:1.7 Sat Feb 1 13:26:43 2020 +++ src/sys/arch/arm/acpi/acpi_pci_machdep.h Sat Aug 7 21:27:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_pci_machdep.h,v 1.7 2020/02/01 13:26:43 jmcneill Exp $ */ +/* $NetBSD: acpi_pci_machdep.h,v 1.8 2021/08/07 21:27:53 jmcneill Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -39,12 +39,15 @@ struct acpi_pci_context { device_t ap_dev; u_int ap_seg; int ap_bus; + int ap_maxbus; bus_space_tag_t ap_bst; bus_space_handle_t ap_conf_bsh; int (*ap_conf_read)(pci_chipset_tag_t, pcitag_t, int, pcireg_t *); int (*ap_conf_write)(pci_chipset_tag_t, pcitag_t, int, pcireg_t); void *ap_conf_priv; int ap_pciflags_clear; + u_int ap_flags; +#define ACPI_PCI_FLAG_NO_MCFG __BIT(0) /* ignore MCFG table */ }; struct acpi_pci_quirk { @@ -57,6 +60,7 @@ struct acpi_pci_quirk { const struct acpi_pci_quirk * acpi_pci_md_find_quirk(int); +void acpi_pci_smccc_init(struct acpi_pci_context *); void ac
CVS commit: src/sys/arch/arm/acpi
Module Name:src Committed By: jmcneill Date: Sat Aug 7 21:24:56 UTC 2021 Modified Files: src/sys/arch/arm/acpi: acpi_platform.c Log Message: acpi: call smccc_probe() after PSCI init To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/acpi/acpi_platform.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_platform.c diff -u src/sys/arch/arm/acpi/acpi_platform.c:1.27 src/sys/arch/arm/acpi/acpi_platform.c:1.28 --- src/sys/arch/arm/acpi/acpi_platform.c:1.27 Fri Aug 6 19:38:53 2021 +++ src/sys/arch/arm/acpi/acpi_platform.c Sat Aug 7 21:24:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_platform.c,v 1.27 2021/08/06 19:38:53 jmcneill Exp $ */ +/* $NetBSD: acpi_platform.c,v 1.28 2021/08/07 21:24:56 jmcneill 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.27 2021/08/06 19:38:53 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.28 2021/08/07 21:24:56 jmcneill Exp $"); #include #include @@ -253,6 +253,7 @@ acpi_platform_startup(void) } else { psci_init(psci_call_smc); } + smccc_probe(); } acpi_table_unmap((ACPI_TABLE_HEADER *)fadt); }
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Aug 7 21:24:14 UTC 2021 Modified Files: src/distrib/sets/lists/tests: mi src/tests/usr.bin/xlint/lint2: Makefile t_lint2.sh Added Files: src/tests/usr.bin/xlint/lint2: read.exp read.ln Log Message: tests/lint: add test for reading the lint1 output To generate a diff of this commit: cvs rdiff -u -r1.1105 -r1.1106 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/Makefile \ src/tests/usr.bin/xlint/lint2/t_lint2.sh cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint2/read.exp \ src/tests/usr.bin/xlint/lint2/read.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.1105 src/distrib/sets/lists/tests/mi:1.1106 --- src/distrib/sets/lists/tests/mi:1.1105 Fri Aug 6 08:44:31 2021 +++ src/distrib/sets/lists/tests/mi Sat Aug 7 21:24:13 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1105 2021/08/06 08:44:31 martin Exp $ +# $NetBSD: mi,v 1.1106 2021/08/07 21:24:13 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -7064,6 +7064,8 @@ ./usr/tests/usr.bin/xlint/lint2/msg_017.ln tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint2/msg_018.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint2/msg_018.ln tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint2/read.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint2/read.lntests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint2/t_lint2tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/ztesttests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/ztest/Atffile tests-usr.bin-tests compattestfile,atf Index: src/tests/usr.bin/xlint/lint2/Makefile diff -u src/tests/usr.bin/xlint/lint2/Makefile:1.1 src/tests/usr.bin/xlint/lint2/Makefile:1.2 --- src/tests/usr.bin/xlint/lint2/Makefile:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/Makefile Sat Aug 7 21:24:14 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2021/08/05 22:36:08 rillig Exp $ +# $NetBSD: Makefile,v 1.2 2021/08/07 21:24:14 rillig Exp $ NOMAN= yes @@ -13,8 +13,9 @@ FILESDIR= ${TESTSDIR} .for msg in \ 000 001 002 003 004 005 006 007 008 009 \ 010 011 012 013 014 015 016 017 018 -FILES+= msg_${msg}.exp msg_${msg}.ln +FILES+= msg_${msg}.exp msg_${msg}.ln .endfor +FILES+= read.exp read.ln # Note: only works for adding tests. # To remove a test, the $$mi file must be edited manually. Index: src/tests/usr.bin/xlint/lint2/t_lint2.sh diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.1 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.2 --- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/t_lint2.sh Sat Aug 7 21:24:14 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_lint2.sh,v 1.1 2021/08/05 22:36:08 rillig Exp $ +# $NetBSD: t_lint2.sh,v 1.2 2021/08/07 21:24:14 rillig Exp $ # # Copyright (c) 2021 The NetBSD Foundation, Inc. # All rights reserved. @@ -27,28 +27,30 @@ lint2=/usr/libexec/lint2 -do_msg_head() +std_head() { atf_set 'require.progs' "$lint2" } -do_msg_body() +std_body() { # shellcheck disable=SC2155 local srcdir="$(atf_get_srcdir)" # remove comments and empty lines from the .ln file - sed -e '/^#/d' -e '/^$/d' < "$srcdir/msg_$1.ln" > "msg_$1.ln" + sed -e '/^#/d' -e '/^$/d' -e 's,[[:space:]]*#.*,,' \ + < "$srcdir/$1.ln" \ + > "$1.ln" - atf_check -o "file:$srcdir/msg_$1.exp" \ - "$lint2" -h -p -x "msg_$1.ln" + atf_check -o "file:$srcdir/$1.exp" \ + "$lint2" -h -p -x "$1.ln" } atf_init_test_cases() { - for i in $(printf '%03d\n' $(seq 0 18)); do - eval "msg_${i}_head() { do_msg_head; }" - eval "msg_${i}_body() { do_msg_body '$i'; }" - atf_add_test_case "msg_$i" + for i in $(printf 'msg_%03d\n' $(seq 0 18)) "read"; do + eval "${i}_head() { std_head; }" + eval "${i}_body() { std_body '$i'; }" + atf_add_test_case "$i" done } Added files: Index: src/tests/usr.bin/xlint/lint2/read.exp diff -u /dev/null src/tests/usr.bin/xlint/lint2/read.exp:1.1 --- /dev/null Sat Aug 7 21:24:14 2021 +++ src/tests/usr.bin/xlint/lint2/read.exp Sat Aug 7 21:24:14 2021 @@ -0,0 +1 @@ +a125 declared( read.c(125) ), but never used or defined Index: src/tests/usr.bin/xlint/lint2/read.ln diff -u /dev/null src/tests/usr.bin/xlint/lint2/read.ln:1.1 --- /dev/null Sat Aug 7 21:24:14 2021 +++ src/tests/usr.bin/xlint/lint2/read.ln Sat Aug 7 21:24:14 2021 @@ -0,0 +1,64 @@ +# $NetBSD: read.ln,v 1.1 2021/08/07 21:24:14 rillig Exp $ +# +# Cover each path of reading declarations, definitions and usages. + +0sread.c +Sread.c + +# Cover all tspec_t constants, in declaration order. +# +# The line numbers correspond to the constant values of tspec_t, +# with the 128-bit typ
CVS commit: src/sys/arch/arm/pci
Module Name:src Committed By: jmcneill Date: Sat Aug 7 21:23:37 UTC 2021 Modified Files: src/sys/arch/arm/pci: files.pci Added Files: src/sys/arch/arm/pci: pci_smccc.c pci_smccc.h Log Message: arm: PCI: Add support for Arm PCI Config Space Access Firmware Interface This adds basic support for the PCI Config Access interface defined in Arm DEN0115. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/pci/files.pci cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/pci/pci_smccc.c \ src/sys/arch/arm/pci/pci_smccc.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/arm/pci/files.pci diff -u src/sys/arch/arm/pci/files.pci:1.1 src/sys/arch/arm/pci/files.pci:1.2 --- src/sys/arch/arm/pci/files.pci:1.1 Sun Oct 21 00:42:06 2018 +++ src/sys/arch/arm/pci/files.pci Sat Aug 7 21:23:37 2021 @@ -1,4 +1,8 @@ -# $NetBSD: files.pci,v 1.1 2018/10/21 00:42:06 jmcneill Exp $ +# $NetBSD: files.pci,v 1.2 2021/08/07 21:23:37 jmcneill Exp $ # PCI MSI/MSI-X support file arch/arm/pci/pci_msi_machdep.c pci & __have_pci_msi_msix + +# Arm PCI Configuration Space Access Firmware Interface (DEN0115) +defflag opt_pci.h PCI_SMCCC +file arch/arm/pci/pci_smccc.c pci_smccc Added files: Index: src/sys/arch/arm/pci/pci_smccc.c diff -u /dev/null src/sys/arch/arm/pci/pci_smccc.c:1.1 --- /dev/null Sat Aug 7 21:23:37 2021 +++ src/sys/arch/arm/pci/pci_smccc.c Sat Aug 7 21:23:37 2021 @@ -0,0 +1,122 @@ +/* $NetBSD: pci_smccc.c,v 1.1 2021/08/07 21:23:37 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. 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 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: pci_smccc.c,v 1.1 2021/08/07 21:23:37 jmcneill Exp $"); + +#include +#include + +#include +#include + +/* Minimum SMCCC version required for PCI_VERSION call. */ +#define SMCCC_VERSION_1_1 0x10001 + +/* PCI Configuration Space Access ABI functions */ +#define PCI_VERSION 0x84000130 +#define PCI_FEATURES 0x84000131 +#define PCI_READ 0x84000132 +#define PCI_WRITE 0x84000133 +#define PCI_GET_SEG_INFO 0x84000134 +#define GET_SEG_INFO_BUS_START __BITS(7,0) +#define GET_SEG_INFO_BUS_END __BITS(15,8) + +static int +pci_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) +{ + static int smccc_ver; + + if (smccc_ver == 0) { + smccc_ver = smccc_version(); + } + if (smccc_ver < SMCCC_VERSION_1_1) { + return SMCCC_NOT_SUPPORTED; + } + + return smccc_call(fid, arg1, arg2, arg3, arg4, + res0, res1, res2, res3); +} + +int +pci_smccc_version(void) +{ + return pci_smccc_call(PCI_VERSION, 0, 0, 0, 0, + NULL, NULL, NULL, NULL); +} + +int +pci_smccc_features(uint32_t fid) +{ + return pci_smccc_call(PCI_FEATURES, fid, 0, 0, 0, + NULL, NULL, NULL, NULL); +} + +int +pci_smccc_read(uint32_t sbdf, uint32_t offset, uint32_t access_size, +uint32_t *data) +{ + register_t value; + int status; + + status = pci_smccc_call(PCI_READ, sbdf, offset, access_size, 0, +NULL, &value, NULL, NULL); + if (status == SMCCC_SUCCESS) { + *data = value; + } + + return status; +} + +int +pci_smccc_write(uint32_t sbdf, uint32_t offset, uint32_t access_size, +uint32_t data) +{ + return pci_smccc_call(PCI_WRITE, sbdf, offset, access_size, data, + NULL, NULL, NULL, NULL); +} + +int +pci_smccc_get_seg_info(uint16_t seg, uint8_t *bus_start, uint8_t *bus_end, +uint16_t *next_seg) +{ + register_t res1, res2; + int status; + + status = pci_smccc_call(PCI_GET_SEG_INFO, seg, 0, 0, 0, +NULL, &res1, &res2, NULL); + if (status == SMCCC_S
CVS commit: src/sys/arch/arm/arm
Module Name:src Committed By: jmcneill Date: Sat Aug 7 21:21:49 UTC 2021 Modified Files: src/sys/arch/arm/arm: smccc.c smccc.h Log Message: arm: SMCCC: Add return values to smccc_call To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/arm/smccc.c \ src/sys/arch/arm/arm/smccc.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/arm/arm/smccc.c diff -u src/sys/arch/arm/arm/smccc.c:1.1 src/sys/arch/arm/arm/smccc.c:1.2 --- src/sys/arch/arm/arm/smccc.c:1.1 Fri Aug 6 19:38:53 2021 +++ src/sys/arch/arm/arm/smccc.c Sat Aug 7 21:21:49 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: smccc.c,v 1.1 2021/08/06 19:38:53 jmcneill Exp $ */ +/* $NetBSD: smccc.c,v 1.2 2021/08/07 21:21:49 jmcneill Exp $ */ /*- * Copyright (c) 2021 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smccc.c,v 1.1 2021/08/06 19:38:53 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smccc.c,v 1.2 2021/08/07 21:21:49 jmcneill Exp $"); #include #include @@ -42,7 +42,10 @@ __KERNEL_RCSID(0, "$NetBSD: smccc.c,v 1. #define SMCCC_VERSION 0x8000 /* True if SMCCC is detected. */ -static bool smccc_present; +static bool smccc_present; + +/* SMCCC conduit (SMC or HVC) */ +static enum psci_conduit smccc_conduit = PSCI_CONDUIT_NONE; /* * smccc_probe -- @@ -58,6 +61,13 @@ smccc_probe(void) } smccc_present = psci_features(SMCCC_VERSION) == PSCI_SUCCESS; + if (smccc_present) { + smccc_conduit = psci_conduit(); + + aprint_debug("SMCCC: Version %#x (%s)\n", + smccc_version(), + smccc_conduit == PSCI_CONDUIT_SMC ? "SMC" : "HVC"); + } } return smccc_present; } @@ -70,7 +80,8 @@ smccc_probe(void) int smccc_version(void) { - return smccc_call(SMCCC_VERSION, 0, 0, 0); + return smccc_call(SMCCC_VERSION, 0, 0, 0, 0, + NULL, NULL, NULL, NULL); } /* @@ -79,11 +90,54 @@ smccc_version(void) * Generic call interface for SMC/HVC calls. */ int -smccc_call(register_t fid, register_t arg1, register_t arg2, register_t arg3) +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) { + register_t args[5] = { fid, arg1, arg2, arg3, arg4 }; + + register register_t r0 asm ("r0"); + register register_t r1 asm ("r1"); + register register_t r2 asm ("r2"); + register register_t r3 asm ("r3"); + register register_t r4 asm ("r4"); + if (!smccc_present) { return SMCCC_NOT_SUPPORTED; } - return psci_call(fid, arg1, arg2, arg3); + KASSERT(smccc_conduit != PSCI_CONDUIT_NONE); + + r0 = args[0]; + r1 = args[1]; + r2 = args[2]; + r3 = args[3]; + r4 = args[4]; + + if (smccc_conduit == PSCI_CONDUIT_SMC) { + asm volatile ("smc #0" : + "=r" (r0), "=r" (r1), "=r" (r2), "=r" (r3) : + "r" (r0), "r" (r1), "r" (r2), "r" (r3), "r" (r4) : + "memory"); + } else { + asm volatile ("hvc #0" : + "=r" (r0), "=r" (r1), "=r" (r2), "=r" (r3) : + "r" (r0), "r" (r1), "r" (r2), "r" (r3), "r" (r4) : + "memory"); + } + + if (res0) { + *res0 = r0; + } + if (res1) { + *res1 = r1; + } + if (res2) { + *res2 = r2; + } + if (res3) { + *res3 = r3; + } + + return r0; } Index: src/sys/arch/arm/arm/smccc.h diff -u src/sys/arch/arm/arm/smccc.h:1.1 src/sys/arch/arm/arm/smccc.h:1.2 --- src/sys/arch/arm/arm/smccc.h:1.1 Fri Aug 6 19:38:53 2021 +++ src/sys/arch/arm/arm/smccc.h Sat Aug 7 21:21:49 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: smccc.h,v 1.1 2021/08/06 19:38:53 jmcneill Exp $ */ +/* $NetBSD: smccc.h,v 1.2 2021/08/07 21:21:49 jmcneill Exp $ */ /*- * Copyright (c) 2021 Jared McNeill @@ -50,6 +50,7 @@ int smccc_version(void); /* * Call an SMC/HVC service. */ -int smccc_call(register_t, register_t, register_t, register_t); +int smccc_call(uint32_t, register_t, register_t, register_t, register_t, + register_t *, register_t *, register_t *, register_t *); #endif /* _ARM_SMCCC_H */
CVS commit: src/sys/arch/arm/arm
Module Name:src Committed By: jmcneill Date: Sat Aug 7 21:20:14 UTC 2021 Modified Files: src/sys/arch/arm/arm: psci.c psci.h Log Message: arm: PSCI: Add a function to return the PSCI conduit. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/arm/psci.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/arm/psci.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/arm/arm/psci.c diff -u src/sys/arch/arm/arm/psci.c:1.6 src/sys/arch/arm/arm/psci.c:1.7 --- src/sys/arch/arm/arm/psci.c:1.6 Fri Aug 6 19:38:53 2021 +++ src/sys/arch/arm/arm/psci.c Sat Aug 7 21:20:14 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: psci.c,v 1.6 2021/08/06 19:38:53 jmcneill Exp $ */ +/* $NetBSD: psci.c,v 1.7 2021/08/07 21:20:14 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: psci.c,v 1.6 2021/08/06 19:38:53 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: psci.c,v 1.7 2021/08/07 21:20:14 jmcneill Exp $"); #include #include @@ -68,6 +68,18 @@ psci_call(register_t fid, register_t arg return psci_call_fn(fid, arg1, arg2, arg3); } +enum psci_conduit +psci_conduit(void) +{ + if (psci_call_fn == psci_call_smc) { + return PSCI_CONDUIT_SMC; + } else if (psci_call_fn == psci_call_hvc) { + return PSCI_CONDUIT_HVC; + } else { + return PSCI_CONDUIT_NONE; + } +} + uint32_t psci_version(void) { Index: src/sys/arch/arm/arm/psci.h diff -u src/sys/arch/arm/arm/psci.h:1.3 src/sys/arch/arm/arm/psci.h:1.4 --- src/sys/arch/arm/arm/psci.h:1.3 Fri Aug 6 19:38:53 2021 +++ src/sys/arch/arm/arm/psci.h Sat Aug 7 21:20:14 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: psci.h,v 1.3 2021/08/06 19:38:53 jmcneill Exp $ */ +/* $NetBSD: psci.h,v 1.4 2021/08/07 21:20:14 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -42,6 +42,15 @@ enum psci_function { }; /* + * Possible PSCI conduits. + */ +enum psci_conduit { + PSCI_CONDUIT_NONE, + PSCI_CONDUIT_SMC, + PSCI_CONDUIT_HVC, +}; + +/* * PSCI error codes */ #define PSCI_SUCCESS 0 @@ -71,6 +80,11 @@ void psci_init(psci_fn); bool psci_available(void); /* + * Return the PSCI conduit type. + */ +enum psci_conduit psci_conduit(void); + +/* * PSCI call methods, implemented in psci.S */ int psci_call_smc(register_t, register_t, register_t, register_t);
CVS commit: src/sys/dev/acpi
Module Name:src Committed By: jmcneill Date: Sat Aug 7 21:19:16 UTC 2021 Modified Files: src/sys/dev/acpi: acpi_mcfg.c acpi_mcfg.h Log Message: acpi: expose acpimcfg_configure_bus_cb To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/dev/acpi/acpi_mcfg.c cvs rdiff -u -r1.3 -r1.4 src/sys/dev/acpi/acpi_mcfg.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/acpi/acpi_mcfg.c diff -u src/sys/dev/acpi/acpi_mcfg.c:1.23 src/sys/dev/acpi/acpi_mcfg.c:1.24 --- src/sys/dev/acpi/acpi_mcfg.c:1.23 Tue Jan 26 15:30:05 2021 +++ src/sys/dev/acpi/acpi_mcfg.c Sat Aug 7 21:19:15 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_mcfg.c,v 1.23 2021/01/26 15:30:05 skrll Exp $ */ +/* $NetBSD: acpi_mcfg.c,v 1.24 2021/08/07 21:19:15 jmcneill Exp $ */ /*- * Copyright (C) 2015 NONAKA Kimihiro @@ -28,7 +28,7 @@ #include "opt_pci.h" #include -__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.23 2021/01/26 15:30:05 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.24 2021/08/07 21:19:15 jmcneill Exp $"); #include #include @@ -693,7 +693,7 @@ out: } #ifdef PCI_NETBSD_CONFIGURE -static ACPI_STATUS +ACPI_STATUS acpimcfg_configure_bus_cb(ACPI_RESOURCE *res, void *ctx) { struct pciconf_resources *pcires = ctx; Index: src/sys/dev/acpi/acpi_mcfg.h diff -u src/sys/dev/acpi/acpi_mcfg.h:1.3 src/sys/dev/acpi/acpi_mcfg.h:1.4 --- src/sys/dev/acpi/acpi_mcfg.h:1.3 Sun Feb 2 16:31:25 2020 +++ src/sys/dev/acpi/acpi_mcfg.h Sat Aug 7 21:19:15 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_mcfg.h,v 1.3 2020/02/02 16:31:25 jmcneill Exp $ */ +/* $NetBSD: acpi_mcfg.h,v 1.4 2021/08/07 21:19:15 jmcneill Exp $ */ /*- * Copyright (C) 2015 NONAKA Kimihiro @@ -33,6 +33,7 @@ void acpimcfg_probe(struct acpi_softc *) int acpimcfg_init(bus_space_tag_t, const struct acpimcfg_ops *); int acpimcfg_map_bus(device_t, pci_chipset_tag_t, int); int acpimcfg_configure_bus(device_t, pci_chipset_tag_t, ACPI_HANDLE, int, int); +ACPI_STATUS acpimcfg_configure_bus_cb(ACPI_RESOURCE *, void *); int acpimcfg_conf_read(pci_chipset_tag_t, pcitag_t, int, pcireg_t *); int acpimcfg_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
CVS commit: src/share/man/man9
Module Name:src Committed By: uwe Date: Sat Aug 7 20:41:17 UTC 2021 Modified Files: src/share/man/man9: autoconf.9 Log Message: autoconf(9) - Improve formatting. Don't hide consumed cfargs in the second sentence of a function's description, they ends up hidden towards the right margin and that sentence is guaranteed to get a line break further reducing its readability. Instead make that the first sentence and start the description with a new paragraph. That makes it looks like part of the signature and is much more prominent. Various markup improvements while here. Bump date for thorpej-cfargs2 changes. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 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.33 src/share/man/man9/autoconf.9:1.34 --- src/share/man/man9/autoconf.9:1.33 Sat Aug 7 19:41:13 2021 +++ src/share/man/man9/autoconf.9 Sat Aug 7 20:41:17 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: autoconf.9,v 1.33 2021/08/07 19:41:13 andvar Exp $ +.\" $NetBSD: autoconf.9,v 1.34 2021/08/07 20:41:17 uwe Exp $ .\" .\" Copyright (c) 2001, 2002, 2021 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 28, 2021 +.Dd August 7, 2021 .Dt AUTOCONF 9 .Os .Sh NAME @@ -126,42 +126,51 @@ This list is constructed using the .Fn CFARGS macro, like this example: .Bd -literal -offset indent -config_search(self, NULL, -CFARGS(.search = mainbus_search, - .iattr = "mainbus")); +config_search(self, NULL, +CFARGS(.search = mainbus_search, + .iattr = "mainbus")); .Ed .Pp Each tag is followed by a tag-specific value. -.Bl -tag -width ".devhandle" -.It Dv .submatch +.Bl -tag -offset indent -width ".Fa devhandle" +.It Fa submatch A pointer to a .Sq submatch -function used in direct configuration. -.It Dv .search +function used in +.Em direct +configuration. +.\" +.It Fa search A pointer to a .Sq search -function used in indirect configuration. -.It Dv .iattr -A pointer to a constant C string -.Pq const char * +function used in +.Em indirect +configuration. +.\" +.It Fa iattr +A pointer to a constant +.Tn C +string +.Pq Vt "const char *" specifying an interface attribute. If a parent device carries only a single interface attribute, then this argument may be omitted. If an interface attribute is specified that the parent device does not -carry, or no interface attribute is specifies and the parent device carries +carry, or no interface attribute is specified and the parent device carries more than one, behavior is undefined. On kernels built with the .Dv DIAGNOSTIC option, this may result in an assertion panic. -.It Dv .locators -A pointer an a constant array of type -.Sq int -.Pq const int * +.\" +.It Fa locators +A pointer to a constant array of integers +.Pq Vt "const int *" containing interface attribute-specific locators. -.It Dv .devhandle -A devhandle_t -.Pq passed by value -corresponding to the device being attached. +.\" +.It Fa devhandle +A +.Vt devhandle_t +(passed by value) corresponding to the device being attached. .El .Pp If no arguments are to be passed, the special value @@ -170,13 +179,17 @@ may be used in place of the .Fn CFARGS macro. .Sh FUNCTIONS -.Bl -tag -width compact +.Bl -tag -width ".Fn config" +.\" +.\" .It Fn config_search "parent" "aux" "cfargs" -Performs indirect configuration of physical devices. Cfargs consumed: -.Em .search , -.Em .iattr , -.Em .locators . +.Fa search , +.Fa iattr , +.Fa locators . +.\" +.Pp +Performs indirect configuration of physical devices. .Fn config_search iterates over all potential children, calling the given search function @@ -216,13 +229,17 @@ itself. Note that this function is designed so that it can be used to apply an arbitrary function to all potential children. In this case callers may choose to ignore the return value. +.\" +.\" .It Fn config_found "parent" "aux" "print" "cfargs" -Performs direct configuration on a physical device. Cfargs consumed: -.Em .submatch , -.Em .iattr , -.Em .locators , -.Em .devhandle . +.Fa submatch , +.Fa iattr , +.Fa locators , +.Fa devhandle . +.\" +.Pp +Performs direct configuration on a physical device. .Fn config_found is called by the parent and in turn calls the specified submatch function as determined by the configuration table. @@ -249,7 +266,7 @@ argument describes the device that has b internally uses .Fn config_search . The -.Em softc +.Vt softc structure for the matched device will be allocated, and the appropriate driver attach function will be called. If the device is matched, the system prints the name of the child and @@ -277,20 +294,28 @@ and unsupported .
CVS commit: src/sys/sys
Module Name:src Committed By: thorpej Date: Sat Aug 7 19:44:39 UTC 2021 Modified Files: src/sys/sys: param.h Log Message: NetBSD 9.99.88 -- CFARG_* -> CFARGS() To generate a diff of this commit: cvs rdiff -u -r1.700 -r1.701 src/sys/sys/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.700 src/sys/sys/param.h:1.701 --- src/sys/sys/param.h:1.700 Thu Jul 22 04:46:29 2021 +++ src/sys/sys/param.h Sat Aug 7 19:44:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.700 2021/07/22 04:46:29 skrll Exp $ */ +/* $NetBSD: param.h,v 1.701 2021/08/07 19:44:39 thorpej Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -67,7 +67,7 @@ * 2.99.9 (299000900) */ -#define __NetBSD_Version__ 999008700 /* NetBSD 9.99.87 */ +#define __NetBSD_Version__ 999008800 /* NetBSD 9.99.88 */ #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \ (m) * 100) + (p) * 100) <= __NetBSD_Version__)
CVS commit: src
Module Name:src Committed By: andvar Date: Sat Aug 7 19:41:14 UTC 2021 Modified Files: src/share/man/man4: gpiopps.4 src/share/man/man9: autoconf.9 src/sys/arch/dreamcast/dev/g2: gapspci_pci.c src/sys/arch/evbarm/conf: files.integrator src/sys/dev/microcode/aic7xxx: aic7xxx.reg Log Message: s/configuraiton/configuration/ in comments and man pages. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/gpiopps.4 cvs rdiff -u -r1.32 -r1.33 src/share/man/man9/autoconf.9 cvs rdiff -u -r1.17 -r1.18 src/sys/arch/dreamcast/dev/g2/gapspci_pci.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/files.integrator cvs rdiff -u -r1.4 -r1.5 src/sys/dev/microcode/aic7xxx/aic7xxx.reg 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/man4/gpiopps.4 diff -u src/share/man/man4/gpiopps.4:1.2 src/share/man/man4/gpiopps.4:1.3 --- src/share/man/man4/gpiopps.4:1.2 Sun May 20 15:28:27 2018 +++ src/share/man/man4/gpiopps.4 Sat Aug 7 19:41:13 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gpiopps.4,v 1.2 2018/05/20 15:28:27 wiz Exp $ +.\" $NetBSD: gpiopps.4,v 1.3 2021/08/07 19:41:13 andvar Exp $ .\" .\" Copyright (c) 2016 Brad Spencer .\" @@ -39,7 +39,7 @@ Pin configurations are discussed below. .Pp The .Ar flag -locator modifies the pin configuraiton: +locator modifies the pin configuration: .Bl -tag -width "" .It Dv 0x01 The PPS ASSERT signal should be triggered on the negative Index: src/share/man/man9/autoconf.9 diff -u src/share/man/man9/autoconf.9:1.32 src/share/man/man9/autoconf.9:1.33 --- src/share/man/man9/autoconf.9:1.32 Sat Aug 7 16:20:02 2021 +++ src/share/man/man9/autoconf.9 Sat Aug 7 19:41:13 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: autoconf.9,v 1.32 2021/08/07 16:20:02 thorpej Exp $ +.\" $NetBSD: autoconf.9,v 1.33 2021/08/07 19:41:13 andvar Exp $ .\" .\" Copyright (c) 2001, 2002, 2021 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -302,7 +302,7 @@ the device. .It Fn config_probe "parent" "cf" "aux" Probe for a device .Pq indirect configuration . -Invokes the driver's match function according to the configuraiton table. +Invokes the driver's match function according to the configuration table. The .Fn config_probe function returns a nonzero integer to indicate a successful probe Index: src/sys/arch/dreamcast/dev/g2/gapspci_pci.c diff -u src/sys/arch/dreamcast/dev/g2/gapspci_pci.c:1.17 src/sys/arch/dreamcast/dev/g2/gapspci_pci.c:1.18 --- src/sys/arch/dreamcast/dev/g2/gapspci_pci.c:1.17 Fri Oct 23 08:40:08 2015 +++ src/sys/arch/dreamcast/dev/g2/gapspci_pci.c Sat Aug 7 19:41:13 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: gapspci_pci.c,v 1.17 2015/10/23 08:40:08 knakahara Exp $ */ +/* $NetBSD: gapspci_pci.c,v 1.18 2021/08/07 19:41:13 andvar Exp $ */ /*- * Copyright (c) 2001 Marcus Comstedt. @@ -34,11 +34,11 @@ */ /* - * PCI configuraiton space implementation for the SEGA GAPS PCI bridge. + * PCI configuration space implementation for the SEGA GAPS PCI bridge. */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: gapspci_pci.c,v 1.17 2015/10/23 08:40:08 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gapspci_pci.c,v 1.18 2021/08/07 19:41:13 andvar Exp $"); #include #include Index: src/sys/arch/evbarm/conf/files.integrator diff -u src/sys/arch/evbarm/conf/files.integrator:1.13 src/sys/arch/evbarm/conf/files.integrator:1.14 --- src/sys/arch/evbarm/conf/files.integrator:1.13 Thu Jun 22 15:27:23 2017 +++ src/sys/arch/evbarm/conf/files.integrator Sat Aug 7 19:41:13 2021 @@ -1,6 +1,6 @@ -# $NetBSD: files.integrator,v 1.13 2017/06/22 15:27:23 christos Exp $ +# $NetBSD: files.integrator,v 1.14 2021/08/07 19:41:13 andvar Exp $ # -# ARM, Ltd. Integrator evaluation board configuraiton info +# ARM, Ltd. Integrator evaluation board configuration info # filearch/arm/arm32/irq_dispatch.S Index: src/sys/dev/microcode/aic7xxx/aic7xxx.reg diff -u src/sys/dev/microcode/aic7xxx/aic7xxx.reg:1.4 src/sys/dev/microcode/aic7xxx/aic7xxx.reg:1.5 --- src/sys/dev/microcode/aic7xxx/aic7xxx.reg:1.4 Sun Dec 11 12:22:18 2005 +++ src/sys/dev/microcode/aic7xxx/aic7xxx.reg Sat Aug 7 19:41:14 2021 @@ -39,7 +39,7 @@ * * $FreeBSD: /repoman/r/ncvs/src/sys/dev/aic7xxx/aic7xxx.reg,v 1.43 2003/01/20 20:44:55 gibbs Exp $ */ -VERSION = "$NetBSD: aic7xxx.reg,v 1.4 2005/12/11 12:22:18 christos Exp $" +VERSION = "$NetBSD: aic7xxx.reg,v 1.5 2021/08/07 19:41:14 andvar Exp $" /* * This file is processed by the aic7xxx_asm utility for use in assembling @@ -1518,7 +1518,7 @@ scratch_ram { size 6 /* * These are reserved registers in the card's scratch ram on the 2742. - * The EISA configuraiton chip is mapped here. On Rev E. of the + * The EISA configuration chip is mapped here. On Rev E. of the * aic7770, the sequencer can use this area for scratch, but the * host cannot directly a
CVS commit: src/sys/arch/sparc/sparc
Module Name:src Committed By: uwe Date: Sat Aug 7 19:23:03 UTC 2021 Modified Files: src/sys/arch/sparc/sparc: pmap.c Log Message: sp_tlb_flush - consistent whitespace in inline asm. To generate a diff of this commit: cvs rdiff -u -r1.373 -r1.374 src/sys/arch/sparc/sparc/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/sparc/sparc/pmap.c diff -u src/sys/arch/sparc/sparc/pmap.c:1.373 src/sys/arch/sparc/sparc/pmap.c:1.374 --- src/sys/arch/sparc/sparc/pmap.c:1.373 Sun Jan 24 07:36:54 2021 +++ src/sys/arch/sparc/sparc/pmap.c Sat Aug 7 19:23:03 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.373 2021/01/24 07:36:54 mrg Exp $ */ +/* $NetBSD: pmap.c,v 1.374 2021/08/07 19:23:03 uwe Exp $ */ /* * Copyright (c) 1996 @@ -56,7 +56,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.373 2021/01/24 07:36:54 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.374 2021/08/07 19:23:03 uwe Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -663,13 +663,13 @@ sp_tlb_flush(int va, int ctx, int lvl) opsr = getpsr(); /* KDASSERT(opsr & PSR_ET); */ __asm volatile ("wr %0, %1, %%psr" :: "r"(opsr), "n"(PSR_ET) : "memory"); - __asm volatile ("nop; nop;nop"); + __asm volatile ("nop; nop; nop"); octx = getcontext4m(); /* save context */ /* Do the TLB flush in "ctx" */ setcontext4m(ctx); - __asm volatile("sta %%g0, [%0]%1" :: "r"(va), "n"(ASI_SRMMUFP)); + __asm volatile ("sta %%g0, [%0]%1" :: "r"(va), "n"(ASI_SRMMUFP)); setcontext4m(octx); /* restore context */ setpsr(opsr); /* turn traps on again */
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Aug 7 19:07:03 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: msg_001.exp msg_001.ln msg_003.exp msg_003.ln msg_004.exp msg_004.ln msg_005.exp msg_005.ln msg_006.exp msg_006.ln msg_011.exp msg_011.ln msg_012.exp msg_012.ln Log Message: tests/lint: add more tests for lint2 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/msg_001.exp \ src/tests/usr.bin/xlint/lint2/msg_001.ln cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_003.exp \ src/tests/usr.bin/xlint/lint2/msg_003.ln \ src/tests/usr.bin/xlint/lint2/msg_004.exp \ src/tests/usr.bin/xlint/lint2/msg_004.ln \ src/tests/usr.bin/xlint/lint2/msg_005.exp \ src/tests/usr.bin/xlint/lint2/msg_005.ln \ src/tests/usr.bin/xlint/lint2/msg_006.exp \ src/tests/usr.bin/xlint/lint2/msg_006.ln \ src/tests/usr.bin/xlint/lint2/msg_011.exp \ src/tests/usr.bin/xlint/lint2/msg_011.ln \ src/tests/usr.bin/xlint/lint2/msg_012.exp \ src/tests/usr.bin/xlint/lint2/msg_012.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/lint2/msg_001.exp diff -u src/tests/usr.bin/xlint/lint2/msg_001.exp:1.2 src/tests/usr.bin/xlint/lint2/msg_001.exp:1.3 --- src/tests/usr.bin/xlint/lint2/msg_001.exp:1.2 Fri Aug 6 16:21:00 2021 +++ src/tests/usr.bin/xlint/lint2/msg_001.exp Sat Aug 7 19:07:03 2021 @@ -1,2 +1,2 @@ -defined_not_used defined( msg_000.c(2) ), but never used -used_not_defined used( msg_000.c(3) ), but not defined +defined_not_used defined( msg_001.c(2) ), but never used +used_not_defined used( msg_001.c(3) ), but not defined Index: src/tests/usr.bin/xlint/lint2/msg_001.ln diff -u src/tests/usr.bin/xlint/lint2/msg_001.ln:1.2 src/tests/usr.bin/xlint/lint2/msg_001.ln:1.3 --- src/tests/usr.bin/xlint/lint2/msg_001.ln:1.2 Fri Aug 6 16:21:00 2021 +++ src/tests/usr.bin/xlint/lint2/msg_001.ln Sat Aug 7 19:07:03 2021 @@ -1,11 +1,25 @@ -# $NetBSD: msg_001.ln,v 1.2 2021/08/06 16:21:00 rillig Exp $ +# $NetBSD: msg_001.ln,v 1.3 2021/08/07 19:07:03 rillig Exp $ # # Test data for message 1 of lint2: # %s defined( %s ), but never used # -0smsg_000.c -Smsg_000.c +0smsg_001.c +Smsg_001.c 3c0.3p1i16used_not_definedf2IDI 2d0.2do16defined_not_usedf0I + +# The function 'main' always counts as used. +# int main(void) {} +10d0.10d4mainF0I +# extern main() {} +12d0.12e4mainFI + +# If a function is declared once in old style and once with prototype, +# the prototype definition is preferred; see chkname. +# +# extern merge_old_style_and_prototype(); +20d0.20e29merge_old_style_and_prototypeFI +# extern int merge_old_style_and_prototype(char *); +21d0.21e29merge_old_style_and_prototypeF1PCI Index: src/tests/usr.bin/xlint/lint2/msg_003.exp diff -u src/tests/usr.bin/xlint/lint2/msg_003.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_003.exp:1.2 --- src/tests/usr.bin/xlint/lint2/msg_003.exp:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_003.exp Sat Aug 7 19:07:03 2021 @@ -0,0 +1,2 @@ +function defined( msg_003_a.c(10) ), but never used +function multiply defined msg_003_a.c(10) :: msg_003_b.c(10) Index: src/tests/usr.bin/xlint/lint2/msg_003.ln diff -u src/tests/usr.bin/xlint/lint2/msg_003.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_003.ln:1.2 --- src/tests/usr.bin/xlint/lint2/msg_003.ln:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_003.ln Sat Aug 7 19:07:03 2021 @@ -1,6 +1,14 @@ -# $NetBSD: msg_003.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $ +# $NetBSD: msg_003.ln,v 1.2 2021/08/07 19:07:03 rillig Exp $ # # Test data for message 3 of lint2: # %s multiply defined %s :: %s -# -# TODO: add actual test data + +0smsg_003_a.c +Smsg_003_a.c +# msg_003_a.c:10: int function(void); +10d0.10d8functionF0I + +0smsg_003_b.c +Smsg_003_b.c +# msg_003_b.c:10: int function(void); +10d0.10d8functionF0I Index: src/tests/usr.bin/xlint/lint2/msg_004.exp diff -u src/tests/usr.bin/xlint/lint2/msg_004.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_004.exp:1.2 --- src/tests/usr.bin/xlint/lint2/msg_004.exp:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_004.exp Sat Aug 7 19:07:03 2021 @@ -0,0 +1,6 @@ +add value used inconsistently msg_004_define.c(2) :: msg_004_call.c(4) +add value declared inconsistently (double != int) msg_004_define.c(2) :: msg_004_call.c(2) +add, arg 1 used inconsistently msg_004_define.c(2)[double] :: msg_004_call.c(4)[int] +add, arg 2 used inconsistently msg_004_define.c(2)[double] :: msg_004_call.c(4)[int] +add, arg 1 declared inconsistently (double != int) msg_004_define.c(2) :: msg_004_call.c(2) +add, arg 2 declared inconsistently (double != int) msg_004_define.c(2) :: msg_004_call.c(2) Index: src/tests/usr.bin/xlint/lint2/msg_004.ln diff -u src/tests/usr.bin/xlint/lint2/msg_004.ln:1.1 src/tests/usr.bin/xlint/l
CVS commit: src/sys/arch/arm/acpi
Module Name:src Committed By: jmcneill Date: Sat Aug 7 18:40:45 UTC 2021 Modified Files: src/sys/arch/arm/acpi: acpi_machdep.c Log Message: acpi: DMA: Use acpi_resource_parse_any to parse _DMA resources _DMA resources really should be marked ResourceProducer, so use acpi_resource_parse_any to pick these up. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 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.23 src/sys/arch/arm/acpi/acpi_machdep.c:1.24 --- src/sys/arch/arm/acpi/acpi_machdep.c:1.23 Sat Aug 7 16:18:42 2021 +++ src/sys/arch/arm/acpi/acpi_machdep.c Sat Aug 7 18:40:45 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_machdep.c,v 1.23 2021/08/07 16:18:42 thorpej Exp $ */ +/* $NetBSD: acpi_machdep.c,v 1.24 2021/08/07 18:40:45 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.23 2021/08/07 16:18:42 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.24 2021/08/07 18:40:45 jmcneill Exp $"); #include #include @@ -417,7 +417,7 @@ default_tag: return; } - rv = acpi_resource_parse(sc->sc_dev, module, "_DMA", &res, + rv = acpi_resource_parse_any(sc->sc_dev, module, "_DMA", &res, &acpi_resource_parse_ops_quiet); if (ACPI_FAILURE(rv)) { aprint_error_dev(sc->sc_dev,
CVS commit: src/sys/dev/acpi
Module Name:src Committed By: jmcneill Date: Sat Aug 7 18:39:40 UTC 2021 Modified Files: src/sys/dev/acpi: acpi_resource.c acpivar.h Log Message: acpi: Add acpi_resource_parse_any(). Like acpi_resource_parse(), but doesn't exclude "produced" resources. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/dev/acpi/acpi_resource.c cvs rdiff -u -r1.86 -r1.87 src/sys/dev/acpi/acpivar.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/acpi/acpi_resource.c diff -u src/sys/dev/acpi/acpi_resource.c:1.41 src/sys/dev/acpi/acpi_resource.c:1.42 --- src/sys/dev/acpi/acpi_resource.c:1.41 Tue Dec 31 17:26:04 2019 +++ src/sys/dev/acpi/acpi_resource.c Sat Aug 7 18:39:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_resource.c,v 1.41 2019/12/31 17:26:04 jmcneill Exp $ */ +/* $NetBSD: acpi_resource.c,v 1.42 2021/08/07 18:39:40 jmcneill Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acpi_resource.c,v 1.41 2019/12/31 17:26:04 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_resource.c,v 1.42 2021/08/07 18:39:40 jmcneill Exp $"); #include #include @@ -83,6 +83,7 @@ static ACPI_STATUS acpi_resource_parse_c struct resource_parse_callback_arg { const struct acpi_resource_parse_ops *ops; + bool include_producer; device_t dev; void *context; }; @@ -247,7 +248,8 @@ acpi_resource_parse_callback(ACPI_RESOUR case ACPI_RESOURCE_TYPE_ADDRESS32: /* XXX Only fixed size supported for now */ if (res->Data.Address32.Address.AddressLength == 0 || - res->Data.Address32.ProducerConsumer != ACPI_CONSUMER) + (!arg->include_producer && + res->Data.Address32.ProducerConsumer != ACPI_CONSUMER)) break; #define ADDRESS32_FIXED2(r) \ ((r)->Data.Address32.MinAddressFixed == ACPI_ADDRESS_FIXED && \ @@ -302,7 +304,8 @@ acpi_resource_parse_callback(ACPI_RESOUR #ifdef _LP64 /* XXX Only fixed size supported for now */ if (res->Data.Address64.Address.AddressLength == 0 || - res->Data.Address64.ProducerConsumer != ACPI_CONSUMER) + (!arg->include_producer && + res->Data.Address64.ProducerConsumer != ACPI_CONSUMER)) break; #define ADDRESS64_FIXED2(r) \ ((r)->Data.Address64.MinAddressFixed == ACPI_ADDRESS_FIXED && \ @@ -357,7 +360,8 @@ acpi_resource_parse_callback(ACPI_RESOUR break; case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: - if (res->Data.ExtendedIrq.ProducerConsumer != ACPI_CONSUMER) { + if (!arg->include_producer && + res->Data.ExtendedIrq.ProducerConsumer != ACPI_CONSUMER) { ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored ExtIRQ producer\n")); break; @@ -420,6 +424,7 @@ acpi_resource_parse(device_t dev, ACPI_H cbarg.context = arg; cbarg.ops = ops; cbarg.dev = dev; + cbarg.include_producer = false; rv = AcpiWalkResources(handle, path, acpi_resource_parse_callback, &cbarg); @@ -436,6 +441,45 @@ acpi_resource_parse(device_t dev, ACPI_H } /* + * acpi_resource_parse_any: + * + * Parse a device node's resources and fill them in for the + * client. Like acpi_resource_parse, but doesn't skip ResourceProducer + * type resources. + */ +ACPI_STATUS +acpi_resource_parse_any(device_t dev, ACPI_HANDLE handle, const char *path, +void *arg, const struct acpi_resource_parse_ops *ops) +{ + struct resource_parse_callback_arg cbarg; + ACPI_STATUS rv; + + ACPI_FUNCTION_TRACE(__func__); + + if (ops->init) + (*ops->init)(dev, arg, &cbarg.context); + else + cbarg.context = arg; + cbarg.ops = ops; + cbarg.dev = dev; + cbarg.include_producer = true; + + rv = AcpiWalkResources(handle, path, acpi_resource_parse_callback, + &cbarg); + if (ACPI_FAILURE(rv)) { + aprint_error_dev(dev, "ACPI: unable to get %s resources: %s\n", + path, AcpiFormatException(rv)); + return_ACPI_STATUS(rv); + } + + if (ops->fini) + (*ops->fini)(dev, cbarg.context); + + return_ACPI_STATUS(AE_OK); +} + + +/* * acpi_resource_print: * * Print the resources assigned to a device. Index: src/sys/dev/acpi/acpivar.h diff -u src/sys/dev/acpi/acpivar.h:1.86 src/sys/dev/acpi/acpivar.h:1.87 --- src/sys/dev/acpi/acpivar.h:1.86 Wed May 12 23:22:33 2021 +++ src/sys/dev/acpi/acpivar.h Sat Aug 7 18:39:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: acpivar.h,v 1.86 2021/05/12 23:22:33 thorpej Exp $ */ +/* $NetBSD: acpivar.h,v 1.87 2021/08/07 18:39:40 jmcneill Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -330,6 +330,8 @@ void acpi_deregister_notify(struct acpi ACPI_STATUS acpi_resource_parse(device_t, ACPI_HANDLE, const char *, void *, const struct acpi_resource_parse_ops *); +ACPI_STATUS acpi_resource_parse_any(device_t, ACPI_HANDLE, const char *, + void *, const struct acpi_resource_parse_ops *); void acpi_resource_print(device_t, struct acpi_resources *); void acpi_resource_cleanup(struct acpi_resources *);
CVS commit: src/sys
Module Name:src Committed By: thorpej Date: Sat Aug 7 18:16:42 UTC 2021 Modified Files: src/sys/kern: subr_device.c src/sys/sys: device.h Log Message: Export devhandle_lookup_device_call(). To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/kern/subr_device.c cvs rdiff -u -r1.172 -r1.173 src/sys/sys/device.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/kern/subr_device.c diff -u src/sys/kern/subr_device.c:1.7 src/sys/kern/subr_device.c:1.8 --- src/sys/kern/subr_device.c:1.7 Sat Feb 6 05:33:20 2021 +++ src/sys/kern/subr_device.c Sat Aug 7 18:16:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_device.c,v 1.7 2021/02/06 05:33:20 thorpej Exp $ */ +/* $NetBSD: subr_device.c,v 1.8 2021/08/07 18:16:42 thorpej Exp $ */ /* * Copyright (c) 2006, 2021 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_device.c,v 1.7 2021/02/06 05:33:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_device.c,v 1.8 2021/08/07 18:16:42 thorpej Exp $"); #include #include @@ -72,7 +72,7 @@ devhandle_type(devhandle_t handle) return handle.impl->type; } -static device_call_t +device_call_t devhandle_lookup_device_call(devhandle_t handle, const char *name, devhandle_t *call_handlep) { Index: src/sys/sys/device.h diff -u src/sys/sys/device.h:1.172 src/sys/sys/device.h:1.173 --- src/sys/sys/device.h:1.172 Sat Aug 7 16:19:18 2021 +++ src/sys/sys/device.h Sat Aug 7 18:16:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: device.h,v 1.172 2021/08/07 16:19:18 thorpej Exp $ */ +/* $NetBSD: device.h,v 1.173 2021/08/07 18:16:42 thorpej Exp $ */ /* * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -671,6 +671,8 @@ bool devhandle_is_valid(devhandle_t); void devhandle_invalidate(devhandle_t *); devhandle_type_t devhandle_type(devhandle_t); +device_call_t devhandle_lookup_device_call(devhandle_t, const char *, + devhandle_t *); void devhandle_impl_inherit(struct devhandle_impl *, const struct devhandle_impl *);
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Sat Aug 7 17:38:41 UTC 2021 Modified Files: src/usr.bin/xlint: Makefile.inc src/usr.bin/xlint/lint1: Makefile Log Message: lint: clean gcov files for lint2 and xlint as well To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/usr.bin/xlint/Makefile.inc cvs rdiff -u -r1.82 -r1.83 src/usr.bin/xlint/lint1/Makefile 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/Makefile.inc diff -u src/usr.bin/xlint/Makefile.inc:1.14 src/usr.bin/xlint/Makefile.inc:1.15 --- src/usr.bin/xlint/Makefile.inc:1.14 Sun Apr 18 22:51:24 2021 +++ src/usr.bin/xlint/Makefile.inc Sat Aug 7 17:38:41 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.14 2021/04/18 22:51:24 rillig Exp $ +# $NetBSD: Makefile.inc,v 1.15 2021/08/07 17:38:41 rillig Exp $ .include @@ -17,6 +17,8 @@ ARCHSUBDIR= ${MACHINE_CPU} CPPFLAGS+= -I${.CURDIR}/../arch/${ARCHSUBDIR} CPPFLAGS+= -I${.CURDIR}/../common +CLEANFILES+= *.gcno *.gcda *.gcov + .if exists(${.CURDIR}/../../Makefile.inc) .include "${.CURDIR}/../../Makefile.inc" .endif Index: src/usr.bin/xlint/lint1/Makefile diff -u src/usr.bin/xlint/lint1/Makefile:1.82 src/usr.bin/xlint/lint1/Makefile:1.83 --- src/usr.bin/xlint/lint1/Makefile:1.82 Sat Jul 31 18:16:42 2021 +++ src/usr.bin/xlint/lint1/Makefile Sat Aug 7 17:38:41 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.82 2021/07/31 18:16:42 rillig Exp $ +# $NetBSD: Makefile,v 1.83 2021/08/07 17:38:41 rillig Exp $ .include @@ -29,7 +29,6 @@ COPTS.err.c+= ${${ACTIVE_CC} == "clang": BINDIR= /usr/libexec CLEANFILES+= ${MAN} -CLEANFILES+= *.gcno *.gcda *.gcov .if ${USETOOLS} == "yes" LINT1= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-lint1
CVS commit: src/doc
Module Name:src Committed By: thorpej Date: Sat Aug 7 16:21:03 UTC 2021 Modified Files: src/doc: BRANCHES Log Message: thorpej-cfargs2 merged. To generate a diff of this commit: cvs rdiff -u -r1.361 -r1.362 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.361 src/doc/BRANCHES:1.362 --- src/doc/BRANCHES:1.361 Sat Aug 7 14:19:12 2021 +++ src/doc/BRANCHES Sat Aug 7 16:21:02 2021 @@ -1,4 +1,4 @@ -# $NetBSD: BRANCHES,v 1.361 2021/08/07 14:19:12 thorpej Exp $ +# $NetBSD: BRANCHES,v 1.362 2021/08/07 16:21:02 thorpej Exp $ # # This file contains a list of branches that exist in the NetBSD CVS # tree and their current state. @@ -737,9 +737,9 @@ Notes: Branch: thorpej-cfargs2 Description: Address complaints regarding the use of variadic arguments in thorpej-cfargs. -Status: Active +Status: Merged Start Date: Sun Aug 1 2021 -End Date: +End Date: Sat Aug 7 2021 Base Tag: thorpej-cfargs2-base Maintainer: Jason Thorpe Scope: src/sys
CVS commit: src/share/man/man9
Module Name:src Committed By: thorpej Date: Sat Aug 7 16:20:02 UTC 2021 Modified Files: src/share/man/man9: autoconf.9 Log Message: Update for thorpej-cfargs2. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 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.31 src/share/man/man9/autoconf.9:1.32 --- src/share/man/man9/autoconf.9:1.31 Wed Apr 28 00:49:22 2021 +++ src/share/man/man9/autoconf.9 Sat Aug 7 16:20:02 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: autoconf.9,v 1.31 2021/04/28 00:49:22 thorpej Exp $ +.\" $NetBSD: autoconf.9,v 1.32 2021/08/07 16:20:02 thorpej Exp $ .\" .\" Copyright (c) 2001, 2002, 2021 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -52,17 +52,17 @@ .In sys/device.h .In sys/errno.h .Ft cfdata_t -.Fn config_search "device_t parent" "void *aux" "cfarg_t tag" "..." +.Fn config_search "device_t parent" "void *aux" "const struct cfargs *" .Ft device_t .Fn config_found "device_t parent" "void *aux" "cfprint_t print" \ -"cfarg_t tag" "..." +"const struct cfargs *" .Ft int .Fn config_match "device_t parent" "cfdata_t cf" "void *aux" .Ft int .Fn config_probe "device_t parent" "cfdata_t cf" "void *aux" .Ft device_t .Fn config_attach "device_t parent" "cfdata_t cf" "void *aux" \ -"cfprint_t print" "cfarg_t tag" "..." +"cfprint_t print" "const struct cfargs *" .Ft device_t .Fn config_attach_pseudo "cfdata_t cf" .Ft int @@ -119,53 +119,64 @@ The unit number identifies an instance o Device data structures are allocated dynamically during autoconfiguration, giving a unique address for each instance. .Pp -Several of the autoconfiguration functions take a variadic list of -tag-value arguments to pass information from driver autoconfiguration +Several of the autoconfiguration functions take a strongly-typed variadic +list of arguments to pass information from driver autoconfiguration functions to the kernel's autoconfiguration system. +This list is constructed using the +.Fn CFARGS +macro, like this example: +.Bd -literal -offset indent +config_search(self, NULL, +CFARGS(.search = mainbus_search, + .iattr = "mainbus")); +.Ed +.Pp Each tag is followed by a tag-specific value. -The end of the argument list must be terminated with the tag -.Dv CFARG_EOL . -Passing an invalid tag or an inappropriate value for a tag results -in undefined behavior and may cause a kernel panic. -.Bl -tag -width "CFARG_DEVHANDLE" -.It Dv CFARG_SUBMATCH +.Bl -tag -width ".devhandle" +.It Dv .submatch A pointer to a .Sq submatch function used in direct configuration. -.It Dv CFARG_SEARCH +.It Dv .search A pointer to a .Sq search function used in indirect configuration. -.It Dv CFARG_IATTR +.It Dv .iattr A pointer to a constant C string .Pq const char * specifying an interface attribute. If a parent device carries only a single interface attribute, then this -tag-value pair may be omitted. +argument may be omitted. If an interface attribute is specified that the parent device does not carry, or no interface attribute is specifies and the parent device carries more than one, behavior is undefined. On kernels built with the .Dv DIAGNOSTIC option, this may result in an assertion panic. -.It Dv CFARG_LOCATORS +.It Dv .locators A pointer an a constant array of type .Sq int .Pq const int * containing interface attribute-specific locators. -.It Dv CFARG_DEVHANDLE +.It Dv .devhandle A devhandle_t .Pq passed by value corresponding to the device being attached. .El +.Pp +If no arguments are to be passed, the special value +.Dv CFARGS_NONE +may be used in place of the +.Fn CFARGS +macro. .Sh FUNCTIONS .Bl -tag -width compact -.It Fn config_search "parent" "aux" "tag" "..." +.It Fn config_search "parent" "aux" "cfargs" Performs indirect configuration of physical devices. -Tag-value arguments consumed: -.Dv CFARG_SEARCH , -.Dv CFARG_IATTR , -.Dv CFARG_LOCATORS . +Cfargs consumed: +.Em .search , +.Em .iattr , +.Em .locators . .Fn config_search iterates over all potential children, calling the given search function @@ -205,13 +216,13 @@ itself. Note that this function is designed so that it can be used to apply an arbitrary function to all potential children. In this case callers may choose to ignore the return value. -.It Fn config_found "parent" "aux" "print" "tag" "..." +.It Fn config_found "parent" "aux" "print" "cfargs" Performs direct configuration on a physical device. -Tag-value arguments consumed: -.Dv CFARG_SUBMATCH , -.Dv CFARG_IATTR , -.Dv CFARG_LOCATORS , -.Dv CFARG_DEVHANDLE . +Cfargs consumed: +.Em .submatch , +.Em .iattr , +.Em .locators , +.Em .devhandle . .Fn config_found is called by the parent and in turn calls the specified submatch function as determined by the configuration table. @@ -301,11 +312,11 @@ Unl
CVS commit: src/sys
Module Name:src Committed By: thorpej Date: Sat Aug 7 16:19:18 UTC 2021 Modified Files: src/sys/arch/acorn32/eb7500atx: rsbus.c src/sys/arch/acorn32/mainbus: fd.c pioc.c src/sys/arch/acorn32/podulebus: amps.c asc.c cosc.c csc.c podulebus.c ptsc.c src/sys/arch/algor/dev: bonito_mainbus.c mainbus.c vtpbc_mainbus.c src/sys/arch/algor/pci: pcib.c src/sys/arch/alpha/alpha: mainbus.c src/sys/arch/alpha/jensenio: jensenio.c src/sys/arch/alpha/mcbus: mcbus.c src/sys/arch/alpha/pci: apecs.c cia.c dwlpx.c irongate.c lca.c mcpcia.c sio.c tsc.c tsciic.c ttwoga.c src/sys/arch/alpha/sableio: sableio.c src/sys/arch/alpha/tc: tcasic.c src/sys/arch/alpha/tlsb: gbus.c kftxx.c tlsb.c src/sys/arch/amd64/amd64: amd64_mainbus.c src/sys/arch/amiga/amiga: autoconf.c device.h src/sys/arch/amiga/clockport: a1k2cp.c clockport.c gencp.c src/sys/arch/amiga/dev: acafh.c afsc.c ahsc.c amidisplaycc.c atzsc.c bppcsc.c cbiiisc.c drsc.c drsupio.c empsc.c fd.c gayle_pcmcia.c grf.c grf_cc.c grf_cl.c grf_cv.c grf_cv3d.c grf_et.c grf_rh.c grf_rt.c grf_ul.c gtsc.c gvpbus.c gvpio.c hyper.c ioblix_zbus.c ivsc.c kbd.c mfc.c mgnsc.c mlhsc.c mntva.c ms.c otgsc.c p5bus.c wesc.c wstsc.c xsh.c xsurf.c z3rambd.c zbus.c zssc.c src/sys/arch/amiga/pci: cv3dpb.c em4k.c empb.c mppb.c p5pb.c src/sys/arch/amigappc/amigappc: autoconf.c mainbus.c src/sys/arch/arc/arc: mainbus.c src/sys/arch/arc/dti: btl.c src/sys/arch/arc/isa: isabus.c src/sys/arch/arc/jazz: fd.c jazzio.c src/sys/arch/arc/pci: necpb.c src/sys/arch/arm/acpi: acpi_machdep.c acpipchb.c gic_acpi.c gtmr_acpi.c src/sys/arch/arm/amlogic: meson_pinctrl.c meson_sdhc.c meson_sdio.c mesongx_mmc.c src/sys/arch/arm/at91: at91bus.c at91cf.c at91ohci.c at91pio.c at91spi.c at91twi.c src/sys/arch/arm/broadcom: bcm2835_bsc_acpi.c bcm2835_dwctwo.c bcm2835_gpio.c bcm2835_mbox.c bcm2835_sdhost.c bcm2835_spi.c bcm2838_pcie.c bcm53xx_cca.c bcm53xx_ccb.c bcm53xx_pax.c bcm53xx_usb.c src/sys/arch/arm/clps711x: clpslcd.c clpssoc.c src/sys/arch/arm/cortex: armperiph.c src/sys/arch/arm/ep93xx: epgpio.c epohci.c eppcic.c epsoc.c src/sys/arch/arm/fdt: a9ptmr_fdt.c a9tmr_fdt.c a9wdt_fdt.c acpi_fdt.c arm_fdt.c cpu_fdt.c gic_fdt.c gtmr_fdt.c l2cc_fdt.c pcihost_fdt.c src/sys/arch/arm/footbridge: footbridge.c src/sys/arch/arm/gemini: gemini_gmac.c gemini_gpio.c gemini_ipi.c gemini_ipm.c gemini_lpc.c gemini_obio.c obio_ehci.c obio_lpchc.c src/sys/arch/arm/imx: imx23_ahb.c imx23_apbh.c imx23_apbx.c imx23_pinctrl.c imx23_ssp.c imx23_usb.c imx31_ahb.c imx31_aips.c imx31_gpio.c imx51_axi.c imx51_ipuv3.c imx51_usb.c imx_pcic.c imxgpio.c imxspi.c imxusb.c src/sys/arch/arm/iomd: iomd.c iomdiic.c qms.c vidc20.c vidcvideo.c src/sys/arch/arm/ixp12x0: ixp12x0.c ixpsip.c src/sys/arch/arm/mainbus: mainbus.c src/sys/arch/arm/marvell: mvsoc.c mvsocgpp.c src/sys/arch/arm/mpcore: mpcore_axi.c mpcore_pmr.c src/sys/arch/arm/nvidia: tegra210_xusbpad.c tegra_cec.c tegra_drm_fb.c tegra_ehci.c tegra_gpio.c tegra_pcie.c tegra_xusb.c src/sys/arch/arm/nxp: imx6_usb.c imxpcie.c src/sys/arch/arm/omap: am335x_gpio.c obio_ohci.c omap2_gpio.c omap2_gpmc.c omap2_l3i.c omap2_obio.c omap3_ehci.c omap3_i2c.c omap_emifs.c omap_ocp.c omap_tipb.c omapfb.c omapl1x_ohci.c omapl1x_tipb.c ti_iic.c tifb.c tiotg.c src/sys/arch/arm/rockchip: rk3328_iomux.c rk3399_iomux.c rk_drm.c rk_gpio.c rk_usb.c src/sys/arch/arm/s3c2xx0: ohci_s3c24x0.c s3c2410.c s3c2410_extint.c s3c2410_spi.c s3c2440.c s3c2440_extint.c s3c2440_i2s.c s3c2440_sdi.c s3c2440_spi.c s3c2440_touch.c s3c2800.c s3c2800_pci.c src/sys/arch/arm/sa11x0: sa.c sa11x0.c sa11x1_pcic.c src/sys/arch/arm/samsung: exynos_ehci.c exynos_gpio.c exynos_ohci.c mct.c src/sys/arch/arm/sociox: sni_gpio.c sni_i2c.c src/sys/arch/arm/sunxi: sun6i_spi.c sunxi_debe.c sunxi_drm.c sunxi_gpio.c sunxi_mmc.c sunxi_ts.c src/sys/arch/arm/ti: omap2_nand.c omap3_dss.c ti_ehci.c ti_gpio.c ti_lcdc.c src/sys/arch/arm/xilinx: zynq_usb.c src/sys/arch/arm/xscale: becc.c i80312.c i80321.c iopi2c.c ixp425.c ixp425_ixme.c ixp425_npe.c ixp425_sip.c pxa2x0.c pxa2x0_gpio.c pxa2x0_mci.c pxa2x0_ohci.c pxa2x0_pcic.c src/sys/arch/arm/zynq: zynq_axi.c zynq_usb.c src/sys/arch/atari/atari: autoconf.c device.h src/sys/arch/atari/dev: fd.c grf.c hdfd.c ite_cc.c ite_et.c kbd.c
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: riastradh Date: Sat Aug 7 15:41:01 UTC 2021 Modified Files: src/sys/arch/arm/sunxi: sun8i_crypto.c Log Message: sun8icrypto(4): Call crypto_unblock when a task completes. Otherwise under load this would presumably just hang after returning ERESTART to opencrypto. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/sunxi/sun8i_crypto.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/sunxi/sun8i_crypto.c diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.25 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.26 --- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.25 Wed Apr 28 16:57:05 2021 +++ src/sys/arch/arm/sunxi/sun8i_crypto.c Sat Aug 7 15:41:00 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_crypto.c,v 1.25 2021/04/28 16:57:05 bad Exp $ */ +/* $NetBSD: sun8i_crypto.c,v 1.26 2021/08/07 15:41:00 riastradh Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.25 2021/04/28 16:57:05 bad Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.26 2021/08/07 15:41:00 riastradh Exp $"); #include #include @@ -211,7 +211,7 @@ static void sun8i_crypto_timeout(void *) static int sun8i_crypto_intr(void *); static void sun8i_crypto_schedule_worker(struct sun8i_crypto_softc *); static void sun8i_crypto_worker(struct work *, void *); -static void sun8i_crypto_chan_done(struct sun8i_crypto_softc *, unsigned, +static bool sun8i_crypto_chan_done(struct sun8i_crypto_softc *, unsigned, int); static int sun8i_crypto_allocbuf(struct sun8i_crypto_softc *, size_t, @@ -1051,6 +1051,7 @@ sun8i_crypto_worker(struct work *wk, voi struct sun8i_crypto_softc *sc = cookie; uint32_t done, esr, esr_chan; unsigned i, now; + bool unblock = false; int error; /* @@ -1084,7 +1085,8 @@ sun8i_crypto_worker(struct work *wk, voi if ((sc->sc_chan[i].cc_task != NULL) && ((now - sc->sc_chan[i].cc_starttime) >= SUN8I_CRYPTO_TIMEOUT)) -sun8i_crypto_chan_done(sc, i, ETIMEDOUT); +unblock |= sun8i_crypto_chan_done(sc, i, +ETIMEDOUT); continue; } @@ -1112,11 +1114,23 @@ sun8i_crypto_worker(struct work *wk, voi * Notify the task of completion. May release the lock * to invoke a callback. */ - sun8i_crypto_chan_done(sc, i, error); + unblock |= sun8i_crypto_chan_done(sc, i, error); } /* All one; release the lock one last time. */ mutex_exit(&sc->sc_lock); + + /* + * If we cleared any channels, it is time to allow opencrypto + * to issue new operations. Asymmetric operations (which we + * don't support, at the moment, but we could) and symmetric + * operations (which we do) use the same task channels, so we + * unblock both kinds. + */ + if (unblock) { + crypto_unblock(sc->sc_opencrypto.co_driverid, + CRYPTO_SYMQ|CRYPTO_ASYMQ); + } } /* @@ -1125,7 +1139,7 @@ sun8i_crypto_worker(struct work *wk, voi * Notify the callback for the task on channel i, if there is one, * of the specified error, or 0 for success. */ -static void +static bool sun8i_crypto_chan_done(struct sun8i_crypto_softc *sc, unsigned i, int error) { struct sun8i_crypto_task *task; @@ -1140,7 +1154,8 @@ sun8i_crypto_chan_done(struct sun8i_cryp if ((task = sc->sc_chan[i].cc_task) == NULL) { device_printf(sc->sc_dev, "channel %u: no task but error=%d\n", i, error); - return; + /* We did not clear a channel. */ + return false; } sc->sc_chan[i].cc_task = NULL; @@ -1183,6 +1198,9 @@ sun8i_crypto_chan_done(struct sun8i_cryp SDT_PROBE2(sdt, sun8i_crypto, task, done, task, error); (*task->ct_callback)(sc, task, task->ct_cookie, error); mutex_enter(&sc->sc_lock); + + /* We cleared a channel. */ + return true; } /* @@ -1811,7 +1829,7 @@ sun8i_crypto_register1(struct sun8i_cryp * Called by opencrypto to allocate a new session. We don't keep * track of sessions, since there are no persistent keys in the * hardware that we take advantage of, so this only validates the - * crypto operations and returns a zero session id. + * crypto operations and returns a dummy session id of 1. */ static int sun8i_crypto_newsession(void *cookie, uint32_t *sidp, struct cryptoini *cri) @@ -1823,7 +1841,7 @@ sun8i_crypto_newsession(void *cookie, ui /* * No variation of rounds is supported here. (XXX Unused and - * unimplemented in opencrypto(9) altogether? + * unimplemented in opencrypto(9) altogether?) */ if (cri->cri_rnd) return EINVAL;
CVS commit: [thorpej-cfargs2] src/sys/sys
Module Name:src Committed By: thorpej Date: Sat Aug 7 14:21:28 UTC 2021 Modified Files: src/sys/sys [thorpej-cfargs2]: device.h Log Message: Hide "struct cfargs" from user space. To generate a diff of this commit: cvs rdiff -u -r1.171.2.1 -r1.171.2.2 src/sys/sys/device.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/sys/device.h diff -u src/sys/sys/device.h:1.171.2.1 src/sys/sys/device.h:1.171.2.2 --- src/sys/sys/device.h:1.171.2.1 Tue Aug 3 15:00:15 2021 +++ src/sys/sys/device.h Sat Aug 7 14:21:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: device.h,v 1.171.2.1 2021/08/03 15:00:15 thorpej Exp $ */ +/* $NetBSD: device.h,v 1.171.2.2 2021/08/07 14:21:28 thorpej Exp $ */ /* * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -530,6 +530,7 @@ struct pdevinit { /* This allows us to wildcard a device unit. */ #define DVUNIT_ANY -1 +#if defined(_KERNEL) || defined(_KMEMUSER) || defined(_STANDALONE) /* * Arguments passed to config_search() and config_found(). */ @@ -564,6 +565,7 @@ struct cfargs { .cfargs_version = CFARGS_VERSION, \ __VA_ARGS__ \ }) +#endif /* _KERNEL || _KMEMUSER || _STANDALONE */ #ifdef _KERNEL
CVS commit: src/doc
Module Name:src Committed By: thorpej Date: Sat Aug 7 14:19:12 UTC 2021 Modified Files: src/doc: BRANCHES Log Message: Document thorpej-futex2. To generate a diff of this commit: cvs rdiff -u -r1.360 -r1.361 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.360 src/doc/BRANCHES:1.361 --- src/doc/BRANCHES:1.360 Sun Aug 1 21:00:41 2021 +++ src/doc/BRANCHES Sat Aug 7 14:19:12 2021 @@ -1,4 +1,4 @@ -# $NetBSD: BRANCHES,v 1.360 2021/08/01 21:00:41 thorpej Exp $ +# $NetBSD: BRANCHES,v 1.361 2021/08/07 14:19:12 thorpej Exp $ # # This file contains a list of branches that exist in the NetBSD CVS # tree and their current state. @@ -762,6 +762,19 @@ Notes: Normal futex operataions pass th Also includes implementations of eventfd and timerfd, as well as some additional improvements to COMPAT_LINUX{,32}. +Branch: thorpej-futex2 +Description: Overhaul of futex operations to fix thread priority issues +Status: Active +Start Date: Thu Aug 5 2021 +End Date: +Base Tag: thorpej-futex2-base +Maintainer: Jason Thorpe +Scope: src/sys src/tests/lib/libc/sys +Notes: Re-based version of thorpej-futex that includes ONLY + the original futex priority issue fixes. The other + changes in thorpej-futex are still maintained on that + branch. + Branch: thorpej-i2c-spi-conf Description: Improve device tree-based I2C and SPI enumeration. Status: Active