CVS commit: src/sys/dev
Module Name:src Committed By: pgoyette Date: Sun Jun 11 09:41:40 UTC 2017 Modified Files: src/sys/dev: spkr.c Log Message: Clean up the spkr_modcmd() routine so it returns ENOTTY for all commands other than MODULE_CMD_{INIT,FINI} To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/dev/spkr.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/spkr.c diff -u src/sys/dev/spkr.c:1.10 src/sys/dev/spkr.c:1.11 --- src/sys/dev/spkr.c:1.10 Sun Jun 11 05:26:52 2017 +++ src/sys/dev/spkr.c Sun Jun 11 09:41:40 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: spkr.c,v 1.10 2017/06/11 05:26:52 pgoyette Exp $ */ +/* $NetBSD: spkr.c,v 1.11 2017/06/11 09:41:40 pgoyette Exp $ */ /* * Copyright (c) 1990 Eric S. Raymond (e...@snark.thyrsus.com) @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.10 2017/06/11 05:26:52 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.11 2017/06/11 09:41:40 pgoyette Exp $"); #if defined(_KERNEL_OPT) #include "wsmux.h" @@ -521,12 +521,14 @@ MODULE(MODULE_CLASS_DRIVER, spkr, "audio int spkr_modcmd(modcmd_t cmd, void *arg) { + int error = 0; #ifdef _MODULE devmajor_t bmajor, cmajor; - int error = 0; +#endif switch(cmd) { case MODULE_CMD_INIT: +#ifdef _MODULE bmajor = cmajor = -1; error = devsw_attach(spkr_cd.cd_name, NULL, &bmajor, &spkr_cdevsw, &cmajor); @@ -538,15 +540,18 @@ spkr_modcmd(modcmd_t cmd, void *arg) if (error) { devsw_detach(NULL, &spkr_cdevsw); } +#endif break; case MODULE_CMD_FINI: +#ifdef _MODULE devsw_detach(NULL, &spkr_cdevsw); error = config_fini_component(cfdriver_ioconf_spkr, cfattach_ioconf_spkr, cfdata_ioconf_spkr); if (error) devsw_attach(spkr_cd.cd_name, NULL, &bmajor, &spkr_cdevsw, &cmajor); +#endif break; default: @@ -555,7 +560,4 @@ spkr_modcmd(modcmd_t cmd, void *arg) } return error; -#else - return 0; -#endif }
CVS commit: src/share/man/man4
Module Name:src Committed By: pgoyette Date: Sun Jun 11 10:30:15 UTC 2017 Modified Files: src/share/man/man4: speaker.4 Log Message: Remove references to the PCPPISPEAKER and VAUDIOSPEAKER options - they don't actually exist. XXX This man page will need a major overhaul. But first we need to get XXX man pages for wsbell(4) and wsbell(9) (and maybe other updates, too) To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/share/man/man4/speaker.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/speaker.4 diff -u src/share/man/man4/speaker.4:1.21 src/share/man/man4/speaker.4:1.22 --- src/share/man/man4/speaker.4:1.21 Sun May 28 18:23:22 2017 +++ src/share/man/man4/speaker.4 Sun Jun 11 10:30:15 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: speaker.4,v 1.21 2017/05/28 18:23:22 wiz Exp $ +.\" $NetBSD: speaker.4,v 1.22 2017/06/11 10:30:15 pgoyette Exp $ .\" .\" Copyright (c) 2016 Nathanial Sloss .\" All rights reserved. @@ -35,18 +35,15 @@ .\" .\" <> .\" -.Dd November 23, 2016 +.Dd June 11, 2017 .Dt SPEAKER 4 .Os .Sh NAME .Nm speaker .Nd console speaker audio device driver .Sh SYNOPSIS -.Cd "options PCPPISPEAKER" -.Cd "spkr0 at pcppi?" -.Pp -.Cd "options VAUDIOSPEAKER" -.Cd "spkr0 at audio?" +.Cd "spkr* at pcppi?" +.Cd "spkr* at audio?" .Pp .In machine/spkr.h .Pa /dev/speaker
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sun Jun 11 11:02:43 UTC 2017 Removed Files: src/sys/arch/evbarm/conf: ODROID-U ODROID-XU ODROID-XU_INSTALL Log Message: Remove ODROID-U and ODROID-XU kernel configs as they no longer work. To generate a diff of this commit: cvs rdiff -u -r1.20 -r0 src/sys/arch/evbarm/conf/ODROID-U cvs rdiff -u -r1.7 -r0 src/sys/arch/evbarm/conf/ODROID-XU cvs rdiff -u -r1.1 -r0 src/sys/arch/evbarm/conf/ODROID-XU_INSTALL Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sun Jun 11 11:04:20 UTC 2017 Modified Files: src/sys/arch/evbarm/conf: EXYNOS Log Message: - Replace CONSADDR with SSCOM2CONSOLE in example - Remove gtmr (Exynos5422 uses mct) - cinclude EXYNOS.local instead of TEGRA.local To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/EXYNOS Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/EXYNOS diff -u src/sys/arch/evbarm/conf/EXYNOS:1.15 src/sys/arch/evbarm/conf/EXYNOS:1.16 --- src/sys/arch/evbarm/conf/EXYNOS:1.15 Sat Jun 10 15:13:19 2017 +++ src/sys/arch/evbarm/conf/EXYNOS Sun Jun 11 11:04:20 2017 @@ -1,5 +1,5 @@ # -# $NetBSD: EXYNOS,v 1.15 2017/06/10 15:13:19 jmcneill Exp $ +# $NetBSD: EXYNOS,v 1.16 2017/06/11 11:04:20 jmcneill Exp $ # # Samsung Exynos SoC kernel # @@ -20,8 +20,8 @@ pseudo-device openfirm # /dev/openfirm #options PMAP_DEBUG # Enable pmap_debug_level code #options IPKDB # remote kernel debugging #options VERBOSE_INIT_ARM # verbose bootstrapping messages -# CONSADDR is required for early init messages from VERBOSE_INIT_ARM. -#options CONSADDR=0x70006300 +# SSCOMnCONSOLE is required for early init messages from VERBOSE_INIT_ARM. +#options SSCOM2CONSOLE makeoptions DEBUG="-g" # compile full symbol table makeoptions COPY_SYMTAB=1 @@ -41,8 +41,6 @@ fregulator* at fdt? pass 4 gpiokeys* at fdt? # Timer -gtmr* at fdt? pass 1 # ARM Generic Timer -armgtmr0 at gtmr? mct* at fdt? # Exynos Multi Core Timer (MCT) # Interrupt controller @@ -91,4 +89,4 @@ usb* at ehci? include "dev/usb/usbdevices.config" midi* at midibus? -cinclude "arch/evbarm/conf/TEGRA.local" +cinclude "arch/evbarm/conf/EXYNOS.local"
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Sun Jun 11 12:56:37 UTC 2017 Modified Files: src/sys/dev/fdt: fdt_intr.c Log Message: Fix an issue with interrupt controller lookup wrt cascading interrupt controllers. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/dev/fdt/fdt_intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/fdt/fdt_intr.c diff -u src/sys/dev/fdt/fdt_intr.c:1.10 src/sys/dev/fdt/fdt_intr.c:1.11 --- src/sys/dev/fdt/fdt_intr.c:1.10 Fri Jun 2 13:12:33 2017 +++ src/sys/dev/fdt/fdt_intr.c Sun Jun 11 12:56:36 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fdt_intr.c,v 1.10 2017/06/02 13:12:33 jmcneill Exp $ */ +/* $NetBSD: fdt_intr.c,v 1.11 2017/06/11 12:56:36 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.10 2017/06/02 13:12:33 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.11 2017/06/11 12:56:36 jmcneill Exp $"); #include #include @@ -44,6 +44,11 @@ struct fdtbus_interrupt_controller { struct fdtbus_interrupt_controller *ic_next; }; +struct fdtbus_interrupt_cookie { + struct fdtbus_interrupt_controller *c_ic; + void *c_ih; +}; + static struct fdtbus_interrupt_controller *fdtbus_ic = NULL; static bool has_interrupt_map(int); @@ -79,7 +84,7 @@ fdtbus_get_interrupt_parent(int phandle) } static struct fdtbus_interrupt_controller * -fdtbus_get_interrupt_controller_ic(int phandle) +fdtbus_get_interrupt_controller(int phandle) { struct fdtbus_interrupt_controller * ic; for (ic = fdtbus_ic; ic; ic = ic->ic_next) { @@ -90,17 +95,6 @@ fdtbus_get_interrupt_controller_ic(int p return NULL; } -static struct fdtbus_interrupt_controller * -fdtbus_get_interrupt_controller(int phandle) -{ - const int ic_phandle = fdtbus_get_interrupt_parent(phandle); - if (ic_phandle < 0) { - return NULL; - } - - return fdtbus_get_interrupt_controller_ic(ic_phandle); -} - int fdtbus_register_interrupt_controller(device_t dev, int phandle, const struct fdtbus_interrupt_controller_func *funcs) @@ -123,8 +117,10 @@ fdtbus_intr_establish(int phandle, u_int int (*func)(void *), void *arg) { struct fdtbus_interrupt_controller *ic; + struct fdtbus_interrupt_cookie *c = NULL; u_int *specifier; int ihandle; + void *ih; specifier = get_specifier_by_index(phandle, index, &ihandle); if (specifier == NULL) @@ -134,17 +130,23 @@ fdtbus_intr_establish(int phandle, u_int if (ic == NULL) return NULL; - return ic->ic_funcs->establish(ic->ic_dev, specifier, + ih = ic->ic_funcs->establish(ic->ic_dev, specifier, ipl, flags, func, arg); + if (ih != NULL) { + c = kmem_alloc(sizeof(*c), KM_SLEEP); + c->c_ic = ic; + c->c_ih = ih; + } + + return c; } void -fdtbus_intr_disestablish(int phandle, void *ih) +fdtbus_intr_disestablish(int phandle, void *cookie) { - struct fdtbus_interrupt_controller *ic; - - ic = fdtbus_get_interrupt_controller(phandle); - KASSERT(ic != NULL); + struct fdtbus_interrupt_cookie *c = cookie; + struct fdtbus_interrupt_controller *ic = c->c_ic; + void *ih = c->c_ih; return ic->ic_funcs->disestablish(ic->ic_dev, ih); }
CVS commit: src/sys/dev
Module Name:src Committed By: nat Date: Sun Jun 11 13:02:44 UTC 2017 Modified Files: src/sys/dev: audiobell.c Log Message: Initialize and set all required parameters for the audiobell. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/dev/audiobell.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/audiobell.c diff -u src/sys/dev/audiobell.c:1.20 src/sys/dev/audiobell.c:1.21 --- src/sys/dev/audiobell.c:1.20 Sun Jun 4 05:37:56 2017 +++ src/sys/dev/audiobell.c Sun Jun 11 13:02:44 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: audiobell.c,v 1.20 2017/06/04 05:37:56 nat Exp $ */ +/* $NetBSD: audiobell.c,v 1.21 2017/06/11 13:02:44 nat Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.20 2017/06/04 05:37:56 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.21 2017/06/11 13:02:44 nat Exp $"); #include #include @@ -123,8 +123,11 @@ audiobell(void *v, u_int pitch, u_int pe return; } + AUDIO_INITINFO(&ai); + ai.mode = AUMODE_PLAY; ai.play.sample_rate = BELL_SAMPLE_RATE; ai.play.precision = 16; + ai.play.channels = 1; ai.play.gain = 255 * volume / 100; #if BYTE_ORDER == LITTLE_ENDIAN
CVS commit: src/sys/dev
Module Name:src Committed By: nat Date: Sun Jun 11 13:05:43 UTC 2017 Modified Files: src/sys/dev: audiobell.c Log Message: Revert back to a 16 bit phase counter - stops overflow when performing calculations on pitch and phase. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/dev/audiobell.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/audiobell.c diff -u src/sys/dev/audiobell.c:1.21 src/sys/dev/audiobell.c:1.22 --- src/sys/dev/audiobell.c:1.21 Sun Jun 11 13:02:44 2017 +++ src/sys/dev/audiobell.c Sun Jun 11 13:05:43 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: audiobell.c,v 1.21 2017/06/11 13:02:44 nat Exp $ */ +/* $NetBSD: audiobell.c,v 1.22 2017/06/11 13:05:43 nat Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.21 2017/06/11 13:02:44 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.22 2017/06/11 13:05:43 nat Exp $"); #include #include @@ -54,7 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: audiobell.c, /* 44.1 kHz should reduce hum at higher pitches. */ #define BELL_SAMPLE_RATE 44100 -#define BELL_SHIFT 19 +#define BELL_SHIFT 3 static inline void audiobell_expandwave(int16_t *buf) @@ -75,7 +75,7 @@ audiobell_expandwave(int16_t *buf) */ static inline int audiobell_synthesize(int16_t *buf, u_int pitch, u_int period, u_int volume, -uint32_t *phase) +uint16_t *phase) { int16_t *wave; @@ -99,7 +99,7 @@ void audiobell(void *v, u_int pitch, u_int period, u_int volume, int poll) { int16_t *buf; - uint32_t phase; + uint16_t phase; struct audio_info ai; struct uio auio; struct iovec aiov;
CVS commit: src/external/bsd/tmux/usr.bin/tmux
Module Name:src Committed By: christos Date: Sun Jun 11 14:34:49 UTC 2017 Modified Files: src/external/bsd/tmux/usr.bin/tmux: utempter.c Log Message: PR/52288: ben: Fix utmp cleanup did not work. XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/bsd/tmux/usr.bin/tmux/utempter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/tmux/usr.bin/tmux/utempter.c diff -u src/external/bsd/tmux/usr.bin/tmux/utempter.c:1.1 src/external/bsd/tmux/usr.bin/tmux/utempter.c:1.2 --- src/external/bsd/tmux/usr.bin/tmux/utempter.c:1.1 Sat Apr 22 22:02:00 2017 +++ src/external/bsd/tmux/usr.bin/tmux/utempter.c Sun Jun 11 10:34:49 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: utempter.c,v 1.1 2017/04/23 02:02:00 christos Exp $ */ +/* $NetBSD: utempter.c,v 1.2 2017/06/11 14:34:49 christos Exp $ */ /*- * Copyright (c) 2011, 2017 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: utempter.c,v 1.1 2017/04/23 02:02:00 christos Exp $"); +__RCSID("$NetBSD: utempter.c,v 1.2 2017/06/11 14:34:49 christos Exp $"); #include #include @@ -86,9 +86,9 @@ login_utmpx(const char *username, const } static void -logout_utmpx(const char *tty, const struct timeval *now) +logout_utmpx(const char *username, const char *tty, const struct timeval *now) { - doutmpx("", "", tty, now, DEAD_PROCESS, 0); + doutmpx(username, "", tty, now, DEAD_PROCESS, 0); } #endif @@ -108,7 +108,8 @@ login_utmp(const char *username, const c } static void -logout_utmp(const char *tty, const struct timeval *now __unused) +logout_utmp(const char *username __unused, +const char *tty, const struct timeval *now __unused) { logout(tty); } @@ -142,17 +143,22 @@ static int utmp_destroy(int fd) { struct timeval tv; + char username[LOGIN_NAME_MAX]; char tty[128], *ttyp; + if (getlogin_r(username, sizeof(username)) == -1) + return -1; + if ((errno = ttyname_r(fd, tty, sizeof(tty))) != 0) return -1; + ttyp = tty + sizeof(_PATH_DEV) - 1; (void)gettimeofday(&tv, NULL); #ifdef SUPPORT_UTMPX - logout_utmpx(ttyp, &tv); + logout_utmpx(username, ttyp, &tv); #endif #ifdef SUPPORT_UTMP - logout_utmp(ttyp, &tv); + logout_utmp(username, ttyp, &tv); #endif return 0; }
CVS commit: src/sys/arch/arm/samsung
Module Name:src Committed By: jmcneill Date: Sun Jun 11 16:19:27 UTC 2017 Modified Files: src/sys/arch/arm/samsung: exynos_combiner.c Log Message: Use fdtbus_intr_establish to hook in block interrupts instead of intr_establish. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/samsung/exynos_combiner.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/samsung/exynos_combiner.c diff -u src/sys/arch/arm/samsung/exynos_combiner.c:1.6 src/sys/arch/arm/samsung/exynos_combiner.c:1.7 --- src/sys/arch/arm/samsung/exynos_combiner.c:1.6 Tue Jan 5 21:53:48 2016 +++ src/sys/arch/arm/samsung/exynos_combiner.c Sun Jun 11 16:19:27 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_combiner.c,v 1.6 2016/01/05 21:53:48 marty Exp $ */ +/* $NetBSD: exynos_combiner.c,v 1.7 2017/06/11 16:19:27 jmcneill Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include "gpio.h" #include -__KERNEL_RCSID(1, "$NetBSD: exynos_combiner.c,v 1.6 2016/01/05 21:53:48 marty Exp $"); +__KERNEL_RCSID(1, "$NetBSD: exynos_combiner.c,v 1.7 2017/06/11 16:19:27 jmcneill Exp $"); #include #include @@ -66,6 +66,7 @@ struct exynos_combiner_irq_entry { int (*irq_handler)(void *); void *irq_arg; struct exynos_combiner_irq_entry *irq_next; + boolirq_mpsafe; }; struct exynos_combiner_irq_block { @@ -73,6 +74,7 @@ struct exynos_combiner_irq_block { struct exynos_combiner_softc *irq_sc; struct exynos_combiner_irq_entry *irq_entries; struct exynos_combiner_irq_block *irq_block_next; + void *irq_ih; }; struct exynos_combiner_softc { @@ -173,7 +175,7 @@ exynos_combiner_get_block(struct exynos_ static struct exynos_combiner_irq_entry * exynos_combiner_new_irq(struct exynos_combiner_irq_block *block, - int irq, int (*func)(void *), void *arg) + int irq, bool mpsafe, int (*func)(void *), void *arg) { struct exynos_combiner_irq_entry * n = kmem_zalloc(sizeof(*n), KM_SLEEP); @@ -181,6 +183,7 @@ exynos_combiner_new_irq(struct exynos_co n->irq_handler = func; n->irq_next = block->irq_entries; n->irq_arg = arg; + n->irq_mpsafe = mpsafe; block->irq_entries = n; return n; } @@ -196,7 +199,8 @@ exynos_combiner_get_irq(struct exynos_co return NULL; } -static int exynos_combiner_irq(void *cookie) +static int +exynos_combiner_irq(void *cookie) { struct exynos_combiner_irq_block *blockp = cookie; struct exynos_combiner_softc *sc = blockp->irq_sc; @@ -211,9 +215,13 @@ static int exynos_combiner_irq(void *coo if (istatus & 1 << irq) { struct exynos_combiner_irq_entry *e = exynos_combiner_get_irq(blockp, irq); - if (e) + if (e) { +if (!e->irq_mpsafe) + KERNEL_LOCK(1, curlwp); e->irq_handler(e->irq_arg); - else +if (!e->irq_mpsafe) + KERNEL_UNLOCK_ONE(curlwp); + } else printf("%s: Unexpected irq %d, %d\n", __func__, intr, irq); } @@ -229,6 +237,7 @@ exynos_combiner_establish(device_t dev, struct exynos_combiner_softc * const sc = device_private(dev); struct exynos_combiner_irq_block *blockp; struct exynos_combiner_irq_entry *entryp; + const bool mpsafe = (flags & FDT_INTR_MPSAFE) != 0; const u_int intr = be32toh(specifier[0]); const u_int irq = be32toh(specifier[1]); @@ -237,18 +246,19 @@ exynos_combiner_establish(device_t dev, intr / COMBINER_BLOCKS_PER_GROUP * COMBINER_GROUP_SIZE + COMBINER_IESR_OFFSET; - blockp = exynos_combiner_get_block(sc, intr); + blockp = exynos_combiner_get_block(sc, intr); if (!blockp) { blockp = exynos_combiner_new_block(sc, intr); KASSERT(blockp); - intr_establish(intr, ipl, IST_LEVEL, exynos_combiner_irq, - blockp); + blockp->irq_ih = fdtbus_intr_establish(sc->sc_phandle, intr, + IPL_VM /* XXX */, FDT_INTR_MPSAFE, exynos_combiner_irq, + blockp); } entryp = exynos_combiner_get_irq(blockp, irq); if (entryp) return NULL; - entryp = exynos_combiner_new_irq(blockp, irq, func, arg); + entryp = exynos_combiner_new_irq(blockp, irq, mpsafe, func, arg); KASSERT(entryp); int istatus = @@ -262,7 +272,7 @@ static void exynos_combiner_disestablish(device_t dev, void *ih) { /* MJF: Find the ih and disable the handler. */ - intr_disestablish(ih); + panic("exynos_combiner_disestablish not implemented"); } static bool
CVS commit: src/sys/arch
Module Name:src Committed By: jmcneill Date: Sun Jun 11 16:21:41 UTC 2017 Modified Files: src/sys/arch/arm/samsung: exynos_platform.c files.exynos mct.c src/sys/arch/evbarm/conf: EXYNOS Log Message: Simplify MCT; just enable it and then attach an ARMv7 generic timer. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/samsung/exynos_platform.c cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/samsung/files.exynos cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/samsung/mct.c cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/conf/EXYNOS 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/samsung/exynos_platform.c diff -u src/sys/arch/arm/samsung/exynos_platform.c:1.4 src/sys/arch/arm/samsung/exynos_platform.c:1.5 --- src/sys/arch/arm/samsung/exynos_platform.c:1.4 Sun Jun 11 01:15:11 2017 +++ src/sys/arch/arm/samsung/exynos_platform.c Sun Jun 11 16:21:41 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_platform.c,v 1.4 2017/06/11 01:15:11 jmcneill Exp $ */ +/* $NetBSD: exynos_platform.c,v 1.5 2017/06/11 16:21:41 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared D. McNeill @@ -33,7 +33,7 @@ #include "ukbd.h" #include -__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.4 2017/06/11 01:15:11 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.5 2017/06/11 16:21:41 jmcneill Exp $"); #include #include @@ -132,9 +132,7 @@ exynos_platform_reset(void) static void exynos_platform_delay(u_int us) { - extern void mct_delay(u_int); - - mct_delay(us); + gtmr_delay(us); } static u_int Index: src/sys/arch/arm/samsung/files.exynos diff -u src/sys/arch/arm/samsung/files.exynos:1.22 src/sys/arch/arm/samsung/files.exynos:1.23 --- src/sys/arch/arm/samsung/files.exynos:1.22 Sat Jun 10 15:13:18 2017 +++ src/sys/arch/arm/samsung/files.exynos Sun Jun 11 16:21:41 2017 @@ -1,4 +1,4 @@ -# $NetBSD: files.exynos,v 1.22 2017/06/10 15:13:18 jmcneill Exp $ +# $NetBSD: files.exynos,v 1.23 2017/06/11 16:21:41 jmcneill Exp $ # # Configuration info for Samsung Exynos SoC ARM Peripherals # @@ -61,12 +61,12 @@ attach sysmmu at fdt with exynos_sysmmu file arch/arm/samsung/exynos_sysmmu.c exynos_sysmmu # real time clock -device exyortc : ftdbus +device exyortc : fdtbus attach exyortc at fdt with exynos_rtc filearch/arm/samsung/exynos_rtc.c exynos_rtc # Multi Core timer -device mct : ftdbus +device mct { } : fdtbus, mpcorebus attach mct at fdt with exyo_mct file arch/arm/samsung/mct.c exyo_mct Index: src/sys/arch/arm/samsung/mct.c diff -u src/sys/arch/arm/samsung/mct.c:1.11 src/sys/arch/arm/samsung/mct.c:1.12 --- src/sys/arch/arm/samsung/mct.c:1.11 Sun Jun 11 01:09:44 2017 +++ src/sys/arch/arm/samsung/mct.c Sun Jun 11 16:21:41 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: mct.c,v 1.11 2017/06/11 01:09:44 jmcneill Exp $ */ +/* $NetBSD: mct.c,v 1.12 2017/06/11 16:21:41 jmcneill Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: mct.c,v 1.11 2017/06/11 01:09:44 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: mct.c,v 1.12 2017/06/11 16:21:41 jmcneill Exp $"); #include #include @@ -50,35 +50,24 @@ __KERNEL_RCSID(1, "$NetBSD: mct.c,v 1.11 #include #include +#include +#include +#include + #include +#include static int mct_match(device_t, cfdata_t, void *); static void mct_attach(device_t, device_t, void *); -static int clockhandler(void *); -static u_int mct_get_timecount(struct timecounter *); - CFATTACH_DECL_NEW(exyo_mct, 0, mct_match, mct_attach, NULL, NULL); - -static struct timecounter mct_timecounter = { - .tc_get_timecount = mct_get_timecount, - .tc_poll_pps = 0, - .tc_counter_mask = ~0u, - .tc_frequency = 0, /* set by cpu_initclocks() */ - .tc_name = NULL, /* set by cpu_initclocks() */ - .tc_quality = 500, /* why 500? */ - .tc_priv = &mct_sc, - .tc_next = NULL, -}; - static inline uint32_t mct_read_global(struct mct_softc *sc, bus_size_t o) { return bus_space_read_4(sc->sc_bst, sc->sc_bsh, o); } - static inline void mct_write_global(struct mct_softc *sc, bus_size_t o, uint32_t v) { @@ -128,6 +117,12 @@ mct_write_global(struct mct_softc *sc, b panic("MCT hangs after writing %#x at %#x", v, (uint32_t) o); } +static void +mct_fdt_cpu_hatch(void *priv, struct cpu_info *ci) +{ + gtmr_init_cpu_clock(ci); +} + static int mct_match(device_t parent, cfdata_t cf, void *aux) { @@ -138,7 +133,6 @@ mct_match(device_t parent, cfdata_t cf, return of_match_compatible(faa->faa_phandle, compatible); } - static void mct_attach(device_t parent, device_t self, void *aux) { @@ -168,145 +162,18 @@ mct_attach(device_t parent, device_t sel aprint_naive("\n"); aprint_normal(": Exynos SoC multi core timer (64 bits)\n"); - evcnt_attach_dynamic(&sc->sc_ev_missing_ticks, EVCNT_TYPE_MISC, NULL, - device_xname(self), "missing interrupts"); - - for
CVS commit: src/lib/libc/sys
Module Name:src Committed By: abhinav Date: Sun Jun 11 17:01:26 UTC 2017 Modified Files: src/lib/libc/sys: send.2 Log Message: Insert missing word Insert comma in a sentence to make the comprehension easier Remove Pp before Bd To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/lib/libc/sys/send.2 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/sys/send.2 diff -u src/lib/libc/sys/send.2:1.31 src/lib/libc/sys/send.2:1.32 --- src/lib/libc/sys/send.2:1.31 Sun Jul 14 14:29:09 2013 +++ src/lib/libc/sys/send.2 Sun Jun 11 17:01:26 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: send.2,v 1.31 2013/07/14 14:29:09 njoly Exp $ +.\" $NetBSD: send.2,v 1.32 2017/06/11 17:01:26 abhinav Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -69,11 +69,10 @@ may be used at any time. .Pp The .Fn sendmmsg -call be used to send multiple messages in the same call using an array of +call can be used to send multiple messages in the same call using an array of .Fa mmsghdr elements with the following form, as defined in .Ao Pa sys/socket.h Ac : -.Pp .Bd -literal struct mmsghdr { struct msghdr msg_hdr; /* the message to be sent */ @@ -98,7 +97,7 @@ with .Dv SO_ERROR . .Pp The address of the target is given by -.Fa to +.Fa to , with .Fa tolen specifying its size.
CVS commit: src/lib/libc/sys
Module Name:src Committed By: abhinav Date: Sun Jun 11 17:34:54 UTC 2017 Modified Files: src/lib/libc/sys: recv.2 Log Message: Grammar and punctuation fixes in few sentences Remove Pp before Bd at couple of places To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/lib/libc/sys/recv.2 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/sys/recv.2 diff -u src/lib/libc/sys/recv.2:1.36 src/lib/libc/sys/recv.2:1.37 --- src/lib/libc/sys/recv.2:1.36 Sun Jul 14 14:29:09 2013 +++ src/lib/libc/sys/recv.2 Sun Jun 11 17:34:54 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: recv.2,v 1.36 2013/07/14 14:29:09 njoly Exp $ +.\" $NetBSD: recv.2,v 1.37 2017/06/11 17:34:54 abhinav Exp $ .\" .\" Copyright (c) 1983, 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -72,11 +72,10 @@ address stored there. .Pp The .Fn recvmmsg -call be used to receive multiple messages in the same call using an array of +call can be used to receive multiple messages in the same call using an array of .Fa mmsghdr elements with the following form, as defined in .Ao Pa sys/socket.h Ac : -.Pp .Bd -literal struct mmsghdr { struct msghdr msg_hdr; /* the message to be sent */ @@ -167,7 +166,7 @@ The .Xr select 2 or .Xr poll 2 -call may be used to determine when more data arrive. +call may be used to determine when more data arrives. .Pp The .Fa flags @@ -207,7 +206,6 @@ call uses a structure to minimize the number of directly supplied parameters. This structure has the following form, as defined in .Ao Pa sys/socket.h Ac : -.Pp .Bd -literal struct msghdr { void *msg_name; /* optional address */ @@ -298,7 +296,7 @@ For connected sockets whose remote peer 0 is returned when no more data is available. The .Fn recvmmsg -calls return the number of messages received, or \-1 +call returns the number of messages received, or \-1 if an error occurred. .Sh ERRORS The calls fail if: @@ -341,7 +339,7 @@ The .Fa msg_iovlen member of the .Fa msg -structure is less than or equal to 0 +structure is less than or equal to 0, or is greater than .Brq Dv IOV_MAX . .El
CVS commit: src/sys/arch/evbarm/fdt
Module Name:src Committed By: jmcneill Date: Sun Jun 11 20:25:07 UTC 2017 Modified Files: src/sys/arch/evbarm/fdt: fdt_machdep.c Log Message: Parse more than one entry from the /memory node's reg property. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/fdt/fdt_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/fdt/fdt_machdep.c diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.6 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.7 --- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.6 Tue Jun 6 09:56:00 2017 +++ src/sys/arch/evbarm/fdt/fdt_machdep.c Sun Jun 11 20:25:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fdt_machdep.c,v 1.6 2017/06/06 09:56:00 jmcneill Exp $ */ +/* $NetBSD: fdt_machdep.c,v 1.7 2017/06/11 20:25:07 jmcneill Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.6 2017/06/06 09:56:00 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.7 2017/06/11 20:25:07 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -139,6 +139,34 @@ fdt_printn(u_int n, int base) #define DPRINTN(x,b) #endif +/* + * Get the first physically contiguous region of memory. + */ +static void +fdt_get_memory(uint64_t *paddr, uint64_t *psize) +{ + const int memory = OF_finddevice("/memory"); + uint64_t cur_addr, cur_size; + int index; + + /* Assume the first entry is the start of memory */ + if (fdtbus_get_reg64(memory, 0, paddr, psize) != 0) + panic("Cannot determine memory size"); + + DPRINTF("FDT /memory [%d] @ 0x%" PRIx64 " size 0x%" PRIx64 "\n", + 0, *paddr, *psize); + + /* If subsequent entries follow the previous one, append them. */ + for (index = 1; + fdtbus_get_reg64(memory, index, &cur_addr, &cur_size) == 0; + index++) { + DPRINTF("FDT /memory [%d] @ 0x%" PRIx64 " size 0x%" PRIx64 "\n", + index, cur_addr, cur_size); + if (*paddr + *psize == cur_addr) + *psize += cur_size; + } +} + u_int initarm(void *arg) { @@ -219,9 +247,7 @@ initarm(void *arg) KERNEL_VM_BASE - KERNEL_BASE, KERNEL_BASE_VOFFSET); - const int memory = OF_finddevice("/memory"); - if (fdtbus_get_reg64(memory, 0, &memory_addr, &memory_size) != 0) - panic("Cannot determine memory size"); + fdt_get_memory(&memory_addr, &memory_size); #if !defined(_LP64) /* Cannot map memory above 4GB */
CVS commit: src/external/bsd/cron/dist
Module Name:src Committed By: joerg Date: Sun Jun 11 20:38:17 UTC 2017 Modified Files: src/external/bsd/cron/dist: pam_auth.c Log Message: Do not partially initialize a static variable. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/bsd/cron/dist/pam_auth.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/cron/dist/pam_auth.c diff -u src/external/bsd/cron/dist/pam_auth.c:1.1 src/external/bsd/cron/dist/pam_auth.c:1.2 --- src/external/bsd/cron/dist/pam_auth.c:1.1 Fri Jun 9 17:36:30 2017 +++ src/external/bsd/cron/dist/pam_auth.c Sun Jun 11 20:38:17 2017 @@ -5,7 +5,7 @@ #include static pam_handle_t *pamh = NULL; -static const struct pam_conv cron_conv = { 0 }; +static const struct pam_conv cron_conv; int cron_pam_start (const char *username)
CVS commit: src/sys/conf
Module Name:src Committed By: pgoyette Date: Sun Jun 11 21:45:28 UTC 2017 Modified Files: src/sys/conf: files Log Message: Remove the 'needs-flag' from spkr.c - it's not needed by anything. To generate a diff of this commit: cvs rdiff -u -r1.1176 -r1.1177 src/sys/conf/files 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.1176 src/sys/conf/files:1.1177 --- src/sys/conf/files:1.1176 Sun Jun 11 03:55:56 2017 +++ src/sys/conf/files Sun Jun 11 21:45:28 2017 @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.1176 2017/06/11 03:55:56 nat Exp $ +# $NetBSD: files,v 1.1177 2017/06/11 21:45:28 pgoyette Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 version 20150846 @@ -345,7 +345,7 @@ define firmload # speaker devices, attaches to audio or pcppi drivers device spkr: wsbelldev -file dev/spkr.c spkr needs-flag +file dev/spkr.c spkr include "dev/files.audio"
CVS commit: src/sys/dev
Module Name:src Committed By: pgoyette Date: Sun Jun 11 21:54:22 UTC 2017 Modified Files: src/sys/dev: spkr.c spkr_audio.c spkrvar.h src/sys/dev/isa: spkr_pcppi.c Log Message: Implement xxx_rescan() and xxx_childdet() functions; these will be needed when child device wsbell(4) becomes a separately-loadable module. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/spkr.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/spkr_audio.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/spkrvar.h cvs rdiff -u -r1.9 -r1.10 src/sys/dev/isa/spkr_pcppi.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/spkr.c diff -u src/sys/dev/spkr.c:1.11 src/sys/dev/spkr.c:1.12 --- src/sys/dev/spkr.c:1.11 Sun Jun 11 09:41:40 2017 +++ src/sys/dev/spkr.c Sun Jun 11 21:54:22 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: spkr.c,v 1.11 2017/06/11 09:41:40 pgoyette Exp $ */ +/* $NetBSD: spkr.c,v 1.12 2017/06/11 21:54:22 pgoyette Exp $ */ /* * Copyright (c) 1990 Eric S. Raymond (e...@snark.thyrsus.com) @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.11 2017/06/11 09:41:40 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.12 2017/06/11 21:54:22 pgoyette Exp $"); #if defined(_KERNEL_OPT) #include "wsmux.h" @@ -372,13 +372,9 @@ spkr_attach(device_t self, void (*tone)( sc->sc_tone = tone; sc->sc_rest = rest; sc->sc_inbuf = NULL; + sc->sc_wsbelldev = NULL; -#if (NWSMUX > 0) - struct wsbelldev_attach_args a; - - a.accesscookie = sc; - sc->sc_wsbelldev = config_found(self, &a, wsbelldevprint); -#endif + spkr_rescan(self, "", NULL); } int @@ -397,6 +393,33 @@ spkr_detach(device_t self, int flags) return 0; } +/* ARGSUSED */ +int +spkr_rescan(device_t self, const char *iattr, const int *locators) +{ +#if NWSMUX > 0 + struct spkr_softc *sc = device_private(self); + struct wsbelldev_attach_args a; + + if (sc->sc_wsbelldev == NULL) { + a.accesscookie = sc; + sc->sc_wsbelldev = config_found(self, &a, wsbelldevprint); + } +#endif + return 0; +} + +int +spkr_childdet(device_t self, device_t child) +{ + struct spkr_softc *sc = device_private(self); + + if (sc->sc_wsbelldev == child) + sc->sc_wsbelldev = NULL; + + return 0; +} + int spkropen(dev_t dev, int flags, int mode, struct lwp *l) { Index: src/sys/dev/spkr_audio.c diff -u src/sys/dev/spkr_audio.c:1.5 src/sys/dev/spkr_audio.c:1.6 --- src/sys/dev/spkr_audio.c:1.5 Sun Jun 11 03:33:48 2017 +++ src/sys/dev/spkr_audio.c Sun Jun 11 21:54:22 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: spkr_audio.c,v 1.5 2017/06/11 03:33:48 nat Exp $ */ +/* $NetBSD: spkr_audio.c,v 1.6 2017/06/11 21:54:22 pgoyette Exp $ */ /*- * Copyright (c) 2016 Nathanial Sloss @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: spkr_audio.c,v 1.5 2017/06/11 03:33:48 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spkr_audio.c,v 1.6 2017/06/11 21:54:22 pgoyette Exp $"); #include #include @@ -51,14 +51,17 @@ __KERNEL_RCSID(0, "$NetBSD: spkr_audio.c static int spkr_audio_probe(device_t, cfdata_t, void *); static void spkr_audio_attach(device_t, device_t, void *); static int spkr_audio_detach(device_t, int); +static int spkr_audio_rescan(device_t, const char *, const int *); +static void spkr_audio_childdet(device_t, device_t); struct spkr_audio_softc { struct spkr_softc sc_spkr; device_t sc_audiodev; }; -CFATTACH_DECL_NEW(spkr_audio, sizeof(struct spkr_audio_softc), -spkr_audio_probe, spkr_audio_attach, spkr_audio_detach, NULL); +CFATTACH_DECL3_NEW(spkr_audio, sizeof(struct spkr_audio_softc), +spkr_audio_probe, spkr_audio_attach, spkr_audio_detach, NULL, +spkr_audio_rescan, spkr_audio_childdet, 0); static void spkr_audio_tone(device_t self, u_int xhz, u_int ticks) @@ -121,3 +124,17 @@ spkr_audio_detach(device_t self, int fla return 0; } + +static int +spkr_audio_rescan(device_t self, const char *iattr, const int *locators) +{ + + return spkr_rescan(self, iattr, locators); +} + +static void +spkr_audio_childdet(device_t self, device_t child) +{ + + spkr_childdet(self, child); +} Index: src/sys/dev/spkrvar.h diff -u src/sys/dev/spkrvar.h:1.8 src/sys/dev/spkrvar.h:1.9 --- src/sys/dev/spkrvar.h:1.8 Sun Jun 11 03:55:56 2017 +++ src/sys/dev/spkrvar.h Sun Jun 11 21:54:22 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: spkrvar.h,v 1.8 2017/06/11 03:55:56 nat Exp $ */ +/* $NetBSD: spkrvar.h,v 1.9 2017/06/11 21:54:22 pgoyette Exp $ */ #ifndef _SYS_DEV_SPKRVAR_H #define _SYS_DEV_SPKRVAR_H @@ -27,4 +27,8 @@ void spkr_attach(device_t, int spkr_detach(device_t, int); +int spkr_rescan(device_t, const char *, const int *); + +int spkr_childdet(device_t, device_t); + #endif /* _SYS_DEV_SPKRVAR_H */ Index: src/sys/dev/isa/spkr_pcppi.c diff -u src/sys/dev/isa/spkr_pcppi.c:1.9 src/sys/dev/isa/spkr_pcppi.c:1.10 --- src/sys/dev/isa/spkr_pcppi.c:1.9 Fri Jan 6 09:32:08 2017 +++ src/sys/dev/isa/spkr_pcppi.c Sun Jun 11 21:54:22 2017
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: christos Date: Sun Jun 11 22:12:56 UTC 2017 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: crypto_openssl.c Log Message: PR/52292: Shinichi Doyashiki: Fix reversed comments. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 \ src/crypto/dist/ipsec-tools/src/racoon/crypto_openssl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/crypto_openssl.c diff -u src/crypto/dist/ipsec-tools/src/racoon/crypto_openssl.c:1.25 src/crypto/dist/ipsec-tools/src/racoon/crypto_openssl.c:1.26 --- src/crypto/dist/ipsec-tools/src/racoon/crypto_openssl.c:1.25 Thu Feb 27 03:37:58 2014 +++ src/crypto/dist/ipsec-tools/src/racoon/crypto_openssl.c Sun Jun 11 18:12:56 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: crypto_openssl.c,v 1.25 2014/02/27 08:37:58 tteras Exp $ */ +/* $NetBSD: crypto_openssl.c,v 1.26 2017/06/11 22:12:56 christos Exp $ */ /* Id: crypto_openssl.c,v 1.47 2006/05/06 20:42:09 manubsd Exp */ @@ -1268,7 +1268,7 @@ eay_idea_encrypt(data, key, iv) if ((res = vmalloc(data->l)) == NULL) return NULL; - /* decryption data */ + /* encrypt data */ idea_cbc_encrypt((unsigned char *)data->v, (unsigned char *)res->v, data->l, &ks, (unsigned char *)iv->v, IDEA_ENCRYPT); @@ -1366,7 +1366,7 @@ eay_rc5_encrypt(data, key, iv) if ((res = vmalloc(data->l)) == NULL) return NULL; - /* decryption data */ + /* encrypt data */ RC5_32_cbc_encrypt((unsigned char *)data->v, (unsigned char *)res->v, data->l, &ks, (unsigned char *)iv->v, RC5_ENCRYPT);
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: pgoyette Date: Sun Jun 11 22:14:55 UTC 2017 Modified Files: src/sys/dev/wscons: wsbell.c Log Message: Add module infrastructure for wsbell(4) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/wscons/wsbell.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/wscons/wsbell.c diff -u src/sys/dev/wscons/wsbell.c:1.1 src/sys/dev/wscons/wsbell.c:1.2 --- src/sys/dev/wscons/wsbell.c:1.1 Sun Jun 11 03:55:56 2017 +++ src/sys/dev/wscons/wsbell.c Sun Jun 11 22:14:55 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: wsbell.c,v 1.1 2017/06/11 03:55:56 nat Exp $ */ +/* $NetBSD: wsbell.c,v 1.2 2017/06/11 22:14:55 pgoyette Exp $ */ /*- * Copyright (c) 2017 Nathanial Sloss @@ -107,10 +107,11 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsbell.c,v 1.1 2017/06/11 03:55:56 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsbell.c,v 1.2 2017/06/11 22:14:55 pgoyette Exp $"); -#include "wsdisplay.h" +#if defined(_KERNEL_OPT) #include "wsmux.h" +#endif #include #include @@ -130,6 +131,7 @@ __KERNEL_RCSID(0, "$NetBSD: wsbell.c,v 1 #include #include #include +#include #include #include @@ -138,6 +140,8 @@ __KERNEL_RCSID(0, "$NetBSD: wsbell.c,v 1 #include +#include "ioconf.h" + #if defined(WSMUX_DEBUG) && NWSMUX > 0 #define DPRINTF(x) if (wsmuxdebug) printf x #define DPRINTFN(n,x) if (wsmuxdebug > (n)) printf x @@ -461,3 +465,50 @@ wsbell_mux_close(struct wsevsrc *me) return (0); } #endif /* NWSMUX > 0 */ + +MODULE(MODULE_CLASS_DRIVER, wsbell, "spkr"); + +#ifdef _MODULE +int wsbell_bmajor = -1, wsbell_cmajor = -1; + +#include "ioconf.c" +#endif + +static int +wsbell_modcmd(modcmd_t cmd, void *arg) +{ + int error = 0; + + switch (cmd) { + case MODULE_CMD_INIT: +#ifdef _MODULE + error = devsw_attach("wsbell", NULL, &wsbell_bmajor, + &wsbell_cdevsw, &wsbell_cmajor); + if (error) + break; + + error = config_init_component(cfdriver_ioconf_wsbell, + cfattach_ioconf_wsbell, cfdata_ioconf_wsbell); + if (error) + devsw_detach(NULL, &wsbell_cdevsw); +#endif + break; + + case MODULE_CMD_FINI: +#ifdef _MODULE + devsw_detach(NULL, &wsbell_cdevsw); + error = config_fini_component(cfdriver_ioconf_wsbell, + cfattach_ioconf_wsbell, cfdata_ioconf_wsbell); + if (error) + devsw_attach("wsbell", NULL, &wsbell_bmajor, + &wsbell_cdevsw, &wsbell_cmajor); +#endif + break; + + default: + error = ENOTTY; + break; + } + + return error; +}
CVS commit: src/sys/modules/wsbell
Module Name:src Committed By: pgoyette Date: Sun Jun 11 22:21:33 UTC 2017 Added Files: src/sys/modules/wsbell: Makefile wsbell.ioconf Log Message: Actually create the wsbell(4) module To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/modules/wsbell/Makefile \ src/sys/modules/wsbell/wsbell.ioconf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/modules/wsbell/Makefile diff -u /dev/null src/sys/modules/wsbell/Makefile:1.1 --- /dev/null Sun Jun 11 22:21:34 2017 +++ src/sys/modules/wsbell/Makefile Sun Jun 11 22:21:33 2017 @@ -0,0 +1,13 @@ +# $NetBSD: Makefile,v 1.1 2017/06/11 22:21:33 pgoyette Exp $ + +.include "../Makefile.inc" + +.PATH: ${S}/dev/wscons + +CPPFLAGS+= -DNWSMUX=1 + +KMOD= wsbell +IOCONF= wsbell.ioconf +SRCS= wsbell.c + +.include Index: src/sys/modules/wsbell/wsbell.ioconf diff -u /dev/null src/sys/modules/wsbell/wsbell.ioconf:1.1 --- /dev/null Sun Jun 11 22:21:34 2017 +++ src/sys/modules/wsbell/wsbell.ioconf Sun Jun 11 22:21:33 2017 @@ -0,0 +1,9 @@ +# $NetBSD: wsbell.ioconf,v 1.1 2017/06/11 22:21:33 pgoyette Exp $ + +ioconf wsbell + +include "conf/files" + +pseudo-root spkr* + +wsbell* at spkr? console ?
CVS commit: src/distrib/sets/lists/modules
Module Name:src Committed By: pgoyette Date: Sun Jun 11 22:22:36 UTC 2017 Modified Files: src/distrib/sets/lists/modules: mi Log Message: Add new wsbell(4) module to the sets list. To generate a diff of this commit: cvs rdiff -u -r1.110 -r1.111 src/distrib/sets/lists/modules/mi 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/modules/mi diff -u src/distrib/sets/lists/modules/mi:1.110 src/distrib/sets/lists/modules/mi:1.111 --- src/distrib/sets/lists/modules/mi:1.110 Thu Jun 1 09:59:13 2017 +++ src/distrib/sets/lists/modules/mi Sun Jun 11 22:22:36 2017 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.110 2017/06/01 09:59:13 pgoyette Exp $ +# $NetBSD: mi,v 1.111 2017/06/11 22:22:36 pgoyette Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -386,6 +386,8 @@ ./@MODULEDIR@/vnd/vnd.kmod base-kernel-modules kmod ./@MODULEDIR@/wapblbase-kernel-modules kmod ./@MODULEDIR@/wapbl/wapbl.kmod base-kernel-modules kmod +./@MODULEDIR@/wsbellbase-kernel-modules kmod +./@MODULEDIR@/wsbell/wsbell.kmod base-kernel-modules kmod ./@MODULEDIR@/zfsbase-kernel-modules kmod,zfs ./@MODULEDIR@/zfs/zfs.kmod base-kernel-modules kmod,zfs ./@MODULEDIR@/zlibbase-kernel-modules kmod
CVS commit: src/sys/modules
Module Name:src Committed By: pgoyette Date: Mon Jun 12 01:01:01 UTC 2017 Modified Files: src/sys/modules: Makefile Log Message: Descend into SUBDIR to actually build the wsbell module. Missed in previous commit - thanks kre@ To generate a diff of this commit: cvs rdiff -u -r1.192 -r1.193 src/sys/modules/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/modules/Makefile diff -u src/sys/modules/Makefile:1.192 src/sys/modules/Makefile:1.193 --- src/sys/modules/Makefile:1.192 Thu Jun 1 09:58:27 2017 +++ src/sys/modules/Makefile Mon Jun 12 01:01:01 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.192 2017/06/01 09:58:27 pgoyette Exp $ +# $NetBSD: Makefile,v 1.193 2017/06/12 01:01:01 pgoyette Exp $ .include @@ -144,6 +144,7 @@ SUBDIR+= vcoda SUBDIR+= v7fs SUBDIR+= vnd SUBDIR+= wapbl +SUBDIR+= wsbell SUBDIR+= zlib SUBDIR+= tprof .if (defined(NOTYET))
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Mon Jun 12 03:03:22 UTC 2017 Modified Files: src/sys/dev/pci: if_wm.c src/sys/dev/pci/ixgbe: ixgbe.c Log Message: Use IFM_1000_KX and IFM_2500_KX. To generate a diff of this commit: cvs rdiff -u -r1.508 -r1.509 src/sys/dev/pci/if_wm.c cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pci/ixgbe/ixgbe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.508 src/sys/dev/pci/if_wm.c:1.509 --- src/sys/dev/pci/if_wm.c:1.508 Thu Apr 13 10:37:36 2017 +++ src/sys/dev/pci/if_wm.c Mon Jun 12 03:03:22 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.508 2017/04/13 10:37:36 knakahara Exp $ */ +/* $NetBSD: if_wm.c,v 1.509 2017/06/12 03:03:22 msaitoh Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -84,7 +84,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508 2017/04/13 10:37:36 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.509 2017/06/12 03:03:22 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -10451,9 +10451,9 @@ do { \ status = CSR_READ(sc, WMREG_STATUS); if (((status & STATUS_2P5_SKU) != 0) && ((status & STATUS_2P5_SKU_OVER) == 0)) { - ADD("2500baseKX-FDX", IFM_2500_SX | IFM_FDX,ANAR_X_FD); + ADD("2500baseKX-FDX", IFM_2500_KX | IFM_FDX,ANAR_X_FD); } else - ADD("1000baseSX-FDX", IFM_1000_SX | IFM_FDX,ANAR_X_FD); + ADD("1000baseKX-FDX", IFM_1000_KX | IFM_FDX,ANAR_X_FD); } else if (sc->sc_type == WM_T_82545) { /* Only 82545 is LX (XXX except SFP) */ ADD("1000baseLX", IFM_1000_LX, ANAR_X_HD); Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.88 src/sys/dev/pci/ixgbe/ixgbe.c:1.89 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.88 Fri Jun 2 08:16:52 2017 +++ src/sys/dev/pci/ixgbe/ixgbe.c Mon Jun 12 03:03:22 2017 @@ -59,7 +59,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/ -/*$NetBSD: ixgbe.c,v 1.88 2017/06/02 08:16:52 msaitoh Exp $*/ +/*$NetBSD: ixgbe.c,v 1.89 2017/06/12 03:03:22 msaitoh Exp $*/ #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -2063,37 +2063,14 @@ ixgbe_media_status(struct ifnet * ifp, s ** XXX: These need to use the proper media types once ** they're added. */ -#ifndef IFM_ETH_XTYPE if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) switch (adapter->link_speed) { case IXGBE_LINK_SPEED_10GB_FULL: +#ifndef IFM_ETH_XTYPE ifmr->ifm_active |= IFM_10G_SR | IFM_FDX; - break; - case IXGBE_LINK_SPEED_2_5GB_FULL: - ifmr->ifm_active |= IFM_2500_SX | IFM_FDX; - break; - case IXGBE_LINK_SPEED_1GB_FULL: - ifmr->ifm_active |= IFM_1000_CX | IFM_FDX; - break; - } - else if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4 - || layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) - switch (adapter->link_speed) { - case IXGBE_LINK_SPEED_10GB_FULL: - ifmr->ifm_active |= IFM_10G_CX4 | IFM_FDX; - break; - case IXGBE_LINK_SPEED_2_5GB_FULL: - ifmr->ifm_active |= IFM_2500_SX | IFM_FDX; - break; - case IXGBE_LINK_SPEED_1GB_FULL: - ifmr->ifm_active |= IFM_1000_CX | IFM_FDX; - break; - } #else - if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) - switch (adapter->link_speed) { - case IXGBE_LINK_SPEED_10GB_FULL: ifmr->ifm_active |= IFM_10G_KR | IFM_FDX; +#endif break; case IXGBE_LINK_SPEED_2_5GB_FULL: ifmr->ifm_active |= IFM_2500_KX | IFM_FDX; @@ -2106,7 +2083,11 @@ ixgbe_media_status(struct ifnet * ifp, s || layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) switch (adapter->link_speed) { case IXGBE_LINK_SPEED_10GB_FULL: +#ifndef IFM_ETH_XTYPE + ifmr->ifm_active |= IFM_10G_CX4 | IFM_FDX; +#else ifmr->ifm_active |= IFM_10G_KX4 | IFM_FDX; +#endif break; case IXGBE_LINK_SPEED_2_5GB_FULL: ifmr->ifm_active |= IFM_2500_KX | IFM_FDX; @@ -2115,7 +2096,6 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_active |= IFM_1000_KX | IFM_FDX; break; } -#endif /* If nothing is recognized... */ #if 0