CVS commit: src/sys/arch/evbarm/smdk2xx0
Module Name:src Committed By: msaitoh Date: Thu Apr 25 05:42:43 UTC 2019 Modified Files: src/sys/arch/evbarm/smdk2xx0: if_cs_smdk24x0.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/smdk2xx0/if_cs_smdk24x0.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/evbarm/smdk2xx0/if_cs_smdk24x0.c diff -u src/sys/arch/evbarm/smdk2xx0/if_cs_smdk24x0.c:1.7 src/sys/arch/evbarm/smdk2xx0/if_cs_smdk24x0.c:1.8 --- src/sys/arch/evbarm/smdk2xx0/if_cs_smdk24x0.c:1.7 Mon Apr 13 21:18:41 2015 +++ src/sys/arch/evbarm/smdk2xx0/if_cs_smdk24x0.c Thu Apr 25 05:42:43 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_cs_smdk24x0.c,v 1.7 2015/04/13 21:18:41 riastradh Exp $ */ +/* $NetBSD: if_cs_smdk24x0.c,v 1.8 2019/04/25 05:42:43 msaitoh Exp $ */ /* * Copyright (c) 2003 Genetec corporation. All rights reserved. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_cs_smdk24x0.c,v 1.7 2015/04/13 21:18:41 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cs_smdk24x0.c,v 1.8 2019/04/25 05:42:43 msaitoh Exp $"); #include #include @@ -122,9 +122,7 @@ cs_ssextio_probe(device_t parent, cfdata if (sa->sa_addr == SSEXTIOCF_ADDR_DEFAULT) sa->sa_addr = S3C2410_BANK_START(3); - /* - * Map the I/O space. - */ + /* Map the I/O space. */ ioaddr = IOADDR(sa->sa_addr); if (bus_space_map(iot, ioaddr, CS8900_IOSIZE, 0, )) goto out; @@ -137,7 +135,7 @@ cs_ssextio_probe(device_t parent, cfdata if (0) { int i; - for (i=0; i <=PKTPG_IND_ADDR; i += 2) { + for (i = 0; i <= PKTPG_IND_ADDR; i += 2) { if (i % 16 == 0) printf( "\n%04x: ", i); printf("%04x ", CS_READ_PACKET_PAGE_IO(, i)); @@ -149,9 +147,7 @@ cs_ssextio_probe(device_t parent, cfdata if (CS_READ_PACKET_PAGE_IO(, PKTPG_EISA_NUM) != EISA_NUM_CRYSTAL) goto out; - /* - * Verify that it's a supported chip. - */ + /* Verify that it's a supported chip. */ switch (CS_READ_PACKET_PAGE_IO(, PKTPG_PRODUCT_ID) & PROD_ID_MASK) { case PROD_ID_CS8900: #ifdef notyet @@ -165,14 +161,14 @@ cs_ssextio_probe(device_t parent, cfdata if (have_io) bus_space_unmap(iot, ioh, CS8900_IOSIZE); - return (rv); + return rv; } /* media selection: UTP only */ static int cs_media[] = { - IFM_ETHER|IFM_10_T, + IFM_ETHER | IFM_10_T, #if 0 - IFM_ETHER|IFM_10_T|IFM_FDX, + IFM_ETHER | IFM_10_T | IFM_FDX, #endif }; @@ -190,12 +186,12 @@ cs_ssextio_attach(device_t parent, devic sc->sc_dev = self; sc->sc_iot = sc->sc_memt = sa->sa_iot; - /* sc_irq is an IRQ number in ISA world. set 10 for INTRQ0 of CS8900A */ - sc->sc_irq = 10; - /* - * Map the device. + * sc_irq is an IRQ number in ISA world. Set 10 for INTRQ0 of CS8900A. */ + sc->sc_irq = 10; + + /* Map the device. */ ioaddr = IOADDR(sa->sa_addr); if (bus_space_map(sc->sc_iot, ioaddr, CS8900_IOSIZE, 0, >sc_ioh)) { aprint_error(": unable to map i/o space\n"); @@ -210,12 +206,14 @@ cs_ssextio_attach(device_t parent, devic sc->sc_pktpgaddr = sa->sa_addr; } - /* CS8900A is very slow. (nOE->Data valid: 135ns max.) - We need to use IOCHRDY signal */ + /* + * CS8900A is very slow. (nOE->Data valid: 135ns max.) + * We need to use IOCHRDY signal. + */ sc->sc_cfgflags |= CFGFLG_IOCHRDY; - sc->sc_ih = s3c2410_extint_establish(sa->sa_intr, IPL_NET, IST_EDGE_RISING, - cs_intr, sc); + sc->sc_ih = s3c2410_extint_establish(sa->sa_intr, IPL_NET, + IST_EDGE_RISING, cs_intr, sc); if (sc->sc_ih == NULL) { aprint_error(": unable to establish interrupt\n"); return; @@ -226,6 +224,6 @@ cs_ssextio_attach(device_t parent, devic /* SMDK24X0 doesn't have EEPRMO hooked to CS8900A */ sc->sc_cfgflags |= CFGFLG_NOT_EEPROM; - cs_attach(sc, enaddr, cs_media, - sizeof(cs_media) / sizeof(cs_media[0]), IFM_ETHER|IFM_10_T); + cs_attach(sc, enaddr, cs_media, __arraycount(cs_media), + IFM_ETHER | IFM_10_T); }
CVS commit: src
Module Name:src Committed By: pgoyette Date: Thu Apr 25 05:12:49 UTC 2019 Modified Files: src: build.sh Log Message: Tyop in error message... To generate a diff of this commit: cvs rdiff -u -r1.330 -r1.331 src/build.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/build.sh diff -u src/build.sh:1.330 src/build.sh:1.331 --- src/build.sh:1.330 Fri Feb 8 02:05:32 2019 +++ src/build.sh Thu Apr 25 05:12:49 2019 @@ -1,5 +1,5 @@ #! /usr/bin/env sh -# $NetBSD: build.sh,v 1.330 2019/02/08 02:05:32 mrg Exp $ +# $NetBSD: build.sh,v 1.331 2019/04/25 05:12:49 pgoyette Exp $ # # Copyright (c) 2001-2011 The NetBSD Foundation, Inc. # All rights reserved. @@ -1291,7 +1291,7 @@ parseoptions() safe_setmakeenv "${OPTARG}" "" ;; *) -usage "-V argument must be of the form 'var=[value]'" +usage "-V argument must be of the form 'var[=value]'" ;; esac ;; @@ -1936,7 +1936,7 @@ createmakewrapper() eval cat <
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Thu Apr 25 03:54:10 UTC 2019 Modified Files: src/bin/sh: trap.c Log Message: Better interactive SIGINT handling (when a trap is set), and other cleanups to the trap code. No longer silently ignore attempts to do anything other than set SIGKILL or SIGSTOP to the default ('-") state. Don't include those in trap or trap -p output (the former because they cannot be other than in default state, so simply aren't included, the latter because it is pointless) but do list them when requested with trap -p SIG. Interactive mode SIGINT traps are now run ASAP, rather than after a command has been entered (so the sequence ^C \n is no longer needed to generate one). Further, when trapped, in interactive mode, while waiting for a user command, a SIGINT acts (aside from the trap being run) just like when not trapped, aborts the command being entered (rather than leaving it, which it did when libedit was in use) prints a new prompt, and starts again (which is what should happen.) Traps other than SIGINT (which has always been handled special in interactive mode) are unaffected by this change, as are SIGINT traps in non-interactive shells.Or that is the intent anyway. Fix an in_dotrap ref count bug (was never being decremented... that was inserted in a place never executed) (relatively harmless) and add/improve some trap/signal related DEBUG mode tracing. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/bin/sh/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/sh/trap.c diff -u src/bin/sh/trap.c:1.51 src/bin/sh/trap.c:1.52 --- src/bin/sh/trap.c:1.51 Fri Jan 18 06:28:09 2019 +++ src/bin/sh/trap.c Thu Apr 25 03:54:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.51 2019/01/18 06:28:09 kre Exp $ */ +/* $NetBSD: trap.c,v 1.52 2019/04/25 03:54:10 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)trap.c 8.5 (Berkeley) 6/5/95"; #else -__RCSID("$NetBSD: trap.c,v 1.51 2019/01/18 06:28:09 kre Exp $"); +__RCSID("$NetBSD: trap.c,v 1.52 2019/04/25 03:54:10 kre Exp $"); #endif #endif /* not lint */ @@ -46,6 +46,7 @@ __RCSID("$NetBSD: trap.c,v 1.51 2019/01/ #include #include #include +#include #include #undef CEOF /* from but concflicts with sh use */ @@ -269,7 +270,9 @@ trapcmd(int argc, char **argv) CTRACE(DBG_TRAP, ("*all*\n")); if (printonly) { - for (count = 0, signo = 0 ; signo < NSIG ; signo++) + for (count = 0, signo = 0 ; signo < NSIG ; signo++) { +if (signo == SIGKILL || signo == SIGSTOP) + continue; if (trap[signo] == NULL) { if (count == 0) out1str("trap -- -"); @@ -280,10 +283,16 @@ trapcmd(int argc, char **argv) count = 0; } } + } if (count) out1str("\n"); } + /* + * We don't need do deal with SIGSTOP or SIGKILL as a + * special case anywhere here, as they cannot be + * ignored or caught - the only possibility is default + */ for (count = 0, signo = 0 ; signo < NSIG ; signo++) if (trap[signo] != NULL && trap[signo][0] == '\0') { if (count == 0) @@ -351,6 +360,11 @@ trapcmd(int argc, char **argv) ap++; if (printonly) { + /* + * we allow SIGSTOP and SIGKILL to be obtained + * (action will always be "-") here, if someone + * really wants to get that particular output + */ out1str("trap -- "); if (trap[signo] == NULL) out1str("-"); @@ -360,6 +374,27 @@ trapcmd(int argc, char **argv) continue; } + if ((signo == SIGKILL || signo == SIGSTOP) && action != NULL) { +#ifndef SMALL + /* + * Don't bother with the error message in a SMALL shell + * just ignore req and return error status silently + * (POSIX says this is an "undefined" operation so + * whatever we do is OK!) + * + * When we do generate an error, make it attempt match + * the user's operand, as best we can reasonably. + */ + outfmt(out2, "trap: '%s%s' cannot be %s\n", + (!is_alpha(ap[-1][0]) || +strncasecmp(ap[-1], "sig", 3) == 0) ? "" : +is_upper(ap[-1][0]) ? "SIG" : "sig", + ap[-1], *action ? "caught" : "ignored"); +#endif + errs = 1; + continue; + } + INTOFF; if (action) action = savestr(action); @@ -647,15 +682,23 @@ SHELLPROC { void onsig(int signo) { - CTRACE(DBG_SIG, ("Signal %d, had: pending %d, gotsig[%d]=%d\n", - signo, pendingsigs, signo, gotsig[signo])); + int sav_err = errno; + + CTRACE(DBG_SIG, ("onsig(%d), had: pendingsigs %d%s, gotsig[%d]=%d\n", + signo, pendingsigs, intpending ? " (SIGINT-pending)" : "", + signo, gotsig[signo])); /* This should not be needed. signal(signo, onsig); */ if (signo == SIGINT && (traps_invalid || trap[SIGINT] == NULL)) { - onint(); + VTRACE(DBG_SIG, ("onsig(SIGINT), doing it now\n")); + if (suppressint && !in_dotrap) + intpending =
CVS commit: src/sys/arch/amd64/conf
Module Name:src Committed By: msaitoh Date: Thu Apr 25 03:53:11 UTC 2019 Modified Files: src/sys/arch/amd64/conf: GENERIC Log Message: Add gem(4). To generate a diff of this commit: cvs rdiff -u -r1.524 -r1.525 src/sys/arch/amd64/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.524 src/sys/arch/amd64/conf/GENERIC:1.525 --- src/sys/arch/amd64/conf/GENERIC:1.524 Thu Apr 18 17:13:00 2019 +++ src/sys/arch/amd64/conf/GENERIC Thu Apr 25 03:53:11 2019 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.524 2019/04/18 17:13:00 maya Exp $ +# $NetBSD: GENERIC,v 1.525 2019/04/25 03:53:11 msaitoh Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.524 $" +#ident "GENERIC-$Revision: 1.525 $" maxusers 64 # estimated number of users @@ -798,6 +798,7 @@ et* at pci? dev ? function ? # Agere/LSI ex* at pci? dev ? function ? # 3Com 90x[BC] fpa* at pci? dev ? function ? # DEC DEFPA FDDI fxp* at pci? dev ? function ? # Intel EtherExpress PRO 10+/100B +gem* at pci? dev ? function ? # Apple GMAC and Sun ERI gigabit enet gsip* at pci? dev ? function ? # NS83820 Gigabit Ethernet ipw* at pci? dev ? function ? # Intel PRO/Wireless 2100 iwi* at pci? dev ? function ? # Intel PRO/Wireless 2200BG
CVS commit: src/sys/dev/ic
Module Name:src Committed By: mlelstv Date: Wed Apr 24 23:39:23 UTC 2019 Modified Files: src/sys/dev/ic: nvme.c nvmevar.h Log Message: Expose device type. You can query it with e.g. drvctl -p ld0 disk-info/type. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/dev/ic/nvme.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/ic/nvmevar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/nvme.c diff -u src/sys/dev/ic/nvme.c:1.41 src/sys/dev/ic/nvme.c:1.42 --- src/sys/dev/ic/nvme.c:1.41 Sat Dec 1 15:07:58 2018 +++ src/sys/dev/ic/nvme.c Wed Apr 24 23:39:23 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: nvme.c,v 1.41 2018/12/01 15:07:58 jdolecek Exp $ */ +/* $NetBSD: nvme.c,v 1.42 2019/04/24 23:39:23 mlelstv Exp $ */ /* $OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.41 2018/12/01 15:07:58 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.42 2019/04/24 23:39:23 mlelstv Exp $"); #include #include @@ -479,6 +479,7 @@ nvme_rescan(device_t self, const char *a naa.naa_nsid = i + 1; naa.naa_qentries = (ioq_entries - 1) * sc->sc_nq; naa.naa_maxphys = sc->sc_mdts; + naa.naa_typename = sc->sc_modelname; sc->sc_namespaces[i].dev = config_found(sc->sc_dev, , nvme_print); } @@ -1449,6 +1450,8 @@ nvme_identify(struct nvme_softc *sc, u_i aprint_normal_dev(sc->sc_dev, "%s, firmware %s, serial %s\n", mn, fr, sn); + strlcpy(sc->sc_modelname, mn, sizeof(sc->sc_modelname)); + if (sc->sc_identify.mdts > 0) { mdts = (1 << sc->sc_identify.mdts) * (1 << mps); if (mdts < sc->sc_mdts) Index: src/sys/dev/ic/nvmevar.h diff -u src/sys/dev/ic/nvmevar.h:1.18 src/sys/dev/ic/nvmevar.h:1.19 --- src/sys/dev/ic/nvmevar.h:1.18 Sat Dec 1 15:07:58 2018 +++ src/sys/dev/ic/nvmevar.h Wed Apr 24 23:39:23 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: nvmevar.h,v 1.18 2018/12/01 15:07:58 jdolecek Exp $ */ +/* $NetBSD: nvmevar.h,v 1.19 2019/04/24 23:39:23 mlelstv Exp $ */ /* $OpenBSD: nvmevar.h,v 1.8 2016/04/14 11:18:32 dlg Exp $ */ /* @@ -139,6 +139,8 @@ struct nvme_softc { uint32_t sc_quirks; #define NVME_QUIRK_DELAY_B4_CHK_RDY __BIT(0) + + char sc_modelname[81]; }; #define lemtoh16(p) le16toh(*((uint16_t *)(p))) @@ -152,6 +154,7 @@ struct nvme_attach_args { uint16_t naa_nsid; uint32_t naa_qentries; /* total number of queue slots */ uint32_t naa_maxphys; /* maximum device transfer size */ + const char *naa_typename; /* identifier */ }; int nvme_attach(struct nvme_softc *);
CVS commit: src/lib/libpthread
Module Name:src Committed By: kamil Date: Wed Apr 24 21:41:15 UTC 2019 Modified Files: src/lib/libpthread: call_once.c Log Message: Drop error path from C11 call_once The original implementation of C11 threads(3) contained check for error paths, but it was stripped in the calls that are documented to return no status from an operation. Do the same in call_once(3). To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libpthread/call_once.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libpthread/call_once.c diff -u src/lib/libpthread/call_once.c:1.1 src/lib/libpthread/call_once.c:1.2 --- src/lib/libpthread/call_once.c:1.1 Wed Apr 24 11:43:19 2019 +++ src/lib/libpthread/call_once.c Wed Apr 24 21:41:15 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: call_once.c,v 1.1 2019/04/24 11:43:19 kamil Exp $ */ +/* $NetBSD: call_once.c,v 1.2 2019/04/24 21:41:15 kamil Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -30,12 +30,10 @@ */ #include -__RCSID("$NetBSD: call_once.c,v 1.1 2019/04/24 11:43:19 kamil Exp $"); +__RCSID("$NetBSD: call_once.c,v 1.2 2019/04/24 21:41:15 kamil Exp $"); #include -#include #include -#include #include void @@ -45,8 +43,8 @@ call_once(once_flag *flag, void (*func)( _DIAGASSERT(flag != NULL); _DIAGASSERT(func != NULL); - /* The call_once(3) function returns no value, this forces this code to - * break as there is nothing better available. */ - if (pthread_once(flag, func) != 0) - errx(EXIT_FAILURE, "pthread_once failed"); + /* + * The call_once(3) function that conforms to C11 returns no value. + */ + (void)pthread_once(flag, func); }
CVS commit: src/sys/conf
Module Name:src Committed By: christos Date: Wed Apr 24 20:53:10 UTC 2019 Modified Files: src/sys/conf: dts.mk Log Message: change -h to -n because it is more "portable" To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/conf/dts.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/conf/dts.mk diff -u src/sys/conf/dts.mk:1.11 src/sys/conf/dts.mk:1.12 --- src/sys/conf/dts.mk:1.11 Tue Apr 23 09:36:42 2019 +++ src/sys/conf/dts.mk Wed Apr 24 16:53:10 2019 @@ -1,4 +1,4 @@ -# $NetBSD: dts.mk,v 1.11 2019/04/23 13:36:42 christos Exp $ +# $NetBSD: dts.mk,v 1.12 2019/04/24 20:53:10 christos Exp $ DTSARCH?=${MACHINE_CPU} DTSGNUARCH?=${DTSARCH} @@ -8,7 +8,7 @@ DTSPADDING?=1024 .BEGIN:: -@mkdir -p dts .for _arch in ${DTSGNUARCH} - -@ln -shf ${S:S@^../@../../@}/external/gpl2/dts/dist/arch/${_arch}/boot/dts dts/${_arch} + -@ln -snf ${S:S@^../@../../@}/external/gpl2/dts/dist/arch/${_arch}/boot/dts dts/${_arch} .endfor .endif
CVS commit: src/lib/libpthread
Module Name:src Committed By: kamil Date: Wed Apr 24 18:47:54 UTC 2019 Modified Files: src/lib/libpthread: thrd.3 thrd.c threads.h Log Message: Introduce minor changes to the C11 threading library Switch tss_t type from int to pthread_key_t (no functional change as pthread_key_t was already typedefed as int). Noted by . Use C11 _Noreturn in thrd_exit(3) instead of NetBSD specific __dead. The former is documented in the standard as an attribute of thrd_exit(3), the latter is more portable to pre-C11 compilers, however C11 thread support library needs C11 compiler for TLS anyway. __dead made a little bit more point 3 years ago than today as 3 years ago pre-C11 compilers were more common. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libpthread/thrd.3 src/lib/libpthread/thrd.c \ src/lib/libpthread/threads.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libpthread/thrd.3 diff -u src/lib/libpthread/thrd.3:1.1 src/lib/libpthread/thrd.3:1.2 --- src/lib/libpthread/thrd.3:1.1 Wed Apr 24 11:43:19 2019 +++ src/lib/libpthread/thrd.3 Wed Apr 24 18:47:54 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: thrd.3,v 1.1 2019/04/24 11:43:19 kamil Exp $ +.\" $NetBSD: thrd.3,v 1.2 2019/04/24 18:47:54 kamil Exp $ .\" .\" Copyright (c) 2016 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -46,7 +46,7 @@ .Fn thrd_detach "thrd_t thr" .Ft int .Fn thrd_equal "thrd_t t1" "thrd_t t2" -.Ft __dead void +.Ft _Noreturn void .Fn thrd_exit "int res" .Ft int .Fn thrd_join "thrd_t thr" "int *res" @@ -191,14 +191,6 @@ otherwise it will return non-zero. The .Fn thrd_exit function does not return. -The standard attributes this function with the -.Dv _Noreturn -keyword, -however in the -.Nx -version it is attributed with the traditional and functionally equivalent -.Dv __dead -keyword. .Pp The .Fn thrd_join Index: src/lib/libpthread/thrd.c diff -u src/lib/libpthread/thrd.c:1.1 src/lib/libpthread/thrd.c:1.2 --- src/lib/libpthread/thrd.c:1.1 Wed Apr 24 11:43:19 2019 +++ src/lib/libpthread/thrd.c Wed Apr 24 18:47:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: thrd.c,v 1.1 2019/04/24 11:43:19 kamil Exp $ */ +/* $NetBSD: thrd.c,v 1.2 2019/04/24 18:47:54 kamil Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: thrd.c,v 1.1 2019/04/24 11:43:19 kamil Exp $"); +__RCSID("$NetBSD: thrd.c,v 1.2 2019/04/24 18:47:54 kamil Exp $"); #include #include @@ -85,7 +85,7 @@ thrd_equal(thrd_t t1, thrd_t t2) return pthread_equal(t1, t2); } -__dead void +_Noreturn void thrd_exit(int res) { Index: src/lib/libpthread/threads.h diff -u src/lib/libpthread/threads.h:1.1 src/lib/libpthread/threads.h:1.2 --- src/lib/libpthread/threads.h:1.1 Wed Apr 24 11:43:19 2019 +++ src/lib/libpthread/threads.h Wed Apr 24 18:47:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: threads.h,v 1.1 2019/04/24 11:43:19 kamil Exp $ */ +/* $NetBSD: threads.h,v 1.2 2019/04/24 18:47:54 kamil Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ /* ISO/IEC 9899:201x 7.26.1/4 */ typedef pthread_cond_t cnd_t; typedef pthread_t thrd_t; -typedef int tss_t; +typedef pthread_key_t tss_t; typedef pthread_mutex_t mtx_t; typedef void (*tss_dtor_t) (void *); typedef int (*thrd_start_t) (void *); @@ -106,7 +106,7 @@ int thrd_create(thrd_t *, thrd_start_t, thrd_t thrd_current(void); int thrd_detach(thrd_t); int thrd_equal(thrd_t, thrd_t); -void thrd_exit(int) __dead; +_Noreturn void thrd_exit(int); int thrd_join(thrd_t, int *); int thrd_sleep(const struct timespec *, struct timespec *); void thrd_yield(void);
CVS commit: src/sys/dev/nvmm/x86
Module Name:src Committed By: maxv Date: Wed Apr 24 18:45:15 UTC 2019 Modified Files: src/sys/dev/nvmm/x86: nvmm_x86_svmfunc.S nvmm_x86_vmxfunc.S Log Message: Match the structure order, for better cache utilization. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S cvs rdiff -u -r1.1 -r1.2 src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.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/dev/nvmm/x86/nvmm_x86_svmfunc.S diff -u src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S:1.2 src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S:1.3 --- src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S:1.2 Thu Jan 10 06:58:36 2019 +++ src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S Wed Apr 24 18:45:15 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: nvmm_x86_svmfunc.S,v 1.2 2019/01/10 06:58:36 maxv Exp $ */ +/* $NetBSD: nvmm_x86_svmfunc.S,v 1.3 2019/04/24 18:45:15 maxv Exp $ */ /* * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -97,9 +97,12 @@ */ #define GUEST_SAVE_GPRS(reg)\ - movq %rbx,(NVMM_X64_GPR_RBX * 8)(reg) ;\ movq %rcx,(NVMM_X64_GPR_RCX * 8)(reg) ;\ movq %rdx,(NVMM_X64_GPR_RDX * 8)(reg) ;\ + movq %rbx,(NVMM_X64_GPR_RBX * 8)(reg) ;\ + movq %rbp,(NVMM_X64_GPR_RBP * 8)(reg) ;\ + movq %rsi,(NVMM_X64_GPR_RSI * 8)(reg) ;\ + movq %rdi,(NVMM_X64_GPR_RDI * 8)(reg) ;\ movq %r8,(NVMM_X64_GPR_R8 * 8)(reg) ;\ movq %r9,(NVMM_X64_GPR_R9 * 8)(reg) ;\ movq %r10,(NVMM_X64_GPR_R10 * 8)(reg) ;\ @@ -107,15 +110,15 @@ movq %r12,(NVMM_X64_GPR_R12 * 8)(reg) ;\ movq %r13,(NVMM_X64_GPR_R13 * 8)(reg) ;\ movq %r14,(NVMM_X64_GPR_R14 * 8)(reg) ;\ - movq %r15,(NVMM_X64_GPR_R15 * 8)(reg) ;\ - movq %rbp,(NVMM_X64_GPR_RBP * 8)(reg) ;\ - movq %rdi,(NVMM_X64_GPR_RDI * 8)(reg) ;\ - movq %rsi,(NVMM_X64_GPR_RSI * 8)(reg) + movq %r15,(NVMM_X64_GPR_R15 * 8)(reg) #define GUEST_RESTORE_GPRS(reg)\ - movq (NVMM_X64_GPR_RBX * 8)(reg),%rbx ;\ movq (NVMM_X64_GPR_RCX * 8)(reg),%rcx ;\ movq (NVMM_X64_GPR_RDX * 8)(reg),%rdx ;\ + movq (NVMM_X64_GPR_RBX * 8)(reg),%rbx ;\ + movq (NVMM_X64_GPR_RBP * 8)(reg),%rbp ;\ + movq (NVMM_X64_GPR_RSI * 8)(reg),%rsi ;\ + movq (NVMM_X64_GPR_RDI * 8)(reg),%rdi ;\ movq (NVMM_X64_GPR_R8 * 8)(reg),%r8 ;\ movq (NVMM_X64_GPR_R9 * 8)(reg),%r9 ;\ movq (NVMM_X64_GPR_R10 * 8)(reg),%r10 ;\ @@ -123,10 +126,7 @@ movq (NVMM_X64_GPR_R12 * 8)(reg),%r12 ;\ movq (NVMM_X64_GPR_R13 * 8)(reg),%r13 ;\ movq (NVMM_X64_GPR_R14 * 8)(reg),%r14 ;\ - movq (NVMM_X64_GPR_R15 * 8)(reg),%r15 ;\ - movq (NVMM_X64_GPR_RBP * 8)(reg),%rbp ;\ - movq (NVMM_X64_GPR_RDI * 8)(reg),%rdi ;\ - movq (NVMM_X64_GPR_RSI * 8)(reg),%rsi + movq (NVMM_X64_GPR_R15 * 8)(reg),%r15 /* * %rdi = PA of VMCB Index: src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S diff -u src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S:1.1 src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S:1.2 --- src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S:1.1 Wed Feb 13 16:03:16 2019 +++ src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S Wed Apr 24 18:45:15 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: nvmm_x86_vmxfunc.S,v 1.1 2019/02/13 16:03:16 maxv Exp $ */ +/* $NetBSD: nvmm_x86_vmxfunc.S,v 1.2 2019/04/24 18:45:15 maxv Exp $ */ /* * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -225,9 +225,12 @@ END(_vmx_vmclear) */ #define GUEST_SAVE_GPRS(reg)\ - movq %rbx,(NVMM_X64_GPR_RBX * 8)(reg) ;\ movq %rcx,(NVMM_X64_GPR_RCX * 8)(reg) ;\ movq %rdx,(NVMM_X64_GPR_RDX * 8)(reg) ;\ + movq %rbx,(NVMM_X64_GPR_RBX * 8)(reg) ;\ + movq %rbp,(NVMM_X64_GPR_RBP * 8)(reg) ;\ + movq %rsi,(NVMM_X64_GPR_RSI * 8)(reg) ;\ + movq %rdi,(NVMM_X64_GPR_RDI * 8)(reg) ;\ movq %r8,(NVMM_X64_GPR_R8 * 8)(reg) ;\ movq %r9,(NVMM_X64_GPR_R9 * 8)(reg) ;\ movq %r10,(NVMM_X64_GPR_R10 * 8)(reg) ;\ @@ -235,15 +238,15 @@ END(_vmx_vmclear) movq %r12,(NVMM_X64_GPR_R12 * 8)(reg) ;\ movq %r13,(NVMM_X64_GPR_R13 * 8)(reg) ;\ movq %r14,(NVMM_X64_GPR_R14 * 8)(reg) ;\ - movq %r15,(NVMM_X64_GPR_R15 * 8)(reg) ;\ - movq %rbp,(NVMM_X64_GPR_RBP * 8)(reg) ;\ - movq %rdi,(NVMM_X64_GPR_RDI * 8)(reg) ;\ - movq %rsi,(NVMM_X64_GPR_RSI * 8)(reg) + movq %r15,(NVMM_X64_GPR_R15 * 8)(reg) #define GUEST_RESTORE_GPRS(reg)\ - movq (NVMM_X64_GPR_RBX * 8)(reg),%rbx ;\ movq (NVMM_X64_GPR_RCX * 8)(reg),%rcx ;\ movq (NVMM_X64_GPR_RDX * 8)(reg),%rdx ;\ + movq (NVMM_X64_GPR_RBX * 8)(reg),%rbx ;\ + movq (NVMM_X64_GPR_RBP * 8)(reg),%rbp ;\ + movq (NVMM_X64_GPR_RSI * 8)(reg),%rsi ;\ + movq (NVMM_X64_GPR_RDI * 8)(reg),%rdi ;\ movq (NVMM_X64_GPR_R8 * 8)(reg),%r8 ;\ movq (NVMM_X64_GPR_R9 * 8)(reg),%r9 ;\ movq (NVMM_X64_GPR_R10 * 8)(reg),%r10 ;\ @@ -252,9 +255,6 @@ END(_vmx_vmclear) movq (NVMM_X64_GPR_R13 * 8)(reg),%r13 ;\ movq (NVMM_X64_GPR_R14 * 8)(reg),%r14 ;\ movq (NVMM_X64_GPR_R15 * 8)(reg),%r15 ;\ - movq (NVMM_X64_GPR_RBP * 8)(reg),%rbp ;\ - movq (NVMM_X64_GPR_RDI * 8)(reg),%rdi ;\ - movq (NVMM_X64_GPR_RSI * 8)(reg),%rsi ;\ movq (NVMM_X64_GPR_RAX * 8)(reg),%rax /*
CVS commit: src/sys/dev/nvmm
Module Name:src Committed By: maxv Date: Wed Apr 24 18:19:28 UTC 2019 Modified Files: src/sys/dev/nvmm: nvmm.h src/sys/dev/nvmm/x86: nvmm_x86_svm.c nvmm_x86_vmx.c Log Message: Provide the hardware error code for NVMM_EXIT_INVALID, useful when debugging. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/dev/nvmm/nvmm.h cvs rdiff -u -r1.39 -r1.40 src/sys/dev/nvmm/x86/nvmm_x86_svm.c cvs rdiff -u -r1.26 -r1.27 src/sys/dev/nvmm/x86/nvmm_x86_vmx.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/nvmm/nvmm.h diff -u src/sys/dev/nvmm/nvmm.h:1.5 src/sys/dev/nvmm/nvmm.h:1.6 --- src/sys/dev/nvmm/nvmm.h:1.5 Thu Mar 21 20:21:40 2019 +++ src/sys/dev/nvmm/nvmm.h Wed Apr 24 18:19:28 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: nvmm.h,v 1.5 2019/03/21 20:21:40 maxv Exp $ */ +/* $NetBSD: nvmm.h,v 1.6 2019/04/24 18:19:28 maxv Exp $ */ /* * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -103,6 +103,10 @@ struct nvmm_exit_insn { uint64_t npc; }; +struct nvmm_exit_invalid { + uint64_t hwcode; +}; + struct nvmm_exit { enum nvmm_exit_reason reason; union { @@ -110,6 +114,7 @@ struct nvmm_exit { struct nvmm_exit_io io; struct nvmm_exit_msr msr; struct nvmm_exit_insn insn; + struct nvmm_exit_invalid inv; } u; uint64_t exitstate[8]; }; Index: src/sys/dev/nvmm/x86/nvmm_x86_svm.c diff -u src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.39 src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.40 --- src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.39 Sat Apr 20 08:45:30 2019 +++ src/sys/dev/nvmm/x86/nvmm_x86_svm.c Wed Apr 24 18:19:28 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: nvmm_x86_svm.c,v 1.39 2019/04/20 08:45:30 maxv Exp $ */ +/* $NetBSD: nvmm_x86_svm.c,v 1.40 2019/04/24 18:19:28 maxv Exp $ */ /* * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.39 2019/04/20 08:45:30 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.40 2019/04/24 18:19:28 maxv Exp $"); #include #include @@ -1118,6 +1118,13 @@ error: svm_inject_gp(mach, vcpu); } +static void +svm_exit_invalid(struct nvmm_exit *exit, uint64_t code) +{ + exit->u.inv.hwcode = code; + exit->reason = NVMM_EXIT_INVALID; +} + /* -- */ static void @@ -1364,7 +1371,7 @@ svm_vcpu_run(struct nvmm_machine *mach, break; case VMCB_EXITCODE_FERR_FREEZE: /* ? */ default: - exit->reason = NVMM_EXIT_INVALID; + svm_exit_invalid(exit, vmcb->ctrl.exitcode); break; } Index: src/sys/dev/nvmm/x86/nvmm_x86_vmx.c diff -u src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.26 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.27 --- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.26 Sat Apr 20 08:45:30 2019 +++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c Wed Apr 24 18:19:28 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: nvmm_x86_vmx.c,v 1.26 2019/04/20 08:45:30 maxv Exp $ */ +/* $NetBSD: nvmm_x86_vmx.c,v 1.27 2019/04/24 18:19:28 maxv Exp $ */ /* * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.26 2019/04/20 08:45:30 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.27 2019/04/24 18:19:28 maxv Exp $"); #include #include @@ -1623,6 +1623,13 @@ vmx_exit_epf(struct nvmm_machine *mach, exit->u.mem.inst_len = 0; } +static void +vmx_exit_invalid(struct nvmm_exit *exit, uint64_t code) +{ + exit->u.inv.hwcode = code; + exit->reason = NVMM_EXIT_INVALID; +} + /* -- */ static void @@ -1917,7 +1924,7 @@ vmx_vcpu_run(struct nvmm_machine *mach, exit->reason = NVMM_EXIT_NMI_READY; break; default: - exit->reason = NVMM_EXIT_INVALID; + vmx_exit_invalid(exit, exitcode); break; }
CVS commit: src/bin/pax
Module Name:src Committed By: cheusov Date: Wed Apr 24 17:27:08 UTC 2019 Modified Files: src/bin/pax: pax.c Log Message: Fix compilation failure with gcc-8. Equal pointers to 'struct sigaction' should not be passed to sigaction(2). So, we pass NULL as an "old sigaction" structure. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/bin/pax/pax.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/pax/pax.c diff -u src/bin/pax/pax.c:1.48 src/bin/pax/pax.c:1.49 --- src/bin/pax/pax.c:1.48 Mon Oct 2 21:55:35 2017 +++ src/bin/pax/pax.c Wed Apr 24 17:27:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pax.c,v 1.48 2017/10/02 21:55:35 joerg Exp $ */ +/* $NetBSD: pax.c,v 1.49 2019/04/24 17:27:08 cheusov Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -44,7 +44,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19 #if 0 static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94"; #else -__RCSID("$NetBSD: pax.c,v 1.48 2017/10/02 21:55:35 joerg Exp $"); +__RCSID("$NetBSD: pax.c,v 1.49 2019/04/24 17:27:08 cheusov Exp $"); #endif #endif /* not lint */ @@ -453,28 +453,28 @@ gen_init(void) if ((sigaction(SIGHUP, _hand, _hand) < 0) && (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGHUP, _hand, _hand) < 0)) + (sigaction(SIGHUP, _hand, NULL) < 0)) goto out; if ((sigaction(SIGTERM, _hand, _hand) < 0) && (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGTERM, _hand, _hand) < 0)) + (sigaction(SIGTERM, _hand, NULL) < 0)) goto out; if ((sigaction(SIGINT, _hand, _hand) < 0) && (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGINT, _hand, _hand) < 0)) + (sigaction(SIGINT, _hand, NULL) < 0)) goto out; if ((sigaction(SIGQUIT, _hand, _hand) < 0) && (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGQUIT, _hand, _hand) < 0)) + (sigaction(SIGQUIT, _hand, NULL) < 0)) goto out; #ifdef SIGXCPU if ((sigaction(SIGXCPU, _hand, _hand) < 0) && (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGXCPU, _hand, _hand) < 0)) + (sigaction(SIGXCPU, _hand, NULL) < 0)) goto out; #endif n_hand.sa_handler = SIG_IGN;
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: christos Date: Wed Apr 24 15:12:09 UTC 2019 Modified Files: src/tests/lib/libc/gen: Makefile Log Message: PR/54000: Andreag Gustafsson: Compile the rounding test with -fround-math since with gcc-7, the default mode ignores fenv settings (the same effect can be achieved with -O0 :-) https://gcc.gnu.org/wiki/FloatingPointMath To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/tests/lib/libc/gen/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/gen/Makefile diff -u src/tests/lib/libc/gen/Makefile:1.51 src/tests/lib/libc/gen/Makefile:1.52 --- src/tests/lib/libc/gen/Makefile:1.51 Wed Feb 8 22:27:07 2017 +++ src/tests/lib/libc/gen/Makefile Wed Apr 24 11:12:09 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.51 2017/02/09 03:27:07 christos Exp $ +# $NetBSD: Makefile,v 1.52 2019/04/24 15:12:09 christos Exp $ .include @@ -40,6 +40,7 @@ TESTS_C+= t_ttyname TESTS_C+= t_vis CPPFLAGS.t_siginfo.c+=-D__TEST_FENV +COPTS.t_fpsetround.c+=-frounding-math LDADD.t_siginfo+= -lm DPADD.t_siginfo+= ${LIBM}
CVS commit: src/doc
Module Name:src Committed By: kamil Date: Wed Apr 24 15:04:51 UTC 2019 Modified Files: src/doc: CHANGES Log Message: libpthread(3): Import C11 thread support library To generate a diff of this commit: cvs rdiff -u -r1.2528 -r1.2529 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.2528 src/doc/CHANGES:1.2529 --- src/doc/CHANGES:1.2528 Sun Apr 21 22:32:12 2019 +++ src/doc/CHANGES Wed Apr 24 15:04:51 2019 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2528 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2529 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -360,3 +360,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0: OpenSSH: Import 8.0 [christos 20180420] evbarm: Add support for boot configuration (efiboot.plist) and applying device tree overlays to efiboot. [thorpej 20190421] + libpthread(3): Import C11 thread support library [kamil 20190424]
CVS commit: src/external/bsd/jemalloc/dist/src
Module Name:src Committed By: christos Date: Wed Apr 24 14:34:22 UTC 2019 Modified Files: src/external/bsd/jemalloc/dist/src: pages.c tsd.c Log Message: Allow os_page sizes greater than the built-in page size. This can happen for example for COMPAT_NETBSD32 sparc binaries (4K page size because of MIN_PAGE_SIZE), running on sparc64 (8K pages). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/dist/src/pages.c cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/tsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/jemalloc/dist/src/pages.c diff -u src/external/bsd/jemalloc/dist/src/pages.c:1.2 src/external/bsd/jemalloc/dist/src/pages.c:1.3 --- src/external/bsd/jemalloc/dist/src/pages.c:1.2 Sat Mar 16 18:14:08 2019 +++ src/external/bsd/jemalloc/dist/src/pages.c Wed Apr 24 10:34:21 2019 @@ -55,8 +55,8 @@ static void os_pages_unmap(void *addr, s static void * os_pages_map(void *addr, size_t size, size_t alignment, bool *commit) { - assert(ALIGNMENT_ADDR2BASE(addr, os_page) == addr); - assert(ALIGNMENT_CEILING(size, os_page) == size); + assert(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, os_page) == addr); + assert(os_page != PAGE || ALIGNMENT_CEILING(size, os_page) == size); assert(size != 0); if (os_overcommits) { @@ -135,8 +135,8 @@ os_pages_trim(void *addr, size_t alloc_s static void os_pages_unmap(void *addr, size_t size) { - assert(ALIGNMENT_ADDR2BASE(addr, os_page) == addr); - assert(ALIGNMENT_CEILING(size, os_page) == size); + assert(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, os_page) == addr); + assert(os_page != PAGE || ALIGNMENT_CEILING(size, os_page) == size); #ifdef _WIN32 if (VirtualFree(addr, 0, MEM_RELEASE) == 0) @@ -187,7 +187,7 @@ pages_map_slow(size_t size, size_t align void * pages_map(void *addr, size_t size, size_t alignment, bool *commit) { assert(alignment >= PAGE); - assert(ALIGNMENT_ADDR2BASE(addr, alignment) == addr); + assert(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, alignment) == addr); /* * Ideally, there would be a way to specify alignment to mmap() (like @@ -570,7 +570,7 @@ label_error: bool pages_boot(void) { os_page = os_page_detect(); - if (os_page > PAGE) { + if (os_page < PAGE) { malloc_write(": Unsupported system page size\n"); if (opt_abort) { abort(); Index: src/external/bsd/jemalloc/dist/src/tsd.c diff -u src/external/bsd/jemalloc/dist/src/tsd.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/tsd.c:1.2 --- src/external/bsd/jemalloc/dist/src/tsd.c:1.1.1.1 Mon Mar 4 12:10:23 2019 +++ src/external/bsd/jemalloc/dist/src/tsd.c Wed Apr 24 10:34:21 2019 @@ -39,7 +39,10 @@ struct tsd_init_head_s { pthread_key_t tsd_tsd; tsd_init_head_t tsd_init_head = { ql_head_initializer(blocks), +#ifndef __lint__ + // XXX: broken lint MALLOC_MUTEX_INITIALIZER +#endif }; tsd_wrapper_t tsd_boot_wrapper = { false,
CVS commit: src/share/misc
Module Name:src Committed By: sevan Date: Wed Apr 24 14:15:35 UTC 2019 Modified Files: src/share/misc: acronyms.comp Log Message: RFU To generate a diff of this commit: cvs rdiff -u -r1.248 -r1.249 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/misc/acronyms.comp diff -u src/share/misc/acronyms.comp:1.248 src/share/misc/acronyms.comp:1.249 --- src/share/misc/acronyms.comp:1.248 Mon Apr 22 12:27:50 2019 +++ src/share/misc/acronyms.comp Wed Apr 24 14:15:35 2019 @@ -1,4 +1,4 @@ -$NetBSD: acronyms.comp,v 1.248 2019/04/22 12:27:50 sevan Exp $ +$NetBSD: acronyms.comp,v 1.249 2019/04/24 14:15:35 sevan Exp $ 3WHS three-way handshake 8VSB 8-state vestigial side band modulation AA anti-aliasing @@ -1220,6 +1220,7 @@ REST representational state transfer RF radio frequency RFI radio frequency interference RFO request for ownership +RFU reserved for future use RGB red green blue RGBA red green blue alpha RGMII reduced gigabit media independent interface
CVS commit: [isaki-audio2] src/sys/dev/bluetooth
Module Name:src Committed By: isaki Date: Wed Apr 24 13:30:34 UTC 2019 Modified Files: src/sys/dev/bluetooth [isaki-audio2]: btsco.c Log Message: Adapt to audio2. To generate a diff of this commit: cvs rdiff -u -r1.38.2.1 -r1.38.2.2 src/sys/dev/bluetooth/btsco.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/bluetooth/btsco.c diff -u src/sys/dev/bluetooth/btsco.c:1.38.2.1 src/sys/dev/bluetooth/btsco.c:1.38.2.2 --- src/sys/dev/bluetooth/btsco.c:1.38.2.1 Sun Apr 21 05:11:22 2019 +++ src/sys/dev/bluetooth/btsco.c Wed Apr 24 13:30:34 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: btsco.c,v 1.38.2.1 2019/04/21 05:11:22 isaki Exp $ */ +/* $NetBSD: btsco.c,v 1.38.2.2 2019/04/24 13:30:34 isaki Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: btsco.c,v 1.38.2.1 2019/04/21 05:11:22 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: btsco.c,v 1.38.2.2 2019/04/24 13:30:34 isaki Exp $"); #include #include @@ -55,8 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: btsco.c,v 1. #include #include -#include -#include #include #include @@ -149,9 +147,10 @@ CFATTACH_DECL_NEW(btsco, sizeof(struct b /* audio(9) glue */ static int btsco_open(void *, int); static void btsco_close(void *); -static int btsco_query_encoding(void *, struct audio_encoding *); -static int btsco_set_params(void *, int, int, audio_params_t *, audio_params_t *, -stream_filter_list_t *, stream_filter_list_t *); +static int btsco_query_format(void *, audio_format_query_t *); +static int btsco_set_format(void *, int, +const audio_params_t *, const audio_params_t *, +audio_filter_reg_t *, audio_filter_reg_t *); static int btsco_round_blocksize(void *, int, int, const audio_params_t *); static int btsco_start_output(void *, void *, int, void (*)(void *), void *); static int btsco_start_input(void *, void *, int, void (*)(void *), void *); @@ -171,8 +170,8 @@ static void btsco_get_locks(void *, kmut static const struct audio_hw_if btsco_if = { .open = btsco_open, .close = btsco_close, - .query_encoding = btsco_query_encoding, - .set_params = btsco_set_params, + .query_format = btsco_query_format, + .set_format = btsco_set_format, .round_blocksize = btsco_round_blocksize, .start_output = btsco_start_output, .start_input = btsco_start_input, @@ -686,58 +685,19 @@ btsco_close(void *hdl) } static int -btsco_query_encoding(void *hdl, struct audio_encoding *ae) +btsco_query_format(void *hdl, audio_format_query_t *afp) { -/* struct btsco_softc *sc = hdl; */ - int err = 0; - switch (ae->index) { - case 0: - strcpy(ae->name, AudioEslinear_le); - ae->encoding = AUDIO_ENCODING_SLINEAR_LE; - ae->precision = 16; - ae->flags = 0; - break; - - default: - err = EINVAL; - } - - return err; + return audio_query_format(_format, 1, afp); } static int -btsco_set_params(void *hdl, int setmode, int usemode, - audio_params_t *play, audio_params_t *rec, - stream_filter_list_t *pfil, stream_filter_list_t *rfil) +btsco_set_format(void *hdl, int setmode, + const audio_params_t *play, const audio_params_t *rec, + audio_filter_reg_t *pfil, audio_filter_reg_t *rfil) { -/* struct btsco_softc *sc = hdl; */ - const struct audio_format *f; - int rv; - - DPRINTF("setmode 0x%x usemode 0x%x\n", setmode, usemode); - DPRINTF("rate %d, precision %d, channels %d encoding %d\n", - play->sample_rate, play->precision, play->channels, play->encoding); - - /* - * If we had a list of formats, we could check the HCI_Voice_Setting - * and select the appropriate one to use. Currently only one is - * supported: 0x0060 == 8000Hz, mono, 16-bit, slinear_le - */ - f = _format; - - if (setmode & AUMODE_PLAY) { - rv = auconv_set_converter(f, 1, AUMODE_PLAY, play, TRUE, pfil); - if (rv < 0) - return EINVAL; - } - - if (setmode & AUMODE_RECORD) { - rv = auconv_set_converter(f, 1, AUMODE_RECORD, rec, TRUE, rfil); - if (rv < 0) - return EINVAL; - } + /* We have only one format so nothing to do here. */ return 0; }
CVS commit: [isaki-audio2] src/sys/arch
Module Name:src Committed By: isaki Date: Wed Apr 24 13:03:07 UTC 2019 Modified Files: src/sys/arch/arm/xscale [isaki-audio2]: pxa2x0_i2s.c pxa2x0_i2s.h src/sys/arch/zaurus/dev [isaki-audio2]: wm8731_zaudio.c wm8750_zaudio.c zaudio.c zaudiovar.h Log Message: Adapt zaudio family to audio2. - wm8731 and wm8750 can share zaudio_formats[]. - Drop INDEPENDENT property. These share sample rate in play and rec. - pxa2x0_i2s_setspeed() no longer needs to writeback sample rate. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.12.12.1 src/sys/arch/arm/xscale/pxa2x0_i2s.c cvs rdiff -u -r1.5 -r1.5.40.1 src/sys/arch/arm/xscale/pxa2x0_i2s.h cvs rdiff -u -r1.2 -r1.2.4.1 src/sys/arch/zaurus/dev/wm8731_zaudio.c cvs rdiff -u -r1.2.4.1 -r1.2.4.2 src/sys/arch/zaurus/dev/wm8750_zaudio.c cvs rdiff -u -r1.21 -r1.21.22.1 src/sys/arch/zaurus/dev/zaudio.c cvs rdiff -u -r1.2 -r1.2.22.1 src/sys/arch/zaurus/dev/zaudiovar.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/xscale/pxa2x0_i2s.c diff -u src/sys/arch/arm/xscale/pxa2x0_i2s.c:1.12 src/sys/arch/arm/xscale/pxa2x0_i2s.c:1.12.12.1 --- src/sys/arch/arm/xscale/pxa2x0_i2s.c:1.12 Thu Jun 1 02:45:06 2017 +++ src/sys/arch/arm/xscale/pxa2x0_i2s.c Wed Apr 24 13:03:06 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pxa2x0_i2s.c,v 1.12 2017/06/01 02:45:06 chs Exp $ */ +/* $NetBSD: pxa2x0_i2s.c,v 1.12.12.1 2019/04/24 13:03:06 isaki Exp $ */ /* $OpenBSD: pxa2x0_i2s.c,v 1.7 2006/04/04 11:45:40 pascoe Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2s.c,v 1.12 2017/06/01 02:45:06 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2s.c,v 1.12.12.1 2019/04/24 13:03:06 isaki Exp $"); #include #include @@ -140,11 +140,10 @@ pxa2x0_i2s_write(struct pxa2x0_i2s_softc } void -pxa2x0_i2s_setspeed(struct pxa2x0_i2s_softc *sc, u_int *argp) +pxa2x0_i2s_setspeed(struct pxa2x0_i2s_softc *sc, u_int arg) { /* * The available speeds are in the following table. - * Keep the speeds in increasing order. */ static const struct speed_struct { int speed; @@ -158,7 +157,6 @@ pxa2x0_i2s_setspeed(struct pxa2x0_i2s_so {48000, SADIV_3_058MHz}, }; const int n = (int)__arraycount(speed_table); - u_int arg = (u_int)*argp; int selected = -1; int i; @@ -167,25 +165,11 @@ pxa2x0_i2s_setspeed(struct pxa2x0_i2s_so if (arg > speed_table[n - 1].speed) selected = n - 1; - for (i = 1; selected == -1 && i < n; i++) { + for (i = 0; selected == -1 && i < n; i++) { if (speed_table[i].speed == arg) selected = i; - else if (speed_table[i].speed > arg) { - int diff1, diff2; - - diff1 = arg - speed_table[i - 1].speed; - diff2 = speed_table[i].speed - arg; - if (diff1 < diff2) -selected = i - 1; - else -selected = i; - } } - - if (selected == -1) - selected = 0; - - *argp = speed_table[selected].speed; + KASSERT(selected != -1); sc->sc_sadiv = speed_table[selected].div; bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2S_SADIV, sc->sc_sadiv); @@ -275,27 +259,6 @@ pxa2x0_i2s_freem(void *hdl, void *ptr, s panic("pxa2x0_i2s_freem: trying to free unallocated memory"); } -paddr_t -pxa2x0_i2s_mappage(void *hdl, void *mem, off_t off, int prot) -{ - struct pxa2x0_i2s_softc *sc = hdl; - struct pxa2x0_i2s_dma *p; - - if (off < 0) - return -1; - - for (p = sc->sc_dmas; p && p->addr != mem; p = p->next) - continue; - if (p == NULL) - return -1; - - if (off > p->size) - return -1; - - return bus_dmamem_mmap(sc->sc_dmat, p->segs, p->nsegs, off, prot, - BUS_DMA_WAITOK); -} - int pxa2x0_i2s_round_blocksize(void *hdl, int bs, int mode, const struct audio_params *param) Index: src/sys/arch/arm/xscale/pxa2x0_i2s.h diff -u src/sys/arch/arm/xscale/pxa2x0_i2s.h:1.5 src/sys/arch/arm/xscale/pxa2x0_i2s.h:1.5.40.1 --- src/sys/arch/arm/xscale/pxa2x0_i2s.h:1.5 Mon Nov 12 18:00:38 2012 +++ src/sys/arch/arm/xscale/pxa2x0_i2s.h Wed Apr 24 13:03:06 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pxa2x0_i2s.h,v 1.5 2012/11/12 18:00:38 skrll Exp $ */ +/* $NetBSD: pxa2x0_i2s.h,v 1.5.40.1 2019/04/24 13:03:06 isaki Exp $ */ /* $OpenBSD: pxa2x0_i2s.h,v 1.3 2006/04/04 11:45:40 pascoe Exp $ */ /* @@ -59,11 +59,10 @@ void pxa2x0_i2s_open(struct pxa2x0_i2s_s void pxa2x0_i2s_close(struct pxa2x0_i2s_softc *); void pxa2x0_i2s_write(struct pxa2x0_i2s_softc *, uint32_t); -void pxa2x0_i2s_setspeed(struct pxa2x0_i2s_softc *, u_int *); +void pxa2x0_i2s_setspeed(struct pxa2x0_i2s_softc *, u_int); void * pxa2x0_i2s_allocm(void *, int, size_t); void pxa2x0_i2s_freem(void *, void *, size_t); -paddr_t pxa2x0_i2s_mappage(void *, void *, off_t, int); int pxa2x0_i2s_round_blocksize(void *, int, int, const struct audio_params *); size_t pxa2x0_i2s_round_buffersize(void *, int, size_t); int pxa2x0_i2s_halt_output(void *); Index: src/sys/arch/zaurus/dev/wm8731_zaudio.c diff -u
CVS commit: src
Module Name:src Committed By: kamil Date: Wed Apr 24 13:01:52 UTC 2019 Modified Files: src/distrib/sets/lists/base: shl.mi src/distrib/sets/lists/debug: shl.mi src/lib/libpthread: shlib_version Log Message: Bump the libpthread(3) minor number to 4 Added C11 Threading library support. To generate a diff of this commit: cvs rdiff -u -r1.862 -r1.863 src/distrib/sets/lists/base/shl.mi cvs rdiff -u -r1.221 -r1.222 src/distrib/sets/lists/debug/shl.mi cvs rdiff -u -r1.18 -r1.19 src/lib/libpthread/shlib_version 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/base/shl.mi diff -u src/distrib/sets/lists/base/shl.mi:1.862 src/distrib/sets/lists/base/shl.mi:1.863 --- src/distrib/sets/lists/base/shl.mi:1.862 Sat Apr 20 17:24:06 2019 +++ src/distrib/sets/lists/base/shl.mi Wed Apr 24 13:01:52 2019 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.862 2019/04/20 17:24:06 christos Exp $ +# $NetBSD: shl.mi,v 1.863 2019/04/24 13:01:52 kamil Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -476,7 +476,7 @@ ./usr/lib/libprop.so.1.1 base-sys-shlib compatfile ./usr/lib/libpthread.sobase-sys-shlib compatfile ./usr/lib/libpthread.so.1 base-sys-shlib compatfile -./usr/lib/libpthread.so.1.3 base-sys-shlib compatfile +./usr/lib/libpthread.so.1.4 base-sys-shlib compatfile ./usr/lib/libpthread_dbg.so base-obsolete obsolete ./usr/lib/libpthread_dbg.so.2 base-obsolete obsolete ./usr/lib/libpthread_dbg.so.2.0 base-obsolete obsolete Index: src/distrib/sets/lists/debug/shl.mi diff -u src/distrib/sets/lists/debug/shl.mi:1.221 src/distrib/sets/lists/debug/shl.mi:1.222 --- src/distrib/sets/lists/debug/shl.mi:1.221 Sat Apr 20 17:24:06 2019 +++ src/distrib/sets/lists/debug/shl.mi Wed Apr 24 13:01:52 2019 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.221 2019/04/20 17:24:06 christos Exp $ +# $NetBSD: shl.mi,v 1.222 2019/04/24 13:01:52 kamil Exp $ ./usr/lib/libbfd_g.a comp-c-debuglib debuglib,compatfile,binutils ./usr/libdata/debug/lib base-sys-usr debug,dynamicroot,compatdir ./usr/libdata/debug/lib/libblacklist.so.0.0.debug comp-sys-debug debug,dynamicroot @@ -165,7 +165,7 @@ ./usr/libdata/debug/usr/lib/libppath.so.0.0.debug comp-sys-debug debug,compatfile ./usr/libdata/debug/usr/lib/libproc.so.1.0.debug comp-sys-debug debug,dtrace ./usr/libdata/debug/usr/lib/libprop.so.1.1.debug comp-sys-debug debug,compatfile -./usr/libdata/debug/usr/lib/libpthread.so.1.3.debug comp-sys-debug debug,compatfile +./usr/libdata/debug/usr/lib/libpthread.so.1.4.debug comp-sys-debug debug,compatfile ./usr/libdata/debug/usr/lib/libpthread_dbg.so.2.0.debug comp-obsolete obsolete ./usr/libdata/debug/usr/lib/libpuffs.so.2.0.debug comp-puffs-debug debug,compatfile ./usr/libdata/debug/usr/lib/libquota.so.1.0.debug comp-sys-debug debug,compatfile Index: src/lib/libpthread/shlib_version diff -u src/lib/libpthread/shlib_version:1.18 src/lib/libpthread/shlib_version:1.19 --- src/lib/libpthread/shlib_version:1.18 Sun Sep 9 07:24:59 2018 +++ src/lib/libpthread/shlib_version Wed Apr 24 13:01:52 2019 @@ -1,4 +1,4 @@ -# $NetBSD: shlib_version,v 1.18 2018/09/09 07:24:59 maya Exp $ +# $NetBSD: shlib_version,v 1.19 2019/04/24 13:01:52 kamil Exp $ # Remember to update distrib/sets/lists/base/shl.* when changing # # Things to do when bumping major version: @@ -18,5 +18,7 @@ # use reserved identifiers for things that shouldn't be visible, # e.g. rename pthread__pagesize to __pthread_pagesize, # +# remove remnants of libpthread_dbg: pthread__dbg +# major=1 -minor=3 +minor=4
CVS commit: [isaki-audio2] src/sys/arch/macppc/dev
Module Name:src Committed By: isaki Date: Wed Apr 24 12:47:13 UTC 2019 Modified Files: src/sys/arch/macppc/dev [isaki-audio2]: awacs.c Log Message: Adapt to audio2. - Some models don't have SLINEAR_LE but only SLINEAR_BE is enough. To generate a diff of this commit: cvs rdiff -u -r1.46.2.1 -r1.46.2.2 src/sys/arch/macppc/dev/awacs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/macppc/dev/awacs.c diff -u src/sys/arch/macppc/dev/awacs.c:1.46.2.1 src/sys/arch/macppc/dev/awacs.c:1.46.2.2 --- src/sys/arch/macppc/dev/awacs.c:1.46.2.1 Sun Apr 21 05:11:21 2019 +++ src/sys/arch/macppc/dev/awacs.c Wed Apr 24 12:47:13 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: awacs.c,v 1.46.2.1 2019/04/21 05:11:21 isaki Exp $ */ +/* $NetBSD: awacs.c,v 1.46.2.2 2019/04/24 12:47:13 isaki Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awacs.c,v 1.46.2.1 2019/04/21 05:11:21 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awacs.c,v 1.46.2.2 2019/04/24 12:47:13 isaki Exp $"); #include #include @@ -38,9 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: awacs.c,v 1. #include #include -#include #include -#include #include #include @@ -59,12 +57,8 @@ __KERNEL_RCSID(0, "$NetBSD: awacs.c,v 1. # define DPRINTF while (0) printf #endif -/* sc_flags values */ -#define AWACS_CAP_BSWAP 0x0001 - struct awacs_softc { device_t sc_dev; - int sc_flags; bus_space_tag_t sc_tag; bus_space_handle_t sc_regh; bus_space_handle_t sc_idmah; @@ -107,9 +101,6 @@ struct awacs_softc { struct dbdma_command *sc_odmacmd; struct dbdma_command *sc_idmacmd; -#define AWACS_NFORMATS 2 - struct audio_format sc_formats[AWACS_NFORMATS]; - kmutex_t sc_lock; kmutex_t sc_intr_lock; }; @@ -120,9 +111,10 @@ static int awacs_intr(void *); static int awacs_status_intr(void *); static void awacs_close(void *); -static int awacs_query_encoding(void *, struct audio_encoding *); -static int awacs_set_params(void *, int, int, audio_params_t *, audio_params_t *, - stream_filter_list_t *, stream_filter_list_t *); +static int awacs_query_format(void *, audio_format_query_t *); +static int awacs_set_format(void *, int, + const audio_params_t *, const audio_params_t *, + audio_filter_reg_t *, audio_filter_reg_t *); static int awacs_round_blocksize(void *, int, int, const audio_params_t *); static int awacs_trigger_output(void *, void *, void *, int, void (*)(void *), @@ -136,7 +128,6 @@ static int awacs_set_port(void *, mixer_ static int awacs_get_port(void *, mixer_ctrl_t *); static int awacs_query_devinfo(void *, mixer_devinfo_t *); static size_t awacs_round_buffersize(void *, int, size_t); -static paddr_t awacs_mappage(void *, void *, off_t, int); static int awacs_get_props(void *); static void awacs_get_locks(void *, kmutex_t **, kmutex_t **); @@ -164,8 +155,8 @@ CFATTACH_DECL_NEW(awacs, sizeof(struct a const struct audio_hw_if awacs_hw_if = { .close = awacs_close, - .query_encoding = awacs_query_encoding, - .set_params = awacs_set_params, + .query_format = awacs_query_format, + .set_format = awacs_set_format, .round_blocksize = awacs_round_blocksize, .halt_output = awacs_halt_output, .halt_input = awacs_halt_input, @@ -174,7 +165,6 @@ const struct audio_hw_if awacs_hw_if = { .get_port = awacs_get_port, .query_devinfo = awacs_query_devinfo, .round_buffersize = awacs_round_buffersize, - .mappage = awacs_mappage, .get_props = awacs_get_props, .trigger_output = awacs_trigger_output, .trigger_input = awacs_trigger_input, @@ -187,24 +177,20 @@ struct audio_device awacs_device = { "awacs" }; -#define AWACS_NFORMATS 2 -#define AWACS_FORMATS_LE 0 -#define AWACS_FORMAT(enc) \ - { \ - .mode = AUMODE_PLAY | AUMODE_RECORD, \ - .encoding = (enc), \ - .validbits = 16, \ - .precision = 16, \ - .channels = 2, \ - .channel_mask = AUFMT_STEREO, \ - .frequency_type = 8, \ - .frequency = \ - { 7350, 8820, 11025, 14700, 17640, 22050, 29400, 44100 }, \ - } -static const struct audio_format awacs_formats[AWACS_NFORMATS] = { - AWACS_FORMAT(AUDIO_ENCODING_SLINEAR_LE), - AWACS_FORMAT(AUDIO_ENCODING_SLINEAR_BE), +static const struct audio_format awacs_formats[] = { + { + .mode = AUMODE_PLAY | AUMODE_RECORD, + .encoding = AUDIO_ENCODING_SLINEAR_BE, + .validbits = 16, + .precision = 16, + .channels = 2, + .channel_mask = AUFMT_STEREO, + .frequency_type = 8, + .frequency = + { 7350, 8820, 11025, 14700, 17640, 22050, 29400, 44100 }, + } }; +#define AWACS_NFORMATS __arraycount(awacs_formats) /* register offset */ #define AWACS_SOUND_CTRL 0x00 @@ -410,17 +396,6 @@ awacs_attach(device_t parent, device_t s sc->vol_l = 0; sc->vol_r = 0; - memcpy(>sc_formats, awacs_formats, sizeof(awacs_formats)); - - /* XXX Uni-North based models don't have byteswap capability. */ -
CVS commit: [isaki-audio2] src/sys/dev/audio
Module Name:src Committed By: isaki Date: Wed Apr 24 12:14:56 UTC 2019 Modified Files: src/sys/dev/audio [isaki-audio2]: audio.c audiodef.h Log Message: Accept if bufsize returned from round_buffersize() is a multiple of blksize. To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/dev/audio/audio.c \ src/sys/dev/audio/audiodef.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/audio/audio.c diff -u src/sys/dev/audio/audio.c:1.1.2.1 src/sys/dev/audio/audio.c:1.1.2.2 --- src/sys/dev/audio/audio.c:1.1.2.1 Sun Apr 21 04:28:59 2019 +++ src/sys/dev/audio/audio.c Wed Apr 24 12:14:56 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.1.2.1 2019/04/21 04:28:59 isaki Exp $ */ +/* $NetBSD: audio.c,v 1.1.2.2 2019/04/24 12:14:56 isaki Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -154,7 +154,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.1.2.1 2019/04/21 04:28:59 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.1.2.2 2019/04/24 12:14:56 isaki Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -4759,6 +4759,7 @@ audio_mixer_init(struct audio_softc *sc, int blksize; int capacity; size_t bufsize; + int hwblks; int blkms; int error; @@ -4779,8 +4780,8 @@ audio_mixer_init(struct audio_softc *sc, mixer->volume = 256; mixer->blktime_d = 1000; mixer->blktime_n = audio_mixer_calc_blktime(sc, mixer); - mixer->hwblks = NBLKHW; sc->sc_blk_ms = mixer->blktime_n; + hwblks = NBLKHW; mixer->frames_per_block = frame_per_block(mixer, >hwbuf.fmt); blksize = frametobyte(>hwbuf.fmt, mixer->frames_per_block); @@ -4799,7 +4800,8 @@ audio_mixer_init(struct audio_softc *sc, return EINVAL; } /* Recalculation */ - mixer->frames_per_block = rounded * NBBY / + blksize = rounded; + mixer->frames_per_block = blksize * NBBY / (mixer->hwbuf.fmt.stride * mixer->hwbuf.fmt.channels); } @@ -4807,20 +4809,34 @@ audio_mixer_init(struct audio_softc *sc, mixer->blktime_n = mixer->frames_per_block; mixer->blktime_d = mixer->hwbuf.fmt.sample_rate; - capacity = mixer->frames_per_block * mixer->hwblks; + capacity = mixer->frames_per_block * hwblks; bufsize = frametobyte(>hwbuf.fmt, capacity); if (sc->hw_if->round_buffersize) { size_t rounded; rounded = sc->hw_if->round_buffersize(sc->hw_hdl, mode, bufsize); TRACE(2, "round_buffersize %zd -> %zd", bufsize, rounded); - if (rounded != bufsize) { - /* XXX what should I do? */ + if (rounded < bufsize) { + /* buffersize needs NBLKHW blocks at least. */ + device_printf(sc->sc_dev, + "buffersize too small: buffersize=%zd blksize=%d\n", + rounded, blksize); + return EINVAL; + } + if (rounded % blksize != 0) { + /* buffersize/blksize constraint mismatch? */ device_printf(sc->sc_dev, - "buffer size not configured %zu -> %zu\n", - bufsize, rounded); + "buffersize must be multiple of blksize: " + "buffersize=%zu blksize=%d\n", + rounded, blksize); return EINVAL; } + if (rounded != bufsize) { + /* Recalcuration */ + bufsize = rounded; + hwblks = bufsize / blksize; + capacity = mixer->frames_per_block * hwblks; + } } TRACE(2, "buffersize for %s = %zu", (mode == AUMODE_PLAY) ? "playback" : "recording", Index: src/sys/dev/audio/audiodef.h diff -u src/sys/dev/audio/audiodef.h:1.1.2.1 src/sys/dev/audio/audiodef.h:1.1.2.2 --- src/sys/dev/audio/audiodef.h:1.1.2.1 Sun Apr 21 04:28:59 2019 +++ src/sys/dev/audio/audiodef.h Wed Apr 24 12:14:56 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: audiodef.h,v 1.1.2.1 2019/04/21 04:28:59 isaki Exp $ */ +/* $NetBSD: audiodef.h,v 1.1.2.2 2019/04/24 12:14:56 isaki Exp $ */ /* * Copyright (C) 2017 Tetsuya Isaki. All rights reserved. @@ -220,7 +220,6 @@ struct audio_trackmixer { audio_ring_t codecbuf; /* also used for wide->int conversion */ audio_ring_t hwbuf; /* HW I/O buf */ - int hwblks; /* number of blocks in hwbuf */ void *sih; /* softint cookie */
CVS commit: [isaki-audio2] src/sys/arch/arm/imx
Module Name:src Committed By: isaki Date: Wed Apr 24 12:01:50 UTC 2019 Modified Files: src/sys/arch/arm/imx [isaki-audio2]: imx23_digfilt.c Log Message: Adapt to audio2. - move resetting sc_cmd_index from drain to halt_output since drain is obsoleted. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.1.24.1 src/sys/arch/arm/imx/imx23_digfilt.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/imx/imx23_digfilt.c diff -u src/sys/arch/arm/imx/imx23_digfilt.c:1.1 src/sys/arch/arm/imx/imx23_digfilt.c:1.1.24.1 --- src/sys/arch/arm/imx/imx23_digfilt.c:1.1 Sat Jan 10 12:16:28 2015 +++ src/sys/arch/arm/imx/imx23_digfilt.c Wed Apr 24 12:01:50 2019 @@ -1,4 +1,4 @@ -/* $Id: imx23_digfilt.c,v 1.1 2015/01/10 12:16:28 jmcneill Exp $ */ +/* $Id: imx23_digfilt.c,v 1.1.24.1 2019/04/24 12:01:50 isaki Exp $ */ /* * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -56,11 +55,10 @@ static void digfilt_attach(device_t, dev static int digfilt_activate(device_t, enum devact); /* Audio driver interface. */ -static int digfilt_drain(void *); -static int digfilt_query_encoding(void *, struct audio_encoding *); -static int digfilt_set_params(void *, int, int, audio_params_t *, -audio_params_t *, stream_filter_list_t *, -stream_filter_list_t *); +static int digfilt_query_format(void *, audio_format_query_t *); +static int digfilt_set_format(void *, int, +const audio_params_t *, const audio_params_t *, +audio_filter_reg_t *, audio_filter_reg_t *); static int digfilt_round_blocksize(void *, int, int, const audio_params_t *); static int digfilt_init_output(void *, void *, int ); static int digfilt_start_output(void *, void *, int, void (*)(void *), void *); @@ -116,7 +114,6 @@ struct digfilt_softc { device_t sc_dev; device_t sc_audiodev; struct audio_format sc_format; - struct audio_encoding_set *sc_encodings; bus_space_handle_t sc_aihdl; bus_space_handle_t sc_aohdl; apbdma_softc_t sc_dmac; @@ -151,9 +148,8 @@ CFATTACH_DECL3_NEW(digfilt, static const struct audio_hw_if digfilt_hw_if = { .open = NULL, .close = NULL, - .drain = digfilt_drain, - .query_encoding = digfilt_query_encoding, - .set_params = digfilt_set_params, + .query_format = digfilt_query_format, + .set_format = digfilt_set_format, .round_blocksize = digfilt_round_blocksize, .commit_settings = NULL, .init_output = digfilt_init_output, @@ -309,11 +305,6 @@ digfilt_attach(device_t parent, device_t sc->sc_format.frequency[6] = 32000; sc->sc_format.frequency[7] = 44100; - if (auconv_create_encodings(>sc_format, 1, >sc_encodings)) { - aprint_error_dev(self, "could not create encodings\n"); - return; - } - sc->sc_audiodev = audio_attach_mi(_hw_if, sc, sc->sc_dev); /* Default mutes. */ @@ -359,41 +350,21 @@ digfilt_activate(device_t self, enum dev } static int -digfilt_drain(void *priv) +digfilt_query_format(void *priv, audio_format_query_t *afp) { - struct digfilt_softc *sc = priv; - apbdma_wait(sc->sc_dmac, 1); - sc->sc_cmd_index = 0; - - return 0; -} - -static int -digfilt_query_encoding(void *priv, struct audio_encoding *ae) -{ - struct digfilt_softc *sc = priv; - return auconv_query_encoding(sc->sc_encodings, ae); + return audio_query_format(>sc_format, 1, afp); } static int -digfilt_set_params(void *priv, int setmode, int usemode, -audio_params_t *play, audio_params_t *rec, -stream_filter_list_t *pfil, stream_filter_list_t *rfil) +digfilt_set_format(void *priv, int setmode, +const audio_params_t *play, const audio_params_t *rec, +audio_filter_reg_t *pfil, audio_filter_reg_t *rfil) { struct digfilt_softc *sc = priv; - int index; - - if (play && (setmode & AUMODE_PLAY)) { - index = auconv_set_converter(>sc_format, 1, - AUMODE_PLAY, play, true, pfil); - if (index < 0) - return EINVAL; - sc->sc_pparam = pfil->req_size > 0 ? - pfil->filters[0].param : - *play; + if ((setmode & AUMODE_PLAY)) { /* At this point bitrate should be figured out. */ digfilt_ao_set_rate(sc, sc->sc_pparam.sample_rate); } @@ -486,6 +457,9 @@ digfilt_start_output(void *priv, void *s static int digfilt_halt_output(void *priv) { + struct digfilt_softc *sc = priv; + + sc->sc_cmd_index = 0; return 0; }
CVS commit: src/external/bsd/ntp/dist/ntpd
Module Name:src Committed By: maya Date: Wed Apr 24 11:55:05 UTC 2019 Modified Files: src/external/bsd/ntp/dist/ntpd: ntp_config.c Log Message: Only warn about being unable to make a smaller stack if asking for debug messages. Between ASLR and stack clash random-sized padding, we can't make small stacks reliably. Not doing so isn't a problem, so don't warn users about it on every boot. PR bin/51118 To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/external/bsd/ntp/dist/ntpd/ntp_config.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/ntp/dist/ntpd/ntp_config.c diff -u src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.20 src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.21 --- src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.20 Mon Dec 24 02:58:39 2018 +++ src/external/bsd/ntp/dist/ntpd/ntp_config.c Wed Apr 24 11:55:05 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ntp_config.c,v 1.20 2018/12/24 02:58:39 christos Exp $ */ +/* $NetBSD: ntp_config.c,v 1.21 2019/04/24 11:55:05 maya Exp $ */ /* ntp_config.c * @@ -5252,7 +5252,7 @@ ntp_rlimit( } rl.rlim_cur = rl_value; if (-1 == setrlimit(RLIMIT_STACK, )) { -msyslog(LOG_ERR, +msyslog(LOG_DEBUG, "ntp_rlimit: Cannot set RLIMIT_STACK: %m"); } }
CVS commit: src
Module Name:src Committed By: kamil Date: Wed Apr 24 11:43:20 UTC 2019 Modified Files: src/distrib/sets/lists/comp: mi src/distrib/sets/lists/debug: mi src/distrib/sets/lists/tests: mi src/lib/libpthread: Makefile src/tests/lib/libpthread: Makefile Added Files: src/lib/libpthread: call_once.3 call_once.c cnd.3 cnd.c mtx.3 mtx.c thrd.3 thrd.c threads.3 threads.h tss.3 tss.c src/tests/lib/libpthread: t_call_once.c t_cnd.c t_mtx.c t_thrd.c t_tss.c Log Message: Add a complete C11 threads(3) implementation C11 Thread support library is a portable threading C API between OSs, similar to std::threads in the C++ world. The library is implemented as a thin shim over POSIX interfaces. NetBSD implements the API as a part of the POSIX threading library (libpthread(3)). C11 threads(3) are in the process of making them an integral part of the POSIX standard. The interface has been implemented in major OSs and used with stopgap libraries for older versions of them. C11 threading library is already used (with a stopgap implementation) in the NetBSD distribution in MESA. Original implementation by myself from 2016. ATF tests are new and cover almost all interfaces. Proposed on tech-userlevel@. To generate a diff of this commit: cvs rdiff -u -r1.2269 -r1.2270 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.281 -r1.282 src/distrib/sets/lists/debug/mi cvs rdiff -u -r1.810 -r1.811 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.91 -r1.92 src/lib/libpthread/Makefile cvs rdiff -u -r0 -r1.1 src/lib/libpthread/call_once.3 \ src/lib/libpthread/call_once.c src/lib/libpthread/cnd.3 \ src/lib/libpthread/cnd.c src/lib/libpthread/mtx.3 \ src/lib/libpthread/mtx.c src/lib/libpthread/thrd.3 \ src/lib/libpthread/thrd.c src/lib/libpthread/threads.3 \ src/lib/libpthread/threads.h src/lib/libpthread/tss.3 \ src/lib/libpthread/tss.c cvs rdiff -u -r1.13 -r1.14 src/tests/lib/libpthread/Makefile cvs rdiff -u -r0 -r1.1 src/tests/lib/libpthread/t_call_once.c \ src/tests/lib/libpthread/t_cnd.c src/tests/lib/libpthread/t_mtx.c \ src/tests/lib/libpthread/t_thrd.c src/tests/lib/libpthread/t_tss.c 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/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.2269 src/distrib/sets/lists/comp/mi:1.2270 --- src/distrib/sets/lists/comp/mi:1.2269 Wed Apr 24 10:26:08 2019 +++ src/distrib/sets/lists/comp/mi Wed Apr 24 11:43:20 2019 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.2269 2019/04/24 10:26:08 roy Exp $ +# $NetBSD: mi,v 1.2270 2019/04/24 11:43:20 kamil Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. ./etc/mtree/set.compcomp-sys-root @@ -3172,6 +3172,7 @@ ./usr/include/termcap.hcomp-c-include ./usr/include/termios.hcomp-c-include ./usr/include/threadlib.h comp-obsolete obsolete +./usr/include/threads.hcomp-c-include ./usr/include/time.hcomp-c-include ./usr/include/trousers/trousers.h comp-c-include tpm ./usr/include/trousers/tss.h comp-c-include tpm @@ -4850,6 +4851,7 @@ ./usr/share/man/cat3/MDC2_Init.0 comp-c-catman .cat,openssl=11 ./usr/share/man/cat3/MIN.0 comp-c-catman .cat ./usr/share/man/cat3/OBJ_nid2obj.0 comp-c-catman .cat +./usr/share/man/cat3/ONCE_FLAG_INIT.0 comp-c-catman .cat ./usr/share/man/cat3/OCSP_REQUEST_new.0 comp-c-catman .cat,openssl=11 ./usr/share/man/cat3/OCSP_cert_to_id.0 comp-c-catman .cat,openssl=11 ./usr/share/man/cat3/OCSP_request_add1_nonce.0 comp-c-catman .cat,openssl=11 @@ -5276,6 +5278,7 @@ ./usr/share/man/cat3/TAILQ_REPLACE.0 comp-c-catman .cat ./usr/share/man/cat3/TIMESPEC_TO_TIMEVAL.0 comp-c-catman .cat ./usr/share/man/cat3/TIMEVAL_TO_TIMESPEC.0 comp-c-catman .cat +./usr/share/man/cat3/TSS_DTOR_ITERATIONS.0 comp-c-catman .cat ./usr/share/man/cat3/Tspi_ChangeAuth.0 comp-c-catman tpm,.cat ./usr/share/man/cat3/Tspi_ChangeAuthAsym.0 comp-c-catman tpm,.cat ./usr/share/man/cat3/Tspi_Context_Close.0 comp-c-catman tpm,.cat @@ -6049,6 +6052,7 @@ ./usr/share/man/cat3/cabsf.0 comp-c-catman complex,.cat ./usr/share/man/cat3/cabsl.0 comp-c-catman complex,.cat ./usr/share/man/cat3/cacos.0 comp-c-catman complex,.cat +./usr/share/man/cat3/call_once.0 comp-c-catman .cat ./usr/share/man/cat3/cacosf.0 comp-c-catman complex,.cat ./usr/share/man/cat3/cacosh.0 comp-c-catman complex,.cat ./usr/share/man/cat3/cacoshf.0 comp-c-catman complex,.cat @@ -6206,6 +6210,13 @@ ./usr/share/man/cat3/clrtobot.0 comp-c-catman .cat ./usr/share/man/cat3/clrtoeol.0 comp-c-catman .cat ./usr/share/man/cat3/cmsg.0 comp-c-catman .cat +./usr/share/man/cat3/cnd.0 comp-c-catman .cat +./usr/share/man/cat3/cnd_broadcast.0 comp-c-catman .cat +./usr/share/man/cat3/cnd_destroy.0 comp-c-catman .cat +./usr/share/man/cat3/cnd_init.0 comp-c-catman .cat
CVS commit: src/sys
Module Name:src Committed By: msaitoh Date: Wed Apr 24 11:18:21 UTC 2019 Modified Files: src/sys/arch/arm/imx: if_enet.c src/sys/dev/pci: if_wm.c Log Message: SIOCS is 'S'et function and the ioctl argument is ifreq. SIOCG is 'G'et function and the ioctl armument is ifmediareq. Before this change, SIOCG modify sc->sc_flowflags unexpectedly. Don't hook SIOCGIFMEDIA becauise this driver uses MII(4) and ether_ioctl has the hook(if_ethersubr.c rev. 1.160). real bug because the modification is overriden in ifmedia_ioctl(). This driver might require some additional fixes for SIOCSIFMTU and other ioctl()s. XXX pullup-[78]. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/imx/if_enet.c cvs rdiff -u -r1.633 -r1.634 src/sys/dev/pci/if_wm.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/imx/if_enet.c diff -u src/sys/arch/arm/imx/if_enet.c:1.18 src/sys/arch/arm/imx/if_enet.c:1.19 --- src/sys/arch/arm/imx/if_enet.c:1.18 Thu Apr 11 08:50:59 2019 +++ src/sys/arch/arm/imx/if_enet.c Wed Apr 24 11:18:20 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_enet.c,v 1.18 2019/04/11 08:50:59 msaitoh Exp $ */ +/* $NetBSD: if_enet.c,v 1.19 2019/04/24 11:18:20 msaitoh Exp $ */ /* * Copyright (c) 2014 Ryo Shimizu @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.18 2019/04/11 08:50:59 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.19 2019/04/24 11:18:20 msaitoh Exp $"); #include "vlan.h" @@ -1041,7 +1041,6 @@ enet_ioctl(struct ifnet *ifp, u_long com } break; case SIOCSIFMEDIA: - case SIOCGIFMEDIA: /* Flow control requires full-duplex mode. */ if (IFM_SUBTYPE(ifr->ifr_media) == IFM_AUTO || (ifr->ifr_media & IFM_FDX) == 0) Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.633 src/sys/dev/pci/if_wm.c:1.634 --- src/sys/dev/pci/if_wm.c:1.633 Wed Apr 24 10:21:22 2019 +++ src/sys/dev/pci/if_wm.c Wed Apr 24 11:18:20 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.633 2019/04/24 10:21:22 msaitoh Exp $ */ +/* $NetBSD: if_wm.c,v 1.634 2019/04/24 11:18:20 msaitoh Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -82,7 +82,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.633 2019/04/24 10:21:22 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.634 2019/04/24 11:18:20 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -3366,7 +3366,6 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, #endif switch (cmd) { case SIOCSIFMEDIA: - case SIOCGIFMEDIA: WM_CORE_LOCK(sc); /* Flow control requires full-duplex mode. */ if (IFM_SUBTYPE(ifr->ifr_media) == IFM_AUTO ||
CVS commit: src/sys/arch/powerpc/booke/dev
Module Name:src Committed By: msaitoh Date: Wed Apr 24 11:12:12 UTC 2019 Modified Files: src/sys/arch/powerpc/booke/dev: pq3etsec.c Log Message: SIOCS is 'S'et function and the ioctl argument is ifreq. SIOCG is 'G'et function and the ioctl armument is ifmediareq. Before this change, SIOCG modify request unexpectedly but it doesn't cause a real bug because the modification is overriden in ifmedia_ioctl(). To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/booke/dev/pq3etsec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/booke/dev/pq3etsec.c diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.41 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.42 --- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.41 Fri Mar 8 08:12:39 2019 +++ src/sys/arch/powerpc/booke/dev/pq3etsec.c Wed Apr 24 11:12:12 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pq3etsec.c,v 1.41 2019/03/08 08:12:39 msaitoh Exp $ */ +/* $NetBSD: pq3etsec.c,v 1.42 2019/04/24 11:12:12 msaitoh Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -41,7 +41,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.41 2019/03/08 08:12:39 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.42 2019/04/24 11:12:12 msaitoh Exp $"); #include #include @@ -1200,7 +1200,6 @@ pq3etsec_ifioctl(struct ifnet *ifp, u_lo switch (cmd) { case SIOCSIFMEDIA: - case SIOCGIFMEDIA: /* Flow control requires full-duplex mode. */ if (IFM_SUBTYPE(ifr->ifr_media) == IFM_AUTO || (ifr->ifr_media & IFM_FDX) == 0)
CVS commit: src/sys/dev/marvell
Module Name:src Committed By: msaitoh Date: Wed Apr 24 10:56:25 UTC 2019 Modified Files: src/sys/dev/marvell: if_mvxpe.c Log Message: This driver uses MII(4) and have hook SIOC[GS]IFMEDIA which just pass to ifmedia_ioctl(), the hook is not required because ether_ioctl has it (if_ethersubr.c rev. 1.160). This driver might require some additional fixes for SIOCSIFMTU and other ioctl()s. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/dev/marvell/if_mvxpe.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/marvell/if_mvxpe.c diff -u src/sys/dev/marvell/if_mvxpe.c:1.22 src/sys/dev/marvell/if_mvxpe.c:1.23 --- src/sys/dev/marvell/if_mvxpe.c:1.22 Mon Mar 18 11:38:03 2019 +++ src/sys/dev/marvell/if_mvxpe.c Wed Apr 24 10:56:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_mvxpe.c,v 1.22 2019/03/18 11:38:03 msaitoh Exp $ */ +/* $NetBSD: if_mvxpe.c,v 1.23 2019/04/24 10:56:24 msaitoh Exp $ */ /* * Copyright (c) 2015 Internet Initiative Japan Inc. * All rights reserved. @@ -25,7 +25,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.22 2019/03/18 11:38:03 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.23 2019/04/24 10:56:24 msaitoh Exp $"); #include "opt_multiprocessor.h" @@ -1727,18 +1727,9 @@ STATIC int mvxpe_ioctl(struct ifnet *ifp, u_long cmd, void *data) { struct mvxpe_softc *sc = ifp->if_softc; - struct ifreq *ifr = data; int error = 0; - int s; switch (cmd) { - case SIOCGIFMEDIA: - case SIOCSIFMEDIA: - DPRINTIFNET(ifp, 2, "mvxpe_ioctl MEDIA\n"); - s = splnet(); /* XXX: is there suitable mutex? */ - error = ifmedia_ioctl(ifp, ifr, >sc_mii.mii_media, cmd); - splx(s); - break; default: DPRINTIFNET(ifp, 2, "mvxpe_ioctl ETHER\n"); error = ether_ioctl(ifp, cmd, data);
CVS commit: src/distrib/sets
Module Name:src Committed By: wiz Date: Wed Apr 24 10:43:00 UTC 2019 Modified Files: src/distrib/sets: descrs Log Message: Fix typo. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/distrib/sets/descrs 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/descrs diff -u src/distrib/sets/descrs:1.22 src/distrib/sets/descrs:1.23 --- src/distrib/sets/descrs:1.22 Wed Apr 24 10:26:08 2019 +++ src/distrib/sets/descrs Wed Apr 24 10:43:00 2019 @@ -207,7 +207,7 @@ comp-c-catman the C programming language comp-c-include This package contains header files for the C programming language, comp-c-include including standard C and UNIX APIs, and APIs specific to the NetBSD comp-c-include operating system. -comp-nis-inlcude Header files for building NIS applications +comp-nis-include Header files for building NIS applications comp-c-lib This contains library archives to build statically linked versions of C comp-c-lib libraries. comp-c-lib programs and simbolic links for use in linking software against shared
CVS commit: src/sys/arch/arm/xscale
Module Name:src Committed By: msaitoh Date: Wed Apr 24 10:40:19 UTC 2019 Modified Files: src/sys/arch/arm/xscale: ixp425_if_npe.c Log Message: This driver uses MII(4) and have hook SIOCGIFMEDIA which just pass to ifmedia_ioctl(), the hook is not required because ether_ioctl has it (if_ethersubr.c rev. 1.160). This driver might require some additional fixes for SIOCSIFMTU and other ioctl()s. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/xscale/ixp425_if_npe.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/xscale/ixp425_if_npe.c diff -u src/sys/arch/arm/xscale/ixp425_if_npe.c:1.37 src/sys/arch/arm/xscale/ixp425_if_npe.c:1.38 --- src/sys/arch/arm/xscale/ixp425_if_npe.c:1.37 Tue Mar 5 08:25:02 2019 +++ src/sys/arch/arm/xscale/ixp425_if_npe.c Wed Apr 24 10:40:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ixp425_if_npe.c,v 1.37 2019/03/05 08:25:02 msaitoh Exp $ */ +/* $NetBSD: ixp425_if_npe.c,v 1.38 2019/04/24 10:40:18 msaitoh Exp $ */ /*- * Copyright (c) 2006 Sam Leffler. All rights reserved. @@ -28,7 +28,7 @@ #if 0 __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $"); #endif -__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.37 2019/03/05 08:25:02 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.38 2019/04/24 10:40:18 msaitoh Exp $"); /* * Intel XScale NPE Ethernet driver. @@ -1421,7 +1421,6 @@ npeioctl(struct ifnet *ifp, u_long cmd, switch (cmd) { case SIOCSIFMEDIA: - case SIOCGIFMEDIA: #if 0 /* not yet */ /* Flow control requires full-duplex mode. */ if (IFM_SUBTYPE(ifr->ifr_media) == IFM_AUTO ||
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Wed Apr 24 10:38:09 UTC 2019 Modified Files: src/sys/dev/pci: if_bnx.c Log Message: This driver uses MII(4) and have hook SIOCGIFMEDIA which just pass to ifmedia_ioctl(), the hook is not required because ether_ioctl has it (if_ethersubr.c rev. 1.160). This driver might require some additional fixes for SIOCSIFMTU and other ioctl()s. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sys/dev/pci/if_bnx.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_bnx.c diff -u src/sys/dev/pci/if_bnx.c:1.81 src/sys/dev/pci/if_bnx.c:1.82 --- src/sys/dev/pci/if_bnx.c:1.81 Thu Apr 11 08:50:59 2019 +++ src/sys/dev/pci/if_bnx.c Wed Apr 24 10:38:09 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bnx.c,v 1.81 2019/04/11 08:50:59 msaitoh Exp $ */ +/* $NetBSD: if_bnx.c,v 1.82 2019/04/24 10:38:09 msaitoh Exp $ */ /* $OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $ */ /*- @@ -35,7 +35,7 @@ #if 0 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $"); #endif -__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.81 2019/04/11 08:50:59 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.82 2019/04/24 10:38:09 msaitoh Exp $"); /* * The following controllers are supported by this driver: @@ -5415,8 +5415,6 @@ bnx_ioctl(struct ifnet *ifp, u_long comm } sc->bnx_flowflags = ifr->ifr_media & IFM_ETH_FMASK; } - /* FALLTHROUGH */ - case SIOCGIFMEDIA: DBPRINT(sc, BNX_VERBOSE, "bnx_phy_flags = 0x%08X\n", sc->bnx_phy_flags);
CVS commit: src/external/bsd/am-utils
Module Name:src Committed By: roy Date: Wed Apr 24 10:28:17 UTC 2019 Modified Files: src/external/bsd/am-utils: Makefile.inc src/external/bsd/am-utils/include: config.h Log Message: Fix building am-utils with MKYP=no To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/bsd/am-utils/Makefile.inc cvs rdiff -u -r1.7 -r1.8 src/external/bsd/am-utils/include/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/am-utils/Makefile.inc diff -u src/external/bsd/am-utils/Makefile.inc:1.7 src/external/bsd/am-utils/Makefile.inc:1.8 --- src/external/bsd/am-utils/Makefile.inc:1.7 Mon Feb 2 16:18:27 2015 +++ src/external/bsd/am-utils/Makefile.inc Wed Apr 24 10:28:17 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.7 2015/02/02 16:18:27 christos Exp $ +# $NetBSD: Makefile.inc,v 1.8 2019/04/24 10:28:17 roy Exp $ .ifndef AMU_MAKEFILE_INC AMU_MAKEFILE_INC= @@ -30,7 +30,7 @@ CPPFLAGS+=-DLDAP_DEPRECATED=1 # OpenLDAP .endif .if (${USE_YP} != "no") -CPPFLAGS+=-DHAVE_MAP_NIS=1 +CPPFLAGS+=-DHAVE_MAP_NIS=1 -DYP .endif .if !defined(LIB) || empty(LIB) Index: src/external/bsd/am-utils/include/config.h diff -u src/external/bsd/am-utils/include/config.h:1.7 src/external/bsd/am-utils/include/config.h:1.8 --- src/external/bsd/am-utils/include/config.h:1.7 Sat Jan 23 01:57:56 2016 +++ src/external/bsd/am-utils/include/config.h Wed Apr 24 10:28:17 2019 @@ -869,11 +869,13 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_RPCSVC_NIS_H */ +#ifdef YP /* Define to 1 if you have the header file. */ #define HAVE_RPCSVC_YPCLNT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_RPCSVC_YP_PROT_H 1 +#endif /* Define to 1 if you have the header file. */ /* #undef HAVE_RPC_AUTH_DES_H */
CVS commit: src/usr.sbin/rpcbind
Module Name:src Committed By: roy Date: Wed Apr 24 10:27:49 UTC 2019 Modified Files: src/usr.sbin/rpcbind: Makefile security.c Log Message: Fix building rpcbind with MKYP=no We add enough of the YP headers to security.c so the security checks can remain as is. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/rpcbind/Makefile cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/rpcbind/security.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/rpcbind/Makefile diff -u src/usr.sbin/rpcbind/Makefile:1.14 src/usr.sbin/rpcbind/Makefile:1.15 --- src/usr.sbin/rpcbind/Makefile:1.14 Thu Aug 17 00:06:00 2017 +++ src/usr.sbin/rpcbind/Makefile Wed Apr 24 10:27:49 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14 2017/08/17 00:06:00 ginsbach Exp $ +# $NetBSD: Makefile,v 1.15 2019/04/24 10:27:49 roy Exp $ .include @@ -18,6 +18,10 @@ CPPFLAGS+= -I${LIBCRPCDIR} -DPORTMAP -DL CPPFLAGS+= -DINET6 .endif +.if (${USE_YP} != "no") +CPPFLAGS+= -DYP +.endif + # Uncomment these to get any useful output from 'rpcbind -d' # CPPFLAGS+= -DRPCBIND_DEBUG # CPPFLAGS+= -DSVC_RUN_DEBUG Index: src/usr.sbin/rpcbind/security.c diff -u src/usr.sbin/rpcbind/security.c:1.12 src/usr.sbin/rpcbind/security.c:1.13 --- src/usr.sbin/rpcbind/security.c:1.12 Wed Aug 16 08:44:40 2017 +++ src/usr.sbin/rpcbind/security.c Wed Apr 24 10:27:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: security.c,v 1.12 2017/08/16 08:44:40 christos Exp $ */ +/* $NetBSD: security.c,v 1.13 2019/04/24 10:27:49 roy Exp $ */ /* $FreeBSD: head/usr.sbin/rpcbind/security.c 262860 2014-03-06 17:33:27Z mav $ */ #include @@ -24,9 +24,22 @@ #include #include #include + +#ifdef YP #include #include #include +#else +/* Define enough to compile. */ +#define YPBINDPROG ((unsigned long)17) +#define YPBINDPROC_SETDOM ((unsigned long)2) +#define YPPROG ((unsigned long)14) +#define YPPROC_FIRST ((unsigned long)4) +#define YPPROC_NEXT ((unsigned long)5) +#define YPPROC_MATCH ((unsigned long)3) +#define YPPROC_ALL ((unsigned long)8) +#define YPPASSWDPROG ((unsigned long)19) +#endif #include "rpcbind.h"
CVS commit: src/lib/librpcsvc
Module Name:src Committed By: roy Date: Wed Apr 24 10:26:43 UTC 2019 Modified Files: src/lib/librpcsvc: Makefile Log Message: Fix building librpcsvc for MKYP=no To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/lib/librpcsvc/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librpcsvc/Makefile diff -u src/lib/librpcsvc/Makefile:1.40 src/lib/librpcsvc/Makefile:1.41 --- src/lib/librpcsvc/Makefile:1.40 Wed Mar 21 10:08:30 2012 +++ src/lib/librpcsvc/Makefile Wed Apr 24 10:26:43 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.40 2012/03/21 10:08:30 matt Exp $ +# $NetBSD: Makefile,v 1.41 2019/04/24 10:26:43 roy Exp $ WARNS= 4 @@ -8,7 +8,14 @@ NOMAN= # defined RPCSRCS= bootparam_prot.x klm_prot.x mount.x nfs_prot.x\ nlm_prot.x rex.x rnusers.x rusers.x rquota.x rstat.x rwall.x\ - sm_inter.x spray.x yp.x yppasswd.x + sm_inter.x spray.x + +.include + +.if (${MKYP} != "no") +RPCSRCS+= yp.x yppasswd.x +.endif + RPC_INCS= ${RPCSRCS:.x=.h} RPC_XDRFILES= ${RPCSRCS:.x=_xdr.c}
CVS commit: src
Module Name:src Committed By: roy Date: Wed Apr 24 10:26:09 UTC 2019 Modified Files: src/distrib/sets: comments deps descrs src/distrib/sets/lists/comp: mi src/include: Makefile Log Message: Don't install YP headers when MKYP=no To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/distrib/sets/comments cvs rdiff -u -r1.17 -r1.18 src/distrib/sets/deps cvs rdiff -u -r1.21 -r1.22 src/distrib/sets/descrs cvs rdiff -u -r1.2268 -r1.2269 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.144 -r1.145 src/include/Makefile 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/comments diff -u src/distrib/sets/comments:1.20 src/distrib/sets/comments:1.21 --- src/distrib/sets/comments:1.20 Sun Sep 23 08:26:00 2018 +++ src/distrib/sets/comments Wed Apr 24 10:26:08 2019 @@ -232,6 +232,7 @@ comp-objc-bin compilers and tools for th comp-objc-lib static libraries and shared library links for the Objective C programming language comp-objc-piclib PIC libraries for Objective C language shared library generation comp-objc-proflib profiling libraries for the Objective C programming language +comp-nis-include Headers for bulding NIS applications comp-sys-catman formatted manual pages for kernel programming comp-sys-man manual pages source for kernel programming comp-sys-shlib shared library support for basic i386 math and utility libs Index: src/distrib/sets/deps diff -u src/distrib/sets/deps:1.17 src/distrib/sets/deps:1.18 --- src/distrib/sets/deps:1.17 Sun Sep 23 08:26:00 2018 +++ src/distrib/sets/deps Wed Apr 24 10:26:08 2019 @@ -251,6 +251,7 @@ comp-krb5-lib base-sys-usr comp-krb5-man base-man-share comp-krb5-proflib base-sys-usr comp-krb5c-catman base-man-share +comp-nis-include comp-c-include comp-objc-bin base-sys-usr comp-objc-lib base-sys-usr comp-objc-piclib base-sys-usr Index: src/distrib/sets/descrs diff -u src/distrib/sets/descrs:1.21 src/distrib/sets/descrs:1.22 --- src/distrib/sets/descrs:1.21 Sun Sep 23 08:26:00 2018 +++ src/distrib/sets/descrs Wed Apr 24 10:26:08 2019 @@ -207,6 +207,7 @@ comp-c-catman the C programming language comp-c-include This package contains header files for the C programming language, comp-c-include including standard C and UNIX APIs, and APIs specific to the NetBSD comp-c-include operating system. +comp-nis-inlcude Header files for building NIS applications comp-c-lib This contains library archives to build statically linked versions of C comp-c-lib libraries. comp-c-lib programs and simbolic links for use in linking software against shared Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.2268 src/distrib/sets/lists/comp/mi:1.2269 --- src/distrib/sets/lists/comp/mi:1.2268 Sat Apr 6 12:33:18 2019 +++ src/distrib/sets/lists/comp/mi Wed Apr 24 10:26:08 2019 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.2268 2019/04/06 12:33:18 kamil Exp $ +# $NetBSD: mi,v 1.2269 2019/04/24 10:26:08 roy Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. ./etc/mtree/set.compcomp-sys-root @@ -2846,12 +2846,12 @@ ./usr/include/rpcsvc/sm_inter.x comp-c-include ./usr/include/rpcsvc/spray.h comp-c-include ./usr/include/rpcsvc/spray.x comp-c-include -./usr/include/rpcsvc/yp.h comp-c-include -./usr/include/rpcsvc/yp.x comp-c-include -./usr/include/rpcsvc/yp_prot.h comp-c-include -./usr/include/rpcsvc/ypclnt.h comp-c-include -./usr/include/rpcsvc/yppasswd.h comp-c-include -./usr/include/rpcsvc/yppasswd.x comp-c-include +./usr/include/rpcsvc/yp.h comp-nis-include yp +./usr/include/rpcsvc/yp.x comp-nis-include yp +./usr/include/rpcsvc/yp_prot.h comp-nis-include yp +./usr/include/rpcsvc/ypclnt.h comp-nis-include yp +./usr/include/rpcsvc/yppasswd.h comp-nis-include yp +./usr/include/rpcsvc/yppasswd.x comp-nis-include yp ./usr/include/rtld_db.hcomp-c-include dtrace ./usr/include/rump/p2k.h comp-puffs-include rump ./usr/include/rump/rump.h comp-c-include rump Index: src/include/Makefile diff -u src/include/Makefile:1.144 src/include/Makefile:1.145 --- src/include/Makefile:1.144 Mon Oct 16 11:38:25 2017 +++ src/include/Makefile Wed Apr 24 10:26:08 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.144 2017/10/16 11:38:25 maya Exp $ +# $NetBSD: Makefile,v 1.145 2019/04/24 10:26:08 roy Exp $ # @(#)Makefile 8.2 (Berkeley) 1/4/94 # Doing a make includes builds /usr/include @@ -30,7 +30,11 @@ INCS+= protocols/dumprestore.h protocols INCS+= hesiod.h +.include + +.if (${MKYP} != "no") INCS+= rpcsvc/yp_prot.h rpcsvc/ypclnt.h +.endif INCS+= ssp/ssp.h ssp/stdio.h ssp/string.h ssp/strings.h ssp/unistd.h @@ -38,9 +42,6 @@ INCS+= ssp/ssp.h ssp/stdio.h ssp/string INCS+= ieeefp.h .endif -.include - - INCSDIR= /usr/include SUBDIR= rpc
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Wed Apr 24 10:21:23 UTC 2019 Modified Files: src/sys/dev/pci: if_wm.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.632 -r1.633 src/sys/dev/pci/if_wm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.632 src/sys/dev/pci/if_wm.c:1.633 --- src/sys/dev/pci/if_wm.c:1.632 Mon Mar 25 05:32:01 2019 +++ src/sys/dev/pci/if_wm.c Wed Apr 24 10:21:22 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.632 2019/03/25 05:32:01 msaitoh Exp $ */ +/* $NetBSD: if_wm.c,v 1.633 2019/04/24 10:21:22 msaitoh Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -82,7 +82,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.632 2019/03/25 05:32:01 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.633 2019/04/24 10:21:22 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -546,10 +546,10 @@ struct wm_softc { int sc_nqueues; struct wm_queue *sc_queue; - u_int sc_tx_process_limit; /* Tx processing repeat limit in softint */ - u_int sc_tx_intr_process_limit; /* Tx processing repeat limit in H/W intr */ - u_int sc_rx_process_limit; /* Rx processing repeat limit in softint */ - u_int sc_rx_intr_process_limit; /* Rx processing repeat limit in H/W intr */ + u_int sc_tx_process_limit; /* Tx proc. repeat limit in softint */ + u_int sc_tx_intr_process_limit; /* Tx proc. repeat limit in H/W intr */ + u_int sc_rx_process_limit; /* Rx proc. repeat limit in softint */ + u_int sc_rx_intr_process_limit; /* Rx proc. repeat limit in H/W intr */ int sc_affinity_offset; @@ -603,9 +603,12 @@ struct wm_softc { struct wm_nvmop nvm; }; -#define WM_CORE_LOCK(_sc) if ((_sc)->sc_core_lock) mutex_enter((_sc)->sc_core_lock) -#define WM_CORE_UNLOCK(_sc) if ((_sc)->sc_core_lock) mutex_exit((_sc)->sc_core_lock) -#define WM_CORE_LOCKED(_sc) (!(_sc)->sc_core_lock || mutex_owned((_sc)->sc_core_lock)) +#define WM_CORE_LOCK(_sc) \ + if ((_sc)->sc_core_lock) mutex_enter((_sc)->sc_core_lock) +#define WM_CORE_UNLOCK(_sc) \ + if ((_sc)->sc_core_lock) mutex_exit((_sc)->sc_core_lock) +#define WM_CORE_LOCKED(_sc) \ + (!(_sc)->sc_core_lock || mutex_owned((_sc)->sc_core_lock)) #define WM_RXCHAIN_RESET(rxq) \ do { \ @@ -641,7 +644,7 @@ do { \ #define CSR_WRITE(sc, reg, val) \ bus_space_write_4((sc)->sc_st, (sc)->sc_sh, (reg), (val)) #define CSR_WRITE_FLUSH(sc) \ - (void) CSR_READ((sc), WMREG_STATUS) + (void)CSR_READ((sc), WMREG_STATUS) #define ICH8_FLASH_READ32(sc, reg) \ bus_space_read_4((sc)->sc_flasht, (sc)->sc_flashh, \ @@ -1924,7 +1927,7 @@ wm_attach(device_t parent, device_t self preg &= ~PCI_COMMAND_INVALIDATE_ENABLE; pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, preg); - /* power up chip */ + /* Power up chip */ if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self, NULL)) && error != EOPNOTSUPP) { aprint_error_dev(sc->sc_dev, "cannot activate %d\n", error); @@ -1984,7 +1987,7 @@ alloc_retry: goto alloc_retry; } } else if (pci_intr_type(pc, sc->sc_intrs[0]) == PCI_INTR_TYPE_MSI) { - wm_adjust_qnum(sc, 0); /* must not use multiqueue */ + wm_adjust_qnum(sc, 0); /* Must not use multiqueue */ error = wm_setup_legacy(sc); if (error) { pci_intr_release(sc->sc_pc, sc->sc_intrs, @@ -1996,7 +1999,7 @@ alloc_retry: goto alloc_retry; } } else { - wm_adjust_qnum(sc, 0); /* must not use multiqueue */ + wm_adjust_qnum(sc, 0); /* Must not use multiqueue */ error = wm_setup_legacy(sc); if (error) { pci_intr_release(sc->sc_pc, sc->sc_intrs, @@ -2304,7 +2307,7 @@ alloc_retry: * NVM_SIZE_MULTIPLIER; /* It is size in bytes, we want words */ sc->sc_nvm_wordsize /= 2; - /* assume 2 banks */ + /* Assume 2 banks */ sc->sc_ich8_flash_bank_size = sc->sc_nvm_wordsize / 2; sc->sc_flashreg_offset = WM_PCH_SPT_FLASHOFFSET; sc->phy.acquire = wm_get_swflag_ich8lan; @@ -2583,7 +2586,7 @@ alloc_retry: sc->sc_flags &= ~WM_F_WOL; break; case PCI_PRODUCT_INTEL_82546GB_QUAD_COPPER_KSP3: - /* if quad port adapter, disable WoL on all but port A */ + /* If quad port adapter, disable WoL on all but port A */ if (sc->sc_funcid != 0) sc->sc_flags &= ~WM_F_WOL; break; @@ -2596,7 +2599,7 @@ alloc_retry: case PCI_PRODUCT_INTEL_82571EB_QUAD_COPPER: case PCI_PRODUCT_INTEL_82571EB_QUAD_FIBER: case PCI_PRODUCT_INTEL_82571GB_QUAD_COPPER: - /* if quad port adapter, disable WoL on all but port A */ + /* If quad port adapter, disable WoL on all but port A */ if (sc->sc_funcid != 0) sc->sc_flags &= ~WM_F_WOL; break; @@ -3134,11 +3137,9 @@ wm_watchdog(struct ifnet *ifp) wm_watchdog_txq(ifp, txq, _queue); } - /* - * IF any of queues hanged up, reset the interface. - */ + /* IF any of
CVS commit: src/sys/netinet
Module Name:src Committed By: roy Date: Wed Apr 24 10:20:36 UTC 2019 Modified Files: src/sys/netinet: if_arp.c Log Message: ARP: Enable Address Defence again. Revert the tentative/duplicated check and test for if it's been broadcast or not. This reverts r1.245. To generate a diff of this commit: cvs rdiff -u -r1.278 -r1.279 src/sys/netinet/if_arp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/netinet/if_arp.c diff -u src/sys/netinet/if_arp.c:1.278 src/sys/netinet/if_arp.c:1.279 --- src/sys/netinet/if_arp.c:1.278 Sat Dec 22 14:28:57 2018 +++ src/sys/netinet/if_arp.c Wed Apr 24 10:20:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_arp.c,v 1.278 2018/12/22 14:28:57 maxv Exp $ */ +/* $NetBSD: if_arp.c,v 1.279 2019/04/24 10:20:36 roy Exp $ */ /* * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.278 2018/12/22 14:28:57 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.279 2019/04/24 10:20:36 roy Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -1171,14 +1171,13 @@ in_arpinput(struct mbuf *m) * Collision on sender address is always a duplicate. * Collision on target address is only a duplicate IF * the sender address is the null host (ie a DAD probe) AND - * our address is in the TENTATIVE state. - * DUPLICATED state is also checked so that processing stops here - * and an error can be logged. + * the message was broadcast - if it's unicast then it's + * a valid Unicast Poll from RFC 1122. */ if (do_dad && (in_hosteq(isaddr, myaddr) || - (in_nullhost(isaddr) && in_hosteq(itaddr, myaddr) - && ia->ia4_flags & (IN_IFF_TENTATIVE | IN_IFF_DUPLICATED + (in_nullhost(isaddr) && in_hosteq(itaddr, myaddr) && + m->m_flags & M_BCAST))) { arp_dad_duplicated((struct ifaddr *)ia, lla_snprintf(llabuf, ar_sha(ah), ah->ar_hln));
CVS commit: src/sys/dev/isa
Module Name:src Committed By: msaitoh Date: Wed Apr 24 09:35:54 UTC 2019 Modified Files: src/sys/dev/isa: if_iy.c Log Message: Remove extra test for SIOCSIFMEDIA. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/sys/dev/isa/if_iy.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/isa/if_iy.c diff -u src/sys/dev/isa/if_iy.c:1.104 src/sys/dev/isa/if_iy.c:1.105 --- src/sys/dev/isa/if_iy.c:1.104 Tue Feb 5 06:17:02 2019 +++ src/sys/dev/isa/if_iy.c Wed Apr 24 09:35:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_iy.c,v 1.104 2019/02/05 06:17:02 msaitoh Exp $ */ +/* $NetBSD: if_iy.c,v 1.105 2019/04/24 09:35:54 msaitoh Exp $ */ /* #define IYDEBUG */ /* #define IYMEMDEBUG */ @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.104 2019/02/05 06:17:02 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.105 2019/04/24 09:35:54 msaitoh Exp $"); #include "opt_inet.h" @@ -60,8 +60,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1. #include #include #include - #include +#include #ifdef INET #include @@ -72,10 +72,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1. #endif -#if defined(SIOCSIFMEDIA) -#include -#endif - #include #include #include
CVS commit: src/sys/dev/pci
Module Name:src Committed By: bouyer Date: Wed Apr 24 09:21:01 UTC 2019 Modified Files: src/sys/dev/pci: mfii.c Log Message: Clean up timeout logic. Now the system survives to a ccb timeout; before the filesystem would stall because one I/O did never completes. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/mfii.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/mfii.c diff -u src/sys/dev/pci/mfii.c:1.3 src/sys/dev/pci/mfii.c:1.4 --- src/sys/dev/pci/mfii.c:1.3 Mon Dec 3 22:34:36 2018 +++ src/sys/dev/pci/mfii.c Wed Apr 24 09:21:01 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mfii.c,v 1.3 2018/12/03 22:34:36 bouyer Exp $ */ +/* $NetBSD: mfii.c,v 1.4 2019/04/24 09:21:01 bouyer Exp $ */ /* $OpenBSD: mfii.c,v 1.58 2018/08/14 05:22:21 jmatthew Exp $ */ /* @@ -19,7 +19,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.3 2018/12/03 22:34:36 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.4 2019/04/24 09:21:01 bouyer Exp $"); #include "bio.h" @@ -265,7 +265,6 @@ struct mfii_ccb { u_int32_t ccb_flags; #define MFI_CCB_F_ERR (1<<0) u_int ccb_smid; - u_int ccb_refcnt; SIMPLEQ_ENTRY(mfii_ccb) ccb_link; }; SIMPLEQ_HEAD(mfii_ccb_list, mfii_ccb); @@ -2160,7 +2159,6 @@ mfii_scsipi_request(struct scsipi_channe return; } - ccb->ccb_refcnt = 2; /* one for the chip, one for the timeout */ mfii_start(sc, ccb); return; @@ -2177,10 +2175,9 @@ mfii_scsi_cmd_done(struct mfii_softc *sc struct scsipi_xfer *xs = ccb->ccb_cookie; struct mpii_msg_scsi_io *io = ccb->ccb_request; struct mfii_raid_context *ctx = (struct mfii_raid_context *)(io + 1); - u_int refs = 2; if (callout_stop(>xs_callout) != 0) - refs = 1; + return; switch (ctx->status) { case MFI_STAT_OK: @@ -2202,10 +2199,8 @@ mfii_scsi_cmd_done(struct mfii_softc *sc break; } - if (atomic_add_int_nv(>ccb_refcnt, -refs) == 0) { - scsipi_done(xs); - mfii_put_ccb(sc, ccb); - } + scsipi_done(xs); + mfii_put_ccb(sc, ccb); } int @@ -2344,7 +2339,6 @@ mfii_pd_scsi_cmd(struct scsipi_xfer *xs) return; } - ccb->ccb_refcnt = 2; /* one for the chip, one for the timeout */ // XXX timeout_add_msec(>stimeout, xs->timeout); mfii_start(sc, ccb); @@ -2544,10 +2538,9 @@ mfii_abort_task(struct work *wk, void *s if (!sc->sc_ld[periph->periph_target].ld_present) { /* device is gone */ - if (atomic_dec_uint_nv(>ccb_refcnt) == 0) { -scsipi_done(xs); -mfii_put_ccb(sc, ccb); - } + xs->error = XS_SELTIMEOUT; + scsipi_done(xs); + mfii_put_ccb(sc, ccb); continue; } @@ -2592,12 +2585,11 @@ mfii_scsi_cmd_abort_done(struct mfii_sof /* XXX check accb completion? */ mfii_put_ccb(sc, accb); + printf("%s: cmd aborted ccb %p\n", DEVNAME(sc), ccb); - if (atomic_dec_uint_nv(>ccb_refcnt) == 0) { - xs->error = XS_TIMEOUT; - scsipi_done(xs); - mfii_put_ccb(sc, ccb); - } + xs->error = XS_TIMEOUT; + scsipi_done(xs); + mfii_put_ccb(sc, ccb); } struct mfii_ccb * @@ -2628,8 +2620,6 @@ mfii_scrub_ccb(struct mfii_ccb *ccb) ccb->ccb_dma64 = false; ccb->ccb_len = 0; ccb->ccb_sgl_len = 0; - ccb->ccb_refcnt = 1; - memset(>ccb_req, 0, sizeof(ccb->ccb_req)); memset(ccb->ccb_request, 0, MFII_REQUEST_SIZE); memset(ccb->ccb_mfi, 0, MFI_FRAME_SIZE);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Wed Apr 24 08:54:35 UTC 2019 Modified Files: src/sys/dev/pci: if_de.c if_tl.c Log Message: Remove extra test of SIOCSIFMEDIA. To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/sys/dev/pci/if_de.c cvs rdiff -u -r1.112 -r1.113 src/sys/dev/pci/if_tl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_de.c diff -u src/sys/dev/pci/if_de.c:1.158 src/sys/dev/pci/if_de.c:1.159 --- src/sys/dev/pci/if_de.c:1.158 Tue Feb 5 06:17:03 2019 +++ src/sys/dev/pci/if_de.c Wed Apr 24 08:54:35 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_de.c,v 1.158 2019/02/05 06:17:03 msaitoh Exp $ */ +/* $NetBSD: if_de.c,v 1.159 2019/04/24 08:54:35 msaitoh Exp $ */ /*- * Copyright (c) 1994-1997 Matt Thomas (m...@3am-software.com) @@ -37,7 +37,7 @@ * board which support 21040, 21041, or 21140 (mostly). */ #include -__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.158 2019/02/05 06:17:03 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.159 2019/04/24 08:54:35 msaitoh Exp $"); #define TULIP_HDR_DATA @@ -67,7 +67,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1. #endif #include -#if defined(SIOCSIFMEDIA) && !defined(TULIP_NOIFMEDIA) +#if !defined(TULIP_NOIFMEDIA) #include #endif #include @@ -4796,12 +4796,10 @@ tulip_ifioctl(struct ifnet *ifp, unsigne #endif tulip_init(sc); break; -#if defined(SIOCSIFMEDIA) case SIOCSIFMEDIA: case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, >tulip_ifmedia, cmd); break; -#endif case SIOCADDMULTI: case SIOCDELMULTI: Index: src/sys/dev/pci/if_tl.c diff -u src/sys/dev/pci/if_tl.c:1.112 src/sys/dev/pci/if_tl.c:1.113 --- src/sys/dev/pci/if_tl.c:1.112 Tue Feb 5 06:17:03 2019 +++ src/sys/dev/pci/if_tl.c Wed Apr 24 08:54:35 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_tl.c,v 1.112 2019/02/05 06:17:03 msaitoh Exp $ */ +/* $NetBSD: if_tl.c,v 1.113 2019/04/24 08:54:35 msaitoh Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.112 2019/02/05 06:17:03 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.113 2019/04/24 08:54:35 msaitoh Exp $"); #undef TLDEBUG #define TL_PRIV_STATS @@ -54,9 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1. #include #include -#if defined(SIOCSIFMEDIA) #include -#endif #include #include #include
CVS commit: src/sys/dev/ic
Module Name:src Committed By: msaitoh Date: Wed Apr 24 08:21:25 UTC 2019 Modified Files: src/sys/dev/ic: dm9000.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/dev/ic/dm9000.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/dm9000.c diff -u src/sys/dev/ic/dm9000.c:1.16 src/sys/dev/ic/dm9000.c:1.17 --- src/sys/dev/ic/dm9000.c:1.16 Tue Feb 5 06:17:02 2019 +++ src/sys/dev/ic/dm9000.c Wed Apr 24 08:21:25 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dm9000.c,v 1.16 2019/02/05 06:17:02 msaitoh Exp $ */ +/* $NetBSD: dm9000.c,v 1.17 2019/04/24 08:21:25 msaitoh Exp $ */ /* * Copyright (c) 2009 Paul Fleischer @@ -240,7 +240,8 @@ dme_phy_write(struct dme_softc *sc, int dme_write(sc, DM9000_EPCR, DM9000_EPCR_ERPRW + DM9000_EPCR_EPOS_PHY); /* Wait until access to PHY has completed */ - while(dme_read(sc, DM9000_EPCR) & DM9000_EPCR_ERRE); + while (dme_read(sc, DM9000_EPCR) & DM9000_EPCR_ERRE) + ; /* Reset ERPRR-bit */ dme_write(sc, DM9000_EPCR, DM9000_EPCR_EPOS_PHY); @@ -287,11 +288,10 @@ dme_phy_init(struct dme_softc *sc) break; } - if(ifm_media & IFM_FDX) { + if (ifm_media & IFM_FDX) bmcr |= DM9000_PHY_BMCR_DUPLEX_MODE; - } else { + else bmcr &= ~DM9000_PHY_BMCR_DUPLEX_MODE; - } dme_phy_write(sc, DM9000_PHY_BMCR, bmcr); dme_phy_write(sc, DM9000_PHY_ANAR, anar); @@ -349,15 +349,13 @@ dme_phy_update_media(struct dme_softc *s sc->sc_media_active = IFM_ETHER; reg = dme_phy_read(sc, DM9000_PHY_BMCR); - if (reg & DM9000_PHY_BMCR_SPEED_SELECT) { + if (reg & DM9000_PHY_BMCR_SPEED_SELECT) sc->sc_media_active |= IFM_100_TX; - } else { + else sc->sc_media_active |= IFM_10_T; - } - if (reg & DM9000_PHY_BMCR_DUPLEX_MODE) { + if (reg & DM9000_PHY_BMCR_DUPLEX_MODE) sc->sc_media_active |= IFM_FDX; - } } void @@ -371,16 +369,15 @@ dme_phy_check_link(void *arg) reg = dme_read(sc, DM9000_NSR) & DM9000_NSR_LINKST; - if( reg ) + if (reg) reg = IFM_ETHER | IFM_AVALID | IFM_ACTIVE; else { reg = IFM_ETHER | IFM_AVALID; sc->sc_media_active = IFM_NONE; } - if ( (sc->sc_media_status != reg) && (reg & IFM_ACTIVE)) { + if ((sc->sc_media_status != reg) && (reg & IFM_ACTIVE)) dme_phy_reset(sc); - } sc->sc_media_status = reg; @@ -440,11 +437,11 @@ dme_attach(struct dme_softc *sc, const u /* Initialize ifmedia structures. */ ifmedia_init(>sc_media, 0, dme_mediachange, dme_mediastatus); - ifmedia_add(>sc_media, IFM_ETHER|IFM_AUTO, 0, NULL); - ifmedia_add(>sc_media, IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL); - ifmedia_add(>sc_media, IFM_ETHER|IFM_10_T, 0, NULL); - ifmedia_add(>sc_media, IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL); - ifmedia_add(>sc_media, IFM_ETHER|IFM_100_TX, 0, NULL); + ifmedia_add(>sc_media, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_add(>sc_media, IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); + ifmedia_add(>sc_media, IFM_ETHER | IFM_10_T, 0, NULL); + ifmedia_add(>sc_media, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); + ifmedia_add(>sc_media, IFM_ETHER | IFM_100_TX, 0, NULL); ifmedia_set(>sc_media, IFM_ETHER|IFM_AUTO); @@ -465,9 +462,8 @@ dme_attach(struct dme_softc *sc, const u uint8_t macAddr[6]; dme_read_c(sc, DM9000_PAB0, macAddr, 6); printf("DM9000 configured with MAC address: "); - for (int i = 0; i < 6; i++) { + for (int i = 0; i < 6; i++) printf("%02X:", macAddr[i]); - } printf("\n"); } #endif @@ -485,9 +481,8 @@ dme_attach(struct dme_softc *sc, const u printf("10Mbps"); else printf("100Mbps"); - } else { + } else printf("Down"); - } printf("\n"); } #endif @@ -569,9 +564,8 @@ int dme_intr(void *arg) } /* If we have nothing ready to transmit, prepare something */ - if (!sc->txready) { + if (!sc->txready) dme_prepare(sc, ifp); - } if (sc->txready) dme_transmit(sc); @@ -586,8 +580,8 @@ int dme_intr(void *arg) #endif /* Enable interrupts again */ - dme_write(sc, DM9000_IMR, DM9000_IMR_PAR | DM9000_IMR_PRM | - DM9000_IMR_PTM); + dme_write(sc, DM9000_IMR, + DM9000_IMR_PAR | DM9000_IMR_PRM | DM9000_IMR_PTM); DPRINTF(("dme_intr: End\n")); @@ -608,10 +602,9 @@ dme_start_output(struct ifnet *ifp) return; } - if (sc->txbusy && sc->txready) { + if (sc->txbusy && sc->txready) panic("DM9000: Internal error, trying to send without" " any empty queue\n"); - } dme_prepare(sc, ifp); @@ -659,9 +652,8 @@ dme_prepare(struct dme_softc *sc, struct length = sc->sc_pkt_write(sc, bufChain); TX_DATA_DPRINTF(("\n")); - if (length % sc->sc_data_width != 0) { + if (length % sc->sc_data_width != 0) panic("dme_prepare: length is not compatible with IO_MODE"); - } sc->txready_length = length; sc->txready = 1; @@ -840,7 +832,7 @@ dme_reset(struct dme_softc *sc) /* We only re-initialized the PHY in this function the first time it is called. */ - if(
CVS commit: src/sys/dev/ic
Module Name:src Committed By: msaitoh Date: Wed Apr 24 08:11:35 UTC 2019 Modified Files: src/sys/dev/ic: mb86950.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/dev/ic/mb86950.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/mb86950.c diff -u src/sys/dev/ic/mb86950.c:1.29 src/sys/dev/ic/mb86950.c:1.30 --- src/sys/dev/ic/mb86950.c:1.29 Tue Feb 5 06:17:02 2019 +++ src/sys/dev/ic/mb86950.c Wed Apr 24 08:11:35 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mb86950.c,v 1.29 2019/02/05 06:17:02 msaitoh Exp $ */ +/* $NetBSD: mb86950.c,v 1.30 2019/04/24 08:11:35 msaitoh Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.29 2019/02/05 06:17:02 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.30 2019/04/24 08:11:35 msaitoh Exp $"); /* * Device driver for Fujitsu mb86950 based Ethernet cards. @@ -227,14 +227,13 @@ mb86950_stop(struct mb86950_softc *sc) bus_space_write_1(bst, bsh, DLCR_RX_STAT, 0xff); /* Clear DMA Bit */ -bus_space_write_2(bst, bsh, BMPR_DMA, 0); + bus_space_write_2(bst, bsh, BMPR_DMA, 0); -/* accept no packets */ + /* accept no packets */ bus_space_write_1(bst, bsh, DLCR_TX_MODE, 0); bus_space_write_1(bst, bsh, DLCR_RX_MODE, 0); -mb86950_drain_fifo(sc); - + mb86950_drain_fifo(sc); } void @@ -257,8 +256,7 @@ mb86950_drain_fifo(struct mb86950_softc * Install interface into kernel networking data structures */ void -mb86950_config(struct mb86950_softc *sc, int *media, -int nmedia, int defmedia) +mb86950_config(struct mb86950_softc *sc, int *media, int nmedia, int defmedia) { struct ifnet *ifp = >sc_ec.ec_if; bus_space_tag_t bst = sc->sc_bst; @@ -278,7 +276,8 @@ mb86950_config(struct mb86950_softc *sc, /* XXX The Tiara LANCard uses board jumpers to change media. * This code may have to be changed for other cards. */ - ifmedia_init(>sc_media, 0, mb86950_mediachange, mb86950_mediastatus); + ifmedia_init(>sc_media, 0, mb86950_mediachange, + mb86950_mediastatus); ifmedia_add(>sc_media, IFM_ETHER | IFM_MANUAL, 0, NULL); ifmedia_set(>sc_media, IFM_ETHER | IFM_MANUAL); @@ -287,7 +286,8 @@ mb86950_config(struct mb86950_softc *sc, if_deferred_start_init(ifp, NULL); /* Feed the chip the station address. */ - bus_space_write_region_1(bst, bsh, DLCR_NODE_ID, sc->sc_enaddr, ETHER_ADDR_LEN); + bus_space_write_region_1(bst, bsh, DLCR_NODE_ID, sc->sc_enaddr, + ETHER_ADDR_LEN); ether_ifattach(ifp, sc->sc_enaddr); @@ -338,9 +338,9 @@ mb86950_mediachange(struct ifnet *ifp) struct mb86950_softc *sc = ifp->if_softc; if (sc->sc_mediachange) - return ((*sc->sc_mediachange)(sc)); + return (*sc->sc_mediachange)(sc); - return (0); + return 0; } /* @@ -389,8 +389,8 @@ mb86950_watchdog(struct ifnet *ifp) bus_space_handle_t bsh = sc->sc_bsh; u_int8_t tstat; - /* verbose watchdog messages for debugging timeouts */ -if ((tstat = bus_space_read_1(bst, bsh, DLCR_TX_STAT)) != 0) { + /* Verbose watchdog messages for debugging timeouts */ + if ((tstat = bus_space_read_1(bst, bsh, DLCR_TX_STAT)) != 0) { if (tstat & TX_CR_LOST) { if ((tstat & (TX_COL | TX_16COL)) == 0) { log(LOG_ERR, "%s: carrier lost\n", @@ -407,17 +407,16 @@ mb86950_watchdog(struct ifnet *ifp) log(LOG_ERR, "%s: transmit error\n", device_xname(sc->sc_dev)); } - } else { + } else log(LOG_ERR, "%s: device timeout\n", device_xname(sc->sc_dev)); - } - /* Don't know how many packets are lost by this accident. + /* + * Don't know how many packets are lost by this accident. * ... So just errors = errors + 1 */ ifp->if_oerrors++; mb86950_reset(sc); - } /* @@ -516,7 +515,7 @@ mb86950_ioctl(struct ifnet *ifp, unsigne } splx(s); - return (error); + return error; } /* @@ -550,15 +549,14 @@ mb86950_init(struct mb86950_softc *sc) /* ...and attempt to start output. */ mb86950_start(ifp); - } void mb86950_start(struct ifnet *ifp) { struct mb86950_softc *sc = ifp->if_softc; -bus_space_tag_t bst = sc->sc_bst; -bus_space_handle_t bsh = sc->sc_bsh; + bus_space_tag_t bst = sc->sc_bst; + bus_space_handle_t bsh = sc->sc_bsh; struct mbuf *m; int len; @@ -577,8 +575,10 @@ mb86950_start(struct ifnet *ifp) m_freem(m); /* XXX bus_space_barrier here ? */ - if (bus_space_read_1(bst, bsh, DLCR_TX_STAT) & (TX_UNDERFLO | TX_BUS_WR_ERR)) { - log(LOG_ERR, "%s: tx fifo underflow/overflow\n", device_xname(sc->sc_dev)); + if (bus_space_read_1(bst, bsh, DLCR_TX_STAT) + & (TX_UNDERFLO | TX_BUS_WR_ERR)) { + log(LOG_ERR, "%s: tx fifo underflow/overflow\n", + device_xname(sc->sc_dev)); } bus_space_write_2(bst, bsh, BMPR_TX_LENGTH, len | TRANSMIT_START); @@ -620,7 +620,8 @@ mb86950_put_fifo(struct
CVS commit: src/sys/dev/ic
Module Name:src Committed By: msaitoh Date: Wed Apr 24 08:03:07 UTC 2019 Modified Files: src/sys/dev/ic: lemac.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/dev/ic/lemac.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/lemac.c diff -u src/sys/dev/ic/lemac.c:1.50 src/sys/dev/ic/lemac.c:1.51 --- src/sys/dev/ic/lemac.c:1.50 Tue Feb 5 06:17:02 2019 +++ src/sys/dev/ic/lemac.c Wed Apr 24 08:03:07 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: lemac.c,v 1.50 2019/02/05 06:17:02 msaitoh Exp $ */ +/* $NetBSD: lemac.c,v 1.51 2019/04/24 08:03:07 msaitoh Exp $ */ /*- * Copyright (c) 1994, 1995, 1997 Matt Thomas @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.50 2019/02/05 06:17:02 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.51 2019/04/24 08:03:07 msaitoh Exp $"); #include "opt_inet.h" @@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1. #include #include #include +#include #ifdef INET #include @@ -73,8 +74,6 @@ __KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1. #include #endif -#include - static void lemac_init(lemac_softc_t *sc); static void lemac_ifstart(struct ifnet *ifp); static void lemac_reset(lemac_softc_t *sc); @@ -86,14 +85,14 @@ static int lemac_read_eeprom(lemac_soft static void lemac_init_adapmem(lemac_softc_t *sc); static const u_int16_t lemac_allmulti_mctbl[LEMAC_MCTBL_SIZE/sizeof(u_int16_t)] = { -0xU, 0xU, 0xU, 0xU, -0xU, 0xU, 0xU, 0xU, -0xU, 0xU, 0xU, 0xU, -0xU, 0xU, 0xU, 0xU, -0xU, 0xU, 0xU, 0xU, -0xU, 0xU, 0xU, 0xU, -0xU, 0xU, 0xU, 0xU, -0xU, 0xU, 0xU, 0xU, + 0xU, 0xU, 0xU, 0xU, + 0xU, 0xU, 0xU, 0xU, + 0xU, 0xU, 0xU, 0xU, + 0xU, 0xU, 0xU, 0xU, + 0xU, 0xU, 0xU, 0xU, + 0xU, 0xU, 0xU, 0xU, + 0xU, 0xU, 0xU, 0xU, + 0xU, 0xU, 0xU, 0xU, }; /* @@ -102,248 +101,232 @@ static const u_int16_t lemac_allmulti_mc unsigned lemac_txmax = 16; static void -lemac_rxd_intr( -lemac_softc_t *sc, -unsigned cs_value) -{ -/* - * Handle CS_RXD (Receiver disabled) here. - * - * Check Free Memory Queue Count. If not equal to zero - * then just turn Receiver back on. If it is equal to - * zero then check to see if transmitter is disabled. - * Process transmit TXD loop once more. If all else - * fails then do software init (0xC0 to EEPROM Init) - * and rebuild Free Memory Queue. - */ - -sc->sc_cntrs.cntr_rxd_intrs++; - -/* - * Re-enable Receiver. - */ +lemac_rxd_intr(lemac_softc_t *sc, unsigned cs_value) +{ + /* + * Handle CS_RXD (Receiver disabled) here. + * + * Check Free Memory Queue Count. If not equal to zero + * then just turn Receiver back on. If it is equal to + * zero then check to see if transmitter is disabled. + * Process transmit TXD loop once more. If all else + * fails then do software init (0xC0 to EEPROM Init) + * and rebuild Free Memory Queue. + */ -cs_value &= ~LEMAC_CS_RXD; -LEMAC_OUTB(sc, LEMAC_REG_CS, cs_value); + sc->sc_cntrs.cntr_rxd_intrs++; -if (LEMAC_INB(sc, LEMAC_REG_FMC) > 0) - return; + /* Re-enable Receiver. */ -if (cs_value & LEMAC_CS_TXD) - lemac_txd_intr(sc, cs_value); + cs_value &= ~LEMAC_CS_RXD; + LEMAC_OUTB(sc, LEMAC_REG_CS, cs_value); -if ((LEMAC_INB(sc, LEMAC_REG_CS) & LEMAC_CS_RXD) == 0) - return; + if (LEMAC_INB(sc, LEMAC_REG_FMC) > 0) + return; -printf("%s: fatal RXD error, attempting recovery\n", sc->sc_if.if_xname); + if (cs_value & LEMAC_CS_TXD) + lemac_txd_intr(sc, cs_value); -lemac_reset(sc); -if (sc->sc_if.if_flags & IFF_UP) { - lemac_init(sc); - return; -} + if ((LEMAC_INB(sc, LEMAC_REG_CS) & LEMAC_CS_RXD) == 0) + return; + + printf("%s: fatal RXD error, attempting recovery\n", + sc->sc_if.if_xname); -/* - * Error during initialization. Mark card as disabled. - */ -printf("%s: recovery failed -- board disabled\n", sc->sc_if.if_xname); + lemac_reset(sc); + if (sc->sc_if.if_flags & IFF_UP) { + lemac_init(sc); + return; + } + + /* Error during initialization. Mark card as disabled. */ + printf("%s: recovery failed -- board disabled\n", sc->sc_if.if_xname); } static void -lemac_tne_intr( -lemac_softc_t *sc) +lemac_tne_intr(lemac_softc_t *sc) { -unsigned txcount = LEMAC_INB(sc, LEMAC_REG_TDC); + unsigned txcount = LEMAC_INB(sc, LEMAC_REG_TDC); -sc->sc_cntrs.cntr_tne_intrs++; -while (txcount-- > 0) { - unsigned txsts = LEMAC_INB(sc, LEMAC_REG_TDQ); - sc->sc_if.if_opackets++; /* another one done */ - if ((txsts & (LEMAC_TDQ_LCL|LEMAC_TDQ_NCL)) - ||
CVS commit: src/sys/dev/ic
Module Name:src Committed By: msaitoh Date: Wed Apr 24 07:46:55 UTC 2019 Modified Files: src/sys/dev/ic: pdq_ifsubr.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/sys/dev/ic/pdq_ifsubr.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/pdq_ifsubr.c diff -u src/sys/dev/ic/pdq_ifsubr.c:1.62 src/sys/dev/ic/pdq_ifsubr.c:1.63 --- src/sys/dev/ic/pdq_ifsubr.c:1.62 Tue Feb 5 06:17:02 2019 +++ src/sys/dev/ic/pdq_ifsubr.c Wed Apr 24 07:46:55 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pdq_ifsubr.c,v 1.62 2019/02/05 06:17:02 msaitoh Exp $ */ +/* $NetBSD: pdq_ifsubr.c,v 1.63 2019/04/24 07:46:55 msaitoh Exp $ */ /*- * Copyright (c) 1995, 1996 Matt Thomas @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c,v 1.62 2019/02/05 06:17:02 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c,v 1.63 2019/04/24 07:46:55 msaitoh Exp $"); #ifdef __NetBSD__ #include "opt_inet.h" @@ -101,125 +101,119 @@ __KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c #endif void -pdq_ifinit( -pdq_softc_t *sc) +pdq_ifinit(pdq_softc_t *sc) { -if (sc->sc_if.if_flags & IFF_UP) { - sc->sc_if.if_flags |= IFF_RUNNING; - if (sc->sc_if.if_flags & IFF_PROMISC) { - sc->sc_pdq->pdq_flags |= PDQ_PROMISC; - } else { - sc->sc_pdq->pdq_flags &= ~PDQ_PROMISC; - } - if (sc->sc_if.if_flags & IFF_LINK1) { - sc->sc_pdq->pdq_flags |= PDQ_PASS_SMT; + if (sc->sc_if.if_flags & IFF_UP) { + sc->sc_if.if_flags |= IFF_RUNNING; + if (sc->sc_if.if_flags & IFF_PROMISC) + sc->sc_pdq->pdq_flags |= PDQ_PROMISC; + else + sc->sc_pdq->pdq_flags &= ~PDQ_PROMISC; + + if (sc->sc_if.if_flags & IFF_LINK1) + sc->sc_pdq->pdq_flags |= PDQ_PASS_SMT; + else + sc->sc_pdq->pdq_flags &= ~PDQ_PASS_SMT; + + sc->sc_pdq->pdq_flags |= PDQ_RUNNING; + pdq_run(sc->sc_pdq); } else { - sc->sc_pdq->pdq_flags &= ~PDQ_PASS_SMT; + sc->sc_if.if_flags &= ~IFF_RUNNING; + sc->sc_pdq->pdq_flags &= ~PDQ_RUNNING; + pdq_stop(sc->sc_pdq); } - sc->sc_pdq->pdq_flags |= PDQ_RUNNING; - pdq_run(sc->sc_pdq); -} else { - sc->sc_if.if_flags &= ~IFF_RUNNING; - sc->sc_pdq->pdq_flags &= ~PDQ_RUNNING; - pdq_stop(sc->sc_pdq); -} } void -pdq_ifwatchdog( -struct ifnet *ifp) +pdq_ifwatchdog(struct ifnet *ifp) { -/* - * No progress was made on the transmit queue for PDQ_OS_TX_TRANSMIT - * seconds. Remove all queued packets. - */ - -ifp->if_flags &= ~IFF_OACTIVE; -ifp->if_timer = 0; -for (;;) { - struct mbuf *m; - IFQ_DEQUEUE(>if_snd, m); - if (m == NULL) - return; - PDQ_OS_DATABUF_FREE(PDQ_OS_IFP_TO_SOFTC(ifp)->sc_pdq, m); -} + /* + * No progress was made on the transmit queue for PDQ_OS_TX_TRANSMIT + * seconds. Remove all queued packets. + */ + + ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_timer = 0; + for (;;) { + struct mbuf *m; + IFQ_DEQUEUE(>if_snd, m); + if (m == NULL) + return; + PDQ_OS_DATABUF_FREE(PDQ_OS_IFP_TO_SOFTC(ifp)->sc_pdq, m); + } } ifnet_ret_t -pdq_ifstart( -struct ifnet *ifp) +pdq_ifstart(struct ifnet *ifp) { -pdq_softc_t * const sc = PDQ_OS_IFP_TO_SOFTC(ifp); -struct mbuf *m; -int tx = 0; - -if ((ifp->if_flags & IFF_RUNNING) == 0) - return; - -if (sc->sc_if.if_timer == 0) - sc->sc_if.if_timer = PDQ_OS_TX_TIMEOUT; - -if ((sc->sc_pdq->pdq_flags & PDQ_TXOK) == 0) { - sc->sc_if.if_flags |= IFF_OACTIVE; - return; -} -sc->sc_flags |= PDQIF_DOWNCALL; -for (;; tx = 1) { - IFQ_POLL(>if_snd, m); - if (m == NULL) - break; + pdq_softc_t * const sc = PDQ_OS_IFP_TO_SOFTC(ifp); + struct mbuf *m; + int tx = 0; + + if ((ifp->if_flags & IFF_RUNNING) == 0) + return; + + if (sc->sc_if.if_timer == 0) + sc->sc_if.if_timer = PDQ_OS_TX_TIMEOUT; + + if ((sc->sc_pdq->pdq_flags & PDQ_TXOK) == 0) { + sc->sc_if.if_flags |= IFF_OACTIVE; + return; + } + sc->sc_flags |= PDQIF_DOWNCALL; + for (;; tx = 1) { + IFQ_POLL(>if_snd, m); + if (m == NULL) + break; #if defined(PDQ_BUS_DMA) && !defined(PDQ_BUS_DMA_NOTX) - if ((m->m_flags & M_HASTXDMAMAP) == 0) { - bus_dmamap_t map; - if (PDQ_OS_HDR_OFFSET != PDQ_RX_FC_OFFSET) { - m->m_data[0] = PDQ_FDDI_PH0; - m->m_data[1] = PDQ_FDDI_PH1; - m->m_data[2] = PDQ_FDDI_PH2; - } - if (!bus_dmamap_create(sc->sc_dmatag, m->m_pkthdr.len, 255, - m->m_pkthdr.len, 0, BUS_DMA_NOWAIT, )) { - if (!bus_dmamap_load_mbuf(sc->sc_dmatag, map, m, - BUS_DMA_WRITE|BUS_DMA_NOWAIT)) { - bus_dmamap_sync(sc->sc_dmatag, map, 0, m->m_pkthdr.len, -BUS_DMASYNC_PREWRITE); - M_SETCTX(m, map); - m->m_flags |= M_HASTXDMAMAP; + if ((m->m_flags & M_HASTXDMAMAP) == 0) { + bus_dmamap_t map; + if (PDQ_OS_HDR_OFFSET != PDQ_RX_FC_OFFSET) { +m->m_data[0] = PDQ_FDDI_PH0; +m->m_data[1] = PDQ_FDDI_PH1; +m->m_data[2] = PDQ_FDDI_PH2; + } + if (!bus_dmamap_create(sc->sc_dmatag, m->m_pkthdr.len, +
CVS commit: src/sys/arch/next68k/dev
Module Name:src Committed By: msaitoh Date: Wed Apr 24 07:32:50 UTC 2019 Modified Files: src/sys/arch/next68k/dev: mb8795.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/arch/next68k/dev/mb8795.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/next68k/dev/mb8795.c diff -u src/sys/arch/next68k/dev/mb8795.c:1.61 src/sys/arch/next68k/dev/mb8795.c:1.62 --- src/sys/arch/next68k/dev/mb8795.c:1.61 Tue Feb 5 06:17:01 2019 +++ src/sys/arch/next68k/dev/mb8795.c Wed Apr 24 07:32:50 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mb8795.c,v 1.61 2019/02/05 06:17:01 msaitoh Exp $ */ +/* $NetBSD: mb8795.c,v 1.62 2019/04/24 07:32:50 msaitoh Exp $ */ /* * Copyright (c) 1998 Darrin B. Jewell * All rights reserved. @@ -25,7 +25,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.61 2019/02/05 06:17:01 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.62 2019/04/24 07:32:50 msaitoh Exp $"); #include "opt_inet.h" @@ -87,10 +87,10 @@ extern int turbo; * and the Fujitsu Manchester Encoder/Decoder (MB502). */ -void mb8795_shutdown(void *); +void mb8795_shutdown(void *); bus_dmamap_t mb8795_txdma_restart(bus_dmamap_t, void *); -void mb8795_start_dma(struct mb8795_softc *); +void mb8795_start_dma(struct mb8795_softc *); int mb8795_mediachange(struct ifnet *); void mb8795_mediastatus(struct ifnet *, struct ifmediareq *); @@ -100,7 +100,7 @@ mb8795_config(struct mb8795_softc *sc, i { struct ifnet *ifp = >sc_ethercom.ec_if; - DPRINTF(("%s: mb8795_config()\n",device_xname(sc->sc_dev))); + DPRINTF(("%s: mb8795_config()\n", device_xname(sc->sc_dev))); /* Initialize ifnet structure. */ memcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ); @@ -119,22 +119,22 @@ mb8795_config(struct mb8795_softc *sc, i ifmedia_add(>sc_media, media[i], 0, NULL); ifmedia_set(>sc_media, defmedia); } else { - ifmedia_add(>sc_media, IFM_ETHER|IFM_MANUAL, 0, NULL); - ifmedia_set(>sc_media, IFM_ETHER|IFM_MANUAL); + ifmedia_add(>sc_media, IFM_ETHER | IFM_MANUAL, 0, NULL); + ifmedia_set(>sc_media, IFM_ETHER | IFM_MANUAL); } - /* Attach the interface. */ - if_attach(ifp); - ether_ifattach(ifp, sc->sc_enaddr); + /* Attach the interface. */ + if_attach(ifp); + ether_ifattach(ifp, sc->sc_enaddr); - sc->sc_sh = shutdownhook_establish(mb8795_shutdown, sc); - if (sc->sc_sh == NULL) -panic("mb8795_config: can't establish shutdownhook"); + sc->sc_sh = shutdownhook_establish(mb8795_shutdown, sc); + if (sc->sc_sh == NULL) + panic("mb8795_config: can't establish shutdownhook"); - rnd_attach_source(>rnd_source, device_xname(sc->sc_dev), -RND_TYPE_NET, RND_FLAG_DEFAULT); + rnd_attach_source(>rnd_source, device_xname(sc->sc_dev), + RND_TYPE_NET, RND_FLAG_DEFAULT); - DPRINTF(("%s: leaving mb8795_config()\n",device_xname(sc->sc_dev))); + DPRINTF(("%s: leaving mb8795_config()\n", device_xname(sc->sc_dev))); } /* @@ -147,14 +147,14 @@ mb8795_mediachange(struct ifnet *ifp) int data; if (turbo) - return (0); + return 0; switch IFM_SUBTYPE(sc->sc_media.ifm_media) { case IFM_AUTO: - if ((bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh, BMAP_DATA) & - BMAP_DATA_UTPENABLED_MASK) || - !(bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh, BMAP_DATA) & - BMAP_DATA_UTPCARRIER_MASK)) { + if ((bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh, + BMAP_DATA) & BMAP_DATA_UTPENABLED_MASK) || + !(bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh, + BMAP_DATA) & BMAP_DATA_UTPCARRIER_MASK)) { data = BMAP_DATA_UTPENABLE; sc->sc_media.ifm_cur->ifm_data = IFM_ETHER|IFM_10_T; } else { @@ -169,7 +169,7 @@ mb8795_mediachange(struct ifnet *ifp) data = BMAP_DATA_BNCENABLE; break; default: - return (1); + return 1; break; } @@ -178,7 +178,7 @@ mb8795_mediachange(struct ifnet *ifp) bus_space_write_1(sc->sc_bmap_bst, sc->sc_bmap_bsh, BMAP_DATA, data); - return (0); + return 0; } /* @@ -192,17 +192,17 @@ mb8795_mediastatus(struct ifnet *ifp, st if (turbo) return; - if (IFM_SUBTYPE(ifmr->ifm_active) == IFM_AUTO) { + if (IFM_SUBTYPE(ifmr->ifm_active) == IFM_AUTO) ifmr->ifm_active = sc->sc_media.ifm_cur->ifm_data; - } + if (IFM_SUBTYPE(ifmr->ifm_active) == IFM_10_T) { ifmr->ifm_status = IFM_AVALID; - if (!(bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh, BMAP_DATA) & - BMAP_DATA_UTPCARRIER_MASK)) + if (!(bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh, + BMAP_DATA) & BMAP_DATA_UTPCARRIER_MASK)) ifmr->ifm_status |= IFM_ACTIVE; - } else { + } else ifmr->ifm_status &= ~IFM_AVALID; /* don't know for 10_2 */ - } + return; } @@ -223,11 +223,14 @@ mb8795_hex_dump(unsigned char *pkt, size if ((i+1) % 16 == 0) { printf(" %c", '|'); for(j=0; j<16; j++) { -printf("%c",
CVS commit: src/lib/libcurses
Module Name:src Committed By: blymn Date: Wed Apr 24 07:09:44 UTC 2019 Modified Files: src/lib/libcurses: add_wch.c refresh.c touchwin.c Log Message: Add/improve debug output for some routines. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/libcurses/add_wch.c cvs rdiff -u -r1.107 -r1.108 src/lib/libcurses/refresh.c cvs rdiff -u -r1.30 -r1.31 src/lib/libcurses/touchwin.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libcurses/add_wch.c diff -u src/lib/libcurses/add_wch.c:1.6 src/lib/libcurses/add_wch.c:1.7 --- src/lib/libcurses/add_wch.c:1.6 Thu Nov 22 22:16:45 2018 +++ src/lib/libcurses/add_wch.c Wed Apr 24 07:09:44 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: add_wch.c,v 1.6 2018/11/22 22:16:45 uwe Exp $ */ +/* $NetBSD: add_wch.c,v 1.7 2019/04/24 07:09:44 blymn Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation Inc. @@ -36,7 +36,7 @@ #include #ifndef lint -__RCSID("$NetBSD: add_wch.c,v 1.6 2018/11/22 22:16:45 uwe Exp $"); +__RCSID("$NetBSD: add_wch.c,v 1.7 2019/04/24 07:09:44 blymn Exp $"); #endif /* not lint */ #include @@ -101,7 +101,8 @@ wadd_wch(WINDOW *win, const cchar_t *wch for (i = 0; i < win->maxy; i++) { assert(win->alines[i]->sentinel == SENTINEL_VALUE); } - __CTRACE(__CTRACE_INPUT, "wadd_wch: win(%p)\n", win); + __CTRACE(__CTRACE_INPUT, "wadd_wch: win(%p), x: %d, y: %d\n", + win, x, y); #endif lnp = win->alines[y]; return _cursesi_addwchar(win, , , , wch, 1); Index: src/lib/libcurses/refresh.c diff -u src/lib/libcurses/refresh.c:1.107 src/lib/libcurses/refresh.c:1.108 --- src/lib/libcurses/refresh.c:1.107 Fri Mar 29 18:32:45 2019 +++ src/lib/libcurses/refresh.c Wed Apr 24 07:09:44 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: refresh.c,v 1.107 2019/03/29 18:32:45 roy Exp $ */ +/* $NetBSD: refresh.c,v 1.108 2019/04/24 07:09:44 blymn Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)refresh.c 8.7 (Berkeley) 8/13/94"; #else -__RCSID("$NetBSD: refresh.c,v 1.107 2019/03/29 18:32:45 roy Exp $"); +__RCSID("$NetBSD: refresh.c,v 1.108 2019/04/24 07:09:44 blymn Exp $"); #endif #endif/* not lint */ @@ -251,14 +251,19 @@ _wnoutrefresh(WINDOW *win, int begy, int "_wnoutrefresh: wy %d\tf %d\tl %d\tflags %x\n", wy, *wlp->firstchp, *wlp->lastchp, wlp->flags); - if ((dwin->flags & __ISDERWIN) != 0) { - __CTRACE(__CTRACE_REFRESH, - "_wnoutrefresh: derwin wy %d\tf %d\tl %d\tflags %x\n", - dy_off, *dwlp->firstchp, *dwlp->lastchp, dwlp->flags); - __CTRACE(__CTRACE_REFRESH, - "_wnoutrefresh: derwin maxx %d\tch_off %d\n", - dwin->maxx, dwin->ch_off); - } + char *_wintype; + + if ((dwin->flags & __ISDERWIN) != 0) + _wintype = "derwin"; + else + _wintype = "dwin"; + + __CTRACE(__CTRACE_REFRESH, + "_wnoutrefresh: %s wy %d\tf %d\tl %d\tflags %x\n", + _wintype, dy_off, *dwlp->firstchp, *dwlp->lastchp, dwlp->flags); + __CTRACE(__CTRACE_REFRESH, + "_wnoutrefresh: %s maxx %d\tch_off %d\n", + _wintype, dwin->maxx, dwin->ch_off); #endif if (((wlp->flags & (__ISDIRTY | __ISFORCED)) == 0) && ((dwlp->flags & (__ISDIRTY | __ISFORCED)) == 0)) Index: src/lib/libcurses/touchwin.c diff -u src/lib/libcurses/touchwin.c:1.30 src/lib/libcurses/touchwin.c:1.31 --- src/lib/libcurses/touchwin.c:1.30 Fri Jan 6 13:53:18 2017 +++ src/lib/libcurses/touchwin.c Wed Apr 24 07:09:44 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: touchwin.c,v 1.30 2017/01/06 13:53:18 roy Exp $ */ +/* $NetBSD: touchwin.c,v 1.31 2019/04/24 07:09:44 blymn Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)touchwin.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: touchwin.c,v 1.30 2017/01/06 13:53:18 roy Exp $"); +__RCSID("$NetBSD: touchwin.c,v 1.31 2019/04/24 07:09:44 blymn Exp $"); #endif #endif/* not lint */ @@ -67,6 +67,10 @@ is_linetouched(WINDOW *win, int line) if (line > win->maxy) return FALSE; +#ifdef DEBUG + __CTRACE(__CTRACE_LINE, "is_linetouched: (%p, line %d, dirty %d)\n", + win, line, (win->alines[line]->flags & __ISDIRTY)); +#endif return (win->alines[line]->flags & __ISDIRTY) != 0; } @@ -106,6 +110,10 @@ is_wintouched(WINDOW *win) { int y, maxy; +#ifdef DEBUG + __CTRACE(__CTRACE_LINE, "is_wintouched: (%p, maxy %d)\n", win, + win->maxy); +#endif maxy = win->maxy; for (y = 0; y < maxy; y++) { if (is_linetouched(win, y) == TRUE)
CVS commit: src/sys/arch/evbarm/fdt
Module Name:src Committed By: skrll Date: Wed Apr 24 06:37:31 UTC 2019 Modified Files: src/sys/arch/evbarm/fdt: fdt_machdep.c Log Message: In fdt_add_boot_physmem make sure the memory range has pages available before adding it to the fdt_physmem array. Fixes a problem that jmcneill@ pointed out to me. To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/arch/evbarm/fdt/fdt_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/evbarm/fdt/fdt_machdep.c diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.61 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.62 --- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.61 Sat Mar 30 13:17:23 2019 +++ src/sys/arch/evbarm/fdt/fdt_machdep.c Wed Apr 24 06:37:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: fdt_machdep.c,v 1.61 2019/03/30 13:17:23 jmcneill Exp $ */ +/* $NetBSD: fdt_machdep.c,v 1.62 2019/04/24 06:37:31 skrll Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.61 2019/03/30 13:17:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.62 2019/04/24 06:37:31 skrll Exp $"); #include "opt_machdep.h" #include "opt_bootconfig.h" @@ -251,14 +251,22 @@ static struct boot_physmem fdt_physmem[M static void fdt_add_boot_physmem(const struct fdt_memory *m, void *arg) { - struct boot_physmem *bp = _physmem[nfdt_physmem++]; + const paddr_t saddr = round_page(m->start); + const paddr_t eaddr = trunc_page(m->end); - VPRINTF(" %" PRIx64 " - %" PRIx64 "\n", m->start, m->end - 1); + VPRINTF(" %" PRIx64 " - %" PRIx64, m->start, m->end - 1); + if (saddr >= eaddr) { + VPRINTF(" skipped\n"); + return; + } + VPRINTF("\n"); + + struct boot_physmem *bp = _physmem[nfdt_physmem++]; KASSERT(nfdt_physmem <= MAX_PHYSMEM); - bp->bp_start = atop(round_page(m->start)); - bp->bp_pages = atop(trunc_page(m->end)) - bp->bp_start; + bp->bp_start = atop(saddr); + bp->bp_pages = atop(eaddr) - bp->bp_start; bp->bp_freelist = VM_FREELIST_DEFAULT; #ifdef _LP64
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: thorpej Date: Wed Apr 24 06:03:02 UTC 2019 Modified Files: src/sys/dev/fdt: fdt_i2c.c Log Message: Fix leak of iba.iba_child_devices in fdtbus_attach_i2cbus(). Patch provided by yarl-baudig %%at%% mailoo.org To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/dev/fdt/fdt_i2c.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/fdt/fdt_i2c.c diff -u src/sys/dev/fdt/fdt_i2c.c:1.6 src/sys/dev/fdt/fdt_i2c.c:1.7 --- src/sys/dev/fdt/fdt_i2c.c:1.6 Wed Jan 30 01:24:00 2019 +++ src/sys/dev/fdt/fdt_i2c.c Wed Apr 24 06:03:02 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: fdt_i2c.c,v 1.6 2019/01/30 01:24:00 jmcneill Exp $ */ +/* $NetBSD: fdt_i2c.c,v 1.7 2019/04/24 06:03:02 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.6 2019/01/30 01:24:00 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.7 2019/04/24 06:03:02 thorpej Exp $"); #include #include @@ -106,6 +106,7 @@ fdtbus_attach_i2cbus(device_t dev, int p { struct i2cbus_attach_args iba; prop_dictionary_t devs, props; + device_t ret; u_int address_cells; devs = prop_dictionary_create(); @@ -124,5 +125,9 @@ fdtbus_attach_i2cbus(device_t dev, int p props = device_properties(dev); prop_dictionary_set_bool(props, "i2c-indirect-config", false); - return config_found_ia(dev, "i2cbus", , print); + ret = config_found_ia(dev, "i2cbus", , print); + if (iba.iba_child_devices) + prop_object_release(iba.iba_child_devices); + + return ret; }