CVS commit: [isaki-audio2] src/sys/arch/arm/sunxi
Module Name:src Committed By: isaki Date: Sat Apr 27 05:30:37 UTC 2019 Modified Files: src/sys/arch/arm/sunxi [isaki-audio2]: sunxi_codec.c sunxi_codec.h Log Message: Adapt to audio2. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.4.1 src/sys/arch/arm/sunxi/sunxi_codec.c cvs rdiff -u -r1.4 -r1.4.8.1 src/sys/arch/arm/sunxi/sunxi_codec.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/sunxi/sunxi_codec.c diff -u src/sys/arch/arm/sunxi/sunxi_codec.c:1.5 src/sys/arch/arm/sunxi/sunxi_codec.c:1.5.4.1 --- src/sys/arch/arm/sunxi/sunxi_codec.c:1.5 Fri Apr 20 18:07:40 2018 +++ src/sys/arch/arm/sunxi/sunxi_codec.c Sat Apr 27 05:30:37 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_codec.c,v 1.5 2018/04/20 18:07:40 bouyer Exp $ */ +/* $NetBSD: sunxi_codec.c,v 1.5.4.1 2019/04/27 05:30:37 isaki Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_codec.c,v 1.5 2018/04/20 18:07:40 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_codec.c,v 1.5.4.1 2019/04/27 05:30:37 isaki Exp $"); #include #include @@ -40,7 +40,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_codec. #include #include -#include #include @@ -163,48 +162,18 @@ sunxi_codec_transfer(struct sunxi_codec_ } static int -sunxi_codec_open(void *priv, int flags) -{ - return 0; -} - -static void -sunxi_codec_close(void *priv) -{ -} - -static int -sunxi_codec_query_encoding(void *priv, struct audio_encoding *ae) +sunxi_codec_query_format(void *priv, audio_format_query_t *afp) { struct sunxi_codec_softc * const sc = priv; - return auconv_query_encoding(sc->sc_encodings, ae); + return audio_query_format(>sc_format, 1, afp); } static int -sunxi_codec_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) +sunxi_codec_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 sunxi_codec_softc * const 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_pchan.ch_params = pfil->req_size > 0 ? - pfil->filters[0].param : *play; - } - if (rec && (setmode & AUMODE_RECORD)) { - index = auconv_set_converter(>sc_format, 1, - AUMODE_RECORD, rec, true, rfil); - if (index < 0) - return EINVAL; - sc->sc_rchan.ch_params = rfil->req_size > 0 ? - rfil->filters[0].param : *rec; - } return 0; } @@ -270,24 +239,6 @@ sunxi_codec_freem(void *priv, void *addr } } -static paddr_t -sunxi_codec_mappage(void *priv, void *addr, off_t off, int prot) -{ - struct sunxi_codec_softc * const sc = priv; - struct sunxi_codec_dma *dma; - - if (off < 0) - return -1; - - LIST_FOREACH(dma, >sc_dmalist, dma_list) - if (dma->dma_addr == addr) { - return bus_dmamem_mmap(sc->sc_dmat, dma->dma_segs, - dma->dma_nsegs, off, prot, BUS_DMA_WAITOK); - } - - return -1; -} - static int sunxi_codec_getdev(void *priv, struct audio_device *adev) { @@ -319,12 +270,6 @@ sunxi_codec_round_blocksize(void *priv, return bs; } -static size_t -sunxi_codec_round_buffersize(void *priv, int dir, size_t bufsize) -{ - return bufsize; -} - static int sunxi_codec_trigger_output(void *priv, void *start, void *end, int blksize, void (*intr)(void *), void *intrarg, const audio_params_t *params) @@ -521,21 +466,16 @@ sunxi_codec_get_locks(void *priv, kmutex } static const struct audio_hw_if sunxi_codec_hw_if = { - .open = sunxi_codec_open, - .close = sunxi_codec_close, - .drain = NULL, - .query_encoding = sunxi_codec_query_encoding, - .set_params = sunxi_codec_set_params, + .query_format = sunxi_codec_query_format, + .set_format = sunxi_codec_set_format, .allocm = sunxi_codec_allocm, .freem = sunxi_codec_freem, - .mappage = sunxi_codec_mappage, .getdev = sunxi_codec_getdev, .set_port = sunxi_codec_set_port, .get_port = sunxi_codec_get_port, .query_devinfo = sunxi_codec_query_devinfo, .get_props = sunxi_codec_get_props, .round_blocksize = sunxi_codec_round_blocksize, - .round_buffersize = sunxi_codec_round_buffersize, .trigger_output = sunxi_codec_trigger_output, .trigger_input = sunxi_codec_trigger_input, .halt_output = sunxi_codec_halt_output, @@ -656,7 +596,6 @@ sunxi_codec_attach(device_t parent, devi bus_addr_t addr; bus_size_t size; uint32_t val; - int error; if (fdtbus_get_reg(phandle, 0, , ) != 0) { aprint_error(": couldn't get registers\n"); @@ -709,14 +648,8 @@ sunxi_codec_attach(device_t parent, devi sc->sc_format.precision = 16; sc->sc_format.channels = 2; sc->sc_format.channel_mask = AUFMT_STEREO; - sc->sc_format.frequency_type
CVS commit: [isaki-audio2] src/sys/arch/arm/sunxi
Module Name:src Committed By: isaki Date: Sat Apr 27 05:22:28 UTC 2019 Modified Files: src/sys/arch/arm/sunxi [isaki-audio2]: sunxi_i2s.c Log Message: Adapt to audio2. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/arch/arm/sunxi/sunxi_i2s.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sunxi_i2s.c diff -u src/sys/arch/arm/sunxi/sunxi_i2s.c:1.3 src/sys/arch/arm/sunxi/sunxi_i2s.c:1.3.2.1 --- src/sys/arch/arm/sunxi/sunxi_i2s.c:1.3 Sat Nov 17 20:36:23 2018 +++ src/sys/arch/arm/sunxi/sunxi_i2s.c Sat Apr 27 05:22:28 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_i2s.c,v 1.3 2018/11/17 20:36:23 jmcneill Exp $ */ +/* $NetBSD: sunxi_i2s.c,v 1.3.2.1 2019/04/27 05:22:28 isaki Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_i2s.c,v 1.3 2018/11/17 20:36:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_i2s.c,v 1.3.2.1 2019/04/27 05:22:28 isaki Exp $"); #include #include @@ -38,7 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_i2s.c, #include #include -#include +#include #include @@ -159,7 +159,6 @@ struct sunxi_i2s_softc { kmutex_t sc_intr_lock; struct audio_format sc_format; - struct audio_encoding_set *sc_encodings; struct sunxi_i2s_chan sc_pchan; struct sunxi_i2s_chan sc_rchan; @@ -234,51 +233,24 @@ sunxi_i2s_transfer(struct sunxi_i2s_chan } static int -sunxi_i2s_open(void *priv, int flags) -{ - return 0; -} - -static void -sunxi_i2s_close(void *priv) -{ -} - -static int -sunxi_i2s_query_encoding(void *priv, struct audio_encoding *ae) +sunxi_i2s_query_format(void *priv, audio_format_query_t *afp) { struct sunxi_i2s_softc * const sc = priv; - return auconv_query_encoding(sc->sc_encodings, ae); + return audio_query_format(>sc_format, 1, afp); } static int -sunxi_i2s_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) +sunxi_i2s_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 sunxi_i2s_softc * const 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_pchan.ch_params = pfil->req_size > 0 ? - pfil->filters[0].param : *play; - pfil->prepend(pfil, linear16_16_to_linear32, - >sc_pchan.ch_params); - } - if (rec && (setmode & AUMODE_RECORD)) { - index = auconv_set_converter(>sc_format, 1, - AUMODE_RECORD, rec, true, rfil); - if (index < 0) - return EINVAL; - sc->sc_rchan.ch_params = rfil->req_size > 0 ? - rfil->filters[0].param : *rec; - rfil->prepend(rfil, linear32_32_to_linear16, - >sc_rchan.ch_params); + if ((setmode & AUMODE_PLAY)) { + pfil->codec = audio_internal_to_linear32; + } + if ((setmode & AUMODE_RECORD)) { + rfil->codec = audio_linear32_to_internal; } return 0; @@ -321,24 +293,6 @@ sunxi_i2s_freem(void *priv, void *addr, } } -static paddr_t -sunxi_i2s_mappage(void *priv, void *addr, off_t off, int prot) -{ - struct sunxi_i2s_softc * const sc = priv; - struct sunxi_i2s_dma *dma; - - if (off < 0) - return -1; - - LIST_FOREACH(dma, >sc_dmalist, dma_list) - if (dma->dma_addr == addr) { - return bus_dmamem_mmap(sc->sc_dmat, dma->dma_segs, - dma->dma_nsegs, off, prot, BUS_DMA_WAITOK); - } - - return -1; -} - static int sunxi_i2s_get_props(void *priv) { @@ -356,12 +310,6 @@ sunxi_i2s_round_blocksize(void *priv, in return bs; } -static size_t -sunxi_i2s_round_buffersize(void *priv, int dir, size_t bufsize) -{ - return bufsize; -} - static int sunxi_i2s_trigger_output(void *priv, void *start, void *end, int blksize, void (*intr)(void *), void *intrarg, const audio_params_t *params) @@ -533,17 +481,13 @@ sunxi_i2s_get_locks(void *priv, kmutex_t } static const struct audio_hw_if sunxi_i2s_hw_if = { - .open = sunxi_i2s_open, - .close = sunxi_i2s_close, .drain = NULL, - .query_encoding = sunxi_i2s_query_encoding, - .set_params = sunxi_i2s_set_params, + .query_format = sunxi_i2s_query_format, + .set_format = sunxi_i2s_set_format, .allocm = sunxi_i2s_allocm, .freem = sunxi_i2s_freem, - .mappage = sunxi_i2s_mappage, .get_props = sunxi_i2s_get_props, .round_blocksize = sunxi_i2s_round_blocksize, - .round_buffersize = sunxi_i2s_round_buffersize, .trigger_output = sunxi_i2s_trigger_output, .trigger_input = sunxi_i2s_trigger_input, .halt_output = sunxi_i2s_halt_output, @@ -751,7 +695,6 @@ sunxi_i2s_attach(device_t parent, device bus_addr_t addr; bus_size_t size; uint32_t val; - int error; if (fdtbus_get_reg(phandle, 0, , ) != 0) { aprint_error(": couldn't get registers\n"); @@ -809,18
CVS commit: src/sys/arch/macppc/conf
Module Name:src Committed By: sevan Date: Sat Apr 27 02:00:12 UTC 2019 Modified Files: src/sys/arch/macppc/conf: GENERIC Log Message: Use usbdevices.config & bluetooth.config to reduce duplication. To generate a diff of this commit: cvs rdiff -u -r1.355 -r1.356 src/sys/arch/macppc/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/macppc/conf/GENERIC diff -u src/sys/arch/macppc/conf/GENERIC:1.355 src/sys/arch/macppc/conf/GENERIC:1.356 --- src/sys/arch/macppc/conf/GENERIC:1.355 Sat Apr 27 00:56:19 2019 +++ src/sys/arch/macppc/conf/GENERIC Sat Apr 27 02:00:12 2019 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.355 2019/04/27 00:56:19 sevan Exp $ +# $NetBSD: GENERIC,v 1.356 2019/04/27 02:00:12 sevan Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/macppc/conf/std.macppc" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.355 $" +#ident "GENERIC-$Revision: 1.356 $" maxusers 32 @@ -437,93 +437,11 @@ slhci* at pcmcia? function ? # ScanLogic usb* at ehci? # USB bus support usb* at ohci? # USB bus support usb* at slhci? # USB bus support -uhub* at usb? # USB Hubs -uhub* at uhub? port ? -uhidev* at uhub? port ? configuration ? interface ? # USB HID device +include "dev/usb/usbdevices.config" pbms* at uhidev? reportid ?# PowerBook 15" mouse -ums* at uhidev? reportid ?# USB Mice - -ukbd* at uhidev? reportid ?# USB Keyboards - -uthum* at uhidev? reportid ?# TEMPerHUM sensors - -ucycom* at uhidev? reportid ?# USB serial adapter - -uhid* at uhidev? reportid ?# USB Generic HID - -ulpt* at uhub? port ? configuration ? interface ? # USB Printer - -umodem* at uhub? port ? configuration ? # USB Modem -ucom* at umodem? - -ubsa* at uhub? port ? # Belkin serial adapter -ucom* at ubsa? portno ? - -uplcom* at uhub? port ? # Prolific serial -ucom* at uplcom? portno ? - -uftdi* at uhub? port ? # FTDI FT8U100AX serial adapter -ucom* at uftdi? portno ? - -uhso* at uhub? port ? configuration ? # Option N.V. Wireless WAN modems - -umass* at uhub? port ? configuration ? interface ? # USB Mass Storage - -uaudio* at uhub? port ? configuration ? # USB audio - -# D-Link DSB-R100 USB FM radio tuner -udsbr* at uhub? port ? -radio* at udsbr? - -# USB Ethernet adapters -aue* at uhub? port ? # ADMtek AN986 Pegasus based adapters -axe* at uhub? port ? # ASIX AX88172 based adapters -axen* at uhub? port ? # ASIX AX88178a/AX88179 based adapters -cdce* at uhub? port ? # CDC, Ethernet Networking Control Model -cue* at uhub? port ? # CATC USB-EL1201A based adapters -kue* at uhub? port ? # Kawasaki LSI KL5KUSB101B based adapters -mue* at uhub? port ? # Microchip LAN75xx/LAN78xx based adapters -udav* at uhub? port ? # Davicom DM9601 based adapters -ure* at uhub? port ? # Realtek RTL8152/RTL8153 based adapters -url* at uhub? port ? # Realtek RTL8150L based adapters - -ukyopon* at uhub? port ?# Kyocera AIR-EDGE PHONE -ucom* at ukyopon? portno ? - -#uscanner* at uhub? port ?# USB scanners -uyap* at uhub? port ? # Y@P firmware loader -ugen* at uhub? port ? configuration ? interface ? # USB Generic driver - -# USB 802.11 adapters -atu* at uhub? port ? # Atmel AT76C50XX based adapters -otus* at uhub? port ? # Atheros AR9001U -ural* at uhub? port ? # Ralink Technology RT2500USB 802.11a/b/g -rum* at uhub? port ? # Ralink Technology RT2501/RT2601 802.11a/b/g -run* at uhub? port ? # Ralink Technology RT(2[78]|30)00 802.11a/b/g/n -upgt* at uhub? port ? # Intersil PrismGT -urtw* at uhub? port ? # Realtek RTL8187/RTL8187B 802.11b/g -urtwn* at uhub? port ? # Realtek RTL8188CU/RTL8192CU 802.11b/g/n -#zyd* at uhub? port ? # Zydas ZD1211 - -# Serial adapters -uchcom* at uhub? port ? # WinChipHead CH341/CH340 serial adapter -ucom* at uchcom? portno ? - -uslsa* at uhub? port ? # Silicon Labs USB-RS232 serial adapter -ucom* at uslsa? portno ? - -# USB 3G datacards -umodeswitch* at uhub? port ? -u3g*at uhub? port ? -ucom* at u3g? - -# USB generic serial port (e.g., data over cellular) -ugensa* at uhub? port ? -ucom* at ugensa? - # Bluetooth Controller and Device support # Bluetooth PCMCIA Controllers @@ -541,23 +459,7 @@ bthub* at btbc? bthub* at btuart? bthub* at ubt? -# Bluetooth HID support -bthidev* at bthub? - -# Bluetooth Mouse -btms* at bthidev? reportid ? -wsmouse* at btms? mux 0 - -# Bluetooth Keyboard -btkbd* at bthidev? reportid ? -wskbd* at btkbd? console ? mux 1 - -# Bluetooth Apple Magic Mouse -btmagic* at bthub? -wsmouse* at btmagic? mux 0 - -# Bluetooth Audio support -btsco* at bthub? +include "dev/bluetooth/bluetoothdevices.config" # PCI IEEE1394 controllers fwohci* at pci? dev ? function ? # IEEE1394 Open Host Controller @@ -647,8 +549,6 @@ pseudo-device wsfont pseudo-device swwdog # software
CVS commit: src/sys/dev/usb
Module Name:src Committed By: sevan Date: Sat Apr 27 01:55:06 UTC 2019 Modified Files: src/sys/dev/usb: if_athn_usb.c Log Message: Rename imask to intr_mask as imask is defined globally in sys/arch/powerpc/include/intr.h:104 and this clashes. Resolves build on macppc. ok To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/dev/usb/if_athn_usb.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/usb/if_athn_usb.c diff -u src/sys/dev/usb/if_athn_usb.c:1.31 src/sys/dev/usb/if_athn_usb.c:1.32 --- src/sys/dev/usb/if_athn_usb.c:1.31 Wed Oct 3 10:02:08 2018 +++ src/sys/dev/usb/if_athn_usb.c Sat Apr 27 01:55:05 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_athn_usb.c,v 1.31 2018/10/03 10:02:08 martin Exp $ */ +/* $NetBSD: if_athn_usb.c,v 1.32 2019/04/27 01:55:05 sevan Exp $ */ /* $OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $ */ /*- @@ -22,7 +22,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.31 2018/10/03 10:02:08 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.32 2019/04/27 01:55:05 sevan Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1422,7 +1422,7 @@ athn_usb_newstate_cb(struct athn_usb_sof struct athn_softc *sc = >usc_sc; struct ieee80211com *ic = >sc_ic; enum ieee80211_state ostate, nstate; - uint32_t reg, imask; + uint32_t reg, intr_mask; int s; DPRINTFN(DBG_FN, sc, "\n"); @@ -1479,13 +1479,13 @@ athn_usb_newstate_cb(struct athn_usb_sof if (ic->ic_opmode == IEEE80211_M_HOSTAP) { athn_set_hostap_timers(sc); /* Enable software beacon alert interrupts. */ - imask = htobe32(AR_IMR_SWBA); + intr_mask = htobe32(AR_IMR_SWBA); } else #endif { athn_set_sta_timers(sc); /* Enable beacon miss interrupts. */ - imask = htobe32(AR_IMR_BMISS); + intr_mask = htobe32(AR_IMR_BMISS); /* Stop receiving beacons from other BSS. */ reg = AR_READ(sc, AR_RX_FILTER); @@ -1495,7 +1495,7 @@ athn_usb_newstate_cb(struct athn_usb_sof AR_WRITE_BARRIER(sc); } athn_usb_wmi_xcmd(usc, AR_WMI_CMD_ENABLE_INTR, - , sizeof(imask), NULL); + _mask, sizeof(intr_mask), NULL); break; } if (!usc->usc_dying)
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Sat Apr 27 01:23:26 UTC 2019 Modified Files: src/sys/dev/usb: uchcom.c Log Message: fix uchcom(4) detach, like umodem(4) recently: - use static normally in umodem_common.c - add sc_refcnt, sc_lock and sc_detach_cv to softc. usage is: - sc_dying is protected by sc_lock - sc_detach_cv is matched with sc_lock for cv operations - sc_refcnt is increased in open and decreased in close, any time it is decreased, it is checked for less than zero, and a broadcast performed on sc_detach_cv. detach waits for sc_refcnt - uchcom_param() and uchcom_set() check for sc_dying this fixes pullout out an open ucom@uchcom. XXX: pullup To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/uchcom.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/usb/uchcom.c diff -u src/sys/dev/usb/uchcom.c:1.28 src/sys/dev/usb/uchcom.c:1.29 --- src/sys/dev/usb/uchcom.c:1.28 Thu Jan 31 18:21:21 2019 +++ src/sys/dev/usb/uchcom.c Sat Apr 27 01:23:26 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: uchcom.c,v 1.28 2019/01/31 18:21:21 jakllsch Exp $ */ +/* $NetBSD: uchcom.c,v 1.29 2019/04/27 01:23:26 mrg Exp $ */ /* * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.28 2019/01/31 18:21:21 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.29 2019/04/27 01:23:26 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -127,7 +127,10 @@ struct uchcom_softc struct usbd_device * sc_udev; device_t sc_subdev; struct usbd_interface * sc_iface; - int sc_dying; + bool sc_dying; + kmutex_t sc_lock; + kcondvar_t sc_detach_cv; + int sc_refcnt; /* */ int sc_intr_endpoint; int sc_intr_size; @@ -170,12 +173,12 @@ static const struct usb_devno uchcom_dev }; #define uchcom_lookup(v, p) usb_lookup(uchcom_devs, v, p) -Static void uchcom_get_status(void *, int, u_char *, u_char *); -Static void uchcom_set(void *, int, int, int); -Static int uchcom_param(void *, int, struct termios *); -Static int uchcom_open(void *, int); -Static void uchcom_close(void *, int); -Static void uchcom_intr(struct usbd_xfer *, void *, +static void uchcom_get_status(void *, int, u_char *, u_char *); +static void uchcom_set(void *, int, int, int); +static int uchcom_param(void *, int, struct termios *); +static int uchcom_open(void *, int); +static void uchcom_close(void *, int); +static void uchcom_intr(struct usbd_xfer *, void *, usbd_status); static int set_config(struct uchcom_softc *); @@ -245,10 +248,14 @@ uchcom_attach(device_t parent, device_t sc->sc_dev = self; sc->sc_udev = dev; - sc->sc_dying = 0; + sc->sc_dying = false; + sc->sc_refcnt = 0; sc->sc_dtr = sc->sc_rts = -1; sc->sc_lsr = sc->sc_msr = 0; + mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_SOFTUSB); + cv_init(>sc_detach_cv, "uchcomdet"); + DPRINTF(("\n\nuchcom attach: sc=%p\n", sc)); if (set_config(sc)) @@ -285,7 +292,9 @@ uchcom_attach(device_t parent, device_t return; failed: - sc->sc_dying = 1; + mutex_enter(>sc_lock); + sc->sc_dying = true; + mutex_exit(>sc_lock); return; } @@ -308,13 +317,24 @@ uchcom_detach(device_t self, int flags) close_intr_pipe(sc); - sc->sc_dying = 1; + mutex_enter(>sc_lock); + sc->sc_dying = true; + + sc->sc_refcnt--; + while (sc->sc_refcnt > 0) { + if (cv_timedwait(>sc_detach_cv, >sc_lock, hz * 60)) + aprint_error_dev(sc->sc_dev, ": didn't detach\n"); + } + mutex_exit(>sc_lock); if (sc->sc_subdev != NULL) rv = config_detach(sc->sc_subdev, flags); usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev); + mutex_destroy(>sc_lock); + cv_destroy(>sc_detach_cv); + return rv; } @@ -326,7 +346,9 @@ uchcom_activate(device_t self, enum deva switch (act) { case DVACT_DEACTIVATE: close_intr_pipe(sc); - sc->sc_dying = 1; + mutex_enter(>sc_lock); + sc->sc_dying = true; + mutex_exit(>sc_lock); return 0; default: return EOPNOTSUPP; @@ -850,8 +872,10 @@ close_intr_pipe(struct uchcom_softc *sc) { usbd_status err; + mutex_enter(>sc_lock); if (sc->sc_dying) return; + mutex_exit(>sc_lock); if (sc->sc_intr_pipe != NULL) { err = usbd_abort_pipe(sc->sc_intr_pipe); @@ -873,25 +897,29 @@ close_intr_pipe(struct uchcom_softc *sc) /* -- * methods for ucom */ -void +static void uchcom_get_status(void *arg, int portno, u_char *rlsr, u_char *rmsr) { struct uchcom_softc *sc = arg; + mutex_enter(>sc_lock); if (sc->sc_dying) return; + mutex_exit(>sc_lock); *rlsr = sc->sc_lsr; *rmsr = sc->sc_msr; } -void +static void uchcom_set(void *arg, int portno, int reg, int onoff) { struct uchcom_softc *sc = arg; + mutex_enter(>sc_lock); if (sc->sc_dying) return; + mutex_exit(>sc_lock); switch (reg) {
CVS commit: src/sys/arch/macppc/conf
Module Name:src Committed By: sevan Date: Sat Apr 27 00:56:19 UTC 2019 Modified Files: src/sys/arch/macppc/conf: GENERIC Log Message: Use filesystems.config to reduce duplication To generate a diff of this commit: cvs rdiff -u -r1.354 -r1.355 src/sys/arch/macppc/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/macppc/conf/GENERIC diff -u src/sys/arch/macppc/conf/GENERIC:1.354 src/sys/arch/macppc/conf/GENERIC:1.355 --- src/sys/arch/macppc/conf/GENERIC:1.354 Fri Apr 26 21:40:31 2019 +++ src/sys/arch/macppc/conf/GENERIC Sat Apr 27 00:56:19 2019 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.354 2019/04/26 21:40:31 sevan Exp $ +# $NetBSD: GENERIC,v 1.355 2019/04/27 00:56:19 sevan Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/macppc/conf/std.macppc" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.354 $" +#ident "GENERIC-$Revision: 1.355 $" maxusers 32 @@ -79,26 +79,7 @@ options DKWEDGE_METHOD_GPT #options DKWEDGE_METHOD_RDB # Support RDB partitions as wedges # File systems -file-system FFS # UFS -file-system EXT2FS # second extended file system (linux) -file-system LFS # log-structured file system -file-system MFS # memory file system -file-system NFS # Network File System client -file-system CD9660 # ISO 9660 + Rock Ridge file system -file-system MSDOSFS # MS-DOS file system -file-system FDESC # /dev/fd -file-system KERNFS # /kern -file-system NULLFS # loopback file system -file-system OVERLAY # overlay file system -file-system PUFFS # Userspace file systems (e.g. ntfs-3g & sshfs) -file-system PROCFS # /proc -file-system UMAPFS # NULLFS + uid and gid remapping -file-system UNION # union file system -file-system SMBFS # CIFS; also needs nsmb (below) -file-system PTYFS # /dev/pts/N support -file-system TMPFS # Efficient memory file-system -#file-system UDF # experimental - OSTA UDF CD/DVD file-system -#file-system HFS # experimental - Apple HFS+ (read-only) +include "conf/filesystems.config" # File system options options QUOTA # legacy UFS quotas @@ -666,8 +647,6 @@ pseudo-device wsfont pseudo-device swwdog # software watchdog driver - swwdog(4) pseudo-device clockctl # user control of clock subsystem pseudo-device ksyms # /dev/ksyms -pseudo-device nsmb # SMB requester -pseudo-device putter # for puffs and pud pseudo-device bcsp # BlueCore Serial Protocol pseudo-device btuart # Bluetooth HCI UART (H4)
CVS commit: src/sys/conf
Module Name:src Committed By: sevan Date: Sat Apr 27 00:37:40 UTC 2019 Modified Files: src/sys/conf: filesystems.config Log Message: Sort more To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/conf/filesystems.config 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/filesystems.config diff -u src/sys/conf/filesystems.config:1.4 src/sys/conf/filesystems.config:1.5 --- src/sys/conf/filesystems.config:1.4 Sat Apr 27 00:30:37 2019 +++ src/sys/conf/filesystems.config Sat Apr 27 00:37:40 2019 @@ -1,15 +1,17 @@ -# $NetBSD: filesystems.config,v 1.4 2019/04/27 00:30:37 sevan Exp $ +# $NetBSD: filesystems.config,v 1.5 2019/04/27 00:37:40 sevan Exp $ #file-system AUTOFS # Automounter Filesystem file-system CD9660 # ISO 9660 + Rock Ridge file system file-system CODA # Coda File System; also needs vcoda (below) pseudo-device vcoda file-system EXT2FS # second extended file system (linux) file-system FDESC # /dev/fd +file-system FFS # UFS #file-system HFS # experimental - Apple HFS+ (read-only) file-system KERNFS # /kern file-system LFS # log-structured file system file-system MFS # memory file system file-system MSDOSFS # MS-DOS file system +file-system NFS # Network File System client #file-system NILFS # experimental - NTT's NiLFS(2) file-system NTFS # Windows/NT file system (experimental) file-system NULLFS # loopback file system @@ -24,5 +26,3 @@ file-system TMPFS # Efficient memory fi #file-system UDF # experimental - OSTA UDF CD/DVD file-system file-system UMAPFS # NULLFS + uid and gid remapping file-system UNION # union file system -file-system FFS # UFS -file-system NFS # Network File System client
CVS commit: src/sys/conf
Module Name:src Committed By: sevan Date: Sat Apr 27 00:30:37 UTC 2019 Modified Files: src/sys/conf: filesystems.config Log Message: Sort To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/conf/filesystems.config 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/filesystems.config diff -u src/sys/conf/filesystems.config:1.3 src/sys/conf/filesystems.config:1.4 --- src/sys/conf/filesystems.config:1.3 Wed Jan 10 11:32:29 2018 +++ src/sys/conf/filesystems.config Sat Apr 27 00:30:37 2019 @@ -1,28 +1,28 @@ -# $NetBSD: filesystems.config,v 1.3 2018/01/10 11:32:29 jmcneill Exp $ -file-system FFS # UFS -file-system MFS # memory file system -file-system NFS # Network File System client -file-system TMPFS # Efficient memory file-system -file-system EXT2FS # second extended file system (linux) -file-system LFS # log-structured file system -file-system NTFS # Windows/NT file system (experimental) +# $NetBSD: filesystems.config,v 1.4 2019/04/27 00:30:37 sevan Exp $ +#file-system AUTOFS # Automounter Filesystem file-system CD9660 # ISO 9660 + Rock Ridge file system -file-system MSDOSFS # MS-DOS file system +file-system CODA # Coda File System; also needs vcoda (below) +pseudo-device vcoda +file-system EXT2FS # second extended file system (linux) file-system FDESC # /dev/fd +#file-system HFS # experimental - Apple HFS+ (read-only) file-system KERNFS # /kern +file-system LFS # log-structured file system +file-system MFS # memory file system +file-system MSDOSFS # MS-DOS file system +#file-system NILFS # experimental - NTT's NiLFS(2) +file-system NTFS # Windows/NT file system (experimental) file-system NULLFS # loopback file system file-system OVERLAY # overlay file system file-system PROCFS # /proc +file-system PTYFS # /dev/ptm support file-system PUFFS # Userspace file systems (e.g. ntfs-3g & sshfs) pseudo-device putter file-system SMBFS # experimental - CIFS; also needs nsmb (below) pseudo-device nsmb +file-system TMPFS # Efficient memory file-system +#file-system UDF # experimental - OSTA UDF CD/DVD file-system file-system UMAPFS # NULLFS + uid and gid remapping file-system UNION # union file system -file-system CODA # Coda File System; also needs vcoda (below) -pseudo-device vcoda -file-system PTYFS # /dev/ptm support -#file-system UDF # experimental - OSTA UDF CD/DVD file-system -#file-system HFS # experimental - Apple HFS+ (read-only) -#file-system NILFS # experimental - NTT's NiLFS(2) -#file-system AUTOFS # Automounter Filesystem +file-system FFS # UFS +file-system NFS # Network File System client
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Sat Apr 27 00:23:18 UTC 2019 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: Backport improvements into GCC's sanitizer_linux.cc from more recent LLVM Backport fixups for syscall()/__syscall() routines from LLVM compiler-rt dated October 1st 2018. The commit beffore switching LLVM compiler-rt sycall calls to libc calls for NetBSD. GCC8 will get part of these changes from upstream and GCC9 will operate on libc calls directly for the NetBSD port. This is intended to correct misuse of parameters of syscall()/__syscall() that could break !x86 ports in UBSan. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.29 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.30 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.29 Tue Apr 16 07:34:54 2019 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Sat Apr 27 00:23:17 2019 @@ -42,6 +42,10 @@ #endif // !SANITIZER_FREEBSD && !SANITIZER_NETBSD +#if SANITIZER_NETBSD +#include +#endif + #include #include #include @@ -74,6 +78,8 @@ extern char **environ; // provided by c #if SANITIZER_NETBSD #include // For NAME_MAX #include +#include +extern struct ps_strings *__ps_strings; extern char **environ; // provided by crt1 #endif // SANITIZER_NETBSD @@ -147,11 +153,11 @@ uptr internal_mmap(void *addr, uptr leng #endif // !SANITIZER_S390 uptr internal_munmap(void *addr, uptr length) { - return internal_syscall(SYSCALL(munmap), (uptr)addr, length); + return internal_syscall_ptr(SYSCALL(munmap), (uptr)addr, length); } int internal_mprotect(void *addr, uptr length, int prot) { - return internal_syscall(SYSCALL(mprotect), (uptr)addr, length, prot); + return internal_syscall_ptr(SYSCALL(mprotect), (uptr)addr, length, prot); } uptr internal_close(fd_t fd) { @@ -162,7 +168,7 @@ uptr internal_open(const char *filename, #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags); #else - return internal_syscall(SYSCALL(open), (uptr)filename, flags); + return internal_syscall_ptr(SYSCALL(open), (uptr)filename, flags); #endif } @@ -171,7 +177,7 @@ uptr internal_open(const char *filename, return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags, mode); #else - return internal_syscall(SYSCALL(open), (uptr)filename, flags, mode); + return internal_syscall_ptr(SYSCALL(open), (uptr)filename, flags, mode); #endif } @@ -200,7 +206,7 @@ uptr internal_write(fd_t fd, const void uptr internal_ftruncate(fd_t fd, uptr size) { sptr res; #ifdef SANITIZER_NETBSD - HANDLE_EINTR(res, internal_syscall(SYSCALL(ftruncate), fd, 0, (s64)size)); + HANDLE_EINTR(res, internal_syscall64(SYSCALL(ftruncate), fd, 0, (s64)size)); #else HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(ftruncate), fd, (OFF_T)size)); @@ -250,7 +256,7 @@ static void kernel_stat_to_stat(struct k uptr internal_stat(const char *path, void *buf) { #if SANITIZER_FREEBSD || SANITIZER_NETBSD - return internal_syscall(SYSCALL(stat), path, buf); + return internal_syscall_ptr(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); @@ -274,7 +280,7 @@ uptr internal_stat(const char *path, voi uptr internal_lstat(const char *path, void *buf) { #if SANITIZER_FREEBSD || SANITIZER_NETBSD - return internal_syscall(SYSCALL(lstat), path, buf); + return internal_syscall_ptr(SYSCALL(lstat), path, buf); #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, AT_SYMLINK_NOFOLLOW); @@ -298,7 +304,7 @@ uptr internal_lstat(const char *path, vo uptr internal_fstat(fd_t fd, void *buf) { #if SANITIZER_FREEBSD || SANITIZER_NETBSD - return internal_syscall(SYSCALL(fstat), fd, (uptr)buf); + return internal_syscall_ptr(SYSCALL(fstat), fd, (uptr)buf); #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return = internal_syscall(SYSCALL(fstat), fd, ); #elif SANITIZER_LINUX_USES_64BIT_SYSCALLS @@ -336,7 +342,7 @@ uptr internal_dup2(int oldfd, int newfd) uptr internal_readlink(const char *path, char *buf, uptr bufsize) { #if SANITIZER_NETBSD - return internal_syscall_ptr(SYSCALL(readlink), path, buf,
CVS commit: src/external/bsd/jemalloc/dist/src
Module Name:src Committed By: christos Date: Fri Apr 26 23:57:59 UTC 2019 Modified Files: src/external/bsd/jemalloc/dist/src: pages.c Log Message: Enforce alignment also if the compiled in PAGE_SIZE is bigger than getpagesize() To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/bsd/jemalloc/dist/src/pages.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.4 src/external/bsd/jemalloc/dist/src/pages.c:1.5 --- src/external/bsd/jemalloc/dist/src/pages.c:1.4 Fri Apr 26 10:58:56 2019 +++ src/external/bsd/jemalloc/dist/src/pages.c Fri Apr 26 19:57:59 2019 @@ -79,9 +79,10 @@ os_pages_map(void *addr, size_t size, si { int flags = mmap_flags; #ifdef MAP_ALIGNED - int a = ilog2(alignment); - if (a > LG_PAGE && a < ilog2(sizeof(void *))) + if (alignment > os_page || PAGE > os_page) { + int a = ilog2(MAX(alignment, PAGE)); flags |= MAP_ALIGNED(a); + } #endif int prot = *commit ? PAGES_PROT_COMMIT : PAGES_PROT_DECOMMIT;
CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal
Module Name:src Committed By: christos Date: Fri Apr 26 23:57:00 UTC 2019 Modified Files: src/external/bsd/jemalloc/include/jemalloc/internal: jemalloc_internal_defs.h Log Message: Back to using MAX_PAGE_SHIFT To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 \ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.7 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.8 --- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.7 Thu Apr 18 12:44:25 2019 +++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h Fri Apr 26 19:57:00 2019 @@ -204,8 +204,8 @@ #include #if defined(PAGE_SHIFT) #define LG_PAGE PAGE_SHIFT -#elif defined(MIN_PAGE_SHIFT) -#define LG_PAGE MIN_PAGE_SHIFT +#elif defined(MAX_PAGE_SHIFT) +#define LG_PAGE MAX_PAGE_SHIFT #else #error "PAGE_SHIFT is not defined" #endif
CVS commit: src/sys/arch
Module Name:src Committed By: sevan Date: Fri Apr 26 22:46:04 UTC 2019 Modified Files: src/sys/arch/amd64/conf: ALL src/sys/arch/amigappc/conf: NULL src/sys/arch/dreamcast/conf: G1IDE GENERIC src/sys/arch/evbarm/conf: ARMADILLO-IOT-G3 CUBOX CUBOX-I DUOVERO GUMSTIX HDL_G HPT5325 IMX6UL-STARTER IYONIX MARVELL_NAS MMNET_GENERIC MPCSA_GENERIC MV2120 NITROGEN6X OPENBLOCKS_A6 OPENBLOCKS_AX3 OVERO PEPPER SHEEVAPLUG src/sys/arch/i386/conf: ALL src/sys/arch/luna68k/conf: GENERIC INSTALL src/sys/arch/macppc/conf: GENERIC_601 src/sys/arch/mmeye/conf: MMEYE_WLF src/sys/arch/mvme68k/conf: GENERIC src/sys/arch/playstation2/conf: GENERIC src/sys/arch/sparc/conf: KRUPS src/sys/arch/sun2/conf: GENERIC src/sys/arch/sun3/conf: GENERIC GENERIC3X src/sys/arch/vax/conf: VAX780 src/sys/arch/x68k/conf: GENERIC Log Message: Use veriexec.config to reduce duplication To generate a diff of this commit: cvs rdiff -u -r1.117 -r1.118 src/sys/arch/amd64/conf/ALL cvs rdiff -u -r1.55 -r1.56 src/sys/arch/amigappc/conf/NULL cvs rdiff -u -r1.6 -r1.7 src/sys/arch/dreamcast/conf/G1IDE cvs rdiff -u -r1.131 -r1.132 src/sys/arch/dreamcast/conf/GENERIC cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3 cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/CUBOX cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/conf/CUBOX-I cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/conf/DUOVERO cvs rdiff -u -r1.99 -r1.100 src/sys/arch/evbarm/conf/GUMSTIX cvs rdiff -u -r1.56 -r1.57 src/sys/arch/evbarm/conf/HDL_G cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbarm/conf/HPT5325 cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/conf/IMX6UL-STARTER \ src/sys/arch/evbarm/conf/PEPPER cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/IYONIX cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbarm/conf/MARVELL_NAS cvs rdiff -u -r1.45 -r1.46 src/sys/arch/evbarm/conf/MMNET_GENERIC cvs rdiff -u -r1.66 -r1.67 src/sys/arch/evbarm/conf/MPCSA_GENERIC cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbarm/conf/MV2120 cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/conf/NITROGEN6X cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/conf/OPENBLOCKS_A6 cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbarm/conf/OPENBLOCKS_AX3 cvs rdiff -u -r1.54 -r1.55 src/sys/arch/evbarm/conf/OVERO cvs rdiff -u -r1.63 -r1.64 src/sys/arch/evbarm/conf/SHEEVAPLUG cvs rdiff -u -r1.466 -r1.467 src/sys/arch/i386/conf/ALL cvs rdiff -u -r1.126 -r1.127 src/sys/arch/luna68k/conf/GENERIC cvs rdiff -u -r1.26 -r1.27 src/sys/arch/luna68k/conf/INSTALL cvs rdiff -u -r1.23 -r1.24 src/sys/arch/macppc/conf/GENERIC_601 cvs rdiff -u -r1.27 -r1.28 src/sys/arch/mmeye/conf/MMEYE_WLF cvs rdiff -u -r1.99 -r1.100 src/sys/arch/mvme68k/conf/GENERIC cvs rdiff -u -r1.12 -r1.13 src/sys/arch/playstation2/conf/GENERIC cvs rdiff -u -r1.80 -r1.81 src/sys/arch/sparc/conf/KRUPS cvs rdiff -u -r1.101 -r1.102 src/sys/arch/sun2/conf/GENERIC cvs rdiff -u -r1.180 -r1.181 src/sys/arch/sun3/conf/GENERIC cvs rdiff -u -r1.133 -r1.134 src/sys/arch/sun3/conf/GENERIC3X cvs rdiff -u -r1.28 -r1.29 src/sys/arch/vax/conf/VAX780 cvs rdiff -u -r1.195 -r1.196 src/sys/arch/x68k/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/ALL diff -u src/sys/arch/amd64/conf/ALL:1.117 src/sys/arch/amd64/conf/ALL:1.118 --- src/sys/arch/amd64/conf/ALL:1.117 Fri Apr 12 04:46:48 2019 +++ src/sys/arch/amd64/conf/ALL Fri Apr 26 22:46:03 2019 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.117 2019/04/12 04:46:48 msaitoh Exp $ +# $NetBSD: ALL,v 1.118 2019/04/26 22:46:03 sevan Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "ALL-$Revision: 1.117 $" +#ident "ALL-$Revision: 1.118 $" maxusers 64 # estimated number of users @@ -1707,19 +1707,8 @@ pseudo-device dmoverio pseudo-device nandemulator -options FILEASSOC # fileassoc(9) - required for Veriexec - # and PAX_SEGVGUARD - # Veriexec -pseudo-device veriexec -# -# Uncomment the fingerprint methods below that are desired. Note that -# removing fingerprint methods will have almost no impact on the kernel -# code size. -# -options VERIFIED_EXEC_FP_SHA256 -options VERIFIED_EXEC_FP_SHA384 -options VERIFIED_EXEC_FP_SHA512 +include "dev/veriexec.config" options PAX_SEGVGUARD=0 # PaX Segmentation fault guard options PAX_MPROTECT=1 # PaX mprotect(2) restrictions Index: src/sys/arch/amigappc/conf/NULL diff -u src/sys/arch/amigappc/conf/NULL:1.55 src/sys/arch/amigappc/conf/NULL:1.56 --- src/sys/arch/amigappc/conf/NULL:1.55 Wed Aug 1 20:04:10 2018 +++ src/sys/arch/amigappc/conf/NULL Fri Apr 26 22:46:03 2019 @@ -1,4 +1,4 @@ -# $NetBSD: NULL,v 1.55 2018/08/01
CVS commit: src/sys/arch/pmax/conf
Module Name:src Committed By: sevan Date: Fri Apr 26 22:29:20 UTC 2019 Modified Files: src/sys/arch/pmax/conf: GENERIC64 Log Message: typo To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/arch/pmax/conf/GENERIC64 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/pmax/conf/GENERIC64 diff -u src/sys/arch/pmax/conf/GENERIC64:1.31 src/sys/arch/pmax/conf/GENERIC64:1.32 --- src/sys/arch/pmax/conf/GENERIC64:1.31 Fri Apr 26 22:28:41 2019 +++ src/sys/arch/pmax/conf/GENERIC64 Fri Apr 26 22:29:20 2019 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC64,v 1.31 2019/04/26 22:28:41 sevan Exp $ +# $NetBSD: GENERIC64,v 1.32 2019/04/26 22:29:20 sevan Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/pmax/conf/std.pmax64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.31 $" +#ident "GENERIC-$Revision: 1.32 $" maxusers 64 @@ -289,4 +289,4 @@ pseudo-device wsfont # wsfont control pseudo-device wsmux # wsmux control device # Veriexec -# include "dev/veriexec.config" +include "dev/veriexec.config"
CVS commit: src/sys/arch/pmax/conf
Module Name:src Committed By: sevan Date: Fri Apr 26 22:28:41 UTC 2019 Modified Files: src/sys/arch/pmax/conf: GENERIC64 Log Message: Enable BUFQ_PRIOCSCAN, CARP, Veriexec To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/arch/pmax/conf/GENERIC64 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/pmax/conf/GENERIC64 diff -u src/sys/arch/pmax/conf/GENERIC64:1.30 src/sys/arch/pmax/conf/GENERIC64:1.31 --- src/sys/arch/pmax/conf/GENERIC64:1.30 Sat Apr 13 08:23:00 2019 +++ src/sys/arch/pmax/conf/GENERIC64 Fri Apr 26 22:28:41 2019 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC64,v 1.30 2019/04/13 08:23:00 isaki Exp $ +# $NetBSD: GENERIC64,v 1.31 2019/04/26 22:28:41 sevan Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/pmax/conf/std.pmax64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.30 $" +#ident "GENERIC-$Revision: 1.31 $" maxusers 64 @@ -55,7 +55,7 @@ options SYSCTL_INCLUDE_DESCR # Include # Alternate buffer queue strategies for better responsiveness under high # disk I/O load. #options BUFQ_READPRIO -#options BUFQ_PRIOCSCAN +options BUFQ_PRIOCSCAN #options SCSIVERBOSE # Verbose SCSI errors #options TCVERBOSE # recognize "unknown" TC devices @@ -255,7 +255,7 @@ pseudo-device ppp # serial-line IP po pseudo-device pppoe # PPP over Ethernet (RFC 2516) pseudo-device pty # pseudo-terminals pseudo-device bpfilter # packet filter ports -#pseudo-device carp # Common Address Redundancy Protocol +pseudo-device carp # Common Address Redundancy Protocol pseudo-device npf # NPF packet filter #pseudo-device gre # generic L3 over IP tunnel pseudo-device gif # IPv[46] over IPv[46] tunnel (RFC1933) @@ -289,14 +289,4 @@ pseudo-device wsfont # wsfont control pseudo-device wsmux # wsmux control device # Veriexec -# -# a pseudo device needed for veriexec -#pseudo-device veriexec -# -# Uncomment the fingerprint methods below that are desired. Note that -# removing fingerprint methods will have almost no impact on the kernel -# code size. -# -#options VERIFIED_EXEC_FP_SHA256 -#options VERIFIED_EXEC_FP_SHA384 -#options VERIFIED_EXEC_FP_SHA512 +# include "dev/veriexec.config"
CVS commit: src/sys/arch
Module Name:src Committed By: sevan Date: Fri Apr 26 21:40:33 UTC 2019 Modified Files: src/sys/arch/acorn32/conf: GENERIC src/sys/arch/alpha/conf: GENERIC src/sys/arch/amd64/conf: GENERIC src/sys/arch/amiga/conf: GENERIC src/sys/arch/amigappc/conf: GENERIC src/sys/arch/arc/conf: GENERIC src/sys/arch/bebox/conf: GENERIC src/sys/arch/cats/conf: GENERIC src/sys/arch/cesfic/conf: GENERIC src/sys/arch/cobalt/conf: GENERIC src/sys/arch/evbarm/conf: GENERIC.common src/sys/arch/evbmips/conf: ADM5120 ADM5120-NB ADM5120-USB ALCHEMY AP30 CI20 CPMBR1400 DB120 ERLITE GDIUM LOONGSON MALTA MERAKI RB153 RB433UAH SBMIPS XLSATX ZYXELKX src/sys/arch/evbppc/conf: EV64260 EXPLORA451 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266 OPENBLOCKS600 P2020DS P2020RDB PMPPC RB800 RB850GX2 TWRP1025 src/sys/arch/evbsh3/conf: AP_MS104_SH4 T_SH7706LAN T_SH7706LSR src/sys/arch/ews4800mips/conf: GENERIC src/sys/arch/hp300/conf: GENERIC src/sys/arch/hpcarm/conf: IPAQ JORNADA720 WZERO3 src/sys/arch/hpcmips/conf: GENERIC src/sys/arch/hpcsh/conf: GENERIC src/sys/arch/hppa/conf: GENERIC src/sys/arch/i386/conf: GENERIC src/sys/arch/ibmnws/conf: GENERIC src/sys/arch/iyonix/conf: GENERIC src/sys/arch/landisk/conf: GENERIC src/sys/arch/mac68k/conf: GENERIC src/sys/arch/macppc/conf: GENERIC src/sys/arch/mipsco/conf: GENERIC src/sys/arch/mmeye/conf: GENERIC src/sys/arch/netwinder/conf: GENERIC src/sys/arch/news68k/conf: GENERIC src/sys/arch/newsmips/conf: GENERIC src/sys/arch/next68k/conf: GENERIC src/sys/arch/ofppc/conf: GENERIC src/sys/arch/pmax/conf: GENERIC src/sys/arch/prep/conf: GENERIC src/sys/arch/rs6000/conf: GENERIC src/sys/arch/sandpoint/conf: GENERIC src/sys/arch/sbmips/conf: GENERIC src/sys/arch/sgimips/conf: GENERIC32_IP12 GENERIC32_IP2x GENERIC32_IP3x src/sys/arch/shark/conf: GENERIC src/sys/arch/sparc/conf: GENERIC src/sys/arch/sparc64/conf: GENERIC src/sys/arch/vax/conf: GENERIC Log Message: Enable BUFQ_PRIOCSCAN, CARP, Veriexec by default in GENERIC kernel configs. On ports without a GENERIC kernel config enable in individul files, e.g evbmips. Omit on: atari, dreamcast, emips, epoc32, evbppc/VIRTEX*, ia64, luna68x, mvme68k, mvmeppc, playstation2, riscv, sun2, sun3, x68k, zaurus due to resource constraints or port infancy. To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/arch/acorn32/conf/GENERIC cvs rdiff -u -r1.393 -r1.394 src/sys/arch/alpha/conf/GENERIC cvs rdiff -u -r1.525 -r1.526 src/sys/arch/amd64/conf/GENERIC cvs rdiff -u -r1.323 -r1.324 src/sys/arch/amiga/conf/GENERIC cvs rdiff -u -r1.36 -r1.37 src/sys/arch/amigappc/conf/GENERIC cvs rdiff -u -r1.192 -r1.193 src/sys/arch/arc/conf/GENERIC cvs rdiff -u -r1.159 -r1.160 src/sys/arch/bebox/conf/GENERIC cvs rdiff -u -r1.172 -r1.173 src/sys/arch/cats/conf/GENERIC cvs rdiff -u -r1.71 -r1.72 src/sys/arch/cesfic/conf/GENERIC cvs rdiff -u -r1.161 -r1.162 src/sys/arch/cobalt/conf/GENERIC cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/conf/GENERIC.common cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbmips/conf/ADM5120 \ src/sys/arch/evbmips/conf/ADM5120-USB src/sys/arch/evbmips/conf/CI20 cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbmips/conf/ADM5120-NB cvs rdiff -u -r1.66 -r1.67 src/sys/arch/evbmips/conf/ALCHEMY cvs rdiff -u -r1.38 -r1.39 src/sys/arch/evbmips/conf/AP30 cvs rdiff -u -r1.30 -r1.31 src/sys/arch/evbmips/conf/CPMBR1400 cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbmips/conf/DB120 cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbmips/conf/ERLITE \ src/sys/arch/evbmips/conf/RB153 cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbmips/conf/GDIUM cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbmips/conf/LOONGSON cvs rdiff -u -r1.95 -r1.96 src/sys/arch/evbmips/conf/MALTA cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbmips/conf/MERAKI cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbmips/conf/RB433UAH cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbmips/conf/SBMIPS cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbmips/conf/XLSATX cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbmips/conf/ZYXELKX cvs rdiff -u -r1.72 -r1.73 src/sys/arch/evbppc/conf/EV64260 cvs rdiff -u -r1.63 -r1.64 src/sys/arch/evbppc/conf/EXPLORA451 cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbppc/conf/MPC8536DS cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbppc/conf/MPC8548CDS \ src/sys/arch/evbppc/conf/OPENBLOCKS600 src/sys/arch/evbppc/conf/TWRP1025 cvs rdiff -u -r1.47 -r1.48 src/sys/arch/evbppc/conf/OPENBLOCKS200 cvs rdiff -u -r1.74 -r1.75 src/sys/arch/evbppc/conf/OPENBLOCKS266 cvs rdiff -u -r1.30 -r1.31 src/sys/arch/evbppc/conf/P2020DS \ src/sys/arch/evbppc/conf/P2020RDB cvs rdiff -u -r1.49 -r1.50 src/sys/arch/evbppc/conf/PMPPC
CVS commit: src/sys/arch/sgimips/dev
Module Name:src Committed By: macallan Date: Fri Apr 26 21:02:42 UTC 2019 Modified Files: src/sys/arch/sgimips/dev: imc.c Log Message: fix misleading error message To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sgimips/dev/imc.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/sgimips/dev/imc.c diff -u src/sys/arch/sgimips/dev/imc.c:1.34 src/sys/arch/sgimips/dev/imc.c:1.35 --- src/sys/arch/sgimips/dev/imc.c:1.34 Wed Feb 18 16:47:58 2015 +++ src/sys/arch/sgimips/dev/imc.c Fri Apr 26 21:02:42 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: imc.c,v 1.34 2015/02/18 16:47:58 macallan Exp $ */ +/* $NetBSD: imc.c,v 1.35 2019/04/26 21:02:42 macallan Exp $ */ /* * Copyright (c) 2001 Rafal K. Boni @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.34 2015/02/18 16:47:58 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.35 2019/04/26 21:02:42 macallan Exp $"); #include #include @@ -106,7 +106,7 @@ imc_attach(device_t parent, device_t sel isc.iot = normal_memt; if (bus_space_map(isc.iot, ma->ma_addr, 0x100, BUS_SPACE_MAP_LINEAR, )) - panic("imc_attach: could not allocate memory\n"); + panic("imc_attach: could not map registers\n"); platform.bus_reset = imc_bus_reset; platform.watchdog_reset = imc_watchdog_reset;
CVS commit: [netbsd-8] src/sys/arch/cats/cats
Module Name:src Committed By: martin Date: Fri Apr 26 20:44:07 UTC 2019 Modified Files: src/sys/arch/cats/cats [netbsd-8]: cats_machdep.c Log Message: Pull up following revision(s) (requested by skrl in ticket #1249): sys/arch/cats/cats/cats_machdep.c: revision 1.87 The free block after the kernel from arm32_bootmem_init doesn't account for bt_memavail. Adjust for this. To generate a diff of this commit: cvs rdiff -u -r1.83.6.1 -r1.83.6.2 src/sys/arch/cats/cats/cats_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/cats/cats/cats_machdep.c diff -u src/sys/arch/cats/cats/cats_machdep.c:1.83.6.1 src/sys/arch/cats/cats/cats_machdep.c:1.83.6.2 --- src/sys/arch/cats/cats/cats_machdep.c:1.83.6.1 Wed Jul 5 15:48:01 2017 +++ src/sys/arch/cats/cats/cats_machdep.c Fri Apr 26 20:44:07 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: cats_machdep.c,v 1.83.6.1 2017/07/05 15:48:01 martin Exp $ */ +/* $NetBSD: cats_machdep.c,v 1.83.6.2 2019/04/26 20:44:07 martin Exp $ */ /* * Copyright (c) 1997,1998 Mark Brinicombe. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.83.6.1 2017/07/05 15:48:01 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.83.6.2 2019/04/26 20:44:07 martin Exp $"); #include "opt_ddb.h" #include "opt_modular.h" @@ -334,6 +334,24 @@ initarm(void *arm_bootargs) arm32_bootmem_init(ebsabootinfo.bt_memstart, ram_size, ebsabootinfo.bt_memstart); + /* + * The free block after the kernel from arm32_bootmem_init doesn't + * account for bt_memavail. Adjust for this. + */ + extern struct bootmem_info bootmem_info; + struct bootmem_info * const bmi = _info; + + pv_addr_t *pv0 = >bmi_freeblocks[0]; + KASSERTMSG(pv0->pv_pa == bmi->bmi_kernelend, + "pv_pa %#lx kernelend %#lx", pv0->pv_pa, bmi->bmi_kernelend); + + pv0->pv_pa = ebsabootinfo.bt_memavail; + pv0->pv_va = KERN_PHYSTOV(pv0->pv_pa); + pv0->pv_size = bmi->bmi_end - pv0->pv_pa; + + printf("First freeblock adjusted to: %lx -> %lx\n", pv0->pv_pa, + pv0->pv_pa + pv0->pv_size - 1); + arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_LOW, 0, cats_devmap, mapallmem_p); @@ -365,9 +383,6 @@ initarm(void *arm_bootargs) ebsabootinfo.bt_pargp, VM_PROT_READ, PTE_CACHE); } - extern struct bootmem_info bootmem_info; - struct bootmem_info * const bmi = _info; - printf("Doing freeblocks: %d\n", bmi->bmi_nfreeblocks); for (size_t i = 0; i < bmi->bmi_nfreeblocks; i++) {
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: maya Date: Fri Apr 26 20:41:10 UTC 2019 Modified Files: src/tests/lib/libc/sys: Makefile Log Message: Use LDADD, which apparently puts the libraries at the end of the command, and makes static builds (aka sun2) happier. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/tests/lib/libc/sys/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/sys/Makefile diff -u src/tests/lib/libc/sys/Makefile:1.55 src/tests/lib/libc/sys/Makefile:1.56 --- src/tests/lib/libc/sys/Makefile:1.55 Thu Apr 25 19:15:23 2019 +++ src/tests/lib/libc/sys/Makefile Fri Apr 26 20:41:10 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.55 2019/04/25 19:15:23 kamil Exp $ +# $NetBSD: Makefile,v 1.56 2019/04/26 20:41:10 maya Exp $ MKMAN= no @@ -88,12 +88,12 @@ SRCS.t_mprotect= t_mprotect.c ${SRCS_EXE LDADD.t_getpid+=-lpthread -LDFLAGS.t_ptrace_wait+= -pthread -lm -LDFLAGS.t_ptrace_wait3+= -pthread -lm -LDFLAGS.t_ptrace_wait4+= -pthread -lm -LDFLAGS.t_ptrace_wait6+= -pthread -lm -LDFLAGS.t_ptrace_waitid+= -pthread -lm -LDFLAGS.t_ptrace_waitpid+= -pthread -lm +LDADD.t_ptrace_wait+= -pthread -lm +LDADD.t_ptrace_wait3+= -pthread -lm +LDADD.t_ptrace_wait4+= -pthread -lm +LDADD.t_ptrace_wait6+= -pthread -lm +LDADD.t_ptrace_waitid+= -pthread -lm +LDADD.t_ptrace_waitpid+= -pthread -lm .if (${MKRUMP} != "no") && !defined(BSD_MK_COMPAT_FILE) CPPFLAGS.t_posix_fadvise.c += -D_KERNTYPES
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: martin Date: Fri Apr 26 19:48:00 UTC 2019 Modified Files: src/doc [netbsd-7]: CHANGES-7.3 Log Message: Ticket #1690 To generate a diff of this commit: cvs rdiff -u -r1.1.2.48 -r1.1.2.49 src/doc/CHANGES-7.3 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-7.3 diff -u src/doc/CHANGES-7.3:1.1.2.48 src/doc/CHANGES-7.3:1.1.2.49 --- src/doc/CHANGES-7.3:1.1.2.48 Fri Apr 19 16:02:01 2019 +++ src/doc/CHANGES-7.3 Fri Apr 26 19:48:00 2019 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.3,v 1.1.2.48 2019/04/19 16:02:01 martin Exp $ +# $NetBSD: CHANGES-7.3,v 1.1.2.49 2019/04/26 19:48:00 martin Exp $ A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3 release: @@ -532,3 +532,14 @@ sys/net/if.c 1.449 (patch) of stack disclosure. [christos, ticket #1689] +external/bsd/dhcpcd/dist/configure (apply patch) +external/bsd/dhcpcd/dist/src/auth.c (apply patch) +external/bsd/dhcpcd/dist/src/dhcp.c (apply patch) +external/bsd/dhcpcd/dist/src/dhcp6.c (apply patch) +external/bsd/dhcpcd/dist/compat/consttime_memequal.h (apply patch) + + Security fixes for dhcpcd: + Fix a potential buffer overflow reading NA/TA addresses. + Fix a potential 1 byte read overflow with DHO_OPTSOVERLOADED. + Use consttime_memequal(3) to compare hashes. + [roy, ticket #1690]
CVS commit: [netbsd-7] src/external/bsd/dhcpcd/dist
Module Name:src Committed By: martin Date: Fri Apr 26 19:47:23 UTC 2019 Modified Files: src/external/bsd/dhcpcd/dist [netbsd-7]: configure src/external/bsd/dhcpcd/dist/src [netbsd-7]: auth.c dhcp.c dhcp6.c Added Files: src/external/bsd/dhcpcd/dist/compat [netbsd-7]: consttime_memequal.h Log Message: Apply patch, requested by roy in ticket #1690: external/bsd/dhcpcd/dist/configure external/bsd/dhcpcd/dist/src/auth.c external/bsd/dhcpcd/dist/src/dhcp.c external/bsd/dhcpcd/dist/src/dhcp6.c external/bsd/dhcpcd/dist/compat/consttime_memequal.h Security fixes for dhcpcd: Fix a potential buffer overflow reading NA/TA addresses. Fix a potential 1 byte read overflow with DHO_OPTSOVERLOADED. Use consttime_memequal(3) to compare hashes. To generate a diff of this commit: cvs rdiff -u -r1.1.1.8.2.2 -r1.1.1.8.2.3 \ src/external/bsd/dhcpcd/dist/configure cvs rdiff -u -r0 -r1.1.1.1.4.2 \ src/external/bsd/dhcpcd/dist/compat/consttime_memequal.h cvs rdiff -u -r1.1.1.5.4.2 -r1.1.1.5.4.3 \ src/external/bsd/dhcpcd/dist/src/auth.c cvs rdiff -u -r1.11.4.3 -r1.11.4.4 src/external/bsd/dhcpcd/dist/src/dhcp.c cvs rdiff -u -r1.1.1.12.4.3 -r1.1.1.12.4.4 \ src/external/bsd/dhcpcd/dist/src/dhcp6.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/dhcpcd/dist/configure diff -u src/external/bsd/dhcpcd/dist/configure:1.1.1.8.2.2 src/external/bsd/dhcpcd/dist/configure:1.1.1.8.2.3 --- src/external/bsd/dhcpcd/dist/configure:1.1.1.8.2.2 Fri Jul 27 10:43:19 2018 +++ src/external/bsd/dhcpcd/dist/configure Fri Apr 26 19:47:23 2019 @@ -13,6 +13,7 @@ IPV4LL= INET6= ARC4RANDOM= CLOSEFROM= +CONSTTIME_MEMEQUAL= STRLCPY= UDEV= OS= @@ -845,6 +846,27 @@ if [ "$STRTOI" = no ]; then echo "#include \"compat/strtoi.h\"" >>$CONFIG_H fi +if [ -z "$CONSTTIME_MEMEQUAL" ]; then + printf "Testing for consttime_memequal ... " + cat <_consttime_memequal.c +#include +int main(void) { + return consttime_memequal("deadbeef", "deadbeef", 8); +} +EOF + if $XCC _consttime_memequal.c -o _consttime_memequal 2>&3; then + CONSTTIME_MEMEQUAL=yes + else + CONSTTIME_MEMEQUAL=no + fi + echo "$CONSTTIME_MEMEQUAL" + rm -f _consttime_memequal.c _consttime_memequal +fi +if [ "$CONSTTIME_MEMEQUAL" = no ]; then + echo "#include \"compat/consttime_memequal.h\"" \ + >>$CONFIG_H +fi + if [ -z "$DPRINTF" ]; then printf "Testing for dprintf ... " cat <_dprintf.c Index: src/external/bsd/dhcpcd/dist/src/auth.c diff -u src/external/bsd/dhcpcd/dist/src/auth.c:1.1.1.5.4.2 src/external/bsd/dhcpcd/dist/src/auth.c:1.1.1.5.4.3 --- src/external/bsd/dhcpcd/dist/src/auth.c:1.1.1.5.4.2 Fri Jul 27 10:43:20 2018 +++ src/external/bsd/dhcpcd/dist/src/auth.c Fri Apr 26 19:47:23 2019 @@ -354,7 +354,7 @@ gottoken: } free(mm); - if (memcmp(d, _code, dlen)) { + if (!consttime_memequal(d, _code, dlen)) { errno = EPERM; return NULL; } Index: src/external/bsd/dhcpcd/dist/src/dhcp.c diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.11.4.3 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.11.4.4 --- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.11.4.3 Sat Aug 25 15:03:00 2018 +++ src/external/bsd/dhcpcd/dist/src/dhcp.c Fri Apr 26 19:47:23 2019 @@ -212,6 +212,12 @@ get_option(struct dhcpcd_ctx *ctx, } l = *p++; + /* Check we can read the option data, if present */ + if (p + l > e) { + errno = EINVAL; + return NULL; + } + if (o == DHO_OPTSOVERLOADED) { /* Ensure we only get this option once by setting * the last bit as well as the value. @@ -246,10 +252,6 @@ get_option(struct dhcpcd_ctx *ctx, bp += ol; } ol = l; - if (p + ol >= e) { -errno = EINVAL; -return NULL; - } op = p; bl += ol; } Index: src/external/bsd/dhcpcd/dist/src/dhcp6.c diff -u src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.1.1.12.4.3 src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.1.1.12.4.4 --- src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.1.1.12.4.3 Sat Aug 25 15:03:00 2018 +++ src/external/bsd/dhcpcd/dist/src/dhcp6.c Fri Apr 26 19:47:23 2019 @@ -2015,12 +2015,12 @@ dhcp6_findna(struct interface *ifp, uint nd = o + ol; l -= (size_t)(nd - d); d = nd; - if (ol < 24) { + if (ol < sizeof(ia)) { errno = EINVAL; logerrx("%s: IA Address option truncated", ifp->name); continue; } - memcpy(, o, ol); + memcpy(, o, sizeof(ia)); ia.pltime = ntohl(ia.pltime); ia.vltime = ntohl(ia.vltime); /* RFC 3315 22.6 */ Added files: Index: src/external/bsd/dhcpcd/dist/compat/consttime_memequal.h diff -u /dev/null src/external/bsd/dhcpcd/dist/compat/consttime_memequal.h:1.1.1.1.4.2 --- /dev/null Fri Apr 26 19:47:23 2019 +++ src/external/bsd/dhcpcd/dist/compat/consttime_memequal.h Fri Apr 26 19:47:23 2019 @@ -0,0 +1,28 @@ +/* + * Written by Matthias Drochner . + * Public domain. + */ + +#ifndef CONSTTIME_MEMEQUAL_H +#define CONSTTIME_MEMEQUAL_H +inline
CVS commit: src/external/mit/xorg/lib/libEGL
Module Name:src Committed By: christos Date: Fri Apr 26 19:42:27 UTC 2019 Modified Files: src/external/mit/xorg/lib/libEGL: Makefile Log Message: Fix stack protector build To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/lib/libEGL/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/xorg/lib/libEGL/Makefile diff -u src/external/mit/xorg/lib/libEGL/Makefile:1.3 src/external/mit/xorg/lib/libEGL/Makefile:1.4 --- src/external/mit/xorg/lib/libEGL/Makefile:1.3 Sat Apr 20 13:31:22 2019 +++ src/external/mit/xorg/lib/libEGL/Makefile Fri Apr 26 15:42:27 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2019/04/20 17:31:22 maya Exp $ +# $NetBSD: Makefile,v 1.4 2019/04/26 19:42:27 christos Exp $ .include @@ -120,6 +120,7 @@ PKGDIST.egl= ${X11SRCDIR.Mesa}/src/egl/m PKGCONFIG_VERSION.egl= ${MESA_VER} CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-format -Wno-constant-conversion +COPTS.platform_drm.c+= -Wno-error=stack-protector .include .include
CVS commit: src/external/bsd/top/dist/machine
Module Name:src Committed By: christos Date: Fri Apr 26 19:39:19 UTC 2019 Modified Files: src/external/bsd/top/dist/machine: m_netbsd.c Log Message: for "countable" lwp names, try to display name* instead of truncating. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/external/bsd/top/dist/machine/m_netbsd.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/top/dist/machine/m_netbsd.c diff -u src/external/bsd/top/dist/machine/m_netbsd.c:1.21 src/external/bsd/top/dist/machine/m_netbsd.c:1.22 --- src/external/bsd/top/dist/machine/m_netbsd.c:1.21 Tue Oct 30 17:15:09 2018 +++ src/external/bsd/top/dist/machine/m_netbsd.c Fri Apr 26 15:39:19 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: m_netbsd.c,v 1.21 2018/10/30 21:15:09 kre Exp $ */ +/* $NetBSD: m_netbsd.c,v 1.22 2019/04/26 19:39:19 christos Exp $ */ /* * top - a top users display for Unix @@ -37,12 +37,12 @@ * Andrew Doran * * - * $Id: m_netbsd.c,v 1.21 2018/10/30 21:15:09 kre Exp $ + * $Id: m_netbsd.c,v 1.22 2019/04/26 19:39:19 christos Exp $ */ #include #ifndef lint -__RCSID("$NetBSD: m_netbsd.c,v 1.21 2018/10/30 21:15:09 kre Exp $"); +__RCSID("$NetBSD: m_netbsd.c,v 1.22 2019/04/26 19:39:19 christos Exp $"); #endif #include @@ -879,6 +879,26 @@ format_next_proc(caddr_t handle, char *( } static char * +countable(char *p, size_t l) +{ + static const char digits[] = "0123456789"; + size_t first = strcspn(p, digits); + size_t last = strspn(p + first, digits); + size_t len = first + last; + if (p[len] || last == 0) + return p; + if (len < l) + return p; + if (l < last + 1) + return p; + size_t start = l - last - 1; + p[start] = '*'; + memmove(p + start + 1, p + first, len - first); + p[l] = '\0'; + return p; +} + +static char * format_next_lwp(caddr_t handle, char *(*get_userid)(int)) { struct kinfo_proc2 *pp; @@ -946,7 +966,7 @@ format_next_lwp(caddr_t handle, char *(* format_time(cputime), 100.0 * weighted_cpu(l_, pct, pl), 100.0 * pct, - printable(pl->l_name), + countable(printable(pl->l_name), 9), get_command(hp->sel, pp)); /* return the result */
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Fri Apr 26 19:20:57 UTC 2019 Modified Files: src/doc [netbsd-8]: CHANGES-8.1 Log Message: Tickets #1247 - #1250 To generate a diff of this commit: cvs rdiff -u -r1.1.2.135 -r1.1.2.136 src/doc/CHANGES-8.1 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.1 diff -u src/doc/CHANGES-8.1:1.1.2.135 src/doc/CHANGES-8.1:1.1.2.136 --- src/doc/CHANGES-8.1:1.1.2.135 Tue Apr 23 18:27:38 2019 +++ src/doc/CHANGES-8.1 Fri Apr 26 19:20:57 2019 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.1,v 1.1.2.135 2019/04/23 18:27:38 martin Exp $ +# $NetBSD: CHANGES-8.1,v 1.1.2.136 2019/04/26 19:20:57 martin Exp $ A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1 release: @@ -2955,3 +2955,94 @@ sys/arch/arm/arm32/pmap.c 1.373 (patch Fix a deadlock between the pool and pmap codes. [bouyer, ticket #1246] +sys/dev/pci/mfii.c1.4 + + Clean up timeout logic. + [bouyer, ticket #1247] + +sys/arch/hppa/hppa/fpu.c 1.25 +sys/arch/hppa/hppa/machdep.c 1.9 + + Some fixes for QEMU/hppa. + [skrll, ticket #1248] + +sys/arch/cats/cats/cats_machdep.c 1.87 + + The free block after the kernel from arm32_bootmem_init doesn't + account for bt_memavail. Adjust for this. + [skrl, ticket #1249] + +external/bsd/dhcpcd/dist/compat/consttime_memequal.h up to 1.1.1.1 +external/bsd/dhcpcd/dist/.arcconfig delete +external/bsd/dhcpcd/dist/BUILDING.mdup to 1.1.1.3 +external/bsd/dhcpcd/dist/LICENSEup to 1.1.1.3 +external/bsd/dhcpcd/dist/Makefile up to 1.1.1.6 +external/bsd/dhcpcd/dist/configure up to 1.1.1.11 +external/bsd/dhcpcd/dist/iconfig.mk up to 1.1.1.2 +external/bsd/dhcpcd/dist/hooks/20-resolv.conf up to 1.2 +external/bsd/dhcpcd/dist/hooks/29-lookup-hostname up to 1.2 +external/bsd/dhcpcd/dist/hooks/30-hostname up to 1.2 +external/bsd/dhcpcd/dist/hooks/50-ntp.conf up to 1.2 +external/bsd/dhcpcd/dist/hooks/50-yp.conf up to 1.2 +external/bsd/dhcpcd/dist/hooks/50-ypbind.in up to 1.2 +external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in up to 1.3 +external/bsd/dhcpcd/dist/src/Makefile up to 1.1.1.5 +external/bsd/dhcpcd/dist/src/arp.c up to 1.1.1.10 +external/bsd/dhcpcd/dist/src/arp.h up to 1.1.1.7 +external/bsd/dhcpcd/dist/src/auth.c up to 1.1.1.7 +external/bsd/dhcpcd/dist/src/auth.h up to 1.1.1.4 +external/bsd/dhcpcd/dist/src/bpf.c up to 1.8 +external/bsd/dhcpcd/dist/src/bpf.h up to 1.1.1.5 +external/bsd/dhcpcd/dist/src/common.c up to 1.1.1.7 +external/bsd/dhcpcd/dist/src/common.h up to 1.1.1.7 +external/bsd/dhcpcd/dist/src/control.c up to 1.1.1.5 +external/bsd/dhcpcd/dist/src/control.h up to 1.1.1.3 +external/bsd/dhcpcd/dist/src/defs.h up to 1.1.1.20 +external/bsd/dhcpcd/dist/src/dev.c up to 1.1.1.4 +external/bsd/dhcpcd/dist/src/dev.h up to 1.1.1.3 +external/bsd/dhcpcd/dist/src/dhcp-common.c up to 1.1.1.5 +external/bsd/dhcpcd/dist/src/dhcp-common.h up to 1.1.1.3 +external/bsd/dhcpcd/dist/src/dhcp.c up to 1.18 +external/bsd/dhcpcd/dist/src/dhcp.h up to 1.1.1.9 +external/bsd/dhcpcd/dist/src/dhcp6.cup to 1.6 +external/bsd/dhcpcd/dist/src/dhcp6.hup to 1.1.1.9 +external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c.in up to 1.1.1.3 +external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h.in up to 1.1.1.3 +external/bsd/dhcpcd/dist/src/dhcpcd.8.inup to 1.1.1.12 +external/bsd/dhcpcd/dist/src/dhcpcd.c up to 1.18 +external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in up to 1.1.1.12 +external/bsd/dhcpcd/dist/src/dhcpcd.h up to 1.1.1.9 +external/bsd/dhcpcd/dist/src/duid.c up to 1.1.1.5 +external/bsd/dhcpcd/dist/src/eloop.cup to 1.1.1.6 +external/bsd/dhcpcd/dist/src/eloop.hup to 1.1.1.4 +external/bsd/dhcpcd/dist/src/if-bsd.c up to 1.6 +external/bsd/dhcpcd/dist/src/if-linux-wext.cup to 1.1.1.3 +external/bsd/dhcpcd/dist/src/if-linux.c up to 1.1.1.12 +external/bsd/dhcpcd/dist/src/if-options.c up to 1.13 +external/bsd/dhcpcd/dist/src/if-options.h up to 1.1.1.8 +external/bsd/dhcpcd/dist/src/if-sun.c up to 1.1.1.7 +external/bsd/dhcpcd/dist/src/if.c up to 1.1.1.12 +external/bsd/dhcpcd/dist/src/if.h up to 1.1.1.7 +external/bsd/dhcpcd/dist/src/ipv4.c up to 1.1.1.13 +external/bsd/dhcpcd/dist/src/ipv4.h up to 1.1.1.7 +external/bsd/dhcpcd/dist/src/ipv4ll.c up to 1.1.1.7 +external/bsd/dhcpcd/dist/src/ipv4ll.h up to 1.1.1.6 +external/bsd/dhcpcd/dist/src/ipv6.c up to 1.1.1.16 +external/bsd/dhcpcd/dist/src/ipv6.h up to 1.1.1.10 +external/bsd/dhcpcd/dist/src/ipv6nd.c up to 1.6
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: maya Date: Fri Apr 26 19:17:05 UTC 2019 Modified Files: src/tests/lib/libc/gen: Makefile Log Message: -frounding-math is gcc specific, help clang builds To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 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.52 src/tests/lib/libc/gen/Makefile:1.53 --- src/tests/lib/libc/gen/Makefile:1.52 Wed Apr 24 15:12:09 2019 +++ src/tests/lib/libc/gen/Makefile Fri Apr 26 19:17:05 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.52 2019/04/24 15:12:09 christos Exp $ +# $NetBSD: Makefile,v 1.53 2019/04/26 19:17:05 maya Exp $ .include @@ -40,7 +40,7 @@ TESTS_C+= t_ttyname TESTS_C+= t_vis CPPFLAGS.t_siginfo.c+=-D__TEST_FENV -COPTS.t_fpsetround.c+=-frounding-math +COPTS.t_fpsetround.c+=${${ACTIVE_CC} == "gcc":? -frounding-math :} LDADD.t_siginfo+= -lm DPADD.t_siginfo+= ${LIBM}
CVS commit: [netbsd-8] src/sys/arch/hppa/hppa
Module Name:src Committed By: martin Date: Fri Apr 26 19:08:03 UTC 2019 Modified Files: src/sys/arch/hppa/hppa [netbsd-8]: fpu.c machdep.c Log Message: Pull up following revision(s) (requested by skrll in ticket #1248): sys/arch/hppa/hppa/machdep.c: revision 1.9 sys/arch/hppa/hppa/fpu.c: revision 1.25 Some fixes for QEMU/hppa. Don't call desidhash_l on pcxl2 as it doesn't support it. QEMU emulates this cpu and would trap on illegal instruction for the diag in desidhash_l Allow a FPU to be missing... more fixes are likely here. QEMU doesn't set C bit properly yet To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.24.32.1 src/sys/arch/hppa/hppa/fpu.c cvs rdiff -u -r1.7 -r1.7.6.1 src/sys/arch/hppa/hppa/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/hppa/hppa/fpu.c diff -u src/sys/arch/hppa/hppa/fpu.c:1.24 src/sys/arch/hppa/hppa/fpu.c:1.24.32.1 --- src/sys/arch/hppa/hppa/fpu.c:1.24 Fri Apr 6 12:21:59 2012 +++ src/sys/arch/hppa/hppa/fpu.c Fri Apr 26 19:08:03 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.24 2012/04/06 12:21:59 skrll Exp $ */ +/* $NetBSD: fpu.c,v 1.24.32.1 2019/04/26 19:08:03 martin Exp $ */ /* * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.24 2012/04/06 12:21:59 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.24.32.1 2019/04/26 19:08:03 martin Exp $"); #include #include @@ -144,6 +144,12 @@ hppa_fpu_bootstrap(u_int ccr_enable) /* See if we have a present and functioning hardware FPU. */ fpu_present = (ccr_enable & HPPA_FPUS) == HPPA_FPUS; + if (!fpu_present) { + fpu_csw = 0; + curcpu()->ci_fpu_state = 0; + + return; + } KASSERT(fpu_present); /* Initialize the FPU and get its version. */ Index: src/sys/arch/hppa/hppa/machdep.c diff -u src/sys/arch/hppa/hppa/machdep.c:1.7 src/sys/arch/hppa/hppa/machdep.c:1.7.6.1 --- src/sys/arch/hppa/hppa/machdep.c:1.7 Sun Apr 2 08:31:10 2017 +++ src/sys/arch/hppa/hppa/machdep.c Fri Apr 26 19:08:03 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.7 2017/04/02 08:31:10 skrll Exp $ */ +/* $NetBSD: machdep.c,v 1.7.6.1 2019/04/26 19:08:03 martin Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.7 2017/04/02 08:31:10 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.7.6.1 2019/04/26 19:08:03 martin Exp $"); #include "opt_cputype.h" #include "opt_ddb.h" @@ -374,7 +374,7 @@ const struct hppa_cpu_info cpu_types[] = { "PA7300LC", "Velociraptor", "PCXL2", hpcxl2, HPPA_CPU_PCXL2, HPPA_FTRS_TLBU | HPPA_FTRS_BTLBU | HPPA_FTRS_HVT, "1.1e", - desidhash_l, itlb_l, dtlb_l, itlbna_l, dtlbna_l, tlbd_l, + NULL, itlb_l, dtlb_l, itlbna_l, dtlbna_l, tlbd_l, ibtlb_g, NULL, pbtlb_g, hpti_g }, #endif #ifdef HP8000_CPU @@ -809,9 +809,6 @@ cpuid(void) if (hppa_cpu_info->hci_chip_name == NULL) panic("bad model string for 0x%x", pdc_model.hwmodel); - else if (hppa_cpu_info->desidhash == NULL) - panic("no kernel support for %s", - hppa_cpu_info->hci_chip_name); /* * TODO: HPT on 7200 is not currently supported @@ -825,7 +822,10 @@ cpuid(void) cpu_hpt_init = hppa_cpu_info->hptinit; cpu_desidhash = hppa_cpu_info->desidhash; - cpu_revision = (*cpu_desidhash)(); + if (cpu_desidhash) + cpu_revision = (*cpu_desidhash)(); + else + cpu_revision = 0; /* force strong ordering for now */ if (hppa_cpu_ispa20_p())
CVS commit: [netbsd-8] src/sys/dev/pci
Module Name:src Committed By: martin Date: Fri Apr 26 19:04:19 UTC 2019 Modified Files: src/sys/dev/pci [netbsd-8]: mfii.c Log Message: Pull up following revision(s) (requested by bouyer in ticket #1247): sys/dev/pci/mfii.c: revision 1.4 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.2.3 -r1.3.2.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.2.3 src/sys/dev/pci/mfii.c:1.3.2.4 --- src/sys/dev/pci/mfii.c:1.3.2.3 Sat Dec 8 12:17:13 2018 +++ src/sys/dev/pci/mfii.c Fri Apr 26 19:04:19 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mfii.c,v 1.3.2.3 2018/12/08 12:17:13 martin Exp $ */ +/* $NetBSD: mfii.c,v 1.3.2.4 2019/04/26 19:04:19 martin Exp $ */ /* $OpenBSD: mfii.c,v 1.58 2018/08/14 05:22:21 jmatthew Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.3.2.3 2018/12/08 12:17:13 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.3.2.4 2019/04/26 19:04:19 martin Exp $"); #include "bio.h" @@ -264,7 +264,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); @@ -2159,7 +2158,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; @@ -2176,10 +2174,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: @@ -2201,10 +2198,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 @@ -2343,7 +2338,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); @@ -2543,10 +2537,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; } @@ -2591,12 +2584,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 * @@ -2627,8 +2619,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/external/mit/xorg/lib/dri
Module Name:src Committed By: christos Date: Fri Apr 26 18:49:35 UTC 2019 Modified Files: src/external/mit/xorg/lib/dri: Makefile Log Message: Amputate stack protector warnings, instead of trying more band-aids. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/external/mit/xorg/lib/dri/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/xorg/lib/dri/Makefile diff -u src/external/mit/xorg/lib/dri/Makefile:1.31 src/external/mit/xorg/lib/dri/Makefile:1.32 --- src/external/mit/xorg/lib/dri/Makefile:1.31 Tue Apr 9 10:47:14 2019 +++ src/external/mit/xorg/lib/dri/Makefile Fri Apr 26 14:49:35 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.31 2019/04/09 14:47:14 maya Exp $ +# $NetBSD: Makefile,v 1.32 2019/04/26 18:49:35 christos Exp $ # Link the mesa_dri_drivers mega driver. @@ -465,17 +465,7 @@ CWARNFLAGS.clang+= -Wno-error=initialize -Wno-error=tautological-constant-out-of-range-compare \ -Wno-error=enum-conversion -COPTS.brw_state_batch.c += -Wno-stack-protector -COPTS.brw_eu_compact.c += -Wno-stack-protector -COPTS.brw_fs.cpp += -Wno-stack-protector -COPTS.brw_fs_copy_propagation.cpp += -Wno-stack-protector -COPTS.brw_fs_reg_allocate.cpp += -Wno-stack-protector -COPTS.brw_program.c += -Wno-stack-protector -COPTS.brw_schedule_instructions.cpp += -Wno-stack-protector -COPTS.brw_vec4.cpp += -Wno-stack-protector -COPTS.brw_vec4_copy_propagation.cpp += -Wno-stack-protector -COPTS.brw_vec4_reg_allocate.cpp += -Wno-stack-protector -COPTS.brw_vec4_visitor.cpp += -Wno-stack-protector +COPTS+= -Wno-error=stack-protector .include .else
CVS commit: src/sys/dev
Module Name:src Committed By: sevan Date: Fri Apr 26 18:41:25 UTC 2019 Added Files: src/sys/dev: veriexec.config Log Message: Add a configuration file for enabling Veriexec in kernel config(5) files. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/dev/veriexec.config Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/dev/veriexec.config diff -u /dev/null src/sys/dev/veriexec.config:1.1 --- /dev/null Fri Apr 26 18:41:25 2019 +++ src/sys/dev/veriexec.config Fri Apr 26 18:41:24 2019 @@ -0,0 +1,18 @@ +# $NetBSD: veriexec.config,v 1.1 2019/04/26 18:41:24 sevan Exp $ +# +# This file contains all Veriexec related configuration. +# It is suitable for inclusion in a kernel config(5) file. +# + +options FILEASSOC # fileassoc(9) - needed by Veriexec + # and PAX_SEGVGUARD + +# a pseudo device needed for veriexec +pseudo-device veriexec +# +# Note that removing fingerprint methods will have almost no impact on the +# kernel code size. +# +options VERIFIED_EXEC_FP_SHA256 +options VERIFIED_EXEC_FP_SHA384 +options VERIFIED_EXEC_FP_SHA512
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Apr 26 18:37:24 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: mainbus.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/hppa/mainbus.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/hppa/hppa/mainbus.c diff -u src/sys/arch/hppa/hppa/mainbus.c:1.3 src/sys/arch/hppa/hppa/mainbus.c:1.4 --- src/sys/arch/hppa/hppa/mainbus.c:1.3 Mon Apr 15 20:45:08 2019 +++ src/sys/arch/hppa/hppa/mainbus.c Fri Apr 26 18:37:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.3 2019/04/15 20:45:08 skrll Exp $ */ +/* $NetBSD: mainbus.c,v 1.4 2019/04/26 18:37:24 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3 2019/04/15 20:45:08 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.4 2019/04/26 18:37:24 skrll Exp $"); #include "locators.h" #include "power.h" @@ -249,7 +249,7 @@ mbus_map(void *v, bus_addr_t bpa, bus_si */ error = extent_alloc_region(hppa_io_extent, bpa, size, EX_NOWAIT); if (error) - return (error); + return error; /* * Map the region of I/O space. @@ -301,7 +301,7 @@ mbus_alloc(void *v, bus_addr_t rstart, b error = extent_alloc_subregion1(hppa_io_extent, rstart, rend, size, align, 0, boundary, EX_NOWAIT, ); if (error) - return (error); + return error; /* * Map the region of I/O space. @@ -758,7 +758,7 @@ mbus_dmamap_create(void *v, bus_size_t s map = malloc(mapsize, M_DMAMAP, (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK); if (!map) - return (ENOMEM); + return ENOMEM; memset(map, 0, mapsize); map->_dm_size = size; @@ -770,7 +770,7 @@ mbus_dmamap_create(void *v, bus_size_t s map->dm_nsegs = 0; *dmamp = map; - return (0); + return 0; } /* @@ -808,7 +808,7 @@ mbus_dmamap_load(void *v, bus_dmamap_t m map->dm_nsegs = 0; if (buflen > map->_dm_size) - return (EINVAL); + return EINVAL; if (p != NULL) { vm = p->p_vmspace; @@ -823,7 +823,7 @@ mbus_dmamap_load(void *v, bus_dmamap_t m map->dm_mapsize = buflen; map->dm_nsegs = seg + 1; } - return (error); + return error; } /* @@ -846,7 +846,7 @@ mbus_dmamap_load_mbuf(void *v, bus_dmama KASSERT(m0->m_flags & M_PKTHDR); if (m0->m_pkthdr.len > map->_dm_size) - return (EINVAL); + return EINVAL; first = 1; seg = 0; @@ -862,7 +862,7 @@ mbus_dmamap_load_mbuf(void *v, bus_dmama map->dm_mapsize = m0->m_pkthdr.len; map->dm_nsegs = seg + 1; } - return (error); + return error; } /* @@ -908,7 +908,7 @@ mbus_dmamap_load_uio(void *v, bus_dmamap map->dm_mapsize = uio->uio_resid; map->dm_nsegs = seg + 1; } - return (error); + return error; } /* @@ -960,7 +960,7 @@ mbus_dmamap_load_raw(void *v, bus_dmamap map->dm_nsegs = seg + 1; map->dm_mapsize = mapsize; - return (0); + return 0; } /* @@ -1070,7 +1070,7 @@ mbus_dmamem_alloc(void *v, bus_size_t si if ((mlist = malloc(sizeof(*mlist), M_DEVBUF, (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL) - return (ENOMEM); + return ENOMEM; /* * Allocate physical pages from the VM system. @@ -1085,7 +1085,7 @@ mbus_dmamem_alloc(void *v, bus_size_t si " failed", __func__, size, low, high, mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0)); free(mlist, M_DEVBUF); - return (error); + return error; } pa_next = 0; @@ -1097,7 +1097,7 @@ mbus_dmamem_alloc(void *v, bus_size_t si if (++seg >= nsegs) { uvm_pglistfree(mlist); free(mlist, M_DEVBUF); -return (ENOMEM); +return ENOMEM; } segs[seg].ds_addr = pa; segs[seg].ds_len = PAGE_SIZE; @@ -1122,7 +1122,7 @@ mbus_dmamem_alloc(void *v, bus_size_t si * We now have physical pages, but no kernel virtual addresses yet. * These may be allocated in bus_dmamap_map. */ - return (0); + return 0; } void @@ -1161,7 +1161,7 @@ mbus_dmamem_map(void *v, bus_dma_segment /* Get a chunk of kernel virtual space. */ va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (__predict_false(va == 0)) - return (ENOMEM); + return ENOMEM; *kvap = (void *)va; @@ -1180,7 +1180,7 @@ mbus_dmamem_map(void *v, bus_dma_segment } } pmap_update(pmap_kernel()); - return (0); + return 0; } /* @@ -1219,11 +1219,11 @@ mbus_dmamem_mmap(void *v, bus_dma_segmen continue; } - return (btop((u_long)segs[i].ds_addr + off)); + return btop((u_long)segs[i].ds_addr + off); } /* Page not found. */ - return (-1); + return -1; } int @@ -1304,8 +1304,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t, * Did we fit? */ if (buflen != 0) - return (EFBIG); /* XXX better return value here? */ - return (0); + return EFBIG; /* XXX better return value here? */ + return 0; } const struct hppa_bus_dma_tag hppa_dmatag = { @@ -1476,7 +1476,7 @@
CVS commit: src/distrib/hppa/ramdisk
Module Name:src Committed By: skrll Date: Fri Apr 26 18:25:08 UTC 2019 Modified Files: src/distrib/hppa/ramdisk: list Log Message: Add mount_cd9660 and sysctl To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/distrib/hppa/ramdisk/list Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/hppa/ramdisk/list diff -u src/distrib/hppa/ramdisk/list:1.1 src/distrib/hppa/ramdisk/list:1.2 --- src/distrib/hppa/ramdisk/list:1.1 Mon Feb 24 07:23:38 2014 +++ src/distrib/hppa/ramdisk/list Fri Apr 26 18:25:08 2019 @@ -1,4 +1,4 @@ -# $NetBSD: list,v 1.1 2014/02/24 07:23:38 skrll Exp $ +# $NetBSD: list,v 1.2 2019/04/26 18:25:08 skrll Exp $ SRCDIRS bin sbin usr.bin usr.sbin @@ -31,6 +31,7 @@ PROG sbin/ifconfig PROG sbin/init PROG sbin/mknod PROG sbin/mount +PROG sbin/mount_cd9660 PROG sbin/mount_ffs PROG sbin/mount_kernfs PROG sbin/mount_nfs @@ -41,6 +42,7 @@ PROG sbin/restore sbin/rrestore PROG sbin/route PROG sbin/shutdown PROG sbin/swapctl +PROG sbin/sysctl PROG sbin/umount PROG usr/bin/ftp
CVS commit: src/sys/kern
Module Name:src Committed By: mlelstv Date: Fri Apr 26 17:24:23 UTC 2019 Modified Files: src/sys/kern: sys_pipe.c Log Message: Handle half-closed pipes in FIONWRITE and FIONSPACE. To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 src/sys/kern/sys_pipe.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/sys_pipe.c diff -u src/sys/kern/sys_pipe.c:1.147 src/sys/kern/sys_pipe.c:1.148 --- src/sys/kern/sys_pipe.c:1.147 Fri Apr 26 17:20:49 2019 +++ src/sys/kern/sys_pipe.c Fri Apr 26 17:24:23 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_pipe.c,v 1.147 2019/04/26 17:20:49 mlelstv Exp $ */ +/* $NetBSD: sys_pipe.c,v 1.148 2019/04/26 17:24:23 mlelstv Exp $ */ /*- * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.147 2019/04/26 17:20:49 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.148 2019/04/26 17:24:23 mlelstv Exp $"); #include #include @@ -1096,10 +1096,12 @@ pipe_ioctl(file_t *fp, u_long cmd, void case FIONWRITE: /* Look at other side */ - pipe = pipe->pipe_peer; mutex_enter(lock); + pipe = pipe->pipe_peer; + if (pipe == NULL) + *(int *)data = 0; #ifndef PIPE_NODIRECT - if (pipe->pipe_state & PIPE_DIRECTW) + else if (pipe->pipe_state & PIPE_DIRECTW) *(int *)data = pipe->pipe_map.cnt; else #endif @@ -1109,8 +,11 @@ pipe_ioctl(file_t *fp, u_long cmd, void case FIONSPACE: /* Look at other side */ - pipe = pipe->pipe_peer; mutex_enter(lock); + pipe = pipe->pipe_peer; + if (pipe == NULL) + *(int *)data = 0; + else #ifndef PIPE_NODIRECT /* * If we're in direct-mode, we don't really have a
CVS commit: src/sys/kern
Module Name:src Committed By: mlelstv Date: Fri Apr 26 17:20:49 UTC 2019 Modified Files: src/sys/kern: sys_pipe.c Log Message: Clean up pipe structure before recycling it. To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147 src/sys/kern/sys_pipe.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/sys_pipe.c diff -u src/sys/kern/sys_pipe.c:1.146 src/sys/kern/sys_pipe.c:1.147 --- src/sys/kern/sys_pipe.c:1.146 Sun Jun 10 17:54:51 2018 +++ src/sys/kern/sys_pipe.c Fri Apr 26 17:20:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_pipe.c,v 1.146 2018/06/10 17:54:51 jdolecek Exp $ */ +/* $NetBSD: sys_pipe.c,v 1.147 2019/04/26 17:20:49 mlelstv Exp $ */ /*- * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.146 2018/06/10 17:54:51 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.147 2019/04/26 17:20:49 mlelstv Exp $"); #include #include @@ -1331,6 +1331,8 @@ pipeclose(struct pipe *pipe) free_resources: pipe->pipe_pgid = 0; pipe->pipe_state = PIPE_SIGNALR; + pipe->pipe_peer = NULL; + pipe->pipe_lock = NULL; pipe_free_kmem(pipe); if (pipe->pipe_kmem != 0) { pool_cache_put(pipe_rd_cache, pipe);
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Fri Apr 26 16:56:58 UTC 2019 Modified Files: src/lib/libedit: el.c eln.c readline.c Log Message: Follow the man page for EL_GETTC and not require a NULL terminated argument list: https://reviews.llvm.org/D61191 To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/lib/libedit/el.c cvs rdiff -u -r1.34 -r1.35 src/lib/libedit/eln.c cvs rdiff -u -r1.151 -r1.152 src/lib/libedit/readline.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/libedit/el.c diff -u src/lib/libedit/el.c:1.97 src/lib/libedit/el.c:1.98 --- src/lib/libedit/el.c:1.97 Sun Nov 18 12:09:39 2018 +++ src/lib/libedit/el.c Fri Apr 26 12:56:57 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: el.c,v 1.97 2018/11/18 17:09:39 christos Exp $ */ +/* $NetBSD: el.c,v 1.98 2019/04/26 16:56:57 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94"; #else -__RCSID("$NetBSD: el.c,v 1.97 2018/11/18 17:09:39 christos Exp $"); +__RCSID("$NetBSD: el.c,v 1.98 2019/04/26 16:56:57 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -439,15 +439,11 @@ el_wget(EditLine *el, int op, ...) case EL_GETTC: { static char name[] = "gettc"; - char *argv[20]; - int i; - - for (i = 1; i < (int)__arraycount(argv); i++) - if ((argv[i] = va_arg(ap, char *)) == NULL) -break; - + char *argv[3]; argv[0] = name; - rv = terminal_gettc(el, i, argv); + argv[1] = va_arg(ap, char *); + argv[2] = va_arg(ap, void *); + rv = terminal_gettc(el, 3, argv); break; } Index: src/lib/libedit/eln.c diff -u src/lib/libedit/eln.c:1.34 src/lib/libedit/eln.c:1.35 --- src/lib/libedit/eln.c:1.34 Mon May 9 17:37:34 2016 +++ src/lib/libedit/eln.c Fri Apr 26 12:56:57 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: eln.c,v 1.34 2016/05/09 21:37:34 christos Exp $ */ +/* $NetBSD: eln.c,v 1.35 2019/04/26 16:56:57 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: eln.c,v 1.34 2016/05/09 21:37:34 christos Exp $"); +__RCSID("$NetBSD: eln.c,v 1.35 2019/04/26 16:56:57 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -321,14 +321,12 @@ el_get(EditLine *el, int op, ...) break; case EL_GETTC: { - char *argv[20]; + char *argv[3]; static char gettc[] = "gettc"; - int i; - for (i = 1; i < (int)__arraycount(argv); ++i) - if ((argv[i] = va_arg(ap, char *)) == NULL) -break; argv[0] = gettc; - ret = terminal_gettc(el, i, argv); + argv[1] = va_arg(ap, char *); + argv[2] = va_arg(ap, void *); + ret = terminal_gettc(el, 3, argv); break; } Index: src/lib/libedit/readline.c diff -u src/lib/libedit/readline.c:1.151 src/lib/libedit/readline.c:1.152 --- src/lib/libedit/readline.c:1.151 Fri Feb 15 18:20:35 2019 +++ src/lib/libedit/readline.c Fri Apr 26 12:56:57 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.151 2019/02/15 23:20:35 christos Exp $ */ +/* $NetBSD: readline.c,v 1.152 2019/04/26 16:56:57 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.151 2019/02/15 23:20:35 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.152 2019/04/26 16:56:57 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -2237,9 +2237,9 @@ void rl_get_screen_size(int *rows, int *cols) { if (rows) - el_get(e, EL_GETTC, "li", rows, (void *)0); + el_get(e, EL_GETTC, "li", rows); if (cols) - el_get(e, EL_GETTC, "co", cols, (void *)0); + el_get(e, EL_GETTC, "co", cols); } void
CVS commit: src/external/bsd/jemalloc/dist/src
Module Name:src Committed By: christos Date: Fri Apr 26 14:58:56 UTC 2019 Modified Files: src/external/bsd/jemalloc/dist/src: pages.c Log Message: Undo previous, it is moving us in the wrong direction. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/jemalloc/dist/src/pages.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.3 src/external/bsd/jemalloc/dist/src/pages.c:1.4 --- src/external/bsd/jemalloc/dist/src/pages.c:1.3 Wed Apr 24 10:34:21 2019 +++ src/external/bsd/jemalloc/dist/src/pages.c Fri Apr 26 10:58:56 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(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, os_page) == addr); - assert(os_page != PAGE || ALIGNMENT_CEILING(size, os_page) == size); + assert(ALIGNMENT_ADDR2BASE(addr, os_page) == addr); + assert(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(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, os_page) == addr); - assert(os_page != PAGE || ALIGNMENT_CEILING(size, os_page) == size); + assert(ALIGNMENT_ADDR2BASE(addr, os_page) == addr); + assert(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(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, alignment) == addr); + assert(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();
CVS commit: src/doc
Module Name:src Committed By: roy Date: Fri Apr 26 14:36:40 UTC 2019 Modified Files: src/doc: 3RDPARTY CHANGES Log Message: Note import of dhcpcd-7.2.1 To generate a diff of this commit: cvs rdiff -u -r1.1613 -r1.1614 src/doc/3RDPARTY cvs rdiff -u -r1.2529 -r1.2530 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/3RDPARTY diff -u src/doc/3RDPARTY:1.1613 src/doc/3RDPARTY:1.1614 --- src/doc/3RDPARTY:1.1613 Sat Apr 20 17:25:13 2019 +++ src/doc/3RDPARTY Fri Apr 26 14:36:40 2019 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1613 2019/04/20 17:25:13 christos Exp $ +# $NetBSD: 3RDPARTY,v 1.1614 2019/04/26 14:36:40 roy Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -341,12 +341,12 @@ Notes: Use the dhcp2netbsd script. Package: dhcpcd -Version: 7.2.0 -Current Vers: 7.2.0 +Version: 7.2.1 +Current Vers: 7.2.1 Maintainer: roy Archive Site: ftp://roy.marples.name/pub/dhcpcd/ Home Page: http://roy.marples.name/projects/dhcpcd/ -Date: 2019-02-07 +Date: 2019-04-26 Mailing List: dhcpcd-disc...@marples.name License: BSD (2-clause) Location: external/bsd/dhcpcd/dist Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.2529 src/doc/CHANGES:1.2530 --- src/doc/CHANGES:1.2529 Wed Apr 24 15:04:51 2019 +++ src/doc/CHANGES Fri Apr 26 14:36:40 2019 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2529 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2530 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -361,3 +361,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0: 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] + dhcpcd(8): Import dhcpcd-7.2.1 [roy 20190426]
CVS commit: src/external/bsd/dhcpcd/dist/src
Module Name:src Committed By: roy Date: Fri Apr 26 14:34:10 UTC 2019 Modified Files: src/external/bsd/dhcpcd/dist/src: dhcp.c dhcp6.c if-bsd.c ipv6nd.c Log Message: Sync To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/external/bsd/dhcpcd/dist/src/dhcp.c cvs rdiff -u -r1.5 -r1.6 src/external/bsd/dhcpcd/dist/src/dhcp6.c \ src/external/bsd/dhcpcd/dist/src/if-bsd.c \ src/external/bsd/dhcpcd/dist/src/ipv6nd.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/dhcpcd/dist/src/dhcp.c diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.17 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.18 --- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.17 Wed Apr 17 23:35:34 2019 +++ src/external/bsd/dhcpcd/dist/src/dhcp.c Fri Apr 26 14:34:10 2019 @@ -215,6 +215,12 @@ get_option(struct dhcpcd_ctx *ctx, } l = *p++; + /* Check we can read the option data, if present */ + if (p + l > e) { + errno = EINVAL; + return NULL; + } + if (o == DHO_OPTSOVERLOADED) { /* Ensure we only get this option once by setting * the last bit as well as the value. @@ -249,10 +255,6 @@ get_option(struct dhcpcd_ctx *ctx, bp += ol; } ol = l; - if (p + ol >= e) { -errno = EINVAL; -return NULL; - } op = p; bl += ol; } @@ -2075,7 +2077,7 @@ dhcp_arp_probed(struct arp_state *astate ifp->name, inet_ntoa(astate->addr)); if (!(ifo->options & DHCPCD_INFORM)) dhcp_bind(ifp); -#ifndef IN_IFF_TENTATIVE +#ifndef IN_IFF_DUPLICATED else { struct bootp *bootp; size_t len; @@ -2429,7 +2431,7 @@ dhcp_arp_address(struct interface *ifp) if (astate == NULL) return -1; -#ifdef IN_IFF_TENTATIVE +#ifdef IN_IFF_NOTUSEABLE if (ia == NULL || ia->addr_flags & IN_IFF_NOTUSEABLE) { state->state = DHS_PROBE; if (ia == NULL) { Index: src/external/bsd/dhcpcd/dist/src/dhcp6.c diff -u src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.5 src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.6 --- src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.5 Wed Apr 17 23:35:34 2019 +++ src/external/bsd/dhcpcd/dist/src/dhcp6.c Fri Apr 26 14:34:10 2019 @@ -2029,12 +2029,12 @@ dhcp6_findna(struct interface *ifp, uint nd = o + ol; l -= (size_t)(nd - d); d = nd; - if (ol < 24) { + if (ol < sizeof(ia)) { errno = EINVAL; logerrx("%s: IA Address option truncated", ifp->name); continue; } - memcpy(, o, ol); + memcpy(, o, sizeof(ia)); ia.pltime = ntohl(ia.pltime); ia.vltime = ntohl(ia.vltime); /* RFC 3315 22.6 */ @@ -3035,7 +3035,7 @@ dhcp6_bind(struct interface *ifp, const * unless those values in those fields are 0. */ logwarnx("%s: ignoring T1 %"PRIu32 -" to due address expiry", +" due to address expiry", ifp->name, state->renew); state->renew = state->rebind = 0; } Index: src/external/bsd/dhcpcd/dist/src/if-bsd.c diff -u src/external/bsd/dhcpcd/dist/src/if-bsd.c:1.5 src/external/bsd/dhcpcd/dist/src/if-bsd.c:1.6 --- src/external/bsd/dhcpcd/dist/src/if-bsd.c:1.5 Wed Apr 17 23:35:34 2019 +++ src/external/bsd/dhcpcd/dist/src/if-bsd.c Fri Apr 26 14:34:10 2019 @@ -943,10 +943,15 @@ if_getlifetime6(struct ipv6_addr *ia) priv = (struct priv *)ia->iface->ctx->priv; if (ioctl(priv->pf_inet6_fd, SIOCGIFALIFETIME_IN6, ) == -1) return -1; + clock_gettime(CLOCK_MONOTONIC, >created); +#if defined(__FreeBSD__) || defined(__DragonFly__) + t = ia->created.tv_sec; +#else t = time(NULL); - lifetime = _ifru.ifru_lifetime; +#endif + lifetime = _ifru.ifru_lifetime; if (lifetime->ia6t_preferred) ia->prefix_pltime = (uint32_t)(lifetime->ia6t_preferred - MIN(t, lifetime->ia6t_preferred)); @@ -956,7 +961,6 @@ if_getlifetime6(struct ipv6_addr *ia) ia->prefix_vltime = (uint32_t)(lifetime->ia6t_expire - MIN(t, lifetime->ia6t_expire)); /* Calculate the created time */ - clock_gettime(CLOCK_MONOTONIC, >created); ia->created.tv_sec -= lifetime->ia6t_vltime - ia->prefix_vltime; } else ia->prefix_vltime = ND6_INFINITE_LIFETIME; Index: src/external/bsd/dhcpcd/dist/src/ipv6nd.c diff -u src/external/bsd/dhcpcd/dist/src/ipv6nd.c:1.5 src/external/bsd/dhcpcd/dist/src/ipv6nd.c:1.6 --- src/external/bsd/dhcpcd/dist/src/ipv6nd.c:1.5 Wed Apr 17 23:35:35 2019 +++ src/external/bsd/dhcpcd/dist/src/ipv6nd.c Fri Apr 26 14:34:10 2019 @@ -190,54 +190,106 @@ ipv6nd_printoptions(const struct dhcpcd_ } static int -ipv6nd_open(struct dhcpcd_ctx *ctx) +ipv6nd_open0(void) { - int on; + int s, on; struct icmp6_filter filt; - if (ctx->nd_fd != -1) - return ctx->nd_fd; #define SOCK_FLAGS SOCK_CLOEXEC | SOCK_NONBLOCK - ctx->nd_fd = xsocket(PF_INET6, SOCK_RAW | SOCK_FLAGS, IPPROTO_ICMPV6); + s = xsocket(PF_INET6, SOCK_RAW | SOCK_FLAGS, IPPROTO_ICMPV6); #undef SOCK_FLAGS - if (ctx->nd_fd == -1) + if (s == -1) return -1; /* RFC4861 4.1 */ on = 255; - if (setsockopt(ctx->nd_fd, IPPROTO_IPV6,
CVS import: src/external/bsd/dhcpcd/dist
Module Name:src Committed By: roy Date: Fri Apr 26 14:32:28 UTC 2019 Update of /cvsroot/src/external/bsd/dhcpcd/dist In directory ivanova.netbsd.org:/tmp/cvs-serv29914 Log Message: Import dhcpcd-7.2.1 with the following changes: * auth: Use consttime_memequal to avoid latency attack * DHCP: Fix a potential 1 byte read overflow with DHO_OPTSOVERLOADED * DHCPv6: Fix a potential buffer overflow reading NA/TA addresses Status: Vendor Tag: roy Release Tags: dhcpcd-7-2-1 U src/external/bsd/dhcpcd/dist/.gitignore U src/external/bsd/dhcpcd/dist/BUILDING.md U src/external/bsd/dhcpcd/dist/LICENSE U src/external/bsd/dhcpcd/dist/Makefile U src/external/bsd/dhcpcd/dist/Makefile.inc U src/external/bsd/dhcpcd/dist/README.md U src/external/bsd/dhcpcd/dist/config-null.mk U src/external/bsd/dhcpcd/dist/configure U src/external/bsd/dhcpcd/dist/iconfig.mk U src/external/bsd/dhcpcd/dist/compat/_strtoi.h U src/external/bsd/dhcpcd/dist/compat/arc4random.c U src/external/bsd/dhcpcd/dist/compat/arc4random.h U src/external/bsd/dhcpcd/dist/compat/bitops.h U src/external/bsd/dhcpcd/dist/compat/queue.h U src/external/bsd/dhcpcd/dist/compat/arc4random_uniform.c U src/external/bsd/dhcpcd/dist/compat/arc4random_uniform.h U src/external/bsd/dhcpcd/dist/compat/strtoi.h N src/external/bsd/dhcpcd/dist/compat/consttime_memequal.h U src/external/bsd/dhcpcd/dist/compat/dprintf.c U src/external/bsd/dhcpcd/dist/compat/dprintf.h U src/external/bsd/dhcpcd/dist/compat/endian.h U src/external/bsd/dhcpcd/dist/compat/pidfile.c U src/external/bsd/dhcpcd/dist/compat/pidfile.h U src/external/bsd/dhcpcd/dist/compat/reallocarray.c U src/external/bsd/dhcpcd/dist/compat/reallocarray.h U src/external/bsd/dhcpcd/dist/compat/strlcpy.c U src/external/bsd/dhcpcd/dist/compat/strlcpy.h U src/external/bsd/dhcpcd/dist/compat/strtoi.c U src/external/bsd/dhcpcd/dist/compat/strtou.c U src/external/bsd/dhcpcd/dist/compat/crypt/hmac.c U src/external/bsd/dhcpcd/dist/compat/crypt/hmac.h U src/external/bsd/dhcpcd/dist/compat/crypt/md5.c U src/external/bsd/dhcpcd/dist/compat/crypt/md5.h U src/external/bsd/dhcpcd/dist/compat/crypt/sha256.c U src/external/bsd/dhcpcd/dist/compat/crypt/sha256.h C src/external/bsd/dhcpcd/dist/src/dhcp.c U src/external/bsd/dhcpcd/dist/src/GNUmakefile U src/external/bsd/dhcpcd/dist/src/Makefile U src/external/bsd/dhcpcd/dist/src/arp.c U src/external/bsd/dhcpcd/dist/src/arp.h U src/external/bsd/dhcpcd/dist/src/auth.c U src/external/bsd/dhcpcd/dist/src/auth.h U src/external/bsd/dhcpcd/dist/src/bpf.c U src/external/bsd/dhcpcd/dist/src/bpf.h U src/external/bsd/dhcpcd/dist/src/common.c U src/external/bsd/dhcpcd/dist/src/common.h U src/external/bsd/dhcpcd/dist/src/control.c U src/external/bsd/dhcpcd/dist/src/control.h U src/external/bsd/dhcpcd/dist/src/defs.h U src/external/bsd/dhcpcd/dist/src/dev.c U src/external/bsd/dhcpcd/dist/src/dev.h U src/external/bsd/dhcpcd/dist/src/dhcp-common.c U src/external/bsd/dhcpcd/dist/src/dhcp-common.h U src/external/bsd/dhcpcd/dist/src/dhcp.h C src/external/bsd/dhcpcd/dist/src/dhcp6.c U src/external/bsd/dhcpcd/dist/src/dhcp6.h U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in U src/external/bsd/dhcpcd/dist/src/dhcpcd-definitions-small.conf U src/external/bsd/dhcpcd/dist/src/dhcpcd-definitions.conf U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c.in U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h.in U src/external/bsd/dhcpcd/dist/src/dhcpcd.c U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf U src/external/bsd/dhcpcd/dist/src/genembedc U src/external/bsd/dhcpcd/dist/src/dhcpcd.h U src/external/bsd/dhcpcd/dist/src/duid.c U src/external/bsd/dhcpcd/dist/src/duid.h U src/external/bsd/dhcpcd/dist/src/eloop.c U src/external/bsd/dhcpcd/dist/src/eloop.h U src/external/bsd/dhcpcd/dist/src/if-linux-wext.c U src/external/bsd/dhcpcd/dist/src/genembedh C src/external/bsd/dhcpcd/dist/src/if-bsd.c U src/external/bsd/dhcpcd/dist/src/if-linux.c U src/external/bsd/dhcpcd/dist/src/if-options.c U src/external/bsd/dhcpcd/dist/src/if-options.h U src/external/bsd/dhcpcd/dist/src/if-sun.c U src/external/bsd/dhcpcd/dist/src/if.c U src/external/bsd/dhcpcd/dist/src/if.h U src/external/bsd/dhcpcd/dist/src/ipv4.c U src/external/bsd/dhcpcd/dist/src/ipv4.h U src/external/bsd/dhcpcd/dist/src/ipv4ll.c U src/external/bsd/dhcpcd/dist/src/ipv4ll.h U src/external/bsd/dhcpcd/dist/src/ipv6.c U src/external/bsd/dhcpcd/dist/src/ipv6.h C src/external/bsd/dhcpcd/dist/src/ipv6nd.c U src/external/bsd/dhcpcd/dist/src/ipv6nd.h U src/external/bsd/dhcpcd/dist/src/logerr.c U src/external/bsd/dhcpcd/dist/src/logerr.h U src/external/bsd/dhcpcd/dist/src/route.c U src/external/bsd/dhcpcd/dist/src/route.h U src/external/bsd/dhcpcd/dist/src/sa.c U src/external/bsd/dhcpcd/dist/src/sa.h U src/external/bsd/dhcpcd/dist/src/script.c U src/external/bsd/dhcpcd/dist/src/script.h U src/external/bsd/dhcpcd/dist/src/dev/Makefile U src/external/bsd/dhcpcd/dist/src/dev/udev.c U
CVS commit: src/sys/dev/ic
Module Name:src Committed By: mlelstv Date: Fri Apr 26 14:28:40 UTC 2019 Modified Files: src/sys/dev/ic: ld_nvme.c Log Message: Expose device type. You can query it with e.g. drvctl -p ld0 disk-info/type. Missing in previous commit. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ic/ld_nvme.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/ld_nvme.c diff -u src/sys/dev/ic/ld_nvme.c:1.21 src/sys/dev/ic/ld_nvme.c:1.22 --- src/sys/dev/ic/ld_nvme.c:1.21 Sat Dec 1 15:07:58 2018 +++ src/sys/dev/ic/ld_nvme.c Fri Apr 26 14:28:40 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ld_nvme.c,v 1.21 2018/12/01 15:07:58 jdolecek Exp $ */ +/* $NetBSD: ld_nvme.c,v 1.22 2019/04/26 14:28:40 mlelstv Exp $ */ /*- * Copyright (C) 2016 NONAKA Kimihiro @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ld_nvme.c,v 1.21 2018/12/01 15:07:58 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ld_nvme.c,v 1.22 2019/04/26 14:28:40 mlelstv Exp $"); #include #include @@ -113,6 +113,7 @@ ld_nvme_attach(device_t parent, device_t ld->sc_dump = ld_nvme_dump; ld->sc_ioctl = ld_nvme_ioctl; ld->sc_flags = LDF_ENABLED | LDF_NO_RND | LDF_MPSAFE; + ld->sc_typename = kmem_asprintf("%s", naa->naa_typename); ldattach(ld, "fcfs"); } @@ -127,6 +128,8 @@ ld_nvme_detach(device_t self, int flags) return rv; ldenddetach(ld); + kmem_free(ld->sc_typename, strlen(ld->sc_typename) + 1); + nvme_ns_free(sc->sc_nvme, sc->sc_nsid); return 0;
CVS commit: src/sys
Module Name:src Committed By: pgoyette Date: Fri Apr 26 11:51:57 UTC 2019 Modified Files: src/sys/dev/ata: ata_raid.c src/sys/net: if_gre.c if_l2tp.c if_stf.c if_tap.c if_vlan.c src/sys/net/agr: if_agr.c Log Message: Some more empty-string --> NULL conversions for module dependencies To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/dev/ata/ata_raid.c cvs rdiff -u -r1.174 -r1.175 src/sys/net/if_gre.c cvs rdiff -u -r1.33 -r1.34 src/sys/net/if_l2tp.c cvs rdiff -u -r1.105 -r1.106 src/sys/net/if_stf.c cvs rdiff -u -r1.110 -r1.111 src/sys/net/if_tap.c cvs rdiff -u -r1.134 -r1.135 src/sys/net/if_vlan.c cvs rdiff -u -r1.48 -r1.49 src/sys/net/agr/if_agr.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/ata/ata_raid.c diff -u src/sys/dev/ata/ata_raid.c:1.41 src/sys/dev/ata/ata_raid.c:1.42 --- src/sys/dev/ata/ata_raid.c:1.41 Mon Oct 22 19:38:06 2018 +++ src/sys/dev/ata/ata_raid.c Fri Apr 26 11:51:56 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ata_raid.c,v 1.41 2018/10/22 19:38:06 jdolecek Exp $ */ +/* $NetBSD: ata_raid.c,v 1.42 2019/04/26 11:51:56 pgoyette Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.41 2018/10/22 19:38:06 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.42 2019/04/26 11:51:56 pgoyette Exp $"); #include #include @@ -320,7 +320,7 @@ ata_raid_config_block_rw(struct vnode *v return (error); } -MODULE(MODULE_CLASS_DRIVER, ataraid, ""); +MODULE(MODULE_CLASS_DRIVER, ataraid, NULL); #ifdef _MODULE CFDRIVER_DECL(ataraid, DV_DISK, NULL); Index: src/sys/net/if_gre.c diff -u src/sys/net/if_gre.c:1.174 src/sys/net/if_gre.c:1.175 --- src/sys/net/if_gre.c:1.174 Wed Apr 17 07:47:56 2019 +++ src/sys/net/if_gre.c Fri Apr 26 11:51:56 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_gre.c,v 1.174 2019/04/17 07:47:56 msaitoh Exp $ */ +/* $NetBSD: if_gre.c,v 1.175 2019/04/26 11:51:56 pgoyette Exp $ */ /* * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -45,7 +45,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.174 2019/04/17 07:47:56 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.175 2019/04/26 11:51:56 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_atalk.h" @@ -1476,4 +1476,4 @@ gredetach(void) */ #include "if_module.h" -IF_MODULE(MODULE_CLASS_DRIVER, gre, "") +IF_MODULE(MODULE_CLASS_DRIVER, gre, NULL) Index: src/sys/net/if_l2tp.c diff -u src/sys/net/if_l2tp.c:1.33 src/sys/net/if_l2tp.c:1.34 --- src/sys/net/if_l2tp.c:1.33 Thu Dec 27 07:56:11 2018 +++ src/sys/net/if_l2tp.c Fri Apr 26 11:51:56 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_l2tp.c,v 1.33 2018/12/27 07:56:11 knakahara Exp $ */ +/* $NetBSD: if_l2tp.c,v 1.34 2019/04/26 11:51:56 pgoyette Exp $ */ /* * Copyright (c) 2017 Internet Initiative Japan Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.33 2018/12/27 07:56:11 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.34 2019/04/26 11:51:56 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1370,7 +1370,7 @@ l2tp_check_nesting(struct ifnet *ifp, st */ #include "if_module.h" -IF_MODULE(MODULE_CLASS_DRIVER, l2tp, "") +IF_MODULE(MODULE_CLASS_DRIVER, l2tp, NULL) /* TODO: IP_TCPMSS support */ Index: src/sys/net/if_stf.c diff -u src/sys/net/if_stf.c:1.105 src/sys/net/if_stf.c:1.106 --- src/sys/net/if_stf.c:1.105 Tue Jun 26 06:48:02 2018 +++ src/sys/net/if_stf.c Fri Apr 26 11:51:56 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_stf.c,v 1.105 2018/06/26 06:48:02 msaitoh Exp $ */ +/* $NetBSD: if_stf.c,v 1.106 2019/04/26 11:51:56 pgoyette Exp $ */ /* $KAME: if_stf.c,v 1.62 2001/06/07 22:32:16 itojun Exp $ */ /* @@ -75,7 +75,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.105 2018/06/26 06:48:02 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.106 2019/04/26 11:51:56 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -744,4 +744,4 @@ stf_ioctl(struct ifnet *ifp, u_long cmd, */ #include "if_module.h" -IF_MODULE(MODULE_CLASS_DRIVER, stf, "") +IF_MODULE(MODULE_CLASS_DRIVER, stf, NULL) Index: src/sys/net/if_tap.c diff -u src/sys/net/if_tap.c:1.110 src/sys/net/if_tap.c:1.111 --- src/sys/net/if_tap.c:1.110 Tue Apr 16 04:26:02 2019 +++ src/sys/net/if_tap.c Fri Apr 26 11:51:56 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_tap.c,v 1.110 2019/04/16 04:26:02 msaitoh Exp $ */ +/* $NetBSD: if_tap.c,v 1.111 2019/04/26 11:51:56 pgoyette Exp $ */ /* * Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.110 2019/04/16 04:26:02 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.111 2019/04/26 11:51:56 pgoyette Exp $"); #if defined(_KERNEL_OPT) @@ -1426,4 +1426,4 @@ tap_sysctl_handler(SYSCTLFN_ARGS) */ #include
CVS commit: src/sys/arch/arm/rockchip
Module Name:src Committed By: mrg Date: Fri Apr 26 10:27:49 UTC 2019 Modified Files: src/sys/arch/arm/rockchip: rk_tsadc.c Log Message: re-#if 0 some testing code. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/rockchip/rk_tsadc.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/rockchip/rk_tsadc.c diff -u src/sys/arch/arm/rockchip/rk_tsadc.c:1.2 src/sys/arch/arm/rockchip/rk_tsadc.c:1.3 --- src/sys/arch/arm/rockchip/rk_tsadc.c:1.2 Fri Apr 26 10:20:09 2019 +++ src/sys/arch/arm/rockchip/rk_tsadc.c Fri Apr 26 10:27:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rk_tsadc.c,v 1.2 2019/04/26 10:20:09 mrg Exp $ */ +/* $NetBSD: rk_tsadc.c,v 1.3 2019/04/26 10:27:49 mrg Exp $ */ /* * Copyright (c) 2019 Matthew R. Green @@ -30,7 +30,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.2 2019/04/26 10:20:09 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.3 2019/04/26 10:27:49 mrg Exp $"); /* * Driver for the TSADC temperature sensor monitor in RK3328 and RK3399. @@ -376,7 +376,7 @@ rk_tsadc_attach(device_t parent, device_ goto fail; rks->s_attached = true; rks->s_tshut = tshut_temp; -#if 1 +#if 0 // testing rks->s_tshut = 6800; rks->s_warn = 6100;
CVS commit: src/sys/arch/arm/rockchip
Module Name:src Committed By: mrg Date: Fri Apr 26 10:20:09 UTC 2019 Modified Files: src/sys/arch/arm/rockchip: rk_tsadc.c Log Message: - implement sub-5degC interpolation. - avoid setting TSADC_AUTO_CON_SRC*_EN twice To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/rockchip/rk_tsadc.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/rockchip/rk_tsadc.c diff -u src/sys/arch/arm/rockchip/rk_tsadc.c:1.1 src/sys/arch/arm/rockchip/rk_tsadc.c:1.2 --- src/sys/arch/arm/rockchip/rk_tsadc.c:1.1 Fri Apr 26 08:28:11 2019 +++ src/sys/arch/arm/rockchip/rk_tsadc.c Fri Apr 26 10:20:09 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rk_tsadc.c,v 1.1 2019/04/26 08:28:11 mrg Exp $ */ +/* $NetBSD: rk_tsadc.c,v 1.2 2019/04/26 10:20:09 mrg Exp $ */ /* * Copyright (c) 2019 Matthew R. Green @@ -30,14 +30,13 @@ #include -__KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.1 2019/04/26 08:28:11 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.2 2019/04/26 10:20:09 mrg Exp $"); /* * Driver for the TSADC temperature sensor monitor in RK3328 and RK3399. * * TODO: * - handle setting various temp values - * - add interpolation between the 5degC intervals in sample data * - handle DT trips/temp value defaults * - interrupts aren't triggered (test by lowering warn/crit values), and * once they work, make the interrupt do something @@ -202,6 +201,7 @@ static const struct { ENTRY(668, 115), ENTRY(677, 120), ENTRY(685, 125), + ENTRY(TSADC_DATA_MAX, 125), #undef ENTRY }; @@ -213,6 +213,7 @@ struct rk_tsadc_sensor { unsigned s_data_reg; unsigned s_comp_tshut; unsigned s_comp_int; + /* enable bit in AUTO_CON register */ unsigned s_comp_int_en; /* warn/crit values in micro Kelvin */ int s_warn; @@ -335,7 +336,7 @@ rk_tsadc_attach(device_t parent, device_ sc->sc_sme->sme_cookie = sc; sc->sc_sme->sme_refresh = rk_tsadc_refresh; sc->sc_sme->sme_get_limits = rk_tsadc_get_limits; - sc->sc_data_mask = 0xfff; + sc->sc_data_mask = TSADC_DATA_MAX; pmf_device_register(self, NULL, NULL); @@ -375,10 +376,10 @@ rk_tsadc_attach(device_t parent, device_ goto fail; rks->s_attached = true; rks->s_tshut = tshut_temp; -#if 0 +#if 1 // testing - rks->s_tshut = 6500; - rks->s_warn = 6000; + rks->s_tshut = 6800; + rks->s_warn = 6100; #endif } @@ -605,8 +606,7 @@ rk_tsadc_init_enable(struct rk_tsadc_sof val = TSADC_READ(sc, TSADC_AUTO_CON); val |= TSADC_AUTO_CON_AUTO_STATUS | - TSADC_AUTO_CON_SRC1_LT_EN | TSADC_AUTO_CON_SRC0_LT_EN | - TSADC_AUTO_CON_SRC1_EN | TSADC_AUTO_CON_SRC0_EN; + TSADC_AUTO_CON_SRC1_LT_EN | TSADC_AUTO_CON_SRC0_LT_EN; TSADC_WRITE(sc, TSADC_AUTO_CON, val); /* Finally, register & enable the controller */ @@ -698,24 +698,33 @@ rk_tsadc_intr(void *arg) * and temperature values in 5 degC intervals, but says that interpolation * can be done to achieve better resolution between these values, and that * the spacing is linear. - * - * XXX The sub-entry interpolation is not yet done. */ static int rk_tsadc_data_to_temp(struct rk_tsadc_softc *sc, uint32_t data) { unsigned i; - for (i = 1; i < __arraycount(rk3399_data_table); i++) { + for (i = 1; i < __arraycount(rk3399_data_table) - 1; i++) { if (rk3399_data_table[i].data >= data) { + int temprange, offset; + uint32_t datarange, datadiff; + if (rk3399_data_table[i].data == data) return rk3399_data_table[i].temp; - /* XXX interpolate */ - return rk3399_data_table[i-1].temp; + + /* must interpolate */ + temprange = rk3399_data_table[i].temp - +rk3399_data_table[i-1].temp; + datarange = rk3399_data_table[i].data - +rk3399_data_table[i-1].data; + datadiff = data - rk3399_data_table[i-1].data; + + offset = (temprange * datadiff) / datarange; + return rk3399_data_table[i-1].temp + offset; } } - return rk3399_data_table[i-1].temp; + return rk3399_data_table[i].temp; } static uint32_t @@ -725,10 +734,21 @@ rk_tsadc_temp_to_data(struct rk_tsadc_so for (i = 1; i < __arraycount(rk3399_data_table); i++) { if (rk3399_data_table[i].temp >= temp) { + int temprange, tempdiff; + uint32_t datarange, offset; + if (rk3399_data_table[i].temp == temp) return rk3399_data_table[i].data; - /* XXX interpolate */ - return rk3399_data_table[i-1].data; + + /* must interpolate */ + datarange = rk3399_data_table[i].data - +rk3399_data_table[i-1].data; + temprange = rk3399_data_table[i].temp - +rk3399_data_table[i-1].temp; + tempdiff = temp - rk3399_data_table[i-1].temp; + + offset = (datarange * tempdiff) / temprange; + return rk3399_data_table[i-1].data + offset; } }
CVS commit: src/lib/libm/arch/i387
Module Name:src Committed By: maya Date: Fri Apr 26 10:11:14 UTC 2019 Removed Files: src/lib/libm/arch/i387: s_cos.S s_cosf.S s_ilogb.S s_ilogbf.S s_modf.S s_sin.S s_sinf.S s_tan.S s_tanf.S Log Message: Remove unused 387 implementations. These were removed from the build for being wrong, but the implementation stayed around. This is confusing, we have the attic for old code, let's delete the unused implementations. To generate a diff of this commit: cvs rdiff -u -r1.8 -r0 src/lib/libm/arch/i387/s_cos.S cvs rdiff -u -r1.6 -r0 src/lib/libm/arch/i387/s_cosf.S \ src/lib/libm/arch/i387/s_ilogbf.S cvs rdiff -u -r1.7 -r0 src/lib/libm/arch/i387/s_ilogb.S \ src/lib/libm/arch/i387/s_sin.S src/lib/libm/arch/i387/s_tan.S cvs rdiff -u -r1.1 -r0 src/lib/libm/arch/i387/s_modf.S cvs rdiff -u -r1.5 -r0 src/lib/libm/arch/i387/s_sinf.S \ src/lib/libm/arch/i387/s_tanf.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: jmcneill Date: Fri Apr 26 10:11:03 UTC 2019 Modified Files: src/sys/conf: files Removed Files: src/sys/dev/ic: dwc_tmr.c dwc_tmr_reg.h dwc_tmr_var.h Log Message: Remove Designware timer code. This was used by the old Rockchip port and is no longer required. To generate a diff of this commit: cvs rdiff -u -r1.1234 -r1.1235 src/sys/conf/files cvs rdiff -u -r1.1 -r0 src/sys/dev/ic/dwc_tmr.c src/sys/dev/ic/dwc_tmr_reg.h \ src/sys/dev/ic/dwc_tmr_var.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/conf/files diff -u src/sys/conf/files:1.1234 src/sys/conf/files:1.1235 --- src/sys/conf/files:1.1234 Sat Apr 13 08:41:36 2019 +++ src/sys/conf/files Fri Apr 26 10:11:03 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.1234 2019/04/13 08:41:36 maxv Exp $ +# $NetBSD: files,v 1.1235 2019/04/26 10:11:03 jmcneill Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 version 20171118 @@ -1149,10 +1149,6 @@ file dev/ic/acpipmtimer.c acpipmtimer device hpet file dev/ic/hpet.c hpet needs-flag -# DesignWare timer -device dwctmr -file dev/ic/dwc_tmr.c dwctmr - # SMSC LAN9118 Family Ethernet Controller # device smsh: arp, ether, ifnet, mii
CVS commit: src/lib/libc
Module Name:src Committed By: maya Date: Fri Apr 26 09:03:47 UTC 2019 Modified Files: src/lib/libc/arch/i386/gen: Makefile.inc src/lib/libc/arch/m68k/gen: Makefile.inc src/lib/libc/arch/sparc64/gen: Makefile.inc src/lib/libc/arch/x86_64/gen: Makefile.inc src/lib/libc/gen: signbitl_ieee754.c Removed Files: src/lib/libc/arch/i386/gen: signbitl.c src/lib/libc/arch/m68k/gen: signbitl.c src/lib/libc/arch/sparc64/gen: signbitl.c src/lib/libc/arch/x86_64/gen: signbitl.c Log Message: Unify signbitl implementations. (Unclear why they were different, it was only the comments that differed) Add a comment describing why the generic version works for both 80-bit and 128-bit double. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/lib/libc/arch/i386/gen/Makefile.inc cvs rdiff -u -r1.2 -r0 src/lib/libc/arch/i386/gen/signbitl.c cvs rdiff -u -r1.35 -r1.36 src/lib/libc/arch/m68k/gen/Makefile.inc cvs rdiff -u -r1.2 -r0 src/lib/libc/arch/m68k/gen/signbitl.c cvs rdiff -u -r1.19 -r1.20 src/lib/libc/arch/sparc64/gen/Makefile.inc cvs rdiff -u -r1.2 -r0 src/lib/libc/arch/sparc64/gen/signbitl.c cvs rdiff -u -r1.18 -r1.19 src/lib/libc/arch/x86_64/gen/Makefile.inc cvs rdiff -u -r1.2 -r0 src/lib/libc/arch/x86_64/gen/signbitl.c cvs rdiff -u -r1.1 -r1.2 src/lib/libc/gen/signbitl_ieee754.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/libc/arch/i386/gen/Makefile.inc diff -u src/lib/libc/arch/i386/gen/Makefile.inc:1.29 src/lib/libc/arch/i386/gen/Makefile.inc:1.30 --- src/lib/libc/arch/i386/gen/Makefile.inc:1.29 Wed Jul 15 14:27:49 2015 +++ src/lib/libc/arch/i386/gen/Makefile.inc Fri Apr 26 09:03:46 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.29 2015/07/15 14:27:49 pooka Exp $ +# $NetBSD: Makefile.inc,v 1.30 2019/04/26 09:03:46 maya Exp $ # objects built from assembler sources (need lint stubs) SRCS+= alloca.S byte_swap_2.S byte_swap_4.S fabs.S \ @@ -21,10 +21,10 @@ SRCS+= fpclassifyf_ieee754.c fpclassifyd SRCS+= isinff_ieee754.c isinfd_ieee754.c SRCS+= isnanf_ieee754.c isnand_ieee754.c SRCS+= isfinitef_ieee754.c isfinited_ieee754.c -SRCS+= signbitf_ieee754.c signbitd_ieee754.c +SRCS+= signbitf_ieee754.c signbitd_ieee754.c signbitl_ieee754.c SRCS+= nanf.c infinityl.c -SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c signbitl.c +SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c # "internal" objects (don't provide part of the user-visible API) SRCS+= divsi3.S fixdfsi.S fixunsdfsi.S udivsi3.S Index: src/lib/libc/arch/m68k/gen/Makefile.inc diff -u src/lib/libc/arch/m68k/gen/Makefile.inc:1.35 src/lib/libc/arch/m68k/gen/Makefile.inc:1.36 --- src/lib/libc/arch/m68k/gen/Makefile.inc:1.35 Wed Mar 22 23:11:07 2017 +++ src/lib/libc/arch/m68k/gen/Makefile.inc Fri Apr 26 09:03:46 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.35 2017/03/22 23:11:07 chs Exp $ +# $NetBSD: Makefile.inc,v 1.36 2019/04/26 09:03:46 maya Exp $ SRCS+= alloca.S fabs.S @@ -18,7 +18,8 @@ SRCS+= nanf.c SRCS+= infinityl_dbl_ieee754.c .else SRCS+= infinityl.c -SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c signbitl.c +SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c +SRCS+= signbitl_ieee754.c .endif SRCS+= ashlsi3.S ashrsi3.S \ Index: src/lib/libc/arch/sparc64/gen/Makefile.inc diff -u src/lib/libc/arch/sparc64/gen/Makefile.inc:1.19 src/lib/libc/arch/sparc64/gen/Makefile.inc:1.20 --- src/lib/libc/arch/sparc64/gen/Makefile.inc:1.19 Sun Dec 6 07:12:17 2009 +++ src/lib/libc/arch/sparc64/gen/Makefile.inc Fri Apr 26 09:03:46 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.19 2009/12/06 07:12:17 uebayasi Exp $ +# $NetBSD: Makefile.inc,v 1.20 2019/04/26 09:03:46 maya Exp $ SRCS+= fabs.S modf.S SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ @@ -10,10 +10,10 @@ SRCS+= fpclassifyf_ieee754.c fpclassifyd SRCS+= isfinitef_ieee754.c isfinited_ieee754.c SRCS+= isinff_ieee754.c isinfd_ieee754.c SRCS+= isnanf_ieee754.c isnand_ieee754.c -SRCS+= signbitf_ieee754.c signbitd_ieee754.c +SRCS+= signbitf_ieee754.c signbitd_ieee754.c signbitl_ieee754.c SRCS+= nanf.c infinityl.c -SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c signbitl.c +SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c SRCS+= bswap16.c bswap32.c bswap64.c SRCS+= setjmp.S Index: src/lib/libc/arch/x86_64/gen/Makefile.inc diff -u src/lib/libc/arch/x86_64/gen/Makefile.inc:1.18 src/lib/libc/arch/x86_64/gen/Makefile.inc:1.19 --- src/lib/libc/arch/x86_64/gen/Makefile.inc:1.18 Wed Jul 15 14:27:49 2015 +++ src/lib/libc/arch/x86_64/gen/Makefile.inc Fri Apr 26 09:03:46 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.18 2015/07/15 14:27:49 pooka Exp $ +# $NetBSD: Makefile.inc,v 1.19 2019/04/26 09:03:46 maya Exp $ # objects built from assembler sources (need lint stubs) SRCS+= alloca.S byte_swap_2.S byte_swap_4.S byte_swap_8.S fabs.S \ @@ -21,10
CVS commit: src
Module Name:src Committed By: maya Date: Fri Apr 26 08:52:16 UTC 2019 Modified Files: src/distrib/sets/lists/debug: mi src/distrib/sets/lists/tests: mi src/tests/lib/libm: Makefile Added Files: src/tests/lib/libm: t_bit.c Log Message: Add a test case for signbit. (paranoia prior to a libm change) To generate a diff of this commit: cvs rdiff -u -r1.282 -r1.283 src/distrib/sets/lists/debug/mi cvs rdiff -u -r1.811 -r1.812 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.45 -r1.46 src/tests/lib/libm/Makefile cvs rdiff -u -r0 -r1.1 src/tests/lib/libm/t_bit.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/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.282 src/distrib/sets/lists/debug/mi:1.283 --- src/distrib/sets/lists/debug/mi:1.282 Wed Apr 24 11:43:20 2019 +++ src/distrib/sets/lists/debug/mi Fri Apr 26 08:52:16 2019 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.282 2019/04/24 11:43:20 kamil Exp $ +# $NetBSD: mi,v 1.283 2019/04/26 08:52:16 maya Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/lib comp-sys-usr compatdir ./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile @@ -2202,6 +2202,7 @@ ./usr/libdata/debug/usr/tests/lib/libm/t_acos.debug tests-lib-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/lib/libm/t_asin.debug tests-lib-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/lib/libm/t_atan.debug tests-lib-debug debug,atf,compattestfile +./usr/libdata/debug/usr/tests/lib/libm/t_bit.debug tests-lib-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/lib/libm/t_cabsl.debug tests-lib-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/lib/libm/t_casinh.debug tests-lib-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/lib/libm/t_cbrt.debug tests-lib-debug debug,atf,compattestfile Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.811 src/distrib/sets/lists/tests/mi:1.812 --- src/distrib/sets/lists/tests/mi:1.811 Wed Apr 24 11:43:20 2019 +++ src/distrib/sets/lists/tests/mi Fri Apr 26 08:52:16 2019 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.811 2019/04/24 11:43:20 kamil Exp $ +# $NetBSD: mi,v 1.812 2019/04/26 08:52:16 maya Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -3036,6 +3036,7 @@ ./usr/tests/lib/libm/t_acos tests-lib-tests compattestfile,atf ./usr/tests/lib/libm/t_asin tests-lib-tests compattestfile,atf ./usr/tests/lib/libm/t_atan tests-lib-tests compattestfile,atf +./usr/tests/lib/libm/t_bit tests-lib-tests compattestfile,atf ./usr/tests/lib/libm/t_cabsl tests-lib-tests compattestfile,atf ./usr/tests/lib/libm/t_casinh tests-lib-tests compattestfile,atf ./usr/tests/lib/libm/t_cbrt tests-lib-tests compattestfile,atf Index: src/tests/lib/libm/Makefile diff -u src/tests/lib/libm/Makefile:1.45 src/tests/lib/libm/Makefile:1.46 --- src/tests/lib/libm/Makefile:1.45 Wed Nov 7 03:56:18 2018 +++ src/tests/lib/libm/Makefile Fri Apr 26 08:52:16 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.45 2018/11/07 03:56:18 riastradh Exp $ +# $NetBSD: Makefile,v 1.46 2019/04/26 08:52:16 maya Exp $ .include @@ -18,6 +18,7 @@ CPPFLAGS.t_fmod.c+= -I${.CURDIR}/../libc TESTS_C+= t_acos TESTS_C+= t_asin TESTS_C+= t_atan +TESTS_C+= t_bit TESTS_C+= t_casinh TESTS_C+= t_cbrt TESTS_C+= t_ceil Added files: Index: src/tests/lib/libm/t_bit.c diff -u /dev/null src/tests/lib/libm/t_bit.c:1.1 --- /dev/null Fri Apr 26 08:52:16 2019 +++ src/tests/lib/libm/t_bit.c Fri Apr 26 08:52:16 2019 @@ -0,0 +1,102 @@ +/* $NetBSD: t_bit.c,v 1.1 2019/04/26 08:52:16 maya Exp $ */ + +/* + * Written by Maya Rashish + * Public domain. + * + * Testing signbit{,f,l} function correctly + */ + +#include +#include +#include +#include +#include +#include + +static const struct { + double input; + bool is_negative; +} values[] = { + { -1, true}, + { -123, true}, + { -123E6, true}, +#ifdef INFINITY + { -INFINITY, true}, + { INFINITY, false}, +#endif + { 123E6, false}, + { 0, false}, + { -FLT_MIN, true}, + { FLT_MIN, false}, + /* + * Cannot be accurately represented as float, + * but sign should be preserved + */ + { DBL_MAX, false}, + { -DBL_MAX, true}, +}; + +#ifdef __HAVE_LONG_DOUBLE +static const struct { + long double input; + bool is_negative; +} ldbl_values[] = { + { -LDBL_MIN, true}, + { LDBL_MIN, false}, + { LDBL_MAX, false}, + { -LDBL_MAX, true}, +}; +#endif + +ATF_TC(signbit); +ATF_TC_HEAD(signbit, tc) +{ + atf_tc_set_md_var(tc, "descr","Check that signbit functions correctly"); +} + +ATF_TC_BODY(signbit, tc) +{ + double iterator_d; + float iterator_f; + + for (unsigned int i = 0; i < __arraycount(values); i++) { + iterator_d = values[i].input; + iterator_f = (float) values[i].input; + if (signbit(iterator_f) != values[i].is_negative) + atf_tc_fail("%s:%d
CVS commit: src/sys
Module Name:src Committed By: pgoyette Date: Fri Apr 26 08:38:25 UTC 2019 Modified Files: src/sys/dev/sysmon: sysmon.c src/sys/kern: sys_ptrace_common.c src/sys/net: if_loop.c if_tun.c Log Message: Set the "required modules" to NULL, not to an empty string. It really doesn't make that much difference to the code, but the output from modstat(8) is different! (With an empty string in the MODULE() macro modstat reports an empty string, but with a NULL in the macro, modstat prints a '-' just like it does for other "empty" fields.) To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sysmon/sysmon.c cvs rdiff -u -r1.47 -r1.48 src/sys/kern/sys_ptrace_common.c cvs rdiff -u -r1.106 -r1.107 src/sys/net/if_loop.c cvs rdiff -u -r1.155 -r1.156 src/sys/net/if_tun.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/sysmon/sysmon.c diff -u src/sys/dev/sysmon/sysmon.c:1.28 src/sys/dev/sysmon/sysmon.c:1.29 --- src/sys/dev/sysmon/sysmon.c:1.28 Tue May 5 09:22:33 2015 +++ src/sys/dev/sysmon/sysmon.c Fri Apr 26 08:38:25 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon.c,v 1.28 2015/05/05 09:22:33 pgoyette Exp $ */ +/* $NetBSD: sysmon.c,v 1.29 2019/04/26 08:38:25 pgoyette Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sysmon.c,v 1.28 2015/05/05 09:22:33 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon.c,v 1.29 2019/04/26 08:38:25 pgoyette Exp $"); #include #include @@ -307,7 +307,7 @@ sysmonkqfilter(dev_t dev, struct knote * return (error); } -MODULE(MODULE_CLASS_DRIVER, sysmon, ""); +MODULE(MODULE_CLASS_DRIVER, sysmon, NULL); static int sm_init_once(void) Index: src/sys/kern/sys_ptrace_common.c diff -u src/sys/kern/sys_ptrace_common.c:1.47 src/sys/kern/sys_ptrace_common.c:1.48 --- src/sys/kern/sys_ptrace_common.c:1.47 Sun Feb 3 03:19:28 2019 +++ src/sys/kern/sys_ptrace_common.c Fri Apr 26 08:38:25 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_ptrace_common.c,v 1.47 2019/02/03 03:19:28 mrg Exp $ */ +/* $NetBSD: sys_ptrace_common.c,v 1.48 2019/04/26 08:38:25 pgoyette Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.47 2019/02/03 03:19:28 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.48 2019/04/26 08:38:25 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_ptrace.h" @@ -1576,7 +1576,7 @@ process_auxv_offset(struct proc *p, stru } #endif /* PTRACE */ -MODULE(MODULE_CLASS_EXEC, ptrace_common, ""); +MODULE(MODULE_CLASS_EXEC, ptrace_common, NULL); static int ptrace_common_modcmd(modcmd_t cmd, void *arg) Index: src/sys/net/if_loop.c diff -u src/sys/net/if_loop.c:1.106 src/sys/net/if_loop.c:1.107 --- src/sys/net/if_loop.c:1.106 Thu Nov 15 10:06:07 2018 +++ src/sys/net/if_loop.c Fri Apr 26 08:38:25 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_loop.c,v 1.106 2018/11/15 10:06:07 maxv Exp $ */ +/* $NetBSD: if_loop.c,v 1.107 2019/04/26 08:38:25 pgoyette Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.106 2018/11/15 10:06:07 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.107 2019/04/26 08:38:25 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -530,4 +530,4 @@ loioctl(struct ifnet *ifp, u_long cmd, v */ #include "if_module.h" -IF_MODULE(MODULE_CLASS_DRIVER, loop, "") +IF_MODULE(MODULE_CLASS_DRIVER, loop, NULL) Index: src/sys/net/if_tun.c diff -u src/sys/net/if_tun.c:1.155 src/sys/net/if_tun.c:1.156 --- src/sys/net/if_tun.c:1.155 Mon Mar 25 10:04:48 2019 +++ src/sys/net/if_tun.c Fri Apr 26 08:38:25 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_tun.c,v 1.155 2019/03/25 10:04:48 pgoyette Exp $ */ +/* $NetBSD: if_tun.c,v 1.156 2019/04/26 08:38:25 pgoyette Exp $ */ /* * Copyright (c) 1988, Julian Onions @@ -19,7 +19,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.155 2019/03/25 10:04:48 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.156 2019/04/26 08:38:25 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1142,4 +1142,4 @@ out_nolock: */ #include "if_module.h" -IF_MODULE(MODULE_CLASS_DRIVER, tun, "") +IF_MODULE(MODULE_CLASS_DRIVER, tun, NULL)
CVS commit: src/sys/arch
Module Name:src Committed By: mrg Date: Fri Apr 26 08:28:11 UTC 2019 Modified Files: src/sys/arch/arm/rockchip: files.rockchip rk3399_cru.c src/sys/arch/evbarm/conf: GENERIC64 Added Files: src/sys/arch/arm/rockchip: rk_tsadc.c Log Message: implement TSADC driver for rockchip RK3328 and RK3399. so far, only tested on RK3399 but the RK3328 looks mostly the same and has a good chance of working too. add clock entries for "clk_tsadc" and "pclk_tsadc" to cru. exports "CPU" and "GPU" temp sensors. these currently limited to 5 degC resolution but can be reduced to sub 1 degC resolution with some interpolation. todo list: - handle setting various temp values - add interpolation between the 5degC intervals in sample data - handle DT trips/temp value defaults - interrupts aren't triggered (test by lowering warn/crit values), and once they work, make the interrupt do something - test on RK3328, and port to other rockchips (will require moving some part into per-chipset sections, such as code<->temp tables) thanks to jmcneill for help. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/rockchip/files.rockchip cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/rockchip/rk3399_cru.c cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/rockchip/rk_tsadc.c cvs rdiff -u -r1.90 -r1.91 src/sys/arch/evbarm/conf/GENERIC64 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/rockchip/files.rockchip diff -u src/sys/arch/arm/rockchip/files.rockchip:1.17 src/sys/arch/arm/rockchip/files.rockchip:1.18 --- src/sys/arch/arm/rockchip/files.rockchip:1.17 Sun Mar 10 11:10:21 2019 +++ src/sys/arch/arm/rockchip/files.rockchip Fri Apr 26 08:28:11 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files.rockchip,v 1.17 2019/03/10 11:10:21 jmcneill Exp $ +# $NetBSD: files.rockchip,v 1.18 2019/04/26 08:28:11 mrg Exp $ # # Configuration info for Rockchip family SoCs # @@ -68,6 +68,11 @@ device rkemmcphy attach rkemmcphy at fdt file arch/arm/rockchip/rk_emmcphy.c rkemmcphy +# TSADC temperature sensors +device rktsadc: sysmon_envsys +attach rktsadc at fdt with rk_tsadc +file arch/arm/rockchip/rk_tsadc.c rk_tsadc + # SOC parameters defflag opt_soc.h SOC_ROCKCHIP defflag opt_soc.h SOC_RK3328: SOC_ROCKCHIP Index: src/sys/arch/arm/rockchip/rk3399_cru.c diff -u src/sys/arch/arm/rockchip/rk3399_cru.c:1.6 src/sys/arch/arm/rockchip/rk3399_cru.c:1.7 --- src/sys/arch/arm/rockchip/rk3399_cru.c:1.6 Wed Mar 13 10:29:56 2019 +++ src/sys/arch/arm/rockchip/rk3399_cru.c Fri Apr 26 08:28:11 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rk3399_cru.c,v 1.6 2019/03/13 10:29:56 jmcneill Exp $ */ +/* $NetBSD: rk3399_cru.c,v 1.7 2019/04/26 08:28:11 mrg Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: rk3399_cru.c,v 1.6 2019/03/13 10:29:56 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: rk3399_cru.c,v 1.7 2019/04/26 08:28:11 mrg Exp $"); #include #include @@ -345,6 +345,7 @@ rk3399_cru_pll_set_rate(struct rk_cru_so static const char * pll_parents[] = { "xin24m", "xin32k" }; static const char * armclkl_parents[] = { "clk_core_l_lpll_src", "clk_core_l_bpll_src", "clk_core_l_dpll_src", "clk_core_l_gpll_src" }; static const char * armclkb_parents[] = { "clk_core_b_lpll_src", "clk_core_b_bpll_src", "clk_core_b_dpll_src", "clk_core_b_gpll_src" }; +static const char * mux_clk_tsadc_parents[] = { "xin24m", "xin32k" }; static const char * mux_pll_src_cpll_gpll_parents[] = { "cpll", "gpll" }; static const char * mux_pll_src_cpll_gpll_npll_parents[] = { "cpll", "gpll", "npll" }; static const char * mux_pll_src_cpll_gpll_upll_parents[] = { "cpll", "gpll", "upll" }; @@ -785,6 +786,16 @@ static struct rk_cru_clk rk3399_cru_clks __BIT(3), /* gate_mask */ 0), RK_MUX(RK3399_SCLK_PCIE_CORE, "clk_pcie_core", mux_pciecore_cru_phy_parents, CLKSEL_CON(18), __BIT(7)), + + /* TSADC */ + RK_COMPOSITE(RK3399_SCLK_TSADC, "clk_tsadc", mux_clk_tsadc_parents, + CLKSEL_CON(27), /* muxdiv_reg */ + __BIT(15), /* mux_mask */ + __BITS(9,0), /* div_mask */ + CLKGATE_CON(9), /* gate_reg */ + __BIT(1), /* gate_mask */ + RK_COMPOSITE_ROUND_DOWN), + RK_GATE(RK3399_PCLK_TSADC, "pclk_tsadc", "pclk_perilp1", CLKGATE_CON(22), 13), }; static int Index: src/sys/arch/evbarm/conf/GENERIC64 diff -u src/sys/arch/evbarm/conf/GENERIC64:1.90 src/sys/arch/evbarm/conf/GENERIC64:1.91 --- src/sys/arch/evbarm/conf/GENERIC64:1.90 Sun Apr 21 14:14:14 2019 +++ src/sys/arch/evbarm/conf/GENERIC64 Fri Apr 26 08:28:11 2019 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC64,v 1.90 2019/04/21 14:14:14 jmcneill Exp $ +# $NetBSD: GENERIC64,v 1.91 2019/04/26 08:28:11 mrg Exp $ # # GENERIC ARM (aarch64) kernel # @@ -440,6 +440,7 @@ pwmbacklight* at fdt? # PWM Backlight # Thermal throttling controller sunxithermal* at fdt? # Allwinner thermal sensor
CVS commit: src/usr.bin/elf2aout
Module Name:src Committed By: skrll Date: Fri Apr 26 07:35:21 UTC 2019 Modified Files: src/usr.bin/elf2aout: elf2aout.c Log Message: A couple of fixes so that NetBSD/cats builds (on linux), works, and produces a symbol table that is readable (by 4.4BSD nm(1) at least) - Change from OMAGIC to ZMAGIC - Resize the a.out string table if we run out of space. - output symbol table size as int32_t (the code already assumes no 64bit a.out. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/usr.bin/elf2aout/elf2aout.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/elf2aout/elf2aout.c diff -u src/usr.bin/elf2aout/elf2aout.c:1.19 src/usr.bin/elf2aout/elf2aout.c:1.20 --- src/usr.bin/elf2aout/elf2aout.c:1.19 Mon Mar 7 22:16:38 2016 +++ src/usr.bin/elf2aout/elf2aout.c Fri Apr 26 07:35:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: elf2aout.c,v 1.19 2016/03/07 22:16:38 martin Exp $ */ +/* $NetBSD: elf2aout.c,v 1.20 2019/04/26 07:35:21 skrll Exp $ */ /* * Copyright (c) 1995 @@ -272,8 +272,8 @@ usage: default: mid = MID_ZERO; } - aex.a_midmag = (u_long)htonl(((u_long)symflag << 26) - | ((u_long)mid << 16) | OMAGIC); + aex.a_midmag = (u_long)htonl(((u_long)symflag << 26) + | ((u_long)mid << 16) | ZMAGIC); aex.a_text = text.len; aex.a_data = data.len; @@ -364,7 +364,8 @@ translate_syms(int out, int in, off_t sy ssize_t i, remaining, cur; char *oldstrings; char *newstrings, *nsp; - size_t newstringsize, stringsizebuf; + size_t newstringsize; + uint32_t stringsizebuf; /* Zero the unused fields in the output buffer.. */ memset(outbuf, 0, sizeof outbuf); @@ -375,10 +376,10 @@ translate_syms(int out, int in, off_t sy /* Suck in the old string table... */ oldstrings = saveRead(in, stroff, (size_t)strsize, "string table"); - /* Allocate space for the new one. XXX We make the wild assumption - * that no two symbol table entries will point at the same place in - * the string table - if that assumption is bad, this could easily - * blow up. */ + /* + * Allocate space for the new one. We will increase the space if + * this is too small + */ newstringsize = (size_t)(strsize + remaining); newstrings = malloc(newstringsize); if (newstrings == NULL) @@ -390,11 +391,10 @@ translate_syms(int out, int in, off_t sy if (lseek(in, symoff, SEEK_SET) < 0) err(EXIT_FAILURE, "Can't seek"); /* Translate and copy symbols... */ - while (remaining) { + for (; remaining; remaining -= cur) { cur = remaining; if (cur > SYMS_PER_PASS) cur = SYMS_PER_PASS; - remaining -= cur; if ((i = read(in, inbuf, (size_t)cur * sizeof(Elf32_Sym))) != cur * (ssize_t)sizeof(Elf32_Sym)) { if (i < 0) @@ -406,6 +406,7 @@ translate_syms(int out, int in, off_t sy /* Do the translation... */ for (i = 0; i < cur; i++) { int binding, type; + size_t off, len; #if TARGET_BYTE_ORDER != BYTE_ORDER inbuf[i].st_name = bswap32(inbuf[i].st_name); @@ -413,12 +414,28 @@ translate_syms(int out, int in, off_t sy inbuf[i].st_size = bswap32(inbuf[i].st_size); inbuf[i].st_shndx = bswap16(inbuf[i].st_shndx); #endif + off = (size_t)(nsp - newstrings); + + /* length of this symbol with leading '_' and trailing '\0' */ + len = strlen(oldstrings + inbuf[i].st_name) + 1 + 1; + + /* Does it fit? If not make more space */ + if (newstringsize - off < len) { +char *nns; + +newstringsize += (size_t)(remaining) * len; +nns = realloc(newstrings, newstringsize); +if (nns == NULL) + err(EXIT_FAILURE, "No memory for new string table!"); +newstrings = nns; +nsp = newstrings + off; + } /* Copy the symbol into the new table, but prepend an * underscore. */ *nsp = '_'; strcpy(nsp + 1, oldstrings + inbuf[i].st_name); outbuf[i].n_un.n_strx = nsp - newstrings + 4; - nsp += strlen(nsp) + 1; + nsp += len; type = ELF32_ST_TYPE(inbuf[i].st_info); binding = ELF32_ST_BIND(inbuf[i].st_info); @@ -475,7 +492,7 @@ copy(int out, int in, off_t offset, off_ charibuf[4096]; ssize_t remaining, cur, count; - /* Go to the start of the ELF symbol table... */ + /* Go to the start of the segment... */ if (lseek(in, offset, SEEK_SET) < 0) err(EXIT_FAILURE, "%s: lseek failed", __func__); if (size > SSIZE_MAX)
CVS commit: src/sys/arch/cats/cats
Module Name:src Committed By: skrll Date: Fri Apr 26 07:32:41 UTC 2019 Modified Files: src/sys/arch/cats/cats: cats_machdep.c Log Message: The free block after the kernel from arm32_bootmem_init doesn't account for bt_memavail. Adjust for this. To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/arch/cats/cats/cats_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/cats/cats/cats_machdep.c diff -u src/sys/arch/cats/cats/cats_machdep.c:1.86 src/sys/arch/cats/cats/cats_machdep.c:1.87 --- src/sys/arch/cats/cats/cats_machdep.c:1.86 Tue Aug 15 08:52:41 2017 +++ src/sys/arch/cats/cats/cats_machdep.c Fri Apr 26 07:32:40 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: cats_machdep.c,v 1.86 2017/08/15 08:52:41 maya Exp $ */ +/* $NetBSD: cats_machdep.c,v 1.87 2019/04/26 07:32:40 skrll Exp $ */ /* * Copyright (c) 1997,1998 Mark Brinicombe. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.86 2017/08/15 08:52:41 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.87 2019/04/26 07:32:40 skrll Exp $"); #include "opt_ddb.h" #include "opt_modular.h" @@ -333,6 +333,24 @@ initarm(void *arm_bootargs) arm32_bootmem_init(ebsabootinfo.bt_memstart, ram_size, ebsabootinfo.bt_memstart); + /* + * The free block after the kernel from arm32_bootmem_init doesn't + * account for bt_memavail. Adjust for this. + */ + extern struct bootmem_info bootmem_info; + struct bootmem_info * const bmi = _info; + + pv_addr_t *pv0 = >bmi_freeblocks[0]; + KASSERTMSG(pv0->pv_pa == bmi->bmi_kernelend, + "pv_pa %#lx kernelend %#lx", pv0->pv_pa, bmi->bmi_kernelend); + + pv0->pv_pa = ebsabootinfo.bt_memavail; + pv0->pv_va = KERN_PHYSTOV(pv0->pv_pa); + pv0->pv_size = bmi->bmi_end - pv0->pv_pa; + + printf("First freeblock adjusted to: %lx -> %lx\n", pv0->pv_pa, + pv0->pv_pa + pv0->pv_size - 1); + arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_LOW, 0, cats_devmap, mapallmem_p); @@ -364,9 +382,6 @@ initarm(void *arm_bootargs) ebsabootinfo.bt_pargp, VM_PROT_READ, PTE_CACHE); } - extern struct bootmem_info bootmem_info; - struct bootmem_info * const bmi = _info; - printf("Doing freeblocks: %d\n", bmi->bmi_nfreeblocks); for (size_t i = 0; i < bmi->bmi_nfreeblocks; i++) {