CVS commit: src/sys/dev/pci/hdaudio
Module Name:src Committed By: jmcneill Date: Mon Oct 24 02:08:23 UTC 2011 Modified Files: src/sys/dev/pci/hdaudio: hdafg.c Log Message: ossaudio's SNDCTL_DSP_GETOSPACE will call AUDIO_SETINFO if the block size isn't a power of two, and since the block size is changing this tells audio(4) to halt output, reconfigure the device, then trigger output again. mplayer's oss driver uses SNDCTL_DSP_GETOSPACE a lot. Instead of simply rounding to 128 bytes as required by the hardware, change hdafg_round_blocksize to return one of 128, 256, 512, 1024, 2048, 4096, or 8192. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/hdaudio/hdafg.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/hdaudio/hdafg.c diff -u src/sys/dev/pci/hdaudio/hdafg.c:1.8 src/sys/dev/pci/hdaudio/hdafg.c:1.9 --- src/sys/dev/pci/hdaudio/hdafg.c:1.8 Wed Sep 7 20:34:58 2011 +++ src/sys/dev/pci/hdaudio/hdafg.c Mon Oct 24 02:08:22 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hdafg.c,v 1.8 2011/09/07 20:34:58 jmcneill Exp $ */ +/* $NetBSD: hdafg.c,v 1.9 2011/10/24 02:08:22 jmcneill Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.8 2011/09/07 20:34:58 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.9 2011/10/24 02:08:22 jmcneill Exp $"); #include #include @@ -3801,7 +3801,7 @@ hdafg_round_blocksize(void *opaque, int { struct hdaudio_audiodev *ad = opaque; struct hdaudio_stream *st; - int bufsize; + int bufsize, nblksize; st = (mode == AUMODE_PLAY) ? ad->ad_playback : ad->ad_capture; if (st == NULL) { @@ -3810,19 +3810,24 @@ hdafg_round_blocksize(void *opaque, int return 128; } - /* Multiple of 128 */ - blksize &= ~127; - if (blksize <= 0) + if (blksize > 8192) + blksize = 8192; + else if (blksize < 0) blksize = 128; + /* HD audio wants a multiple of 128, and OSS wants a power of 2 */ + for (nblksize = 128; nblksize < blksize; nblksize <<= 1) + ; + + /* Make sure there are enough BDL descriptors */ bufsize = st->st_data.dma_size; - if (bufsize > HDAUDIO_BDL_MAX * blksize) { + if (bufsize > HDAUDIO_BDL_MAX * nblksize) { blksize = bufsize / HDAUDIO_BDL_MAX; - if (blksize & 127) - blksize = (blksize + 127) & ~127; + for (nblksize = 128; nblksize < blksize; nblksize <<= 1) + ; } - return blksize; + return nblksize; } static int
CVS commit: src/sbin/iscsictl
Module Name:src Committed By: christos Date: Sun Oct 23 23:41:56 UTC 2011 Modified Files: src/sbin/iscsictl: iscsic_globals.h iscsic_main.c Log Message: add printflike and fix the format error. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sbin/iscsictl/iscsic_globals.h \ src/sbin/iscsictl/iscsic_main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/iscsictl/iscsic_globals.h diff -u src/sbin/iscsictl/iscsic_globals.h:1.1 src/sbin/iscsictl/iscsic_globals.h:1.2 --- src/sbin/iscsictl/iscsic_globals.h:1.1 Sun Oct 23 17:11:23 2011 +++ src/sbin/iscsictl/iscsic_globals.h Sun Oct 23 19:41:56 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsic_globals.h,v 1.1 2011/10/23 21:11:23 agc Exp $ */ +/* $NetBSD: iscsic_globals.h,v 1.2 2011/10/23 23:41:56 christos Exp $ */ /*- * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc. @@ -152,10 +152,10 @@ ntohq(uint64_t x) /* iscsic_main.c */ -void arg_error(char *, const char *, ...); +void arg_error(char *, const char *, ...) __printflike(2, 3); void arg_missing(const char *); -void io_error(const char *, ...); -void gen_error(const char *, ...); +void io_error(const char *, ...) __printflike(1, 2); +void gen_error(const char *, ...) __printflike(1, 2); void check_extra_args(int, char **); void status_error(unsigned); void status_error_slist(unsigned); Index: src/sbin/iscsictl/iscsic_main.c diff -u src/sbin/iscsictl/iscsic_main.c:1.1 src/sbin/iscsictl/iscsic_main.c:1.2 --- src/sbin/iscsictl/iscsic_main.c:1.1 Sun Oct 23 17:11:23 2011 +++ src/sbin/iscsictl/iscsic_main.c Sun Oct 23 19:41:56 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsic_main.c,v 1.1 2011/10/23 21:11:23 agc Exp $ */ +/* $NetBSD: iscsic_main.c,v 1.2 2011/10/23 23:41:56 christos Exp $ */ /*- * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc. @@ -441,7 +441,7 @@ get_response(int temp) if (temp) { if (NULL == (pbuf = (int *) malloc(len + sizeof(int - gen_error("Can't allocate response buffer (%d bytes)", + gen_error("Can't allocate response buffer (%zu bytes)", len + sizeof(int)); rsp = (iscsid_response_t *) & pbuf[1];
CVS commit: src/share/man/man4
Module Name:src Committed By: jym Date: Sun Oct 23 22:02:45 UTC 2011 Modified Files: src/share/man/man4: ddb.4 Log Message: ps/l shows LWP name, not command name. To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147 src/share/man/man4/ddb.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/ddb.4 diff -u src/share/man/man4/ddb.4:1.146 src/share/man/man4/ddb.4:1.147 --- src/share/man/man4/ddb.4:1.146 Sun Oct 23 13:20:59 2011 +++ src/share/man/man4/ddb.4 Sun Oct 23 22:02:45 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: ddb.4,v 1.146 2011/10/23 13:20:59 jym Exp $ +.\" $NetBSD: ddb.4,v 1.147 2011/10/23 22:02:45 jym Exp $ .\" .\" Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -584,7 +584,7 @@ LWPs currently running on a CPU are mark .It Cm /l show each LWP ID, process ID, process status, CPU ID the LWP runs on, process flags, kernel virtual address of LWP structure, -command name and wait channel message. +LWP name and wait channel message. LWPs currently running on a CPU are marked with the '\&>' sign. This is the default. .El
CVS commit: src/sys/kern
Module Name:src Committed By: jym Date: Sun Oct 23 21:41:23 UTC 2011 Modified Files: src/sys/kern: subr_workqueue.c Log Message: Turn a workqueue(9) name into an array in the struct workqueue, rather than a const char *. This avoids keeping a reference to a string owned by caller (string could be allocated on stack). To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/kern/subr_workqueue.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/subr_workqueue.c diff -u src/sys/kern/subr_workqueue.c:1.31 src/sys/kern/subr_workqueue.c:1.32 --- src/sys/kern/subr_workqueue.c:1.31 Wed Jul 27 14:35:34 2011 +++ src/sys/kern/subr_workqueue.c Sun Oct 23 21:41:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_workqueue.c,v 1.31 2011/07/27 14:35:34 uebayasi Exp $ */ +/* $NetBSD: subr_workqueue.c,v 1.32 2011/10/23 21:41:23 jym Exp $ */ /*- * Copyright (c)2002, 2005, 2006, 2007 YAMAMOTO Takashi, @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.31 2011/07/27 14:35:34 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.32 2011/10/23 21:41:23 jym Exp $"); #include #include @@ -58,7 +58,7 @@ struct workqueue { void *wq_arg; int wq_flags; - const char *wq_name; + char wq_name[MAXCOMLEN]; pri_t wq_prio; void *wq_ptr; }; @@ -142,8 +142,9 @@ workqueue_init(struct workqueue *wq, con pri_t prio, int ipl) { + strncpy(wq->wq_name, name, sizeof(wq->wq_name)); + wq->wq_prio = prio; - wq->wq_name = name; wq->wq_func = callback_func; wq->wq_arg = callback_arg; }
CVS commit: src/libexec/ld.elf_so
Module Name:src Committed By: christos Date: Sun Oct 23 21:06:08 UTC 2011 Modified Files: src/libexec/ld.elf_so: rtld.c Log Message: Don't block SIGTRAP so that on architectures where the debugger needs to be able to receive sigtrap for breakpoints to work, it can. For example we are setting breakpoints inside dlopen(), after we've blocked the signal, so the process keep trapping and looping over the trap instruction without being able to send the signal. Another way would be to move the _rtld_debug_state() calls outside the critical section... To generate a diff of this commit: cvs rdiff -u -r1.152 -r1.153 src/libexec/ld.elf_so/rtld.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/rtld.c diff -u src/libexec/ld.elf_so/rtld.c:1.152 src/libexec/ld.elf_so/rtld.c:1.153 --- src/libexec/ld.elf_so/rtld.c:1.152 Sat Aug 13 18:24:24 2011 +++ src/libexec/ld.elf_so/rtld.c Sun Oct 23 17:06:07 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rtld.c,v 1.152 2011/08/13 22:24:24 christos Exp $ */ +/* $NetBSD: rtld.c,v 1.153 2011/10/23 21:06:07 christos Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -40,7 +40,7 @@ #include #ifndef lint -__RCSID("$NetBSD: rtld.c,v 1.152 2011/08/13 22:24:24 christos Exp $"); +__RCSID("$NetBSD: rtld.c,v 1.153 2011/10/23 21:06:07 christos Exp $"); #endif /* not lint */ #include @@ -1532,6 +1532,7 @@ _rtld_exclusive_enter(sigset_t *mask) sigset_t blockmask; sigfillset(&blockmask); + sigdelset(&blockmask, SIGTRAP); /* Allow the debugger */ sigprocmask(SIG_BLOCK, &blockmask, mask); membar_enter();
CVS commit: othersrc/external/bsd/iscsi/sbin/iscsid
Module Name:othersrc Committed By: agc Date: Sun Oct 23 20:02:52 UTC 2011 Modified Files: othersrc/external/bsd/iscsi/sbin/iscsid: Makefile Log Message: also build the man page for iscsid To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/iscsi/sbin/iscsid/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/iscsi/sbin/iscsid/Makefile diff -u othersrc/external/bsd/iscsi/sbin/iscsid/Makefile:1.2 othersrc/external/bsd/iscsi/sbin/iscsid/Makefile:1.3 --- othersrc/external/bsd/iscsi/sbin/iscsid/Makefile:1.2 Tue Jul 26 05:53:03 2011 +++ othersrc/external/bsd/iscsi/sbin/iscsid/Makefile Sun Oct 23 20:02:52 2011 @@ -1,6 +1,5 @@ -# $NetBSD: Makefile,v 1.2 2011/07/26 05:53:03 agc Exp $ +# $NetBSD: Makefile,v 1.3 2011/10/23 20:02:52 agc Exp $ -MKMAN= no PROG= iscsid SRCS= iscsid_main.c iscsid_lists.c iscsid_driverif.c \ @@ -10,6 +9,8 @@ CPPFLAGS+= -I${DESTDIR}/usr/include/dev/ CPPFLAGS+= -I${DESTDIR}/usr/include CPPFLAGS+= -D_THREAD_SAFE +MAN= iscsid.8 + WARNS= 4 # CPPFLAGS+= -DISCSI_DEBUG
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Sun Oct 23 17:37:55 UTC 2011 Modified Files: src/lib/libedit: chared.c Log Message: Fixed misplaced parenthesis (Nirbhay Choubey) To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/lib/libedit/chared.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/chared.c diff -u src/lib/libedit/chared.c:1.35 src/lib/libedit/chared.c:1.36 --- src/lib/libedit/chared.c:1.35 Tue Aug 16 12:25:15 2011 +++ src/lib/libedit/chared.c Sun Oct 23 13:37:55 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: chared.c,v 1.35 2011/08/16 16:25:15 christos Exp $ */ +/* $NetBSD: chared.c,v 1.36 2011/10/23 17:37:55 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: chared.c,v 1.35 2011/08/16 16:25:15 christos Exp $"); +__RCSID("$NetBSD: chared.c,v 1.36 2011/10/23 17:37:55 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -201,7 +201,7 @@ c_delbefore1(EditLine *el) protected int ce__isword(Int p) { - return Isalnum(p || Strchr(STR("*?_-.[]~="), p) != NULL); + return Isalnum(p) || Strchr(STR("*?_-.[]~="), p) != NULL; }
CVS commit: src/sys/ddb
Module Name:src Committed By: jym Date: Sun Oct 23 13:30:20 UTC 2011 Modified Files: src/sys/ddb: db_proc.c Log Message: Like ddb(4) "ps/l", use '>' sign to indicate running LWPs for the /w modifier. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/ddb/db_proc.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/ddb/db_proc.c diff -u src/sys/ddb/db_proc.c:1.5 src/sys/ddb/db_proc.c:1.6 --- src/sys/ddb/db_proc.c:1.5 Tue Apr 12 17:46:38 2011 +++ src/sys/ddb/db_proc.c Sun Oct 23 13:30:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: db_proc.c,v 1.5 2011/04/12 17:46:38 nakayama Exp $ */ +/* $NetBSD: db_proc.c,v 1.6 2011/10/23 13:30:20 jym Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_proc.c,v 1.5 2011/04/12 17:46:38 nakayama Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_proc.c,v 1.6 2011/10/23 13:30:20 jym Exp $"); #ifndef _KERNEL #include @@ -237,13 +237,16 @@ db_show_all_procs(db_expr_t addr, bool h } else { wbuf[0] = '\0'; } +run = (l.l_stat == LSONPROC || +(l.l_pflag & LP_RUNNING) != 0); db_read_bytes((db_addr_t)&p.p_emul->e_name, sizeof(ename), (char *)&ename); db_read_bytes((db_addr_t)ename, sizeof(db_nbuf), db_nbuf); db_printf( -"%4d %16s %8s %4d %-12s %-18lx\n", -l.l_lid, p.p_comm, db_nbuf, +"%c%4d %16s %8s %4d %-12s %-18lx\n", +(run ? '>' : ' '), l.l_lid, +p.p_comm, db_nbuf, l.l_priority, wbuf, (long)l.l_wchan); lp = LIST_NEXT((&l), l_sibling); if (lp != NULL) {
CVS commit: src/sys/arch/x68k/dev
Module Name:src Committed By: tsutsui Date: Sun Oct 23 13:21:54 UTC 2011 Modified Files: src/sys/arch/x68k/dev: kbd.c Log Message: Calling psignal(9) (via EV_WAKEUP()) in interrupt handlers could cause mutex error panic, so defer it via softint(9). This should fix panic on heavy key strokes during running Xserver. Should be pulled up to netbsd-5. XXX: amiga and atari might have the similar problem? To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x68k/dev/kbd.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/x68k/dev/kbd.c diff -u src/sys/arch/x68k/dev/kbd.c:1.36 src/sys/arch/x68k/dev/kbd.c:1.37 --- src/sys/arch/x68k/dev/kbd.c:1.36 Sat Jan 17 03:26:31 2009 +++ src/sys/arch/x68k/dev/kbd.c Sun Oct 23 13:21:54 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: kbd.c,v 1.36 2009/01/17 03:26:31 isaki Exp $ */ +/* $NetBSD: kbd.c,v 1.37 2011/10/23 13:21:54 tsutsui Exp $ */ /* * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.36 2009/01/17 03:26:31 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.37 2011/10/23 13:21:54 tsutsui Exp $"); #include "ite.h" #include "bell.h" @@ -350,7 +350,7 @@ kbdintr(void *arg) fe->value = KEY_UP(c) ? VKEY_UP : VKEY_DOWN; firm_gettime(fe); sc->sc_events.ev_put = put; - EV_WAKEUP(&sc->sc_events); + softint_schedule(sc->sc_softintr_cookie); return 0; } @@ -358,10 +358,14 @@ kbdintr(void *arg) void kbdsoftint(void *arg) /* what if ite is not configured? */ { + struct kbd_softc *sc = arg; int s; s = spltty(); + if (sc->sc_event_mode) + EV_WAKEUP(&sc->sc_events); + while(kbdgetoff < kbdputoff) ite_filter(kbdbuf[kbdgetoff++ & KBDBUFMASK]); kbdgetoff = kbdputoff = 0;
CVS commit: src/share/man/man4
Module Name:src Committed By: jym Date: Sun Oct 23 13:20:59 UTC 2011 Modified Files: src/share/man/man4: ddb.4 Log Message: Document "show proc". Be more verbose about commands that print information about processes especially the '>' sign (e.g. LWP is currently running). Bump date. Straight from Hackathon@ESPCI. To generate a diff of this commit: cvs rdiff -u -r1.145 -r1.146 src/share/man/man4/ddb.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/ddb.4 diff -u src/share/man/man4/ddb.4:1.145 src/share/man/man4/ddb.4:1.146 --- src/share/man/man4/ddb.4:1.145 Mon Aug 29 22:01:47 2011 +++ src/share/man/man4/ddb.4 Sun Oct 23 13:20:59 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: ddb.4,v 1.145 2011/08/29 22:01:47 jym Exp $ +.\" $NetBSD: ddb.4,v 1.146 2011/10/23 13:20:59 jym Exp $ .\" .\" Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -56,7 +56,7 @@ .\" any improvements or extensions that they make and grant Carnegie Mellon .\" the rights to redistribute these changes. .\" -.Dd August 29, 2011 +.Dd October 23, 2011 .Dt DDB 4 .Os .Sh NAME @@ -568,21 +568,24 @@ show process information in a .Xr ps 1 style format. Information printed includes: process ID, parent process ID, -process group, UID, process status, process flags, process +process group, UID, process status, process flags, number of LWPs, command name, and process wait channel message. .It Cm /a -show the kernel virtual addresses of each process' -proc structure, u-area, and vmspace structure. +show each process ID, command name, kernel virtual addresses of +each process' proc structure, u-area, and vmspace structure. The vmspace address is also the address of the process' vm_map structure, and can be used in the .Ic show map command. .It Cm /w -show each process' PID, command, system call emulation, wait channel -address, and wait channel message. +show each LWP ID, process ID, command name, system call emulation, +priority, wait channel message and wait channel address. +LWPs currently running on a CPU are marked with the '\&>' sign. .It Cm /l -show each process' associated LWP information, including each LWP's -LID, flags, kernel LWP structure address, u-area, and wait channel. +show each LWP ID, process ID, process status, CPU ID the LWP runs on, +process flags, kernel virtual address of LWP structure, +command name and wait channel message. +LWPs currently running on a CPU are marked with the '\&>' sign. This is the default. .El .It Ic show arptab @@ -694,6 +697,22 @@ Print the log entries for this pool. .It Cm /p Print the pagelist for this pool. .El +.It Ic show proc Ns Oo Cm /ap Oc Ar address | pid +Show information about a process and its LWPs. +LWPs currently running on a CPU are marked with the '\&>' sign. +.Bl -tag -width 4n -compact +.It Cm /a +The argument passed is the kernel virtual address +of LWP structure. +.It Cm /p +The argument passed is a PID. +Note that +.Ar pid +is interpreted using the current radix (see +.Cm trace/t +command for details). +This is the default. +.El .It Ic show registers Ns Op Cm /u Display the register set. If
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jmcneill Date: Sun Oct 23 13:02:32 UTC 2011 Modified Files: src/sys/arch/i386/i386: longrun.c Log Message: PR #32894: protection fault trap in tmx86_get_longrun_mode Use rdmsr_safe in tmx86_init_longrun to verify that the MSRs are present. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/i386/longrun.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/i386/i386/longrun.c diff -u src/sys/arch/i386/i386/longrun.c:1.3 src/sys/arch/i386/i386/longrun.c:1.4 --- src/sys/arch/i386/i386/longrun.c:1.3 Wed Feb 27 20:18:56 2008 +++ src/sys/arch/i386/i386/longrun.c Sun Oct 23 13:02:32 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: longrun.c,v 1.3 2008/02/27 20:18:56 xtraeme Exp $ */ +/* $NetBSD: longrun.c,v 1.4 2011/10/23 13:02:32 jmcneill Exp $ */ /*- * Copyright (c) 2001 Tamotsu Hattori. @@ -35,7 +35,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: longrun.c,v 1.3 2008/02/27 20:18:56 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: longrun.c,v 1.4 2011/10/23 13:02:32 jmcneill Exp $"); #include #include @@ -92,6 +92,11 @@ void tmx86_init_longrun(void) { const struct sysctlnode *mnode; + uint64_t msr; + + /* PR #32894, make sure the longrun MSR is present */ + if (rdmsr_safe(MSR_TMx86_LONGRUN, &msr) == EFAULT) + return; /* create the sysctl machdep.tm_longrun_* nodes */ sysctl_createv(NULL, 0, NULL, &mnode, CTLFLAG_PERMANENT,
CVS commit: src/sys/fs/smbfs
Module Name:src Committed By: hannken Date: Sun Oct 23 08:42:06 UTC 2011 Modified Files: src/sys/fs/smbfs: smbfs_kq.c Log Message: VOP_GETATTR() needs a shared lock at least. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/fs/smbfs/smbfs_kq.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/fs/smbfs/smbfs_kq.c diff -u src/sys/fs/smbfs/smbfs_kq.c:1.23 src/sys/fs/smbfs/smbfs_kq.c:1.24 --- src/sys/fs/smbfs/smbfs_kq.c:1.23 Sun Jun 12 03:35:54 2011 +++ src/sys/fs/smbfs/smbfs_kq.c Sun Oct 23 08:42:06 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_kq.c,v 1.23 2011/06/12 03:35:54 rmind Exp $ */ +/* $NetBSD: smbfs_kq.c,v 1.24 2011/10/23 08:42:06 hannken Exp $ */ /*- * Copyright (c) 2003, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smbfs_kq.c,v 1.23 2011/06/12 03:35:54 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smbfs_kq.c,v 1.24 2011/10/23 08:42:06 hannken Exp $"); #include #include @@ -149,7 +149,9 @@ smbfs_kqpoll(void *arg) /* save v_size, smbfs_getattr() updates it */ osize = ke->vp->v_size; + vn_lock(ke->vp, LK_SHARED | LK_RETRY); error = VOP_GETATTR(ke->vp, &attr, l->l_cred); + VOP_UNLOCK(ke->vp); if (error) { /* relock and proceed with next */ mutex_enter(&smbkq_lock); @@ -458,7 +460,9 @@ smbfs_kqfilter(void *v) * held. This is likely cheap due to attrcache, so do it now. */ memset(&attr, 0, sizeof(attr)); + vn_lock(vp, LK_SHARED | LK_RETRY); (void) VOP_GETATTR(vp, &attr, l->l_cred); + VOP_UNLOCK(vp); /* ensure the handler is running */ /* XXX this is unreliable. */