CVS commit: src/sys/dev/i2c
Module Name:src Committed By: thorpej Date: Tue Jun 26 06:34:55 UTC 2018 Modified Files: src/sys/dev/i2c: at24cxx.c files.i2c i2c.c i2cvar.h Log Message: Remove the i2c "size" locator and corresponding property / attach arg. It was a hack meant only for EEPROMs, which have another way to specify size in the config directive ("flag" paramter), as well as a better way to detect size based on "compatible" string. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/dev/i2c/at24cxx.c cvs rdiff -u -r1.92 -r1.93 src/sys/dev/i2c/files.i2c cvs rdiff -u -r1.65 -r1.66 src/sys/dev/i2c/i2c.c cvs rdiff -u -r1.16 -r1.17 src/sys/dev/i2c/i2cvar.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/i2c/at24cxx.c diff -u src/sys/dev/i2c/at24cxx.c:1.29 src/sys/dev/i2c/at24cxx.c:1.30 --- src/sys/dev/i2c/at24cxx.c:1.29 Tue Jun 26 06:21:23 2018 +++ src/sys/dev/i2c/at24cxx.c Tue Jun 26 06:34:55 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: at24cxx.c,v 1.29 2018/06/26 06:21:23 thorpej Exp $ */ +/* $NetBSD: at24cxx.c,v 1.30 2018/06/26 06:34:55 thorpej Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.29 2018/06/26 06:21:23 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.30 2018/06/26 06:34:55 thorpej Exp $"); #include #include @@ -169,8 +169,6 @@ seeprom_attach(device_t parent, device_t */ if (device_cfdata(self)->cf_flags) sc->sc_size = (device_cfdata(self)->cf_flags << 7); - else - sc->sc_size = ia->ia_size; if (sc->sc_size <= 0 && ia->ia_ncompat > 0) { if (iic_compatible_match(ia, compat_data, &dce)) Index: src/sys/dev/i2c/files.i2c diff -u src/sys/dev/i2c/files.i2c:1.92 src/sys/dev/i2c/files.i2c:1.93 --- src/sys/dev/i2c/files.i2c:1.92 Sun May 27 05:31:20 2018 +++ src/sys/dev/i2c/files.i2c Tue Jun 26 06:34:55 2018 @@ -1,10 +1,10 @@ -# $NetBSD: files.i2c,v 1.92 2018/05/27 05:31:20 thorpej Exp $ +# $NetBSD: files.i2c,v 1.93 2018/06/26 06:34:55 thorpej Exp $ obsolete defflag opt_i2cbus.h I2C_SCAN define i2cbus { } define i2cexec -device iic { [addr = -1], [size = -1] } : i2c_bitbang +device iic { [addr = -1] } : i2c_bitbang attach iic at i2cbus file dev/i2c/i2c.ciic file dev/i2c/i2c_exec.c iic | i2cbus | i2cexec Index: src/sys/dev/i2c/i2c.c diff -u src/sys/dev/i2c/i2c.c:1.65 src/sys/dev/i2c/i2c.c:1.66 --- src/sys/dev/i2c/i2c.c:1.65 Tue Jun 26 04:32:35 2018 +++ src/sys/dev/i2c/i2c.c Tue Jun 26 06:34:55 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: i2c.c,v 1.65 2018/06/26 04:32:35 thorpej Exp $ */ +/* $NetBSD: i2c.c,v 1.66 2018/06/26 06:34:55 thorpej Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.65 2018/06/26 04:32:35 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.66 2018/06/26 06:34:55 thorpej Exp $"); #include #include @@ -285,7 +285,6 @@ iic_search(device_t parent, cfdata_t cf, } ia.ia_tag = sc->sc_tag; - ia.ia_size = cf->cf_loc[IICCF_SIZE]; ia.ia_type = sc->sc_type; ia.ia_name = NULL; @@ -441,7 +440,7 @@ iic_attach(device_t parent, device_t sel unsigned int i, count; prop_dictionary_t dev; prop_data_t cdata; - uint32_t addr, size; + uint32_t addr; uint64_t cookie; const char *name; struct i2c_attach_args ia; @@ -462,10 +461,6 @@ iic_attach(device_t parent, device_t sel if (!prop_dictionary_get_uint64(dev, "cookie", &cookie)) cookie = 0; loc[IICCF_ADDR] = addr; - if (prop_dictionary_get_uint32(dev, "size", &size)) -loc[IICCF_SIZE] = size; - else -size = loc[IICCF_SIZE] = IICCF_SIZE_DEFAULT; memset(&ia, 0, sizeof ia); ia.ia_addr = addr; @@ -473,7 +468,6 @@ iic_attach(device_t parent, device_t sel ia.ia_tag = ic; ia.ia_name = name; ia.ia_cookie = cookie; - ia.ia_size = size; ia.ia_prop = dev; buf = NULL; Index: src/sys/dev/i2c/i2cvar.h diff -u src/sys/dev/i2c/i2cvar.h:1.16 src/sys/dev/i2c/i2cvar.h:1.17 --- src/sys/dev/i2c/i2cvar.h:1.16 Tue Jun 26 04:32:35 2018 +++ src/sys/dev/i2c/i2cvar.h Tue Jun 26 06:34:55 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: i2cvar.h,v 1.16 2018/06/26 04:32:35 thorpej Exp $ */ +/* $NetBSD: i2cvar.h,v 1.17 2018/06/26 06:34:55 thorpej Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -133,7 +133,6 @@ struct i2cbus_attach_args { struct i2c_attach_args { i2c_tag_t ia_tag; /* our controller */ i2c_addr_t ia_addr; /* address of device */ - int ia_size; /* size (for EEPROMs) */ int ia_type; /* bus type */ /* only set if using direct config */ const char * ia_name; /* name of the device */
CVS commit: src/sys/dev/ofw
Module Name:src Committed By: thorpej Date: Tue Jun 26 06:24:52 UTC 2018 Modified Files: src/sys/dev/ofw: ofw_subr.c Log Message: In of_enter_i2c_devs(), we no longer need to set a "size" property for a couple of models of Atmel EEPROMs because the driver can figure this out on its own now (based on the same "compatible" criteria that we're using). To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ofw/ofw_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ofw/ofw_subr.c diff -u src/sys/dev/ofw/ofw_subr.c:1.30 src/sys/dev/ofw/ofw_subr.c:1.31 --- src/sys/dev/ofw/ofw_subr.c:1.30 Mon Jul 3 00:47:34 2017 +++ src/sys/dev/ofw/ofw_subr.c Tue Jun 26 06:24:52 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_subr.c,v 1.30 2017/07/03 00:47:34 jmcneill Exp $ */ +/* $NetBSD: ofw_subr.c,v 1.31 2018/06/26 06:24:52 thorpej Exp $ */ /* * Copyright 1998 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.30 2017/07/03 00:47:34 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.31 2018/06/26 06:24:52 thorpej Exp $"); #include #include @@ -450,7 +450,7 @@ of_enter_i2c_devs(prop_dictionary_t prop int addr_shift) { int node, len; - char name[32], compatible[32]; + char name[32]; uint64_t reg64; uint32_t reg32; uint64_t addr; @@ -493,14 +493,6 @@ of_enter_i2c_devs(prop_dictionary_t prop prop_dictionary_set_uint32(dev, "addr", addr); prop_dictionary_set_uint64(dev, "cookie", node); of_to_dataprop(dev, node, "compatible", "compatible"); - if (OF_getprop(node, "compatible", compatible, - sizeof(compatible)) > 0) { - /* Set size for EEPROM's that we know about */ - if (strcmp(compatible, "i2c-at24c64") == 0) -prop_dictionary_set_uint32(dev, "size", 8192); - if (strcmp(compatible, "i2c-at34c02") == 0) -prop_dictionary_set_uint32(dev, "size", 256); - } prop_array_add(array, dev); prop_object_release(dev); }
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: thorpej Date: Tue Jun 26 06:21:23 UTC 2018 Modified Files: src/sys/dev/i2c: at24cxx.c Log Message: Encode the size information in the compat data. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/i2c/at24cxx.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/i2c/at24cxx.c diff -u src/sys/dev/i2c/at24cxx.c:1.28 src/sys/dev/i2c/at24cxx.c:1.29 --- src/sys/dev/i2c/at24cxx.c:1.28 Tue Jun 26 06:03:57 2018 +++ src/sys/dev/i2c/at24cxx.c Tue Jun 26 06:21:23 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: at24cxx.c,v 1.28 2018/06/26 06:03:57 thorpej Exp $ */ +/* $NetBSD: at24cxx.c,v 1.29 2018/06/26 06:21:23 thorpej Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.28 2018/06/26 06:03:57 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.29 2018/06/26 06:21:23 thorpej Exp $"); #include #include @@ -111,20 +111,11 @@ const struct cdevsw seeprom_cdevsw = { static int seeprom_wait_idle(struct seeprom_softc *); -static const struct seeprom_size { - const char *name; - int size; -} seeprom_sizes[] = { - { "atmel,24c02", 256 }, - { "atmel,24c16", 2048 }, -}; - -/* XXXJRT collapse seeprom_size stuff into compat_data; see also ofw code */ static const struct device_compatible_entry compat_data[] = { - { "i2c-at24c64", 0 }, - { "i2c-at34c02", 0 }, - { "atmel,24c02", 0 }, - { "atmel,24c16", 0 }, + { "i2c-at24c64", 8192 }, + { "i2c-at34c02", 256 }, + { "atmel,24c02", 256 }, + { "atmel,24c16", 2048 }, { NULL,0 } }; @@ -148,7 +139,7 @@ seeprom_attach(device_t parent, device_t { struct seeprom_softc *sc = device_private(self); struct i2c_attach_args *ia = aux; - u_int n, m; + const struct device_compatible_entry *dce; sc->sc_tag = ia->ia_tag; sc->sc_address = ia->ia_addr; @@ -182,15 +173,8 @@ seeprom_attach(device_t parent, device_t sc->sc_size = ia->ia_size; if (sc->sc_size <= 0 && ia->ia_ncompat > 0) { - for (n = 0; n < __arraycount(seeprom_sizes); n++) { - for (m = 0; m < ia->ia_ncompat; m++) { -if (!strcmp(seeprom_sizes[n].name, -ia->ia_compat[m])) { - sc->sc_size = seeprom_sizes[n].size; - break; -} - } - } + if (iic_compatible_match(ia, compat_data, &dce)) + sc->sc_size = dce->data; } switch (sc->sc_size) {
CVS commit: src/sys/dev/ic
Module Name:src Committed By: msaitoh Date: Tue Jun 26 06:17:40 UTC 2018 Modified Files: src/sys/dev/ic: malo.c Log Message: bpf_mtap*() after ieee80211_encap() should be bpf_mtap3() rather than bpf_mtap(). bpf_mtap3() is for raw bpf. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/dev/ic/malo.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/malo.c diff -u src/sys/dev/ic/malo.c:1.10 src/sys/dev/ic/malo.c:1.11 --- src/sys/dev/ic/malo.c:1.10 Mon Oct 23 09:31:17 2017 +++ src/sys/dev/ic/malo.c Tue Jun 26 06:17:40 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: malo.c,v 1.10 2017/10/23 09:31:17 msaitoh Exp $ */ +/* $NetBSD: malo.c,v 1.11 2018/06/26 06:17:40 msaitoh Exp $ */ /* $OpenBSD: malo.c,v 1.92 2010/08/27 17:08:00 jsg Exp $ */ /* @@ -19,7 +19,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: malo.c,v 1.10 2017/10/23 09:31:17 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: malo.c,v 1.11 2018/06/26 06:17:40 msaitoh Exp $"); #include #include @@ -1074,7 +1074,7 @@ malo_start(struct ifnet *ifp) m0 = ieee80211_encap(ic, m0, ni); if (m0 == NULL) continue; - bpf_mtap(ifp, m0); + bpf_mtap3(ic->ic_rawbpf, m0); if (malo_tx_data(sc, m0, ni) != 0) { ieee80211_free_node(ni);
CVS commit: src/sys/dev/ic
Module Name:src Committed By: msaitoh Date: Tue Jun 26 06:16:09 UTC 2018 Modified Files: src/sys/dev/ic: rt2661.c Log Message: bpf_mtap*() before ieee80211_encap() should be bpf_mtap() rather than bpf_mtap3(). bpf_mtap3() is for raw bpf and be used after ieee80211_encap(). To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/dev/ic/rt2661.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/rt2661.c diff -u src/sys/dev/ic/rt2661.c:1.37 src/sys/dev/ic/rt2661.c:1.38 --- src/sys/dev/ic/rt2661.c:1.37 Tue May 1 16:18:13 2018 +++ src/sys/dev/ic/rt2661.c Tue Jun 26 06:16:09 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: rt2661.c,v 1.37 2018/05/01 16:18:13 maya Exp $ */ +/* $NetBSD: rt2661.c,v 1.38 2018/06/26 06:16:09 msaitoh Exp $ */ /* $OpenBSD: rt2661.c,v 1.17 2006/05/01 08:41:11 damien Exp $ */ /* $FreeBSD: rt2560.c,v 1.5 2006/06/02 19:59:31 csjp Exp $ */ @@ -25,7 +25,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.37 2018/05/01 16:18:13 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.38 2018/06/26 06:16:09 msaitoh Exp $"); #include @@ -1878,7 +1878,7 @@ rt2661_start(struct ifnet *ifp) continue; } - bpf_mtap3(ifp->if_bpf, m0); + bpf_mtap(ifp, m0); m0 = ieee80211_encap(ic, m0, ni); if (m0 == NULL) { ieee80211_free_node(ni);
CVS commit: src/sys
Module Name:src Committed By: thorpej Date: Tue Jun 26 06:03:57 UTC 2018 Modified Files: src/sys/arch/macppc/dev: deq.c smusat.c src/sys/arch/sparc64/dev: pcf8591_envctrl.c src/sys/dev/i2c: adadc.c adm1021.c adm1026.c as3722.c at24cxx.c axp20x.c axp22x.c axppmic.c dbcool.c ds1307.c dstemp.c fcu.c ihidev.c lm75.c lm87.c max77620.c pcf8563.c sy8106a.c tcagpio.c tcakp.c titemp.c tsl256x.c src/sys/kern: subr_autoconf.c src/sys/sys: device.h Log Message: In my quest to make device_compatible_entry (and associated goo) super-general, it turns out I also made it a little to cumbersome to use (if my tired fingers are any indication). So, this is a course-correction -- one string per entry (like of_compat_data, which it will soon replace), and remove the over-verbose macros. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/macppc/dev/deq.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/macppc/dev/smusat.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc64/dev/pcf8591_envctrl.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/adadc.c src/sys/dev/i2c/axp22x.c \ src/sys/dev/i2c/fcu.c src/sys/dev/i2c/max77620.c \ src/sys/dev/i2c/tsl256x.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/i2c/adm1021.c cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/adm1026.c src/sys/dev/i2c/ihidev.c cvs rdiff -u -r1.14 -r1.15 src/sys/dev/i2c/as3722.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/i2c/at24cxx.c cvs rdiff -u -r1.12 -r1.13 src/sys/dev/i2c/axp20x.c cvs rdiff -u -r1.13 -r1.14 src/sys/dev/i2c/axppmic.c cvs rdiff -u -r1.51 -r1.52 src/sys/dev/i2c/dbcool.c cvs rdiff -u -r1.28 -r1.29 src/sys/dev/i2c/ds1307.c cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/dstemp.c src/sys/dev/i2c/sy8106a.c \ src/sys/dev/i2c/tcagpio.c cvs rdiff -u -r1.32 -r1.33 src/sys/dev/i2c/lm75.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/i2c/lm87.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/pcf8563.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/tcakp.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/titemp.c cvs rdiff -u -r1.261 -r1.262 src/sys/kern/subr_autoconf.c cvs rdiff -u -r1.154 -r1.155 src/sys/sys/device.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/macppc/dev/deq.c diff -u src/sys/arch/macppc/dev/deq.c:1.15 src/sys/arch/macppc/dev/deq.c:1.16 --- src/sys/arch/macppc/dev/deq.c:1.15 Mon Jun 18 17:07:07 2018 +++ src/sys/arch/macppc/dev/deq.c Tue Jun 26 06:03:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: deq.c,v 1.15 2018/06/18 17:07:07 thorpej Exp $ */ +/* $NetBSD: deq.c,v 1.16 2018/06/26 06:03:57 thorpej Exp $ */ /*- * Copyright (C) 2005 Michael Lorenz @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: deq.c,v 1.15 2018/06/18 17:07:07 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: deq.c,v 1.16 2018/06/26 06:03:57 thorpej Exp $"); #include #include @@ -52,18 +52,13 @@ static int deq_match(device_t, struct cf CFATTACH_DECL_NEW(deq, sizeof(struct deq_softc), deq_match, deq_attach, NULL, NULL); -static const char * deq_compats[] = { - "deq", - "tas3004", - "pcm3052", - "cs8416", - "codec", - NULL -}; - -static const struct device_compatible_entry deq_compat_data[] = { - DEVICE_COMPAT_ENTRY(deq_compats), - DEVICE_COMPAT_TERMINATOR +static const struct device_compatible_entry compat_data[] = { + { "deq", 0 }, + { "tas3004", 0 }, + { "pcm3052", 0 }, + { "cs8416", 0 }, + { "codec", 0 }, + { NULL, 0 } }; int @@ -72,7 +67,7 @@ deq_match(device_t parent, struct cfdata struct i2c_attach_args *ia = aux; int match_result; - if (iic_use_direct_match(ia, cf, deq_compat_data, &match_result)) + if (iic_use_direct_match(ia, cf, compat_data, &match_result)) return match_result; /* This driver is direct-config only. */ Index: src/sys/arch/macppc/dev/smusat.c diff -u src/sys/arch/macppc/dev/smusat.c:1.5 src/sys/arch/macppc/dev/smusat.c:1.6 --- src/sys/arch/macppc/dev/smusat.c:1.5 Mon Jun 18 17:07:07 2018 +++ src/sys/arch/macppc/dev/smusat.c Tue Jun 26 06:03:57 2018 @@ -105,15 +105,10 @@ static int smusat_sysctl_sensor_value(SY CFATTACH_DECL_NEW(smusat, sizeof(struct smusat_softc), smusat_match, smusat_attach, NULL, NULL); -static const char * smusat_compats[] = { - "sat", - "smu-sat", - NULL -}; - -static const struct device_compatible_entry smusat_compat_data[] = { - DEVICE_COMPAT_ENTRY(smusat_compats), - DEVICE_COMPAT_TERMINATOR +static const struct device_compatible_entry compat_data[] = { + { "sat", 0 }, + { "smu-sat", 0 }, + { NULL, 0 } }; static int @@ -122,7 +117,7 @@ smusat_match(device_t parent, struct cfd struct i2c_attach_args *ia = aux; int match_result; - if (iic_use_direct_match(ia, cf, smusat_compat_data, &match_result)) + if (iic_use_direct_match(ia, cf, compat_data, &match_result)) return match_result; if (ia->ia_addr == 0x58) Index: src/sys/arch/sparc64/dev/pcf8591_envctrl.c diff -u src/sys/arch/sparc64/dev/pcf
CVS commit: src/sys
Module Name:src Committed By: thorpej Date: Tue Jun 26 04:32:35 UTC 2018 Modified Files: src/sys/dev/i2c: axppmic.c ds1307.c i2c.c i2cvar.h src/sys/kern: subr_autoconf.c src/sys/sys: device.h Log Message: Change device_compatible_match() and iic_compatible_match() to return the weighted match value and take an optional compatible-entry pointer, rather than the other way around. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/i2c/axppmic.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/i2c/ds1307.c cvs rdiff -u -r1.64 -r1.65 src/sys/dev/i2c/i2c.c cvs rdiff -u -r1.15 -r1.16 src/sys/dev/i2c/i2cvar.h cvs rdiff -u -r1.260 -r1.261 src/sys/kern/subr_autoconf.c cvs rdiff -u -r1.153 -r1.154 src/sys/sys/device.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/i2c/axppmic.c diff -u src/sys/dev/i2c/axppmic.c:1.12 src/sys/dev/i2c/axppmic.c:1.13 --- src/sys/dev/i2c/axppmic.c:1.12 Tue Jun 19 02:08:12 2018 +++ src/sys/dev/i2c/axppmic.c Tue Jun 26 04:32:35 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: axppmic.c,v 1.12 2018/06/19 02:08:12 thorpej Exp $ */ +/* $NetBSD: axppmic.c,v 1.13 2018/06/26 04:32:35 thorpej Exp $ */ /*- * Copyright (c) 2014-2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.12 2018/06/19 02:08:12 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.13 2018/06/26 04:32:35 thorpej Exp $"); #include #include @@ -694,7 +694,7 @@ static void axppmic_attach(device_t parent, device_t self, void *aux) { struct axppmic_softc *sc = device_private(self); - const struct device_compatible_entry *dce; + const struct device_compatible_entry *dce = NULL; const struct axppmic_config *c; struct axpreg_attach_args aaa; struct i2c_attach_args *ia = aux; @@ -702,7 +702,7 @@ axppmic_attach(device_t parent, device_t uint32_t irq_mask; void *ih; - dce = iic_compatible_match(ia, axppmic_compat_data, NULL); + (void) iic_compatible_match(ia, axppmic_compat_data, &dce); KASSERT(dce != NULL); c = DEVICE_COMPAT_ENTRY_GET_PTR(dce); Index: src/sys/dev/i2c/ds1307.c diff -u src/sys/dev/i2c/ds1307.c:1.27 src/sys/dev/i2c/ds1307.c:1.28 --- src/sys/dev/i2c/ds1307.c:1.27 Mon Jun 18 17:07:07 2018 +++ src/sys/dev/i2c/ds1307.c Tue Jun 26 04:32:35 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ds1307.c,v 1.27 2018/06/18 17:07:07 thorpej Exp $ */ +/* $NetBSD: ds1307.c,v 1.28 2018/06/26 04:32:35 thorpej Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.27 2018/06/18 17:07:07 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.28 2018/06/26 04:32:35 thorpej Exp $"); #include #include @@ -249,8 +249,7 @@ dsrtc_model_by_compat(const struct i2c_a const struct dsrtc_model *dm = NULL; const struct device_compatible_entry *dce; - dce = iic_compatible_match(ia, dsrtc_compat_data, NULL); - if (dce != NULL) + if (iic_compatible_match(ia, dsrtc_compat_data, &dce)) dm = DEVICE_COMPAT_ENTRY_GET_PTR(dce); return dm; Index: src/sys/dev/i2c/i2c.c diff -u src/sys/dev/i2c/i2c.c:1.64 src/sys/dev/i2c/i2c.c:1.65 --- src/sys/dev/i2c/i2c.c:1.64 Fri Jun 22 15:52:00 2018 +++ src/sys/dev/i2c/i2c.c Tue Jun 26 04:32:35 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: i2c.c,v 1.64 2018/06/22 15:52:00 martin Exp $ */ +/* $NetBSD: i2c.c,v 1.65 2018/06/26 04:32:35 thorpej Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.64 2018/06/22 15:52:00 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.65 2018/06/26 04:32:35 thorpej Exp $"); #include #include @@ -695,22 +695,22 @@ iic_fill_compat(struct i2c_attach_args * * Match a device's "compatible" property against the list * of compatible strings provided by the driver. */ -const struct device_compatible_entry * +int iic_compatible_match(const struct i2c_attach_args *ia, const struct device_compatible_entry *compats, - int *match_resultp) + const struct device_compatible_entry **matching_entryp) { - const struct device_compatible_entry *dce; - int match_weight; + int match_result; - dce = device_compatible_match(ia->ia_compat, ia->ia_ncompat, - compats, &match_weight); - if (dce != NULL && match_resultp != NULL) { - *match_resultp = MIN(I2C_MATCH_DIRECT_COMPATIBLE + match_weight, - I2C_MATCH_DIRECT_COMPATIBLE_MAX); + match_result = device_compatible_match(ia->ia_compat, ia->ia_ncompat, + compats, matching_entryp); + if (match_result) { + match_result = + MIN(I2C_MATCH_DIRECT_COMPATIBLE + match_result - 1, + I2C_MATCH_DIRECT_COMPATIBLE_MAX); } - return dce; + return match_result; } /* @@ -735,8 +735,7 @@ iic_use_direct_match(const struct i2c_at } if (ia->ia_ncompat > 0 && ia->ia_compat != NULL) { - if (iic_compatible_match(ia, compats, m
CVS commit: src/share/misc
Module Name:src Committed By: kamil Date: Tue Jun 26 00:06:09 UTC 2018 Modified Files: src/share/misc: acronyms.comp Log Message: Document sanitizers in acronyms.comp Added: ASan, CFI, DFSan, ESan, HWASan, LSan, MSan, TSan, UBSan. To generate a diff of this commit: cvs rdiff -u -r1.208 -r1.209 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.208 src/share/misc/acronyms.comp:1.209 --- src/share/misc/acronyms.comp:1.208 Mon Jun 25 19:56:54 2018 +++ src/share/misc/acronyms.comp Tue Jun 26 00:06:08 2018 @@ -1,4 +1,4 @@ -$NetBSD: acronyms.comp,v 1.208 2018/06/25 19:56:54 sevan Exp $ +$NetBSD: acronyms.comp,v 1.209 2018/06/26 00:06:08 kamil Exp $ 3WHS three-way handshake 8VSB 8-state vestigial side band modulation AA anti-aliasing @@ -77,6 +77,7 @@ ARR address range register ARU audio response unit AS autonomous system ASA Adaptive Security Appliance +ASAN Address Sanitizer ASC advanced smart cache ASCII American Standard Code for Information Interchange ASD agile software development @@ -204,6 +205,7 @@ CF compact flash CFB cipher feedback CFG context-free grammar CFG control-flow graph +CFI control-flow integrity sanitizer CG control gate CGA Color Graphics Adapter CGI common gateway interface @@ -336,6 +338,7 @@ DFA deterministic finite automaton DFC data flow control DFS depth first search DFS distributed file system +DFSAN Data Flow Sanitizer DFT diagnostic function test DFT discrete Fourier transform DGL data generation language @@ -459,6 +462,7 @@ ERD emergency recovery disk ERD entity relationship diagram ERE extended regular expression ERST error record serialization table +ESAN Efficiency Sanitizer ESB enterprise service bus ESDRAM enhanced synchronous dynamic random access memory ESS electronic switching system @@ -591,6 +595,7 @@ HTTP Hypertext Transfer Protocol HTTPS Hypertext Transfer Protocol Secure HVM hardware virtual machine HVDS High-Voltage Differential Signaling +HWASAN Hardware-assisted Address Sanitizer HZ Hertz I2O intelligent input/output IA information assurance @@ -753,6 +758,7 @@ LRC longitudinal redundancy check LRM left-to-right mark LRO left-to-right override LRU least recently used +LSAN Leak Sanitizer LSB Linux standards base LSB least significant {bit,byte} LSI large scale integration @@ -856,6 +862,7 @@ MQTT Message Queuing Telemetry Transport MR modem ready MRU most recently used MS Microsoft +MSAN Memory Sanitizer MSB most significant {bit,byte} MSE mean square error MSF minutes seconds frames @@ -1398,6 +1405,7 @@ TS terminal services TS time series TS time stamp TS transport stream +TSAN Thread Sanitizer TSC time stamp counter TSD time stamp disable TSDB time series database @@ -1421,6 +1429,7 @@ UAF use-after-free UART universal asynchronous receiver/transmitter UAT user acceptance testing UB undefined behavior +UBSAN Undefined Behavior Sanitizer UC uncacheable UCS uniform-cost search UDMA ultra DMA
CVS commit: src/share/misc
Module Name:src Committed By: sevan Date: Mon Jun 25 19:56:54 UTC 2018 Modified Files: src/share/misc: acronyms.comp Log Message: Add HVDS, LVDS, RDRAM To generate a diff of this commit: cvs rdiff -u -r1.207 -r1.208 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.207 src/share/misc/acronyms.comp:1.208 --- src/share/misc/acronyms.comp:1.207 Sun Jun 24 19:48:46 2018 +++ src/share/misc/acronyms.comp Mon Jun 25 19:56:54 2018 @@ -1,4 +1,4 @@ -$NetBSD: acronyms.comp,v 1.207 2018/06/24 19:48:46 sevan Exp $ +$NetBSD: acronyms.comp,v 1.208 2018/06/25 19:56:54 sevan Exp $ 3WHS three-way handshake 8VSB 8-state vestigial side band modulation AA anti-aliasing @@ -590,6 +590,7 @@ HTT hyper-threading technology HTTP Hypertext Transfer Protocol HTTPS Hypertext Transfer Protocol Secure HVM hardware virtual machine +HVDS High-Voltage Differential Signaling HZ Hertz I2O intelligent input/output IA information assurance @@ -771,6 +772,7 @@ LUN logical unit number LV logical volume LVM logical volume management LVT local vector table +LVDS Low-Voltage Differential Signaling LWP light-weight process LZW Lempel Ziv Welch MAC mandatory access control @@ -1130,6 +1132,7 @@ RDBMS relational database management sys RDF Resource Description Framework RDM relational data model RDMA remote direct memory access +RDRAM Rambus DRAM RE regular expression REST representational state transfer RF radio frequency
CVS commit: src/external/bsd/tmux/dist
Module Name:src Committed By: kamil Date: Mon Jun 25 18:41:25 UTC 2018 Modified Files: src/external/bsd/tmux/dist: window-copy.c Log Message: Avoid UB in tmux/window_copy_add_formats() Do not perform NULL pointer arithmetics. Reported with MKSANITIZER/UBSan. The patch proposed by upstream https://github.com/tmux/tmux/issues/1382 To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/bsd/tmux/dist/window-copy.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/tmux/dist/window-copy.c diff -u src/external/bsd/tmux/dist/window-copy.c:1.7 src/external/bsd/tmux/dist/window-copy.c:1.8 --- src/external/bsd/tmux/dist/window-copy.c:1.7 Thu Oct 12 22:17:35 2017 +++ src/external/bsd/tmux/dist/window-copy.c Mon Jun 25 18:41:25 2018 @@ -2418,12 +2418,11 @@ void window_copy_add_formats(struct window_pane *wp, struct format_tree *ft) { struct window_copy_mode_data *data = wp->modedata; - struct screen *s = &data->screen; if (wp->mode != &window_copy_mode) return; - format_add(ft, "selection_present", "%d", s->sel.flag); + format_add(ft, "selection_present", "%d", data->screen.sel.flag); format_add(ft, "scroll_position", "%d", data->oy); }
CVS commit: src/external/bsd/nvi/dist/common
Module Name:src Committed By: kamil Date: Mon Jun 25 18:36:36 UTC 2018 Modified Files: src/external/bsd/nvi/dist/common: log1.c Log Message: Include for offsetof(3) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/nvi/dist/common/log1.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/nvi/dist/common/log1.c diff -u src/external/bsd/nvi/dist/common/log1.c:1.5 src/external/bsd/nvi/dist/common/log1.c:1.6 --- src/external/bsd/nvi/dist/common/log1.c:1.5 Mon Jun 25 17:42:34 2018 +++ src/external/bsd/nvi/dist/common/log1.c Mon Jun 25 18:36:36 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: log1.c,v 1.5 2018/06/25 17:42:34 kamil Exp $ */ +/* $NetBSD: log1.c,v 1.6 2018/06/25 18:36:36 kamil Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -16,7 +16,7 @@ static const char sccsid[] = "Id: log.c,v 10.26 2002/03/02 23:12:13 skimo Exp (Berkeley) Date: 2002/03/02 23:12:13 "; #endif /* not lint */ #else -__RCSID("$NetBSD: log1.c,v 1.5 2018/06/25 17:42:34 kamil Exp $"); +__RCSID("$NetBSD: log1.c,v 1.6 2018/06/25 18:36:36 kamil Exp $"); #endif #include @@ -30,6 +30,7 @@ __RCSID("$NetBSD: log1.c,v 1.5 2018/06/2 #include #include #include +#include #include "common.h"
CVS commit: src/usr.bin/chpass
Module Name:src Committed By: kamil Date: Mon Jun 25 18:05:25 UTC 2018 Modified Files: src/usr.bin/chpass: Makefile Log Message: Specify SANITIZER_RENAME_SYMBOL in chpass Rename local versions of getpwent getpwnam getpwnam_r getpwuid getpwuid_r (all of the symbols are namespaced) in order to remove symbol clash with libc. This program uses code directly from libc. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.bin/chpass/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/chpass/Makefile diff -u src/usr.bin/chpass/Makefile:1.15 src/usr.bin/chpass/Makefile:1.16 --- src/usr.bin/chpass/Makefile:1.15 Mon May 28 12:06:25 2007 +++ src/usr.bin/chpass/Makefile Mon Jun 25 18:05:25 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.15 2007/05/28 12:06:25 tls Exp $ +# $NetBSD: Makefile,v 1.16 2018/06/25 18:05:25 kamil Exp $ # @(#)Makefile 8.2 (Berkeley) 4/2/94 .include @@ -22,6 +22,11 @@ LDADD+= -lrpcsvc .else SRCS+= getpwent.c CPPFLAGS.getpwent.c=-UYP +SANITIZER_RENAME_SYMBOL+= __getpwent50 +SANITIZER_RENAME_SYMBOL+= __getpwnam50 +SANITIZER_RENAME_SYMBOL+= __getpwnam_r50 +SANITIZER_RENAME_SYMBOL+= __getpwuid50 +SANITIZER_RENAME_SYMBOL+= __getpwuid_r50 .endif DPADD+= ${LIBUTIL}
CVS commit: src/external/gpl2/xcvs
Module Name:src Committed By: kamil Date: Mon Jun 25 18:03:56 UTC 2018 Modified Files: src/external/gpl2/xcvs: Makefile.inc Log Message: Specify SANITIZER_RENAME_SYMBOL in cvs Rename local versions of regcomp regerror regexec regfree in order to remove symbol clash with libc. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/xcvs/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/xcvs/Makefile.inc diff -u src/external/gpl2/xcvs/Makefile.inc:1.4 src/external/gpl2/xcvs/Makefile.inc:1.5 --- src/external/gpl2/xcvs/Makefile.inc:1.4 Sat Jan 30 16:47:00 2016 +++ src/external/gpl2/xcvs/Makefile.inc Mon Jun 25 18:03:56 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.4 2016/01/30 16:47:00 christos Exp $ +# $NetBSD: Makefile.inc,v 1.5 2018/06/25 18:03:56 kamil Exp $ .include @@ -24,3 +24,5 @@ COBJDIR!=cd $(.CURDIR)/../../lib/libcvs LIBDIFF= ${DOBJDIR}/libdiff.a LIBCVS= ${COBJDIR}/libcvs.a .endif + +SANITIZER_RENAME_SYMBOL+= regcomp regerror regexec regfree
CVS commit: src/external/gpl2/grep
Module Name:src Committed By: kamil Date: Mon Jun 25 18:02:49 UTC 2018 Modified Files: src/external/gpl2/grep: Makefile.inc Log Message: Specify SANITIZER_RENAME_SYMBOL in grep Rename local versions of regcomp regerror regexec regfree in order to remove symbol clash with libc. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/gpl2/grep/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/grep/Makefile.inc diff -u src/external/gpl2/grep/Makefile.inc:1.1 src/external/gpl2/grep/Makefile.inc:1.2 --- src/external/gpl2/grep/Makefile.inc:1.1 Sun Jan 10 22:16:40 2016 +++ src/external/gpl2/grep/Makefile.inc Mon Jun 25 18:02:49 2018 @@ -1,7 +1,9 @@ -# $NetBSD: Makefile.inc,v 1.1 2016/01/10 22:16:40 christos Exp $ +# $NetBSD: Makefile.inc,v 1.2 2018/06/25 18:02:49 kamil Exp $ .include +SANITIZER_RENAME_SYMBOL+= regcomp regerror regexec regfree + WARNS= 0 IDIST= ${NETBSDSRCDIR}/external/gpl2/grep/dist
CVS commit: src/external/gpl2/diffutils
Module Name:src Committed By: kamil Date: Mon Jun 25 18:01:13 UTC 2018 Modified Files: src/external/gpl2/diffutils: Makefile.inc Log Message: Specify SANITIZER_RENAME_SYMBOL in diffutils Rename local versions of regcomp regerror regexec regfree in order to remove symbol clash with libc. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/gpl2/diffutils/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/diffutils/Makefile.inc diff -u src/external/gpl2/diffutils/Makefile.inc:1.1 src/external/gpl2/diffutils/Makefile.inc:1.2 --- src/external/gpl2/diffutils/Makefile.inc:1.1 Wed Jan 13 03:39:28 2016 +++ src/external/gpl2/diffutils/Makefile.inc Mon Jun 25 18:01:13 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.1 2016/01/13 03:39:28 christos Exp $ +# $NetBSD: Makefile.inc,v 1.2 2018/06/25 18:01:13 kamil Exp $ WARNS= 0 @@ -6,3 +6,5 @@ IDIST= ${NETBSDSRCDIR}/external/gpl2/dif CPPFLAGS+= -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H \ -I${IDIST}/../include -I${IDIST}/lib + +SANITIZER_RENAME_SYMBOL+= regcomp regerror regexec regfree
CVS commit: src/external/bsd/nvi
Module Name:src Committed By: kamil Date: Mon Jun 25 18:00:34 UTC 2018 Modified Files: src/external/bsd/nvi: Makefile.inc Log Message: Specify SANITIZER_RENAME_SYMBOL in nvi Rename local versions of regcomp regerror regexec regfree in order to remove symbol clash with libc. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/nvi/Makefile.inc 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/nvi/Makefile.inc diff -u src/external/bsd/nvi/Makefile.inc:1.5 src/external/bsd/nvi/Makefile.inc:1.6 --- src/external/bsd/nvi/Makefile.inc:1.5 Sat Jan 21 22:27:43 2017 +++ src/external/bsd/nvi/Makefile.inc Mon Jun 25 18:00:34 2018 @@ -1,7 +1,9 @@ -# $NetBSD: Makefile.inc,v 1.5 2017/01/21 22:27:43 rin Exp $ +# $NetBSD: Makefile.inc,v 1.6 2018/06/25 18:00:34 kamil Exp $ .include +SANITIZER_RENAME_SYMBOL+= regcomp regerror regexec regfree + DIST= ${NETBSDSRCDIR}/external/bsd/nvi/dist .PATH: ${DIST} BINDIR=/usr/bin
CVS commit: src/share/mk
Module Name:src Committed By: kamil Date: Mon Jun 25 17:58:36 UTC 2018 Modified Files: src/share/mk: bsd.lib.mk bsd.prog.mk Log Message: Add a framework for renaming symbols in libc&co for MKSANITIZER A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified a list of symbols to be renamed in a processor in order to remove naming conflicts with public symbols in libc/m/pthread/rt. This renaming will occur for libraries and programs. A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'. Based on an idea by To generate a diff of this commit: cvs rdiff -u -r1.375 -r1.376 src/share/mk/bsd.lib.mk cvs rdiff -u -r1.314 -r1.315 src/share/mk/bsd.prog.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.lib.mk diff -u src/share/mk/bsd.lib.mk:1.375 src/share/mk/bsd.lib.mk:1.376 --- src/share/mk/bsd.lib.mk:1.375 Thu Jun 21 11:24:38 2018 +++ src/share/mk/bsd.lib.mk Mon Jun 25 17:58:36 2018 @@ -1,9 +1,17 @@ -# $NetBSD: bsd.lib.mk,v 1.375 2018/06/21 11:24:38 kamil Exp $ +# $NetBSD: bsd.lib.mk,v 1.376 2018/06/25 17:58:36 kamil Exp $ # @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94 .include .include .include + +# Rename the local function definitions to not conflict with libc/rt/pthread/m. +.if ${MKSANITIZER:Uno} == "yes" && defined(SANITIZER_RENAME_SYMBOL) +. for _symbol in ${SANITIZER_RENAME_SYMBOL} +CPPFLAGS+= -D${_symbol}=__mksanitizer_${_symbol} +. endfor +.endif + # Pull in here so we can override its .c.o rule .include Index: src/share/mk/bsd.prog.mk diff -u src/share/mk/bsd.prog.mk:1.314 src/share/mk/bsd.prog.mk:1.315 --- src/share/mk/bsd.prog.mk:1.314 Thu Jun 21 11:24:38 2018 +++ src/share/mk/bsd.prog.mk Mon Jun 25 17:58:36 2018 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prog.mk,v 1.314 2018/06/21 11:24:38 kamil Exp $ +# $NetBSD: bsd.prog.mk,v 1.315 2018/06/25 17:58:36 kamil Exp $ # @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94 .ifndef HOSTPROG @@ -13,6 +13,13 @@ CFLAGS+= ${SANITIZERFLAGS} CXXFLAGS+= ${SANITIZERFLAGS} LDFLAGS+= ${SANITIZERFLAGS} +# Rename the local function definitions to not conflict with libc/rt/pthread/m. +.if ${MKSANITIZER:Uno} == "yes" && defined(SANITIZER_RENAME_SYMBOL) +. for _symbol in ${SANITIZER_RENAME_SYMBOL} +CPPFLAGS+= -D${_symbol}=__mksanitizer_${_symbol} +. endfor +.endif + # # Definitions and targets shared among all programs built by a single # Makefile.
CVS commit: src/external/bsd/nvi/dist/common
Module Name:src Committed By: kamil Date: Mon Jun 25 17:42:34 UTC 2018 Modified Files: src/external/bsd/nvi/dist/common: log1.c Log Message: Avoid unportable offsetof(3) calculation in nvi in log1.c Detected with MKSANITIZER/UBSan. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/bsd/nvi/dist/common/log1.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/nvi/dist/common/log1.c diff -u src/external/bsd/nvi/dist/common/log1.c:1.4 src/external/bsd/nvi/dist/common/log1.c:1.5 --- src/external/bsd/nvi/dist/common/log1.c:1.4 Sun Jan 26 21:43:45 2014 +++ src/external/bsd/nvi/dist/common/log1.c Mon Jun 25 17:42:34 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: log1.c,v 1.4 2014/01/26 21:43:45 christos Exp $ */ +/* $NetBSD: log1.c,v 1.5 2018/06/25 17:42:34 kamil Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -16,7 +16,7 @@ static const char sccsid[] = "Id: log.c,v 10.26 2002/03/02 23:12:13 skimo Exp (Berkeley) Date: 2002/03/02 23:12:13 "; #endif /* not lint */ #else -__RCSID("$NetBSD: log1.c,v 1.4 2014/01/26 21:43:45 christos Exp $"); +__RCSID("$NetBSD: log1.c,v 1.5 2018/06/25 17:42:34 kamil Exp $"); #endif #include @@ -88,7 +88,7 @@ typedef struct { chardata[sizeof(u_char) /* type */ + sizeof(db_recno_t)]; CHAR_T str[1]; } log_t; -#define CHAR_T_OFFSET ((char *)(((log_t*)0)->str) - (char *)0) +#define CHAR_T_OFFSET (offsetof(log_t, str)) /* * log_init --
CVS commit: src/usr.bin/jot
Module Name:src Committed By: christos Date: Mon Jun 25 14:29:17 UTC 2018 Modified Files: src/usr.bin/jot: jot.1 jot.c Log Message: Don't require any arguments as the usage indicates; simplifies the code and the documentation: now "jot" works like "jot -" used to (and continues to). From Ingo Schwarze To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.bin/jot/jot.1 cvs rdiff -u -r1.25 -r1.26 src/usr.bin/jot/jot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/jot/jot.1 diff -u src/usr.bin/jot/jot.1:1.15 src/usr.bin/jot/jot.1:1.16 --- src/usr.bin/jot/jot.1:1.15 Mon Jul 3 17:34:19 2017 +++ src/usr.bin/jot/jot.1 Mon Jun 25 10:29:17 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: jot.1,v 1.15 2017/07/03 21:34:19 wiz Exp $ +.\" $NetBSD: jot.1,v 1.16 2018/06/25 14:29:17 christos Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)jot.1 8.1 (Berkeley) 6/6/93 .\" -.Dd January 5, 2016 +.Dd June 25, 2018 .Dt JOT 1 .Os .Sh NAME @@ -104,8 +104,7 @@ in which case the data are inserted rath The last four arguments indicate, respectively, the number of data, the lower bound, the upper bound, and the step size or, for random data, the seed. -While at least one of them must appear, -any of the other three may be omitted, and +Any argument may be omitted, and will be considered as such if given as .Dq - . Any three of these arguments determines the fourth. Index: src/usr.bin/jot/jot.c diff -u src/usr.bin/jot/jot.c:1.25 src/usr.bin/jot/jot.c:1.26 --- src/usr.bin/jot/jot.c:1.25 Sun Apr 12 07:19:18 2009 +++ src/usr.bin/jot/jot.c Mon Jun 25 10:29:17 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: jot.c,v 1.25 2009/04/12 11:19:18 lukem Exp $ */ +/* $NetBSD: jot.c,v 1.26 2018/06/25 14:29:17 christos Exp $ */ /*- * Copyright (c) 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\ #if 0 static char sccsid[] = "@(#)jot.c 8.1 (Berkeley) 6/6/93"; #endif -__RCSID("$NetBSD: jot.c,v 1.25 2009/04/12 11:19:18 lukem Exp $"); +__RCSID("$NetBSD: jot.c,v 1.26 2018/06/25 14:29:17 christos Exp $"); #endif /* not lint */ /* @@ -216,9 +216,7 @@ getargs(int argc, char *argv[]) argv[0]); have |= REPS; } - break; case 0: - usage(); break; default: errx(EXIT_FAILURE,
CVS commit: src/sys/dev/ppbus
Module Name:src Committed By: msaitoh Date: Mon Jun 25 13:28:12 UTC 2018 Modified Files: src/sys/dev/ppbus: if_plip.c Log Message: KNF & fix typo. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/ppbus/if_plip.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/ppbus/if_plip.c diff -u src/sys/dev/ppbus/if_plip.c:1.28 src/sys/dev/ppbus/if_plip.c:1.29 --- src/sys/dev/ppbus/if_plip.c:1.28 Sun Jun 25 12:27:13 2017 +++ src/sys/dev/ppbus/if_plip.c Mon Jun 25 13:28:12 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_plip.c,v 1.28 2017/06/25 12:27:13 maxv Exp $ */ +/* $NetBSD: if_plip.c,v 1.29 2018/06/25 13:28:12 msaitoh Exp $ */ /*- * Copyright (c) 1997 Poul-Henning Kamp @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_plip.c,v 1.28 2017/06/25 12:27:13 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_plip.c,v 1.29 2018/06/25 13:28:12 msaitoh Exp $"); /* * Parallel port TCP/IP interfaces added. I looked at the driver from @@ -41,7 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_plip.c,v * This driver sends two bytes (0x08, 0x00) in front of each packet, * to allow us to distinguish another format later. * - * Now added an Linux/Crynwr compatibility mode which is enabled using + * Now added a Linux/Crynwr compatibility mode which is enabled using * IF_LINK0 - Tim Wilkinson. * * TODO: @@ -194,7 +194,7 @@ static void lpinittables(void); static void lpfreetables(void); static int lpioctl(struct ifnet *, u_long, void *); static int lpoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, - const struct rtentry *); +const struct rtentry *); static void lpstart(struct ifnet *); static void lp_intr(void *); @@ -205,7 +205,7 @@ lp_probe(device_t parent, cfdata_t match struct ppbus_attach_args * args = aux; /* Fail if ppbus is not interrupt capable */ - if(args->capabilities & PPBUS_HAS_INTR) + if (args->capabilities & PPBUS_HAS_INTR) return 1; printf("%s(%s): not an interrupt-driven port.\n", __func__, @@ -243,7 +243,7 @@ lp_attach(device_t parent, device_t self bpf_attach(ifp, DLT_NULL, sizeof(u_int32_t)); - if(lp_count++ == 0) + if (lp_count++ == 0) lpinittables(); printf("\n"); } @@ -255,8 +255,8 @@ lp_detach(device_t self, int flags) struct lp_softc * lp = device_private(self); device_t ppbus = device_parent(self); - if(lp->sc_dev_ok) { - if(!(flags & DETACH_QUIET)) + if (lp->sc_dev_ok) { + if (!(flags & DETACH_QUIET)) LP_PRINTF("%s(%s): device not properly attached! " "Skipping detach\n", __func__, device_xname(self)); @@ -264,33 +264,33 @@ lp_detach(device_t self, int flags) } /* If interface is up, bring it down and release ppbus */ - if(lp->sc_if.if_flags & IFF_RUNNING) { + if (lp->sc_if.if_flags & IFF_RUNNING) { ppbus_wctr(ppbus, 0x00); if_detach(&lp->sc_if); error = ppbus_remove_handler(ppbus, lp_intr); - if(error) { - if(!(flags & DETACH_QUIET)) + if (error) { + if (!(flags & DETACH_QUIET)) LP_PRINTF("%s(%s): unable to remove interrupt " "callback.\n", __func__, device_xname(self)); - if(!(flags & DETACH_FORCE)) + if (!(flags & DETACH_FORCE)) return error; } error = ppbus_release_bus(ppbus, self, 0, 0); - if(error) { - if(!(flags & DETACH_QUIET)) + if (error) { + if (!(flags & DETACH_QUIET)) LP_PRINTF("%s(%s): error releasing bus %s.\n", __func__, device_xname(self), device_xname(ppbus)); - if(!(flags & DETACH_FORCE)) + if (!(flags & DETACH_FORCE)) return error; } } - if(lp->sc_ifbuf) + if (lp->sc_ifbuf) free(lp->sc_ifbuf, M_DEVBUF); - if(--lp_count == 0) + if (--lp_count == 0) lpfreetables(); return error; } @@ -301,7 +301,7 @@ lp_detach(device_t self, int flags) * precalculate them when we initialize. */ static void -lpinittables (void) +lpinittables(void) { int i; @@ -311,14 +311,14 @@ lpinittables (void) if (!ctxmith) ctxmith = malloc(4*LPIPTBLSIZE, M_DEVBUF, M_WAITOK); - for(i = 0; i < LPIPTBLSIZE; i++) { + for (i = 0; i < LPIPTBLSIZE; i++) { ctxmith[i] = (i & 0xF0) >> 4; ctxmitl[i] = 0x10 | (i & 0x0F); ctrecvh[i] = (i & 0x78) << 1; ctrecvl[i] = (i & 0x78) >> 3; } - for(i = 0; i < LPIPTBLSIZE; i++) { + for (i = 0; i < LPIPTBLSIZE; i++) { txmith[i] = ((i & 0x80) >> 3) | ((i & 0x70) >> 4) | 0x08; txmitl[i] = ((i & 0x08) << 1) | (i & 0x07); trecvh[i] = ((~i) & 0x80) | ((i & 0x38) << 1); @@ -328,7 +328,7 @@ lpinittables (void) /* Free translation tables */ static void -lpfreetables (void) +lpfreetables(void) { if (txmith) free(txmith, M_DEVBUF); @@ -353,7 +353,7 @@ lpioctl(struct ifnet *ifp, u_long cmd, v error = 0; s = splnet(); - if(sc->sc_dev_ok) { + if (sc->sc_dev_ok) { LP_PRINTF("%s(%s): device not properly attached!", __func__, device_xname(dev)); error = ENODEV; @@ -377,15 +37
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Mon Jun 25 13:01:26 UTC 2018 Modified Files: src/doc [netbsd-8]: CHANGES-8.0 Log Message: Ticket #904, ammend #892 To generate a diff of this commit: cvs rdiff -u -r1.1.2.218 -r1.1.2.219 src/doc/CHANGES-8.0 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-8.0 diff -u src/doc/CHANGES-8.0:1.1.2.218 src/doc/CHANGES-8.0:1.1.2.219 --- src/doc/CHANGES-8.0:1.1.2.218 Sun Jun 24 09:51:46 2018 +++ src/doc/CHANGES-8.0 Mon Jun 25 13:01:26 2018 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.0,v 1.1.2.218 2018/06/24 09:51:46 martin Exp $ +# $NetBSD: CHANGES-8.0,v 1.1.2.219 2018/06/25 13:01:26 martin Exp $ A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04 until the 8.0 release: @@ -13994,8 +13994,10 @@ crypto/external/bsd/openssl/dist/crypto/ lib/libc/sys/sched.c1.5 +tests/lib/libc/gen/posix_spawn/t_spawnattr.c 1.2,1.3 Return PRI_NONE for sched_get_priority_m{in,ax} and SCHED_OTHER. + Fix broken test, don't use SCHED_OTHER. [maya, ticket #892] sys/netinet6/icmp6.c1.228,1.230 @@ -14106,3 +14108,13 @@ sys/sys/param.h changed manually Welcome to 8.0 RC2 +distrib/common/Makefile.bootcd 1.40 + + Do not put debug.tgz and xdebug.tgz onto install CDs. + [martin, ticket #904] + +tests/lib/libc/gen/posix_spawn/t_spawnattr.c +distrib/common/Makefile.bootcd +doc/CHANGES-8.0 + + Tag moved for additional RC2 pullups (#892, #904)
CVS commit: [netbsd-8] src/distrib/common
Module Name:src Committed By: martin Date: Mon Jun 25 12:59:27 UTC 2018 Modified Files: src/distrib/common [netbsd-8]: Makefile.bootcd Log Message: Pull up following revision(s) (requested by martin in ticket #904): distrib/common/Makefile.bootcd: revision 1.40 Do not put debug.tgz and xdebug.tgz onto install CDs (a lot of them grow out of bounds and for some architectures can not turn into DVDs). To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.38.4.1 src/distrib/common/Makefile.bootcd Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/Makefile.bootcd diff -u src/distrib/common/Makefile.bootcd:1.38 src/distrib/common/Makefile.bootcd:1.38.4.1 --- src/distrib/common/Makefile.bootcd:1.38 Thu Feb 16 02:37:32 2017 +++ src/distrib/common/Makefile.bootcd Mon Jun 25 12:59:27 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootcd,v 1.38 2017/02/16 02:37:32 christos Exp $ +# $NetBSD: Makefile.bootcd,v 1.38.4.1 2018/06/25 12:59:27 martin Exp $ # # Makefile snipped to create a CD/DVD ISO # @@ -185,6 +185,8 @@ copy-releasedir: ${TOOL_PAX} ${PAX_TIMESTAMP}\ -rw -pe ${PAX_v}\ ${CDRELEASE_EXCLUDE}\ + -s ',./binary/sets/debug.tgz,,gp' \ + -s ',./binary/sets/xdebug.tgz,,gp' \ . $$release_destdir; \ cd "${CUROBJDIR}"; \ fi
CVS commit: [netbsd-8] src/tests/lib/libc/gen/posix_spawn
Module Name:src Committed By: martin Date: Mon Jun 25 12:55:01 UTC 2018 Modified Files: src/tests/lib/libc/gen/posix_spawn [netbsd-8]: t_spawnattr.c Log Message: Additionally pull up following revision(s) (requested by maya in ticket #892): tests/lib/libc/gen/posix_spawn/t_spawnattr.c: revision 1.2,1.3 Don't use SCHED_OTHER. Fix broken test: we can't assume that the current schedule priority range will overlap with the requested scheduler range, so get the new scheduler range, and then try to find a different priority. If that fails (to find a different scheduling range), give up here. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.1.34.1 \ src/tests/lib/libc/gen/posix_spawn/t_spawnattr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/gen/posix_spawn/t_spawnattr.c diff -u src/tests/lib/libc/gen/posix_spawn/t_spawnattr.c:1.1 src/tests/lib/libc/gen/posix_spawn/t_spawnattr.c:1.1.34.1 --- src/tests/lib/libc/gen/posix_spawn/t_spawnattr.c:1.1 Mon Feb 13 21:03:08 2012 +++ src/tests/lib/libc/gen/posix_spawn/t_spawnattr.c Mon Jun 25 12:55:01 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: t_spawnattr.c,v 1.1 2012/02/13 21:03:08 martin Exp $ */ +/* $NetBSD: t_spawnattr.c,v 1.1.34.1 2018/06/25 12:55:01 martin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -45,37 +45,33 @@ #define MAX(a, b) (a) > (b) ? (a) : (b) #define MIN(a, b) (a) > (b) ? (b) : (a) -static int get_different_scheduler(void); -static int get_different_priority(void); - static int -get_different_scheduler() +get_different_scheduler(void) { - int scheduler, max, min, new; - - max = MAX(MAX(SCHED_FIFO, SCHED_OTHER), SCHED_RR); - min = MIN(MIN(SCHED_FIFO, SCHED_OTHER), SCHED_RR); + /* + * We don't want to use SCHED_OTHER because it does not have + * different priorities. + */ /* get current schedule policy */ - scheduler = sched_getscheduler(0); - - /* new scheduler */ - new = (scheduler + 1); - if (new > max) - new = min; - - return new; + switch (sched_getscheduler(0)) { + case SCHED_RR: + return SCHED_FIFO; + case SCHED_FIFO: + case SCHED_OTHER: + return SCHED_RR; + default: + abort(); + } } static int -get_different_priority() +get_different_priority(int scheduler) { - int scheduler, max, min, new, priority; + int min, max, new, priority; struct sched_param param; - /* get current schedule policy */ - scheduler = sched_getscheduler(0); - + /* Get the priority range for the new scheduler */ max = sched_get_priority_max(scheduler); min = sched_get_priority_min(scheduler); @@ -83,10 +79,13 @@ get_different_priority() priority = param.sched_priority; /* new schedule policy */ - new = (priority + 1); - if (new > max) - new = min; + for (new = min; new <= max; new++) + if (priority != new) + break; + ATF_REQUIRE_MSG(priority != new, "could not find different priority"); + printf("min %d max %d for scheduler %d, returning %d\n", + min, max, scheduler, new); return new; } @@ -119,8 +118,9 @@ ATF_TC_BODY(t_spawnattr, tc) posix_spawnattr_init(&attr); scheduler = get_different_scheduler(); - priority = get_different_priority(); + priority = get_different_priority(scheduler); sp.sched_priority = priority; + printf("using scheduler %d, priority %d\n", scheduler, priority); sigemptyset(&sig); sigaddset(&sig, SIGUSR1);
CVS commit: src/distrib/common
Module Name:src Committed By: martin Date: Mon Jun 25 12:18:22 UTC 2018 Modified Files: src/distrib/common: Makefile.bootcd Log Message: Do not put debug.tgz and xdebug.tgz onto install CDs (a lot of them grow out of bounds and for some architectures can not turn into DVDs). To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/distrib/common/Makefile.bootcd Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/Makefile.bootcd diff -u src/distrib/common/Makefile.bootcd:1.39 src/distrib/common/Makefile.bootcd:1.40 --- src/distrib/common/Makefile.bootcd:1.39 Fri Sep 8 09:50:44 2017 +++ src/distrib/common/Makefile.bootcd Mon Jun 25 12:18:22 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootcd,v 1.39 2017/09/08 09:50:44 martin Exp $ +# $NetBSD: Makefile.bootcd,v 1.40 2018/06/25 12:18:22 martin Exp $ # # Makefile snipped to create a CD/DVD ISO # @@ -189,6 +189,8 @@ copy-releasedir: ${TOOL_PAX} ${PAX_TIMESTAMP}\ -rw -pe ${PAX_v}\ ${CDRELEASE_EXCLUDE}\ + -s ',./binary/sets/debug.tgz,,gp' \ + -s ',./binary/sets/xdebug.tgz,,gp' \ . $$release_destdir; \ cd "${CUROBJDIR}"; \ fi
CVS commit: [pgoyette-compat] src/external/cddl/osnet/dev/fbt
Module Name:src Committed By: pgoyette Date: Mon Jun 25 11:22:57 UTC 2018 Modified Files: src/external/cddl/osnet/dev/fbt [pgoyette-compat]: fbt.c Log Message: Adapt to new world order - mod_required is no a pointer to an array. To generate a diff of this commit: cvs rdiff -u -r1.23.2.2 -r1.23.2.3 src/external/cddl/osnet/dev/fbt/fbt.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/cddl/osnet/dev/fbt/fbt.c diff -u src/external/cddl/osnet/dev/fbt/fbt.c:1.23.2.2 src/external/cddl/osnet/dev/fbt/fbt.c:1.23.2.3 --- src/external/cddl/osnet/dev/fbt/fbt.c:1.23.2.2 Mon Jun 25 07:25:14 2018 +++ src/external/cddl/osnet/dev/fbt/fbt.c Mon Jun 25 11:22:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: fbt.c,v 1.23.2.2 2018/06/25 07:25:14 pgoyette Exp $ */ +/* $NetBSD: fbt.c,v 1.23.2.3 2018/06/25 11:22:57 pgoyette Exp $ */ /* * CDDL HEADER START @@ -284,7 +284,7 @@ fbt_provide_module(void *arg, modctl_t * * dependency are ineligible for FBT tracing. */ for (i = 0; i < mod->mod_nrequired; i++) { - if (strncmp(module_name(mod->mod_required[i]), + if (strncmp(module_name((*mod->mod_required)[i]), "dtrace", 6) == 0) return; }
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Mon Jun 25 10:53:47 UTC 2018 Modified Files: src/share/man/man9: bpf.9 Log Message: Remove superfluous Pp. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/share/man/man9/bpf.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/bpf.9 diff -u src/share/man/man9/bpf.9:1.4 src/share/man/man9/bpf.9:1.5 --- src/share/man/man9/bpf.9:1.4 Mon Jun 25 03:22:14 2018 +++ src/share/man/man9/bpf.9 Mon Jun 25 10:53:47 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: bpf.9,v 1.4 2018/06/25 03:22:14 msaitoh Exp $ +.\" $NetBSD: bpf.9,v 1.5 2018/06/25 10:53:47 wiz Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -36,7 +36,6 @@ .Sh DESCRIPTION .Nm is called via an operations vector described by the following struct: -.Pp .Bd -literal struct bpf_ops { void (*bpf_attach)(struct ifnet *, u_int, u_int, struct bpf_if **);
CVS commit: [pgoyette-compat] src/sys/sys
Module Name:src Committed By: pgoyette Date: Mon Jun 25 10:11:21 UTC 2018 Modified Files: src/sys/sys [pgoyette-compat]: module.h Log Message: Resolve conflict correctly! To generate a diff of this commit: cvs rdiff -u -r1.41.14.9 -r1.41.14.10 src/sys/sys/module.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/module.h diff -u src/sys/sys/module.h:1.41.14.9 src/sys/sys/module.h:1.41.14.10 --- src/sys/sys/module.h:1.41.14.9 Mon Jun 25 07:22:54 2018 +++ src/sys/sys/module.h Mon Jun 25 10:11:21 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: module.h,v 1.41.14.9 2018/06/25 07:22:54 pgoyette Exp $ */ +/* $NetBSD: module.h,v 1.41.14.10 2018/06/25 10:11:21 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -250,8 +250,9 @@ typedef struct modctl_load { enum modctl { MODCTL_LOAD, /* modctl_load_t *ml */ MODCTL_UNLOAD, /* char *name */ - MODCTL_STAT, /* struct iovec *buffer */ - MODCTL_EXISTS /* enum: 0: load, 1: autoload */ + MODCTL_OSTAT, /* struct iovec *buffer */ + MODCTL_EXISTS, /* enum: 0: load, 1: autoload */ + MODCTL_STAT /* struct iovec *buffer */ }; /*
CVS commit: src/sys/dev/pcmcia
Module Name:src Committed By: msaitoh Date: Mon Jun 25 09:57:26 UTC 2018 Modified Files: src/sys/dev/pcmcia: if_malo_pcmcia.c Log Message: Simplify bpf_mtap() call. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pcmcia/if_malo_pcmcia.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/pcmcia/if_malo_pcmcia.c diff -u src/sys/dev/pcmcia/if_malo_pcmcia.c:1.16 src/sys/dev/pcmcia/if_malo_pcmcia.c:1.17 --- src/sys/dev/pcmcia/if_malo_pcmcia.c:1.16 Mon Jan 22 14:40:53 2018 +++ src/sys/dev/pcmcia/if_malo_pcmcia.c Mon Jun 25 09:57:25 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_malo_pcmcia.c,v 1.16 2018/01/22 14:40:53 maxv Exp $ */ +/* $NetBSD: if_malo_pcmcia.c,v 1.17 2018/06/25 09:57:25 msaitoh Exp $ */ /* $OpenBSD: if_malo.c,v 1.65 2009/03/29 21:53:53 sthen Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_malo_pcmcia.c,v 1.16 2018/01/22 14:40:53 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_malo_pcmcia.c,v 1.17 2018/06/25 09:57:25 msaitoh Exp $"); #ifdef _MODULE #include @@ -522,8 +522,7 @@ cmalo_start(struct ifnet *ifp) IFQ_DEQUEUE(&ifp->if_snd, m); - if (ifp->if_bpf) - bpf_ops->bpf_mtap(ifp->if_bpf, m); + bpf_mtap(ifp, m); if (cmalo_tx(sc, m) != 0) ifp->if_oerrors++;
CVS commit: src/share/mk
Module Name:src Committed By: kamil Date: Mon Jun 25 09:38:46 UTC 2018 Modified Files: src/share/mk: bsd.README Log Message: Rephrase the documentation of MKSANITIZER Based on the feedback from and . To generate a diff of this commit: cvs rdiff -u -r1.376 -r1.377 src/share/mk/bsd.README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.README diff -u src/share/mk/bsd.README:1.376 src/share/mk/bsd.README:1.377 --- src/share/mk/bsd.README:1.376 Sun Jun 24 20:40:58 2018 +++ src/share/mk/bsd.README Mon Jun 25 09:38:46 2018 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.README,v 1.376 2018/06/24 20:40:58 kamil Exp $ +# $NetBSD: bsd.README,v 1.377 2018/06/25 09:38:46 kamil Exp $ # @(#)bsd.README 8.2 (Berkeley) 4/2/94 This is the README file for the make "include" files for the NetBSD @@ -392,7 +392,7 @@ MKSANITIZER if "yes", use the selected s "address". A selection of available sanitizers: address: A memory error detector (default) thread: A data race detector - memory: An uninitializer read detector + memory: An uninitialized memory read detector undefined: An undefined behavior detector leak: A memory leak detector dataflow: A general data flow analysis @@ -400,12 +400,11 @@ MKSANITIZER if "yes", use the selected s safe-stack: Protect against stack-based corruption scudo: The Scudo Hardened allocator It's possible to specify multiple sanitizers within the - USE_SANITIZER option (comma separated) and some combinations of - them work. The USE_SANITIZER value is passed to the -fsanitize= - argument to a compiler. + USE_SANITIZER option (comma separated). The USE_SANITIZER value + is passed to the -fsanitize= argument to the compiler. Additional arguments can be passed through SANITIZERFLAGS. - The list of supported features depends on the compiler version - and target CPU architecture. + The list of supported features and their valid combinations + depends on the compiler version and target CPU architecture. MKSHARE If "no", act as "MKCATPAGES=no MKDOC=no MKHTML=no MKINFO=no MKMAN=no MKNLS=no".
CVS commit: src
Module Name:src Committed By: msaitoh Date: Mon Jun 25 09:32:28 UTC 2018 Modified Files: src/doc: TODO.smpnet src/sys/dev/pci: if_lmc.c if_lmc.h Log Message: Move txintr_setup() stuff from lmc_interrupt() and do it in ifnet_start(). Now we can use bpf_mtap() in the TX path. Not tested. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/doc/TODO.smpnet cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/if_lmc.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/if_lmc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/TODO.smpnet diff -u src/doc/TODO.smpnet:1.19 src/doc/TODO.smpnet:1.20 --- src/doc/TODO.smpnet:1.19 Tue Feb 27 14:28:01 2018 +++ src/doc/TODO.smpnet Mon Jun 25 09:32:28 2018 @@ -1,4 +1,4 @@ -$NetBSD: TODO.smpnet,v 1.19 2018/02/27 14:28:01 maxv Exp $ +$NetBSD: TODO.smpnet,v 1.20 2018/06/25 09:32:28 msaitoh Exp $ MP-safe components == @@ -104,7 +104,7 @@ This is the list of the functions that h - sca_frame_process() @ sys/dev/ic/hd64570.c - en_intr() @ sys/dev/ic/midway.c - - rxintr_cleanup() and txintr_cleanup() @ sys/dev/pci/if_lmc.c + - rxintr_cleanup() @ sys/dev/pci/if_lmc.c - ipr_rx_data_rdy() @ sys/netisdn/i4b_ipr.c Ideally we should make the functions run in softint somehow, but we don't have Index: src/sys/dev/pci/if_lmc.c diff -u src/sys/dev/pci/if_lmc.c:1.64 src/sys/dev/pci/if_lmc.c:1.65 --- src/sys/dev/pci/if_lmc.c:1.64 Wed Feb 7 06:18:11 2018 +++ src/sys/dev/pci/if_lmc.c Mon Jun 25 09:32:28 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_lmc.c,v 1.64 2018/02/07 06:18:11 mrg Exp $ */ +/* $NetBSD: if_lmc.c,v 1.65 2018/06/25 09:32:28 msaitoh Exp $ */ /*- * Copyright (c) 2002-2006 David Boggs. @@ -74,7 +74,7 @@ */ # include -__KERNEL_RCSID(0, "$NetBSD: if_lmc.c,v 1.64 2018/02/07 06:18:11 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_lmc.c,v 1.65 2018/06/25 09:32:28 msaitoh Exp $"); # include /* OS version */ # include "opt_inet.h" /* INET6, INET */ # include "opt_altq_enabled.h" /* ALTQ */ @@ -3388,7 +3388,7 @@ ifnet_output(struct ifnet *ifp, struct m } else /* Process tx pkts; do not process rx pkts. */ -lmc_interrupt(sc, 0, 0); +ifnet_start(ifp); return error; } @@ -3466,9 +3466,43 @@ static void /* context: process */ ifnet_start(struct ifnet *ifp) { softc_t *sc = IFP2SC(ifp); + int activity; - /* Process tx pkts; do not process rx pkts. */ - lmc_interrupt(sc, 0, 0); + /* Do this FIRST! Otherwise UPs deadlock and MPs spin. */ + WRITE_CSR(sc, TLP_STATUS, READ_CSR(sc, TLP_STATUS)); + + /* If any CPU is inside this critical section, then */ + /* other CPUs should go away without doing anything. */ + if (BOTTOM_TRYLOCK(sc) == 0) +{ +sc->status.cntrs.lck_intr++; +return; +} + + /* In Linux, pci_alloc_consistent() means DMA */ + /* descriptors do not need explicit syncing? */ +#if BSD + { + struct desc_ring *ring = &sc->txring; + DMA_SYNC(sc->txring.map, sc->txring.size_descs, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + } +#endif + + do +{ +activity = txintr_setup(sc); +} while (activity); + +#if BSD + { + struct desc_ring *ring = &sc->txring; + DMA_SYNC(sc->txring.map, sc->txring.size_descs, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } +#endif + + BOTTOM_UNLOCK(sc); } static void /* context: softirq */ @@ -4294,7 +4328,7 @@ rxintr_cleanup(softc_t *sc) sc->status.cntrs.ipackets++; /* Berkeley Packet Filter */ -LMC_BPF_MTAP(sc, first_mbuf); +bpf_mtap_softint(sc->ifp, first_mbuf); /* Give this good packet to the network stacks. */ sc->quota--; @@ -,9 +4478,6 @@ txintr_cleanup(softc_t *sc) /* Include CRC and one flag byte in output byte count. */ sc->status.cntrs.obytes += m->m_pkthdr.len + sc->config.crc_len +1; sc->status.cntrs.opackets++; - -/* Berkeley Packet Filter */ -LMC_BPF_MTAP(sc, m); } m_freem(m); @@ -4564,6 +4595,9 @@ txintr_setup(softc_t *sc) /* Enqueue the mbuf; txintr_cleanup will free it. */ mbuf_enqueue(ring, sc->tx_mbuf); + /* Berkeley Packet Filter */ + bpf_mtap(sc->ifp, sc->tx_mbuf); + /* The transmitter has room for another packet. */ sc->tx_mbuf = NULL; @@ -4969,7 +5003,6 @@ lmc_interrupt(void *arg, int quota, int do { activity = txintr_cleanup(sc); -activity += txintr_setup(sc); activity += rxintr_cleanup(sc); activity += rxintr_setup(sc); } while (activity); Index: src/sys/dev/pci/if_lmc.h diff -u src/sys/dev/pci/if_lmc.h:1.24 src/sys/dev/pci/if_lmc.h:1.25 --- src/sys/dev/pci/if_lmc.h:1.24 Tue Jan 24 09:05:28 2017 +++ src/sys/dev/pci/if_lmc.h Mon Jun 25 09:32:28 2018 @@ -1,5 +1,5 @@ /*- - * $NetBSD: if_lmc.h,v 1.24 2017/01/24 09:05:28 ozaki-r Exp $ + * $NetBSD: if_lmc.h,v 1.25 2018/06/25 09:32:28 msaitoh Exp $ * * Copyright (c) 2002-2006 David Bogg
CVS commit: [pgoyette-compat] src/sys/kern
Module Name:src Committed By: pgoyette Date: Mon Jun 25 08:50:10 UTC 2018 Modified Files: src/sys/kern [pgoyette-compat]: kern_module.c Log Message: Finish de-confliction To generate a diff of this commit: cvs rdiff -u -r1.130.2.9 -r1.130.2.10 src/sys/kern/kern_module.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/kern/kern_module.c diff -u src/sys/kern/kern_module.c:1.130.2.9 src/sys/kern/kern_module.c:1.130.2.10 --- src/sys/kern/kern_module.c:1.130.2.9 Mon Jun 25 07:22:54 2018 +++ src/sys/kern/kern_module.c Mon Jun 25 08:50:10 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_module.c,v 1.130.2.9 2018/06/25 07:22:54 pgoyette Exp $ */ +/* $NetBSD: kern_module.c,v 1.130.2.10 2018/06/25 08:50:10 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.130.2.9 2018/06/25 07:22:54 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.130.2.10 2018/06/25 08:50:10 pgoyette Exp $"); #define _MODULE_INTERNAL @@ -1105,7 +1105,6 @@ module_do_load(const char *name, bool is #endif SLIST_REMOVE_HEAD(&pend_stack, pe_entry); module_free(mod); - depth--; return error; } TAILQ_INSERT_TAIL(pending, mod, mod_chain); @@ -1332,7 +1331,6 @@ module_do_load(const char *name, bool is TAILQ_REMOVE(pending, mod, mod_chain); SLIST_REMOVE_HEAD(&pend_stack, pe_entry); module_free(mod); - depth--; return error; }
CVS commit: [pgoyette-compat] src/sys
Module Name:src Committed By: pgoyette Date: Mon Jun 25 07:22:54 UTC 2018 Modified Files: src/sys/kern [pgoyette-compat]: kern_module.c src/sys/sys [pgoyette-compat]: module.h Log Message: Resolve conflicts with HEAD To generate a diff of this commit: cvs rdiff -u -r1.130.2.8 -r1.130.2.9 src/sys/kern/kern_module.c cvs rdiff -u -r1.41.14.8 -r1.41.14.9 src/sys/sys/module.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_module.c diff -u src/sys/kern/kern_module.c:1.130.2.8 src/sys/kern/kern_module.c:1.130.2.9 --- src/sys/kern/kern_module.c:1.130.2.8 Mon Apr 2 00:18:43 2018 +++ src/sys/kern/kern_module.c Mon Jun 25 07:22:54 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_module.c,v 1.130.2.8 2018/04/02 00:18:43 pgoyette Exp $ */ +/* $NetBSD: kern_module.c,v 1.130.2.9 2018/06/25 07:22:54 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.130.2.8 2018/04/02 00:18:43 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.130.2.9 2018/06/25 07:22:54 pgoyette Exp $"); #define _MODULE_INTERNAL @@ -65,6 +65,21 @@ struct modlistmodule_list = TAIL struct modlistmodule_builtins = TAILQ_HEAD_INITIALIZER(module_builtins); static struct modlist module_bootlist = TAILQ_HEAD_INITIALIZER(module_bootlist); +struct module_callbacks { + TAILQ_ENTRY(module_callbacks) modcb_list; + void (*modcb_load)(struct module *); + void (*modcb_unload)(struct module *); +}; +TAILQ_HEAD(modcblist, module_callbacks); +static struct modcblist modcblist; + +static module_t *module_netbsd; +static const modinfo_t module_netbsd_modinfo = { + .mi_version = __NetBSD_Version__, + .mi_class = MODULE_CLASS_MISC, + .mi_name = "netbsd" +}; + static module_t *module_active; bool module_verbose_on; #ifdef MODULAR_DEFAULT_AUTOLOAD @@ -84,11 +99,14 @@ int (*module_load_vfs_vec)(const char *, static kauth_listener_t module_listener; +static specificdata_domain_t module_specificdata_domain; + /* Ensure that the kernel's link set isn't empty. */ static modinfo_t module_dummy; __link_set_add_rodata(modules, module_dummy); static module_t *module_newmodule(modsrc_t); +static void module_free(module_t *); static void module_require_force(module_t *); static int module_do_load(const char *, bool, int, prop_dictionary_t, module_t **, modclass_t modclass, bool); @@ -107,6 +125,9 @@ static bool module_merge_dicts(prop_dict static void sysctl_module_setup(void); static int sysctl_module_autotime(SYSCTLFN_PROTO); +static void module_callback_load(struct module *); +static void module_callback_unload(struct module *); + #define MODULE_CLASS_MATCH(mi, modclass) \ ((modclass) == MODULE_CLASS_ANY || (modclass) == (mi)->mi_class) @@ -117,6 +138,13 @@ module_incompat(const modinfo_t *mi, int mi->mi_name, modclass, mi->mi_class); } +struct module * +module_kernel(void) +{ + + return module_netbsd; +} + /* * module_error: * @@ -153,6 +181,30 @@ module_print(const char *fmt, ...) } } +/* + * module_name: + * + * Utility function: return the module's name. + */ +const char * +module_name(struct module *mod) +{ + + return mod->mod_info->mi_name; +} + +/* + * module_source: + * + * Utility function: return the module's source. + */ +modsrc_t +module_source(struct module *mod) +{ + + return mod->mod_source; +} + static int module_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, void *arg0, void *arg1, void *arg2, void *arg3) @@ -180,12 +232,25 @@ module_newmodule(modsrc_t source) mod = kmem_zalloc(sizeof(*mod), KM_SLEEP); mod->mod_source = source; - mod->mod_info = NULL; - mod->mod_flags = 0; + specificdata_init(module_specificdata_domain, &mod->mod_sdref); return mod; } /* + * Free a module_t + */ +static void +module_free(module_t *mod) +{ + + specificdata_fini(module_specificdata_domain, &mod->mod_sdref); + if (mod->mod_required) + kmem_free(mod->mod_required, mod->mod_arequired * + sizeof(module_t)); + kmem_free(mod, sizeof(*mod)); +} + +/* * Require the -f (force) flag to load a module */ static void @@ -281,7 +346,7 @@ module_builtin_add(modinfo_t *const *mip if (rv != 0) { for (i = 0; i < nmodinfo; i++) { if (modp[i]) -kmem_free(modp[i], sizeof(*modp[i])); +module_free(modp[i]); } } kmem_free(modp, sizeof(*modp) * nmodinfo); @@ -348,6 +413,7 @@ module_init(void) } cv_init(&module_thread_cv, "mod_unld"); mutex_init(&module_thread_lock, MUTEX_DEFAULT, IPL_NONE); + TAILQ_INIT(&modcblist); #ifdef MODULAR /* XXX */ module_init_md(); @@ -374,6 +440,11 @@ module_init(void) } sysctl_module_setup(); + module_specificdata_domain = specificdata_domain_create(); + + module_netbsd = module_newmodule(MODULE_SOURCE_KERNEL); + module_netbsd->mod_refcnt = 1; + module_netbsd->mod_i