Re: CVS commit: src/sys/kern

2011-11-20 Thread J. Hannken-Illjes

On Nov 19, 2011, at 5:11 PM, Christos Zoulas wrote:

 Module Name:  src
 Committed By: christos
 Date: Sat Nov 19 16:11:24 UTC 2011
 
 Modified Files:
   src/sys/kern: cnmagic.c
 
 Log Message:
 PR/45633: Christian Biere: Don't access byte after NUL when setting magic.

This cannot work:

if (c == '\0')
return EINVAL;
switch (c) {
case '\0':
...
return 0;   == This statement looks unreachable.

All attempts to set cnmagic result in EINVAL.

--
Juergen Hannken-Illjes - hann...@eis.cs.tu-bs.de - TU Braunschweig (Germany)



Re: CVS commit: src/sys/kern

2011-11-20 Thread Christos Zoulas
On Nov 20, 10:02am, hann...@eis.cs.tu-bs.de (J. Hannken-Illjes) wrote:
-- Subject: Re: CVS commit: src/sys/kern

| 
| On Nov 19, 2011, at 5:11 PM, Christos Zoulas wrote:
| 
|  Module Name:src
|  Committed By:   christos
|  Date:   Sat Nov 19 16:11:24 UTC 2011
|  
|  Modified Files:
|  src/sys/kern: cnmagic.c
|  
|  Log Message:
|  PR/45633: Christian Biere: Don't access byte after NUL when setting magic.
| 
| This cannot work:
| 
|   if (c == '\0')
|   return EINVAL;
|   switch (c) {
|   case '\0':
|   ...
|   return 0;   == This statement looks unreachable.
| 
| All attempts to set cnmagic result in EINVAL.

The patch was amended. Do you still have an issue?

christos


Re: CVS commit: src/sys/kern

2011-11-20 Thread J. Hannken-Illjes

On Nov 20, 2011, at 6:10 PM, Christos Zoulas wrote:

 On Nov 20, 10:02am, hann...@eis.cs.tu-bs.de (J. Hannken-Illjes) wrote:
 -- Subject: Re: CVS commit: src/sys/kern
 
 | 
 | On Nov 19, 2011, at 5:11 PM, Christos Zoulas wrote:
 | 
 |  Module Name:  src
 |  Committed By: christos
 |  Date: Sat Nov 19 16:11:24 UTC 2011
 |  
 |  Modified Files:
 |src/sys/kern: cnmagic.c
 |  
 |  Log Message:
 |  PR/45633: Christian Biere: Don't access byte after NUL when setting magic.
 | 
 | This cannot work:
 | 
 | if (c == '\0')
 | return EINVAL;
 | switch (c) {
 | case '\0':
 | ...
 | return 0;   == This statement looks unreachable.
 | 
 | All attempts to set cnmagic result in EINVAL.
 
 The patch was amended. Do you still have an issue?

No, Rev. 1.13 works fine -- sorry for the noise ...

--
Juergen Hannken-Illjes - hann...@eis.cs.tu-bs.de - TU Braunschweig (Germany)



Re: CVS commit: src/sys/arch/i386/i386

2011-11-20 Thread YAMAMOTO Takashi
hi,

 On Oct 31, 2011, at 1:42 PM, YAMAMOTO Takashi wrote:
 
 Module Name: src
 Committed By:yamt
 Date:Mon Oct 31 12:42:53 UTC 2011
 
 Modified Files:
  src/sys/arch/i386/i386: dumpsys.c
 
 Log Message:
 dumpsys_seg: don't overwrite the previous mapping
 
 With this change in place core dumps from ddb (reboot 104) no longer work
 on MP machines.
 
 Before pmap_tlb_shootnow() always returned on the `tp-tp_count == 0' check.
 
 Now it goes into the `remote' case and hangs hard trying to reach other CPUs.

thanks, i've reverted the changes for now.

YAMAMOTO Takashi

 
 --
 Juergen Hannken-Illjes - hann...@eis.cs.tu-bs.de - TU Braunschweig (Germany)


Re: CVS commit: src/sys/arch/i386/i386

2011-11-20 Thread Mindaugas Rasiukevicius
J. Hannken-Illjes hann...@eis.cs.tu-bs.de wrote:
  Module Name:src
  Committed By:   yamt
  Date:   Mon Oct 31 12:42:53 UTC 2011
  
  Modified Files:
  src/sys/arch/i386/i386: dumpsys.c
  
  Log Message:
  dumpsys_seg: don't overwrite the previous mapping
 
 With this change in place core dumps from ddb (reboot 104) no longer work
 on MP machines.
 
 Before pmap_tlb_shootnow() always returned on the `tp-tp_count == 0'
 check.
 
 Now it goes into the `remote' case and hangs hard trying to reach other
 CPUs.

We could check for panicstr.  Not sure if that is desirable, though.

-- 
Mindaugas


Re: CVS commit: [yamt-pagecache] src/sys

2011-11-20 Thread YAMAMOTO Takashi
 Module Name:  src
 Committed By: yamt
 Date: Sun Nov 20 10:52:35 UTC 2011
 
 Modified Files:
   src/sys/kern [yamt-pagecache]: init_main.c
   src/sys/uvm [yamt-pagecache]: uvm.h uvm_extern.h uvm_init.c uvm_loan.c
   uvm_meter.c uvm_page.c uvm_page.h uvm_page_status.c
 
 Log Message:
 - fix page loaning  XXX make O-A loaning further

i meant: XXX make O-A loaning bitrot further

 - add some statistics
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.436.2.1 -r1.436.2.2 src/sys/kern/init_main.c
 cvs rdiff -u -r1.62.4.2 -r1.62.4.3 src/sys/uvm/uvm.h
 cvs rdiff -u -r1.176.2.3 -r1.176.2.4 src/sys/uvm/uvm_extern.h
 cvs rdiff -u -r1.41 -r1.41.4.1 src/sys/uvm/uvm_init.c
 cvs rdiff -u -r1.81.2.3 -r1.81.2.4 src/sys/uvm/uvm_loan.c
 cvs rdiff -u -r1.56.4.4 -r1.56.4.5 src/sys/uvm/uvm_meter.c
 cvs rdiff -u -r1.178.2.6 -r1.178.2.7 src/sys/uvm/uvm_page.c
 cvs rdiff -u -r1.73.2.6 -r1.73.2.7 src/sys/uvm/uvm_page.h
 cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/uvm/uvm_page_status.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.



Re: CVS commit: src/sys/arch

2011-11-20 Thread Jean-Yves Migeon

On 19.11.2011 18:13, Cherry G. Mathew wrote:

Module Name:src
Committed By:   cherry
Date:   Sat Nov 19 17:13:39 UTC 2011

Modified Files:
src/sys/arch/x86/include: cpu.h
src/sys/arch/xen/include: hypervisor.h
src/sys/arch/xen/x86: hypervisor_machdep.c
src/sys/arch/xen/xen: evtchn.c

Log Message:
[merging from cherry-xenmp] bring in bouyer@'s changes via:
http://mail-index.netbsd.org/source-changes/2011/10/22/msg028271.html
 From the Log:
Log Message:
Various interrupt fixes, mainly:
keep a per-cpu mask of enabled events, and use it to get pending events.
A cpu-specific event (all of them at this time) should not be ever masked
by another CPU, because it may prevent the target CPU from seeing it
(the clock events all fires at once for example).


This patch breaks various xenstore/xenbus related functions, like 
ballooning. Steps to reproduce:

- connect to a dom0 system
- try ballooning up or down, with:
sysctl -w machdep.xen.balloon.target=10

All newly created processes will then stay in tstile, and the sysctl 
never returns, waiting on rplq wait channel.


Observed in QEMU, Virtualbox, and my amd64 spare host.

--
Jean-Yves Migeon
jeanyves.mig...@free.fr


Re: CVS commit: src/sys/sys

2011-11-20 Thread Joerg Sonnenberger
On Sun, Nov 20, 2011 at 06:37:00PM -0500, Christos Zoulas wrote:
 Module Name:  src
 Committed By: christos
 Date: Sun Nov 20 23:37:00 UTC 2011
 
 Modified Files:
   src/sys/sys: aio.h buf.h kernhist.h lockdebug.h lwp.h malloc.h mbuf.h
   module.h mqueue.h namei.h pool.h sched.h sleepq.h vmem.h vnode.h
   wapbl.h
 
 Log Message:
 add more missing printf attributes.

Please use __printflike.

Joerg


Re: CVS commit: src/sys/arch

2011-11-20 Thread Cherry G. Mathew
On 21 November 2011 01:11, Jean-Yves Migeon j...@netbsd.org wrote:
 Module Name:    src
 Committed By:   jym
 Date:           Sun Nov 20 19:41:27 UTC 2011

 Modified Files:
        src/sys/arch/x86/include: pmap.h

...

+#ifdef PAE
+void   pmap_map_recursive_entries(void);
+void   pmap_unmap_recursive_entries(void);
+#endif /* PAE */
+
 #endif /* XEN */


Since that's xen specific, can that go in xenpmap.h ?

Cheers,
-- 
~Cherry


Re: CVS commit: src/sys/sys

2011-11-20 Thread Christos Zoulas
In article 2020235018.ga32...@britannica.bec.de,
Joerg Sonnenberger  jo...@britannica.bec.de wrote:
On Sun, Nov 20, 2011 at 06:37:00PM -0500, Christos Zoulas wrote:
 Module Name: src
 Committed By:christos
 Date:Sun Nov 20 23:37:00 UTC 2011
 
 Modified Files:
  src/sys/sys: aio.h buf.h kernhist.h lockdebug.h lwp.h malloc.h mbuf.h
  module.h mqueue.h namei.h pool.h sched.h sleepq.h vmem.h vnode.h
  wapbl.h
 
 Log Message:
 add more missing printf attributes.

Please use __printflike.

Well, the rest of the sys files don't, so I followed suit.

christos



Re: CVS commit: src/sys/sys

2011-11-20 Thread Christos Zoulas
In article 2021033128.ga3...@britannica.bec.de,
Joerg Sonnenberger  jo...@britannica.bec.de wrote:

They are not consistent, which is a bug. There should be no plain
__attribute__s in the tree except 3rd party code.

Do you want me to fix it, or are you?

christos



Re: CVS commit: src/sys/sys

2011-11-20 Thread Joerg Sonnenberger
On Mon, Nov 21, 2011 at 03:34:12AM +, Christos Zoulas wrote:
 In article 2021033128.ga3...@britannica.bec.de,
 Joerg Sonnenberger  jo...@britannica.bec.de wrote:
 
 They are not consistent, which is a bug. There should be no plain
 __attribute__s in the tree except 3rd party code.
 
 Do you want me to fix it, or are you?

If possible, do it yourself :)

Joerg


Re: CVS commit: src/sys/arch

2011-11-20 Thread Cherry G. Mathew
On 21 November 2011 02:45, Jean-Yves Migeon jeanyves.mig...@free.fr wrote:


 Observed in QEMU, Virtualbox, and my amd64 spare host.

Thank you, I will look into this presently.


-- 
~Cherry


CVS commit: [jmcneill-audiomp3] src/sys/dev/isa

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 08:40:52 UTC 2011

Modified Files:
src/sys/dev/isa [jmcneill-audiomp3]: ess.c

Log Message:
make sure to return from the end of essattach() before destroying
the callouts and mutexes.  with an uncommited audio.c change, i can
now play audio on my shark with the branch.


To generate a diff of this commit:
cvs rdiff -u -r1.78.10.1 -r1.78.10.2 src/sys/dev/isa/ess.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/isa/ess.c
diff -u src/sys/dev/isa/ess.c:1.78.10.1 src/sys/dev/isa/ess.c:1.78.10.2
--- src/sys/dev/isa/ess.c:1.78.10.1	Sat Nov 19 21:49:37 2011
+++ src/sys/dev/isa/ess.c	Sun Nov 20 08:40:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ess.c,v 1.78.10.1 2011/11/19 21:49:37 jmcneill Exp $	*/
+/*	$NetBSD: ess.c,v 1.78.10.2 2011/11/20 08:40:52 mrg Exp $	*/
 
 /*
  * Copyright 1997
@@ -66,7 +66,7 @@
 */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ess.c,v 1.78.10.1 2011/11/19 21:49:37 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: ess.c,v 1.78.10.2 2011/11/20 08:40:52 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1076,6 +1076,8 @@ essattach(struct ess_softc *sc, int enab
 		ess_printsc(sc);
 #endif
 
+	return;
+
  fail:
 	callout_destroy(sc-sc_poll1_ch);
 	callout_destroy(sc-sc_poll2_ch);



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 09:37:04 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: audio_if.h

Log Message:
don't need to forward declare 'struct malloc_type' anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.66.14.1 -r1.66.14.2 src/sys/dev/audio_if.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/audio_if.h
diff -u src/sys/dev/audio_if.h:1.66.14.1 src/sys/dev/audio_if.h:1.66.14.2
--- src/sys/dev/audio_if.h:1.66.14.1	Sat Nov 19 21:49:34 2011
+++ src/sys/dev/audio_if.h	Sun Nov 20 09:37:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio_if.h,v 1.66.14.1 2011/11/19 21:49:34 jmcneill Exp $	*/
+/*	$NetBSD: audio_if.h,v 1.66.14.2 2011/11/20 09:37:04 mrg Exp $	*/
 
 /*
  * Copyright (c) 1994 Havard Eidnes.
@@ -172,7 +172,6 @@ typedef struct stream_filter_list {
 	} filters[AUDIO_MAX_FILTERS];
 } stream_filter_list_t;
 
-struct malloc_type;
 struct audio_hw_if {
 	int	(*open)(void *, int);	/* open hardware */
 	void	(*close)(void *);	/* close hardware */



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 09:40:20 UTC 2011

Modified Files:
src/sys/dev/ebus [jmcneill-audiomp3]: cs4231_ebus.c
src/sys/dev/ic [jmcneill-audiomp3]: cs4231.c cs4231var.h
src/sys/dev/sbus [jmcneill-audiomp3]: cs4231_sbus.c

Log Message:
make audiocs(4) compile.  i don't have anything handy to actually test
this easily, but this was just updating the alloc/free to kmem and
hooking into ad1848_get_locks().


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.4.1 src/sys/dev/ebus/cs4231_ebus.c
cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/dev/ic/cs4231.c
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/dev/ic/cs4231var.h
cvs rdiff -u -r1.48 -r1.48.4.1 src/sys/dev/sbus/cs4231_sbus.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/ebus/cs4231_ebus.c
diff -u src/sys/dev/ebus/cs4231_ebus.c:1.34 src/sys/dev/ebus/cs4231_ebus.c:1.34.4.1
--- src/sys/dev/ebus/cs4231_ebus.c:1.34	Thu Jun  2 00:23:28 2011
+++ src/sys/dev/ebus/cs4231_ebus.c	Sun Nov 20 09:40:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs4231_ebus.c,v 1.34 2011/06/02 00:23:28 christos Exp $ */
+/*	$NetBSD: cs4231_ebus.c,v 1.34.4.1 2011/11/20 09:40:19 mrg Exp $ */
 
 /*
  * Copyright (c) 2002 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cs4231_ebus.c,v 1.34 2011/06/02 00:23:28 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: cs4231_ebus.c,v 1.34.4.1 2011/11/20 09:40:19 mrg Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_sparc_arch.h
@@ -38,8 +38,9 @@ __KERNEL_RCSID(0, $NetBSD: cs4231_ebus.
 #include sys/systm.h
 #include sys/errno.h
 #include sys/device.h
-#include sys/malloc.h
 #include sys/cpu.h
+#include sys/kmem.h
+#include sys/malloc.h
 
 #include machine/autoconf.h
 
@@ -123,6 +124,7 @@ const struct audio_hw_if audiocs_ebus_hw
 	cs4231_ebus_trigger_input,
 	NULL,			/* dev_ioctl */
 	NULL,			/* powerstate */
+	ad1848_get_locks,
 };
 
 #ifdef AUDIO_DEBUG

Index: src/sys/dev/ic/cs4231.c
diff -u src/sys/dev/ic/cs4231.c:1.26 src/sys/dev/ic/cs4231.c:1.26.4.1
--- src/sys/dev/ic/cs4231.c:1.26	Thu Jun  2 00:23:28 2011
+++ src/sys/dev/ic/cs4231.c	Sun Nov 20 09:40:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs4231.c,v 1.26 2011/06/02 00:23:28 christos Exp $	*/
+/*	$NetBSD: cs4231.c,v 1.26.4.1 2011/11/20 09:40:19 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cs4231.c,v 1.26 2011/06/02 00:23:28 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: cs4231.c,v 1.26.4.1 2011/11/20 09:40:19 mrg Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -39,8 +39,9 @@ __KERNEL_RCSID(0, $NetBSD: cs4231.c,v 1
 #include sys/systm.h
 #include sys/errno.h
 #include sys/device.h
-#include sys/malloc.h
 #include sys/bus.h
+#include sys/kmem.h
+#include sys/malloc.h
 
 #include machine/autoconf.h
 #include sys/cpu.h
@@ -175,8 +176,7 @@ cs4231_common_attach(struct cs4231_softc
 }
 
 void *
-cs4231_malloc(void *addr, int direction, size_t size,
-struct malloc_type *pool, int flags)
+cs4231_malloc(void *addr, int direction, size_t size)
 {
 	struct cs4231_softc *sc;
 	bus_dma_tag_t dmatag;
@@ -184,7 +184,7 @@ cs4231_malloc(void *addr, int direction,
 
 	sc = addr;
 	dmatag = sc-sc_dmatag;
-	p = malloc(sizeof(*p), pool, flags);
+	p = kmem_alloc(sizeof(*p), KM_SLEEP);
 	if (p == NULL)
 		return NULL;
 
@@ -221,12 +221,12 @@ fail3:
 fail2:
 	bus_dmamap_destroy(dmatag, p-dmamap);
 fail1:
-	free(p, pool);
+	kmem_free(p, size);
 	return NULL;
 }
 
 void
-cs4231_free(void *addr, void *ptr, struct malloc_type *pool)
+cs4231_free(void *addr, void *ptr, size_t size)
 {
 	struct cs4231_softc *sc;
 	bus_dma_tag_t dmatag;
@@ -242,7 +242,7 @@ cs4231_free(void *addr, void *ptr, struc
 		bus_dmamem_free(dmatag, p-segs, p-nsegs);
 		bus_dmamap_destroy(dmatag, p-dmamap);
 		*pp = p-next;
-		free(p, pool);
+		kmem_free(p, size);
 		return;
 	}
 	printf(cs4231_free: rogue pointer\n);

Index: src/sys/dev/ic/cs4231var.h
diff -u src/sys/dev/ic/cs4231var.h:1.9 src/sys/dev/ic/cs4231var.h:1.9.4.1
--- src/sys/dev/ic/cs4231var.h:1.9	Thu Jun  2 00:23:28 2011
+++ src/sys/dev/ic/cs4231var.h	Sun Nov 20 09:40:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs4231var.h,v 1.9 2011/06/02 00:23:28 christos Exp $	*/
+/*	$NetBSD: cs4231var.h,v 1.9.4.1 2011/11/20 09:40:19 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@ int	cs4231_get_port(void *, mixer_ctrl_t
 int	cs4231_query_devinfo(void *, mixer_devinfo_t *);
 int	cs4231_get_props(void *);
 
-void	*cs4231_malloc(void *, int, size_t, struct malloc_type *, int);
-void	cs4231_free(void *, void *, struct malloc_type *);
+void	*cs4231_malloc(void *, int, size_t);
+void	cs4231_free(void *, void *, size_t);
 
 #endif /* _DEV_IC_CS4231VAR_H_ */

Index: src/sys/dev/sbus/cs4231_sbus.c
diff -u src/sys/dev/sbus/cs4231_sbus.c:1.48 src/sys/dev/sbus/cs4231_sbus.c:1.48.4.1
--- 

CVS commit: [jmcneill-audiomp3] src/sys/arch/amiga/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 10:27:36 UTC 2011

Modified Files:
src/sys/arch/amiga/dev [jmcneill-audiomp3]: repulse.c

Log Message:
port this to audiomp branch.  no allocm/freem here, no detach, so just
add/initialise sc_lock and sc_intr_lock, and add get_locks() support.

XXX: untested, but amiga kernels compile now.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.4.1 src/sys/arch/amiga/dev/repulse.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/amiga/dev/repulse.c
diff -u src/sys/arch/amiga/dev/repulse.c:1.17 src/sys/arch/amiga/dev/repulse.c:1.17.4.1
--- src/sys/arch/amiga/dev/repulse.c:1.17	Tue Jul 19 15:55:27 2011
+++ src/sys/arch/amiga/dev/repulse.c	Sun Nov 20 10:27:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: repulse.c,v 1.17 2011/07/19 15:55:27 dyoung Exp $ */
+/*	$NetBSD: repulse.c,v 1.17.4.1 2011/11/20 10:27:36 mrg Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: repulse.c,v 1.17 2011/07/19 15:55:27 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: repulse.c,v 1.17.4.1 2011/11/20 10:27:36 mrg Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -85,6 +85,7 @@ int rep_set_port(void *, mixer_ctrl_t *)
 int rep_get_port(void *, mixer_ctrl_t *);
 int rep_query_devinfo(void *, mixer_devinfo_t *);
 size_t rep_round_buffersize(void *, int, size_t);
+void rep_get_locks(void *, kmutex_t **, kmutex_t **);
 
 int rep_start_input(void *, void *, int, void (*)(void *), void *);
 int rep_start_output(void *, void *, int, void (*)(void *), void *);
@@ -122,6 +123,8 @@ const struct audio_hw_if rep_hw_if = {
 	/* trigger_output */ 0,
 	/* trigger_input */ 0,
 	/* dev_ioctl */ 0,
+	/* powerstate */ 0,
+	rep_get_locks,
 };
 
 /* hardware registers */
@@ -219,6 +222,8 @@ struct repulse_softc {
 	int	  sc_playscale;
 	unsigned  sc_playflags;
 
+	kmutex_t  sc_lock;
+	kmutex_t  sc_intr_lock;
 };
 
 int repulse_match (struct device *, struct cfdata *, void *);
@@ -310,7 +315,10 @@ repulse_attach(struct device *parent, st
 	sc-sc_achost.attach = repac_attach;
 	sc-sc_achost.flags = 0;
 
-	if (ac97_attach(sc-sc_achost, self)) {
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+
+	if (ac97_attach(sc-sc_achost, self, sc-sc_lock)) {
 		printf(%s: error attaching codec\n, self-dv_xname);
 		return;
 	}
@@ -579,6 +587,15 @@ rep_round_buffersize(void *arg, int dire
 	return size;
 }
 
+void
+rep_get_locks(void *opaque, kmutex_t **intr, kmutex_t **thread)
+{
+	struct repulse_softc *sc = opaque;
+
+	*intr = sc-sc_intr_lock;
+	*thread = sc-sc_lock;
+}
+
 
 int
 rep_set_params(void *addr, int setmode, int usemode,



CVS commit: src/sys/kern

2011-11-20 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sun Nov 20 10:32:33 UTC 2011

Modified Files:
src/sys/kern: kern_verifiedexec.c

Log Message:
Fix locking against self in veriexec_fp_calc().


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/kern/kern_verifiedexec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_verifiedexec.c
diff -u src/sys/kern/kern_verifiedexec.c:1.127 src/sys/kern/kern_verifiedexec.c:1.128
--- src/sys/kern/kern_verifiedexec.c:1.127	Fri Oct 14 09:23:31 2011
+++ src/sys/kern/kern_verifiedexec.c	Sun Nov 20 10:32:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_verifiedexec.c,v 1.127 2011/10/14 09:23:31 hannken Exp $	*/
+/*	$NetBSD: kern_verifiedexec.c,v 1.128 2011/11/20 10:32:33 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2006 Elad Efrat e...@netbsd.org
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_verifiedexec.c,v 1.127 2011/10/14 09:23:31 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_verifiedexec.c,v 1.128 2011/11/20 10:32:33 hannken Exp $);
 
 #include opt_veriexec.h
 
@@ -411,9 +411,11 @@ veriexec_fp_calc(struct lwp *l, struct v
 	size_t resid, npages;
 	int error, do_perpage, pagen;
 
-	vn_lock(vp, LK_SHARED | LK_RETRY);
+	if (lock_state == VERIEXEC_UNLOCKED)
+		vn_lock(vp, LK_SHARED | LK_RETRY);
 	error = VOP_GETATTR(vp, va, l-l_cred);
-	VOP_UNLOCK(vp);
+	if (lock_state == VERIEXEC_UNLOCKED)
+		VOP_UNLOCK(vp);
 	if (error)
 		return (error);
 



CVS commit: [jmcneill-audiomp3] src/sys/dev/sbus

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 10:48:55 UTC 2011

Modified Files:
src/sys/dev/sbus [jmcneill-audiomp3]: dbri.c dbrivar.h

Log Message:
port to audiomp:  update allocm/freem, and add get_locks() support.
bots on my ss20, but i haven't really tested it yet.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.6.1 src/sys/dev/sbus/dbri.c
cvs rdiff -u -r1.12 -r1.12.10.1 src/sys/dev/sbus/dbrivar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sbus/dbri.c
diff -u src/sys/dev/sbus/dbri.c:1.33 src/sys/dev/sbus/dbri.c:1.33.6.1
--- src/sys/dev/sbus/dbri.c:1.33	Wed Mar  9 05:40:11 2011
+++ src/sys/dev/sbus/dbri.c	Sun Nov 20 10:48:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbri.c,v 1.33 2011/03/09 05:40:11 macallan Exp $	*/
+/*	$NetBSD: dbri.c,v 1.33.6.1 2011/11/20 10:48:54 mrg Exp $	*/
 
 /*
  * Copyright (C) 1997 Rudolf Koenig (rfkoe...@immd4.informatik.uni-erlangen.de)
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.33 2011/03/09 05:40:11 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.33.6.1 2011/11/20 10:48:54 mrg Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -43,11 +43,11 @@ __KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.3
 #include sys/systm.h
 #include sys/errno.h
 #include sys/device.h
-#include sys/malloc.h
 #include sys/proc.h
 #include sys/kernel.h
 #include sys/bus.h
 #include sys/intr.h
+#include sys/kmem.h
 
 #include dev/sbus/sbusvar.h
 #include sparc/sparc/auxreg.h
@@ -156,9 +156,10 @@ static int	dbri_trigger_output(void *, v
 void (*)(void *), void *, const struct audio_params *);
 static int	dbri_trigger_input(void *, void *, void *, int,
 void (*)(void *), void *, const struct audio_params *);
+static void	dbri_get_locks(void *, kmutex_t **, kmutex_t **);
 
-static void	*dbri_malloc(void *, int, size_t, struct malloc_type *, int);
-static void	dbri_free(void *, void *, struct malloc_type *);
+static void	*dbri_malloc(void *, int, size_t);
+static void	dbri_free(void *, void *, size_t);
 static paddr_t	dbri_mappage(void *, void *, off_t, int);
 static void	dbri_set_power(struct dbri_softc *, int);
 static void	dbri_bring_up(struct dbri_softc *);
@@ -175,32 +176,25 @@ struct audio_device dbri_device = {
 };
 
 struct audio_hw_if dbri_hw_if = {
-	dbri_open,
-	dbri_close,
-	NULL,	/* drain */
-	dbri_query_encoding,
-	dbri_set_params,
-	dbri_round_blocksize,
-	NULL,	/* commit_settings */
-	NULL,	/* init_output */
-	NULL,	/* init_input */
-	NULL,	/* start_output */
-	NULL,	/* start_input */
-	dbri_halt_output,
-	dbri_halt_input,
-	NULL,	/* speaker_ctl */
-	dbri_getdev,
-	NULL,	/* setfd */
-	dbri_set_port,
-	dbri_get_port,
-	dbri_query_devinfo,
-	dbri_malloc,
-	dbri_free,
-	dbri_round_buffersize,
-	dbri_mappage,
-	dbri_get_props,
-	dbri_trigger_output,
-	dbri_trigger_input
+	.open			= dbri_open,
+	.close			= dbri_close,
+	.query_encoding		= dbri_query_encoding,
+	.set_params		= dbri_set_params,
+	.round_blocksize	= dbri_round_blocksize,
+	.halt_output		= dbri_halt_output,
+	.halt_input		= dbri_halt_input,
+	.getdev			= dbri_getdev,
+	.set_port		= dbri_set_port,
+	.get_port		= dbri_get_port,
+	.query_devinfo		= dbri_query_devinfo,
+	.allocm			= dbri_malloc,
+	.freem			= dbri_free,
+	.round_buffersize	= dbri_round_buffersize,
+	.mappage		= dbri_mappage,
+	.get_props		= dbri_get_props,
+	.trigger_output		= dbri_trigger_output,
+	.trigger_input		= dbri_trigger_input,
+	.get_locks		= dbri_get_locks,
 };
 
 CFATTACH_DECL_NEW(dbri, sizeof(struct dbri_softc),
@@ -370,6 +364,9 @@ dbri_attach_sbus(device_t parent, device
 	sc-sc_dmabase = sc-sc_dmamap-dm_segs[0].ds_addr;
 	sc-sc_bufsiz = size;
 
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+
 	bus_intr_establish(sa-sa_bustag, sa-sa_pri, IPL_SCHED, dbri_intr,
 	sc);
 
@@ -2049,6 +2046,14 @@ dbri_trigger_input(void *hdl, void *star
 	return 0;
 }
 
+static void
+dbri_get_locks(void *opaque, kmutex_t **intr, kmutex_t **thread)
+{
+	struct dbri_softc *sc = opaque;
+
+	*intr = sc-sc_intr_lock;
+	*thread = sc-sc_lock;
+}
 
 static uint32_t
 reverse_bytes(uint32_t b, int len)
@@ -2075,7 +2080,7 @@ reverse_bytes(uint32_t b, int len)
 }
 
 static void *
-dbri_malloc(void *v, int dir, size_t s, struct malloc_type *mt, int flags)
+dbri_malloc(void *v, int dir, size_t s)
 {
 	struct dbri_softc *sc = v;
 	struct dbri_desc *dd = sc-sc_desc[sc-sc_desc_used];
@@ -2116,7 +2121,7 @@ dbri_malloc(void *v, int dir, size_t s, 
 }
 
 static void
-dbri_free(void *v, void *p, struct malloc_type *mt)
+dbri_free(void *v, void *p, size_t size)
 {
 	struct dbri_softc *sc = v;
 	struct dbri_desc *dd;

Index: src/sys/dev/sbus/dbrivar.h
diff -u src/sys/dev/sbus/dbrivar.h:1.12 src/sys/dev/sbus/dbrivar.h:1.12.10.1
--- src/sys/dev/sbus/dbrivar.h:1.12	Tue Jan 11 00:49:50 2011
+++ src/sys/dev/sbus/dbrivar.h	Sun Nov 20 10:48:54 2011
@@ -1,4 

CVS commit: [yamt-pagecache] src/sys/miscfs/genfs

2011-11-20 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sun Nov 20 10:49:21 UTC 2011

Modified Files:
src/sys/miscfs/genfs [yamt-pagecache]: genfs_io.c genfs_node.h

Log Message:
- simplify code
- comments


To generate a diff of this commit:
cvs rdiff -u -r1.53.2.2 -r1.53.2.3 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.20 -r1.20.8.1 src/sys/miscfs/genfs/genfs_node.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.53.2.2 src/sys/miscfs/genfs/genfs_io.c:1.53.2.3
--- src/sys/miscfs/genfs/genfs_io.c:1.53.2.2	Thu Nov 10 14:37:33 2011
+++ src/sys/miscfs/genfs/genfs_io.c	Sun Nov 20 10:49:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.53.2.2 2011/11/10 14:37:33 yamt Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.53.2.3 2011/11/20 10:49:20 yamt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.53.2.2 2011/11/10 14:37:33 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.53.2.3 2011/11/20 10:49:20 yamt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -87,10 +87,8 @@ genfs_rel_pages(struct vm_page **pgs, in
 static void
 genfs_markdirty(struct vnode *vp)
 {
-	struct genfs_node * const gp = VTOG(vp);
 
 	KASSERT(mutex_owned(vp-v_interlock));
-	gp-g_dirtygen++;
 	if ((vp-v_iflag  VI_ONWORKLST) == 0) {
 		vn_syncer_add_to_worklist(vp, filedelay);
 	}
@@ -861,18 +859,16 @@ genfs_do_putpages(struct vnode *vp, off_
 	int i, error, npages, nback;
 	int freeflag;
 	struct vm_page *pgs[maxpages], *pg;
-	struct uvm_page_array ar;
+	struct uvm_page_array a;
 	bool wasclean, needs_clean, yld;
 	bool async = (origflags  PGO_SYNCIO) == 0;
 	bool pagedaemon = curlwp == uvm.pagedaemon_lwp;
 	struct lwp * const l = curlwp ? curlwp : lwp0;
-	struct genfs_node * const gp = VTOG(vp);
 	int flags;
-	int dirtygen;
 	bool modified;		/* if we write out any pages */
 	bool need_wapbl;
 	bool has_trans;
-	bool cleanall;		/* try to pull off from the syncer's list */
+	bool tryclean;		/* try to pull off from the syncer's list */
 	bool onworklst;
 	const bool dirtyonly = (origflags  (PGO_DEACTIVATE|PGO_FREE)) == 0;
 
@@ -894,6 +890,11 @@ retry:
 	flags = origflags;
 	KASSERT((vp-v_iflag  VI_ONWORKLST) != 0 ||
 	(vp-v_iflag  VI_WRMAPDIRTY) == 0);
+
+	/*
+	 * shortcut if we have no pages to process.
+	 */
+
 	if (uobj-uo_npages == 0 || (dirtyonly 
 	radix_tree_empty_tagged_tree_p(uobj-uo_pages,
 	UVM_PAGE_DIRTY_TAG))) {
@@ -957,29 +958,18 @@ retry:
 	}
 
 	/*
-	 * start the loop.  when scanning by list, hold the last page
-	 * in the list before we start.  pages allocated after we start
-	 * will be added to the end of the list, so we can stop at the
-	 * current last page.
+	 * start the loop.
 	 */
 
-	cleanall = (flags  PGO_CLEANIT) != 0  wasclean 
-	startoff == 0  endoff == trunc_page(LLONG_MAX) 
-	(vp-v_iflag  VI_ONWORKLST) != 0;
-	dirtygen = gp-g_dirtygen;
 	freeflag = pagedaemon ? PG_PAGEOUT : PG_RELEASED;
-
-	uvm_page_array_init(ar);
+	tryclean = true;
+	uvm_page_array_init(a);
 	for (;;) {
 		bool protected;
 
-		pg = uvm_page_array_peek(ar);
+		pg = uvm_page_array_fill_and_peek(a, uobj, off, dirtyonly);
 		if (pg == NULL) {
-			if (uvm_page_array_fill(ar, uobj, off, dirtyonly)) {
-break;
-			}
-			pg = uvm_page_array_peek(ar);
-			KASSERT(pg != NULL);
+			break;
 		}
 
 		/*
@@ -987,21 +977,20 @@ retry:
 		 */
 
 		KASSERT(pg-uobject == uobj);
-		KASSERT((pg-flags  PG_MARKER) == 0);
 		KASSERT((pg-flags  (PG_RELEASED|PG_PAGEOUT)) == 0 ||
-		(pg-flags  (PG_BUSY|PG_MARKER)) != 0);
+		(pg-flags  (PG_BUSY)) != 0);
 		KASSERT(pg-offset = startoff);
 		KASSERT(pg-offset = off);
 		KASSERT(!dirtyonly ||
 		uvm_pagegetdirty(pg) != UVM_PAGE_STATUS_CLEAN);
-		off = pg-offset + PAGE_SIZE;
 		if (pg-offset = endoff) {
 			break;
 		}
 		if (pg-flags  (PG_RELEASED|PG_PAGEOUT)) {
 			KASSERT((pg-flags  PG_BUSY) != 0);
 			wasclean = false;
-			uvm_page_array_advance(ar);
+			off = pg-offset + PAGE_SIZE;
+			uvm_page_array_advance(a);
 			continue;
 		}
 
@@ -1029,23 +1018,25 @@ retry:
 break;
 			}
 			off = pg-offset; /* visit this page again */
-			if (yld) {
-mutex_exit(slock);
-preempt();
-			} else {
+			if ((pg-flags  PG_BUSY) != 0) {
 pg-flags |= PG_WANTED;
 UVM_UNLOCK_AND_WAIT(pg, slock, 0, genput, 0);
+			} else {
+KASSERT(yld);
+mutex_exit(slock);
+preempt();
 			}
 			/*
 			 * as we dropped the object lock, our cached pages can
 			 * be stale.
 			 */
-			uvm_page_array_clear(ar);
+			uvm_page_array_clear(a);
 			mutex_enter(slock);
 			continue;
 		}
 
-		uvm_page_array_advance(ar);
+		off = pg-offset + PAGE_SIZE;
+		uvm_page_array_advance(a);
 
 		/*
 		 * if we're freeing, remove all mappings of the page now.
@@ -1063,8 +1054,7 @@ retry:
 			 * from the syncer queue, write-protect the page.

CVS commit: [yamt-pagecache] src/sys

2011-11-20 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sun Nov 20 10:52:35 UTC 2011

Modified Files:
src/sys/kern [yamt-pagecache]: init_main.c
src/sys/uvm [yamt-pagecache]: uvm.h uvm_extern.h uvm_init.c uvm_loan.c
uvm_meter.c uvm_page.c uvm_page.h uvm_page_status.c

Log Message:
- fix page loaning  XXX make O-A loaning further
- add some statistics


To generate a diff of this commit:
cvs rdiff -u -r1.436.2.1 -r1.436.2.2 src/sys/kern/init_main.c
cvs rdiff -u -r1.62.4.2 -r1.62.4.3 src/sys/uvm/uvm.h
cvs rdiff -u -r1.176.2.3 -r1.176.2.4 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.41 -r1.41.4.1 src/sys/uvm/uvm_init.c
cvs rdiff -u -r1.81.2.3 -r1.81.2.4 src/sys/uvm/uvm_loan.c
cvs rdiff -u -r1.56.4.4 -r1.56.4.5 src/sys/uvm/uvm_meter.c
cvs rdiff -u -r1.178.2.6 -r1.178.2.7 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.73.2.6 -r1.73.2.7 src/sys/uvm/uvm_page.h
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/uvm/uvm_page_status.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/init_main.c
diff -u src/sys/kern/init_main.c:1.436.2.1 src/sys/kern/init_main.c:1.436.2.2
--- src/sys/kern/init_main.c:1.436.2.1	Wed Nov  2 21:53:59 2011
+++ src/sys/kern/init_main.c	Sun Nov 20 10:52:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.436.2.1 2011/11/02 21:53:59 yamt Exp $	*/
+/*	$NetBSD: init_main.c,v 1.436.2.2 2011/11/20 10:52:33 yamt Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: init_main.c,v 1.436.2.1 2011/11/02 21:53:59 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: init_main.c,v 1.436.2.2 2011/11/20 10:52:33 yamt Exp $);
 
 #include opt_ddb.h
 #include opt_ipsec.h
@@ -324,10 +324,6 @@ main(void)
 
 	percpu_init();
 
-	/* Initialize lock caches. */
-	mutex_obj_init();
-	rw_obj_init();
-
 	/* Passive serialization. */
 	pserialize_init();
 

Index: src/sys/uvm/uvm.h
diff -u src/sys/uvm/uvm.h:1.62.4.2 src/sys/uvm/uvm.h:1.62.4.3
--- src/sys/uvm/uvm.h:1.62.4.2	Sat Nov 12 02:54:04 2011
+++ src/sys/uvm/uvm.h	Sun Nov 20 10:52:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm.h,v 1.62.4.2 2011/11/12 02:54:04 yamt Exp $	*/
+/*	$NetBSD: uvm.h,v 1.62.4.3 2011/11/20 10:52:33 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -88,6 +88,19 @@ struct uvm_cpu {
 	 * 	[1] anonymous (PQ_SWAPBACKED)
 	 */
 	int64_t pagestate[2][UVM_PAGE_NUM_STATUS];
+
+	int64_t loan_obj;	/* O-K loan */
+	int64_t unloan_obj;	/* O-K unloan */
+	int64_t loanbreak_obj;	/* O-K loan resolved on write */
+	int64_t loanfree_obj;	/* O-K loan resolved on free */
+
+	int64_t loan_anon;	/* A-K loan */
+	int64_t unloan_anon;	/* A-K unloan */
+	int64_t loanbreak_anon;	/* A-K loan resolved on write */
+	int64_t loanfree_anon;	/* A-K loan resolved on free */
+
+	int64_t loan_zero;	/* O-K loan (zero) */
+	int64_t unloan_zero;	/* O-K unloan (zero) */
 };
 
 /*

Index: src/sys/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.176.2.3 src/sys/uvm/uvm_extern.h:1.176.2.4
--- src/sys/uvm/uvm_extern.h:1.176.2.3	Mon Nov 14 14:24:54 2011
+++ src/sys/uvm/uvm_extern.h	Sun Nov 20 10:52:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.176.2.3 2011/11/14 14:24:54 yamt Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.176.2.4 2011/11/20 10:52:33 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -456,12 +456,26 @@ struct uvmexp_sysctl {
 	int64_t colorhit;
 	int64_t colormiss;
 	int64_t ncolors;
+
 	int64_t possiblydirtypages;
 	int64_t cleanpages;
 	int64_t dirtypages;
 	int64_t possiblydirtyanonpages;
 	int64_t cleananonpages;
 	int64_t dirtyanonpages;
+
+	int64_t loan_obj;	/* O-K loan */
+	int64_t unloan_obj;	/* O-K unloan */
+	int64_t loanbreak_obj;	/* O-K loan resolved on write */
+	int64_t loanfree_obj;	/* O-K loan resolved on free */
+
+	int64_t loan_anon;	/* A-K loan */
+	int64_t unloan_anon;	/* A-K unloan */
+	int64_t loanbreak_anon;	/* A-K loan resolved on write */
+	int64_t loanfree_anon;	/* A-K loan resolved on free */
+
+	int64_t loan_zero;	/* O-K loan (zero) */
+	int64_t unloan_zero;	/* O-K unloan (zero) */
 };
 
 #ifdef _KERNEL

Index: src/sys/uvm/uvm_init.c
diff -u src/sys/uvm/uvm_init.c:1.41 src/sys/uvm/uvm_init.c:1.41.4.1
--- src/sys/uvm/uvm_init.c:1.41	Sun Apr 24 03:56:50 2011
+++ src/sys/uvm/uvm_init.c	Sun Nov 20 10:52:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_init.c,v 1.41 2011/04/24 03:56:50 rmind Exp $	*/
+/*	$NetBSD: uvm_init.c,v 1.41.4.1 2011/11/20 10:52:33 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_init.c,v 1.41 2011/04/24 03:56:50 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_init.c,v 1.41.4.1 2011/11/20 10:52:33 yamt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -42,6 +42,8 @@ __KERNEL_RCSID(0, $NetBSD: uvm_init.c,v
 #include sys/resourcevar.h
 #include 

CVS commit: [jmcneill-audiomp3] src/sys

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 10:56:19 UTC 2011

Modified Files:
src/sys/arch/sparc/dev [jmcneill-audiomp3]: audioamd.c
src/sys/dev/ic [jmcneill-audiomp3]: am7930.c am7930var.h
src/sys/dev/tc [jmcneill-audiomp3]: bba.c

Log Message:
port the am7930 drivers to audiomp.  sparc and pmax GENERIC builds,
but i am unable to test these drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/arch/sparc/dev/audioamd.c
cvs rdiff -u -r1.50 -r1.50.56.1 src/sys/dev/ic/am7930.c
cvs rdiff -u -r1.12 -r1.12.4.1 src/sys/dev/ic/am7930var.h
cvs rdiff -u -r1.38 -r1.38.4.1 src/sys/dev/tc/bba.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/sparc/dev/audioamd.c
diff -u src/sys/arch/sparc/dev/audioamd.c:1.26 src/sys/arch/sparc/dev/audioamd.c:1.26.4.1
--- src/sys/arch/sparc/dev/audioamd.c:1.26	Sat Jun  4 01:27:57 2011
+++ src/sys/arch/sparc/dev/audioamd.c	Sun Nov 20 10:56:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: audioamd.c,v 1.26 2011/06/04 01:27:57 tsutsui Exp $	*/
+/*	$NetBSD: audioamd.c,v 1.26.4.1 2011/11/20 10:56:18 mrg Exp $	*/
 /*	NetBSD: am7930_sparc.c,v 1.44 1999/03/14 22:29:00 jonathan Exp 	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: audioamd.c,v 1.26 2011/06/04 01:27:57 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: audioamd.c,v 1.26.4.1 2011/11/20 10:56:18 mrg Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -148,6 +148,7 @@ struct am7930_glue audioamd_glue = {
 int	audioamd_start_output(void *, void *, int, void (*)(void *), void *);
 int	audioamd_start_input(void *, void *, int, void (*)(void *), void *);
 int	audioamd_getdev(void *, struct audio_device *);
+void	audioamd_get_locks(void *opaque, kmutex_t **intr, kmutex_t **thread);
 
 const struct audio_hw_if sa_hw_if = {
 	am7930_open,
@@ -177,6 +178,8 @@ const struct audio_hw_if sa_hw_if = {
 	0,
 	0,
 	0,
+	0,
+	audioamd_get_locks,
 };
 
 struct audio_device audioamd_device = {
@@ -558,4 +561,14 @@ audioamd_getdev(void *addr, struct audio
 	return 0;
 }
 
+void
+audioamd_get_locks(void *opaque, kmutex_t **intr, kmutex_t **thread)
+{
+	struct audioamd_softc *asc = opaque;
+	struct am7930_softc *sc = asc-sc_am7930;
+ 
+	*intr = sc-sc_intr_lock;
+	*thread = sc-sc_lock;
+}
+
 #endif /* NAUDIO  0 */

Index: src/sys/dev/ic/am7930.c
diff -u src/sys/dev/ic/am7930.c:1.50 src/sys/dev/ic/am7930.c:1.50.56.1
--- src/sys/dev/ic/am7930.c:1.50	Fri Oct 19 11:59:46 2007
+++ src/sys/dev/ic/am7930.c	Sun Nov 20 10:56:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: am7930.c,v 1.50 2007/10/19 11:59:46 ad Exp $	*/
+/*	$NetBSD: am7930.c,v 1.50.56.1 2011/11/20 10:56:18 mrg Exp $	*/
 
 /*
  * Copyright (c) 1995 Rolf Grossmann
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: am7930.c,v 1.50 2007/10/19 11:59:46 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: am7930.c,v 1.50.56.1 2011/11/20 10:56:18 mrg Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -190,6 +190,9 @@ am7930_init(struct am7930_softc *sc, int
 			AM7930_MCR4_INT_ENABLE);
 	}
 
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	/* We used to take splaudio() in commit_settings */
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_VM);
 }
 
 int
@@ -288,7 +291,7 @@ am7930_commit_settings(void *addr)
 	struct am7930_softc *sc;
 	uint16_t ger, gr, gx, stgr;
 	uint8_t mmr2, mmr3;
-	int s, level;
+	int level;
 
 	DPRINTF((sa_commit.\n));
 	sc = addr;
@@ -304,7 +307,7 @@ am7930_commit_settings(void *addr)
 		gr = gx_coeff[level];
 	}
 
-	s = splaudio();
+	mutex_enter(sc-sc_intr_lock);
 
 	mmr2 = AM7930_IREAD(sc, AM7930_IREG_MAP_MMR2);
 	if (sc-sc_out_port == AUDIOAMD_SPEAKER_VOL)
@@ -329,7 +332,7 @@ am7930_commit_settings(void *addr)
 	AM7930_IWRITE16(sc, AM7930_IREG_MAP_GR, gr);
 	AM7930_IWRITE16(sc, AM7930_IREG_MAP_GER, ger);
 
-	splx(s);
+	mutex_exit(sc-sc_intr_lock);
 
 	return 0;
 }

Index: src/sys/dev/ic/am7930var.h
diff -u src/sys/dev/ic/am7930var.h:1.12 src/sys/dev/ic/am7930var.h:1.12.4.1
--- src/sys/dev/ic/am7930var.h:1.12	Sat Jun  4 01:27:57 2011
+++ src/sys/dev/ic/am7930var.h	Sun Nov 20 10:56:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: am7930var.h,v 1.12 2011/06/04 01:27:57 tsutsui Exp $	*/
+/*	$NetBSD: am7930var.h,v 1.12.4.1 2011/11/20 10:56:18 mrg Exp $	*/
 
 struct am7930_softc;
 
@@ -24,6 +24,9 @@ struct am7930_softc {
 	uint8_t	sc_mic_mute;
 
 	struct am7930_glue *sc_glue;
+
+	kmutex_t sc_lock;
+	kmutex_t sc_intr_lock;
 };
 
 extern int am7930debug;

Index: src/sys/dev/tc/bba.c
diff -u src/sys/dev/tc/bba.c:1.38 src/sys/dev/tc/bba.c:1.38.4.1
--- src/sys/dev/tc/bba.c:1.38	Sat Jun  4 01:27:57 2011
+++ src/sys/dev/tc/bba.c	Sun Nov 20 10:56:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: bba.c,v 1.38 2011/06/04 01:27:57 tsutsui Exp $ */
+/* $NetBSD: bba.c,v 1.38.4.1 2011/11/20 10:56:19 mrg Exp $ */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -29,13 +29,13 @@
 /* maxine/alpha baseboard audio (bba) */
 

CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 10:58:11 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: audio.c

Log Message:
change the locking protocol for audio_get_props().  make it always
assert that the thread lock is held before entry, and arrange to
make this always so.


To generate a diff of this commit:
cvs rdiff -u -r1.253.4.1 -r1.253.4.2 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.253.4.1 src/sys/dev/audio.c:1.253.4.2
--- src/sys/dev/audio.c:1.253.4.1	Sat Nov 19 21:49:34 2011
+++ src/sys/dev/audio.c	Sun Nov 20 10:58:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.253.4.1 2011/11/19 21:49:34 jmcneill Exp $	*/
+/*	$NetBSD: audio.c,v 1.253.4.2 2011/11/20 10:58:10 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: audio.c,v 1.253.4.1 2011/11/19 21:49:34 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: audio.c,v 1.253.4.2 2011/11/20 10:58:10 mrg Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -430,7 +430,9 @@ audioattach(device_t parent, device_t se
 	sc-sc_dev = parent;
 	sc-sc_lastinfovalid = false;
 
+	mutex_enter(sc-sc_lock);
 	props = audio_get_props(sc);
+	mutex_exit(sc-sc_lock);
 
 	if (props  AUDIO_PROP_FULLDUPLEX)
 		aprint_normal(: full duplex);
@@ -449,6 +451,14 @@ audioattach(device_t parent, device_t se
 	aprint_naive(\n);
 	aprint_normal(\n);
 
+	/*
+	 * XXX  Would like to not hold the sc_lock around this whole block
+	 * escpially for audio_alloc_ring(), except that the latter calls
+	 * -round_blocksize() which demands the thread lock to be taken.
+	 *
+	 * Revisit.
+	 */
+	mutex_enter(sc-sc_lock);
 	if (audio_can_playback(sc)) {
 		error = audio_alloc_ring(sc, sc-sc_pr,
 		AUMODE_PLAY, AU_RING_SIZE);
@@ -472,7 +482,6 @@ audioattach(device_t parent, device_t se
 
 	sc-sc_lastgain = 128;
 
-	mutex_enter(sc-sc_lock);
 	error = audio_set_defaults(sc, 0);
 	mutex_exit(sc-sc_lock);
 	if (error != 0) {
@@ -1663,9 +1672,11 @@ audio_open(dev_t dev, struct audio_softc
 	sc-sc_eof = 0;
 	sc-sc_playdrop = 0;
 
+	mutex_enter(sc-sc_intr_lock);
 	sc-sc_full_duplex = 
 		(flags  (FWRITE|FREAD)) == (FWRITE|FREAD) 
 		(audio_get_props(sc)  AUDIO_PROP_FULLDUPLEX);
+	mutex_exit(sc-sc_intr_lock);
 
 	mode = 0;
 	if (flags  FREAD) {
@@ -4416,10 +4427,10 @@ audio_get_props(struct audio_softc *sc)
 	const struct audio_hw_if *hw;
 	int props;
 
+	KASSERT(mutex_owned(sc-sc_lock));
+
 	hw = sc-hw_if;
-	mutex_enter(sc-sc_lock);
 	props = hw-get_props(sc-hw_hdl);
-	mutex_exit(sc-sc_lock);
 
 	/*
 	 * if neither playback nor capture properties are reported,



CVS commit: [jmcneill-audiomp3] src/sys/dev/pci/hdaudio

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 11:09:26 UTC 2011

Modified Files:
src/sys/dev/pci/hdaudio [jmcneill-audiomp3]: hdafg.c

Log Message:
need to hold intr_lock while calling audio_pint/audio_rint


To generate a diff of this commit:
cvs rdiff -u -r1.10.4.1 -r1.10.4.2 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.10.4.1 src/sys/dev/pci/hdaudio/hdafg.c:1.10.4.2
--- src/sys/dev/pci/hdaudio/hdafg.c:1.10.4.1	Sat Nov 19 23:40:07 2011
+++ src/sys/dev/pci/hdaudio/hdafg.c	Sun Nov 20 11:09:25 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.10.4.1 2011/11/19 23:40:07 jmcneill Exp $ */
+/* $NetBSD: hdafg.c,v 1.10.4.2 2011/11/20 11:09:25 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd supp...@precedence.co.uk
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hdafg.c,v 1.10.4.1 2011/11/19 23:40:07 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: hdafg.c,v 1.10.4.2 2011/11/20 11:09:25 jmcneill Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -3166,15 +3166,16 @@ hdafg_stream_intr(struct hdaudio_stream 
 	hda_write1(ad-ad_sc-sc_host, HDAUDIO_SD_STS(st-st_shift),
 	HDAUDIO_STS_DESE | HDAUDIO_STS_FIFOE | HDAUDIO_STS_BCIS);
 
-	//if (sts  HDAUDIO_STS_BCIS) {
-		if (st == ad-ad_playback  ad-ad_playbackintr) {
-			ad-ad_playbackintr(ad-ad_playbackintrarg);
-			handled = 1;
-		} else if (st == ad-ad_capture  ad-ad_captureintr) {
-			ad-ad_captureintr(ad-ad_captureintrarg);
-			handled = 1;
-		}
-	//}
+	mutex_spin_enter(ad-ad_sc-sc_intr_lock);
+	/* XXX test (sts  HDAUDIO_STS_BCIS)? */
+	if (st == ad-ad_playback  ad-ad_playbackintr) {
+		ad-ad_playbackintr(ad-ad_playbackintrarg);
+		handled = 1;
+	} else if (st == ad-ad_capture  ad-ad_captureintr) {
+		ad-ad_captureintr(ad-ad_captureintrarg);
+		handled = 1;
+	}
+	mutex_spin_exit(ad-ad_sc-sc_intr_lock);
 
 	return handled;
 }



CVS commit: [jmcneill-audiomp3] src/sys/dev/pci

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 11:10:16 UTC 2011

Modified Files:
src/sys/dev/pci [jmcneill-audiomp3]: gcscaudio.c

Log Message:
need to hold intr_lock when calling audio_pint/audio_rint


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.2 -r1.7.4.3 src/sys/dev/pci/gcscaudio.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/gcscaudio.c
diff -u src/sys/dev/pci/gcscaudio.c:1.7.4.2 src/sys/dev/pci/gcscaudio.c:1.7.4.3
--- src/sys/dev/pci/gcscaudio.c:1.7.4.2	Sat Nov 19 23:36:38 2011
+++ src/sys/dev/pci/gcscaudio.c	Sun Nov 20 11:10:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gcscaudio.c,v 1.7.4.2 2011/11/19 23:36:38 jmcneill Exp $	*/
+/*	$NetBSD: gcscaudio.c,v 1.7.4.3 2011/11/20 11:10:16 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2008 SHIMIZU Ryo r...@nerv.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gcscaudio.c,v 1.7.4.2 2011/11/19 23:36:38 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: gcscaudio.c,v 1.7.4.3 2011/11/20 11:10:16 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1210,9 +1210,12 @@ gcscaudio_intr(void *arg)
 
 	nintr = 0;
 	sc = (struct gcscaudio_softc *)arg;
+
+	mutex_spin_enter(sc-sc_intr_lock);
+
 	intr = bus_space_read_2(sc-sc_iot, sc-sc_ioh, ACC_IRQ_STATUS);
 	if (intr == 0)
-		return 0;
+		goto done;
 
 	/* Front output */
 	if (intr  ACC_IRQ_STATUS_BM0_IRQ_STS) {
@@ -1289,6 +1292,9 @@ gcscaudio_intr(void *arg)
 		aprint_normal_dev(sc-sc_dev, Audio Bus Master 5 IRQ Status\n);
 #endif
 
+done:
+	mutex_spin_exit(sc-sc_intr_lock);
+
 	return nintr ? 1 : 0;
 }
 



CVS commit: src/sys/arch/hpcarm/dev

2011-11-20 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Nov 20 11:20:32 UTC 2011

Modified Files:
src/sys/arch/hpcarm/dev: epsonlcd.c

Log Message:
Remove a white-space and a Tab.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hpcarm/dev/epsonlcd.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/hpcarm/dev/epsonlcd.c
diff -u src/sys/arch/hpcarm/dev/epsonlcd.c:1.1 src/sys/arch/hpcarm/dev/epsonlcd.c:1.2
--- src/sys/arch/hpcarm/dev/epsonlcd.c:1.1	Sat Aug  6 03:53:40 2011
+++ src/sys/arch/hpcarm/dev/epsonlcd.c	Sun Nov 20 11:20:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: epsonlcd.c,v 1.1 2011/08/06 03:53:40 kiyohara Exp $ */
+/*	$NetBSD: epsonlcd.c,v 1.2 2011/11/20 11:20:32 kiyohara Exp $ */
 /*
  * Copyright (c) 2011 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: epsonlcd.c,v 1.1 2011/08/06 03:53:40 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: epsonlcd.c,v 1.2 2011/11/20 11:20:32 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -73,7 +73,7 @@ static void epsonlcd_setup_hpcfbif(struc
 static void epsonlcd_get_video_chip(struct epsonlcd_softc *,
 struct video_chip *);
 
-CFATTACH_DECL_NEW(epsonlcd, sizeof(struct epsonlcd_softc), 
+CFATTACH_DECL_NEW(epsonlcd, sizeof(struct epsonlcd_softc),
 epsonlcd_match, epsonlcd_attach, NULL, NULL);
 
 
@@ -142,7 +142,7 @@ epsonlcd_attach(device_t parent, device_
 	haa.ha_curdspconf = 0;
 	haa.ha_ndspconf = 1;
 	haa.ha_dspconflist = sc-sc_dsp;
-	
+
 	config_found(self, haa, hpcfbprint);
 
 	if (!pmf_device_register(self, NULL, NULL))



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 11:26:35 UTC 2011

Added Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
list of audio and midi drivers and their statuses


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u /dev/null src/sys/dev/TODO.audiomp:1.1.2.1
--- /dev/null	Sun Nov 20 11:26:35 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 11:26:35 2011
@@ -0,0 +1,58 @@
+driverstatus
+===
+arch/amiga/dev/aucc.c
+arch/amiga/dev/repulse.c	done
+arch/amiga/dev/toccata.c
+arch/arm/iomd/vidcaudio.c
+arcm/arm/xscale/pxa2x0_ac97.c
+arch/dreamcast/dev/g2/aica.c
+arch/hp700/gsc/harmony.c
+arch/hpcmips/vr/vraiu.c
+arch/macppc/dev/awacs.c
+arch/macppc/dev/snapper.c
+arch/prep/isa/paud_isa.c
+arch/sgimips/hpc/haltwo.c
+arch/sgimips/mace/mavb.c
+arch/sparc/dev/audioamd.c	done
+arch/x68k/dev/vs.c
+arch/zaurus/dev/zaudio.c
+dev/bluetooth/btsco.c		done
+dev/ebus/cs4231_ebus.c		done
+dev/ic/interwave.c		done
+dev/ic/mpu.c			done
+dev/ic/opl.c			done
+dev/ic/tms320av110.c
+dev/isa/aria.c			done
+dev/isa/ess.c			done
+dev/isa/gus.c			done
+dev/isa/pas.c			done
+dev/isa/sb.c			done
+dev/isa/wss.c			done
+dev/isa/ym.c			done
+dev/isapnp/mpu_isapnp.c		done
+dev/pad/pad.c			done
+dev/pci/auacer.c		done
+dev/pci/auich.c			done
+dev/pci/auixp.c			done
+dev/pci/autri.c			done
+dev/pci/auvia.c			done
+dev/pci/azalia.c		done
+dev/pci/cmpci.c			done
+dev/pci/cs4280.c		done
+dev/pci/cs4281.c		done
+dev/pci/eap.c			done
+dev/pci/emuxki.c		done
+dev/pci/esa.c			done
+dev/pci/esm.c			done
+dev/pci/eso.c			done
+dev/pci/fms.c			done
+dev/pci/gcscaudio.c		done
+dev/pci/neo.c			done
+dev/pci/sv.c			done
+dev/pci/yds.c			done
+dev/pci/hdaudio/hdafg.c		done
+dev/sbus/cs4231_sbus.c		done
+dev/sbus/dbri.c			done
+dev/tc/bba.c			done
+dev/usb/uaudio.c
+dev/usb/umidi.c



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 11:41:53 UTC 2011

Modified Files:
src/sys/dev/ebus [jmcneill-audiomp3]: cs4231_ebus.c
src/sys/dev/sbus [jmcneill-audiomp3]: cs4231_sbus.c

Log Message:
complete the port to audiomp:  don't forget to take sc_intr_lock in the
hardware interrupt routines.


To generate a diff of this commit:
cvs rdiff -u -r1.34.4.1 -r1.34.4.2 src/sys/dev/ebus/cs4231_ebus.c
cvs rdiff -u -r1.48.4.1 -r1.48.4.2 src/sys/dev/sbus/cs4231_sbus.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/ebus/cs4231_ebus.c
diff -u src/sys/dev/ebus/cs4231_ebus.c:1.34.4.1 src/sys/dev/ebus/cs4231_ebus.c:1.34.4.2
--- src/sys/dev/ebus/cs4231_ebus.c:1.34.4.1	Sun Nov 20 09:40:19 2011
+++ src/sys/dev/ebus/cs4231_ebus.c	Sun Nov 20 11:41:53 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs4231_ebus.c,v 1.34.4.1 2011/11/20 09:40:19 mrg Exp $ */
+/*	$NetBSD: cs4231_ebus.c,v 1.34.4.2 2011/11/20 11:41:53 mrg Exp $ */
 
 /*
  * Copyright (c) 2002 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cs4231_ebus.c,v 1.34.4.1 2011/11/20 09:40:19 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: cs4231_ebus.c,v 1.34.4.2 2011/11/20 11:41:53 mrg Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_sparc_arch.h
@@ -542,6 +542,8 @@ cs4231_ebus_intr(void *arg)
 
 	ebsc = arg;
 	sc = ebsc-sc_cs4231;
+	mutex_spin_enter(sc-sc_ad1848.sc_intr_lock);
+
 	status = ADREAD(sc-sc_ad1848, AD1848_STATUS);
 
 #ifdef AUDIO_DEBUG
@@ -582,6 +584,7 @@ cs4231_ebus_intr(void *arg)
 		ret = 1;
 	}
 
+	mutex_spin_exit(sc-sc_ad1848.sc_intr_lock);
 
 	return ret;
 }
@@ -592,10 +595,10 @@ cs4231_ebus_pint(void *cookie)
 	struct cs4231_softc *sc = cookie;
 	struct cs_transfer *t = sc-sc_playback;
 
-	KERNEL_LOCK(1, NULL);
+	mutex_spin_enter(sc-sc_ad1848.sc_intr_lock);
 	if (t-t_intr != NULL)
 		(*t-t_intr)(t-t_arg);
-	KERNEL_UNLOCK_ONE(NULL);
+	mutex_spin_exit(sc-sc_ad1848.sc_intr_lock);
 	return 0;
 }
 
@@ -605,9 +608,9 @@ cs4231_ebus_rint(void *cookie)
 	struct cs4231_softc *sc = cookie;
 	struct cs_transfer *t = sc-sc_capture;
 
-	KERNEL_LOCK(1, NULL);
+	mutex_spin_enter(sc-sc_ad1848.sc_intr_lock);
 	if (t-t_intr != NULL)
 		(*t-t_intr)(t-t_arg);
-	KERNEL_UNLOCK_ONE(NULL);
+	mutex_spin_exit(sc-sc_ad1848.sc_intr_lock);
 	return 0;
 }

Index: src/sys/dev/sbus/cs4231_sbus.c
diff -u src/sys/dev/sbus/cs4231_sbus.c:1.48.4.1 src/sys/dev/sbus/cs4231_sbus.c:1.48.4.2
--- src/sys/dev/sbus/cs4231_sbus.c:1.48.4.1	Sun Nov 20 09:40:19 2011
+++ src/sys/dev/sbus/cs4231_sbus.c	Sun Nov 20 11:41:53 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs4231_sbus.c,v 1.48.4.1 2011/11/20 09:40:19 mrg Exp $	*/
+/*	$NetBSD: cs4231_sbus.c,v 1.48.4.2 2011/11/20 11:41:53 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2002, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cs4231_sbus.c,v 1.48.4.1 2011/11/20 09:40:19 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: cs4231_sbus.c,v 1.48.4.2 2011/11/20 11:41:53 mrg Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -516,6 +516,8 @@ cs4231_sbus_intr(void *arg)
 	if ((csr  APC_INTR_MASK) == 0)	/* any interrupt pedning? */
 		return 0;
 
+	mutex_spin_enter(sc-sc_ad1848.sc_intr_lock);
+
 	/* write back DMA status to clear interrupt */
 	bus_space_write_4(sbsc-sc_bt, sbsc-sc_bh, APC_DMA_CSR, csr);
 	++sc-sc_intrcnt.ev_count;
@@ -596,6 +598,8 @@ cs4231_sbus_intr(void *arg)
 		/* evcnt? */
 	}
 
+	mutex_spin_exit(sc-sc_ad1848.sc_intr_lock);
+
 	return 1;
 }
 
@@ -605,11 +609,11 @@ cs4231_sbus_pint(void *cookie)
 	struct cs4231_softc *sc = cookie;
 	struct cs_transfer *t;
 
-	KERNEL_LOCK(1, NULL);
+	mutex_spin_enter(sc-sc_ad1848.sc_intr_lock);
 	t = sc-sc_playback;
 	if (t-t_intr != NULL)
 		(*t-t_intr)(t-t_arg);
-	KERNEL_UNLOCK_ONE(NULL);
+	mutex_spin_exit(sc-sc_ad1848.sc_intr_lock);
 	return 0;
 }
 
@@ -619,11 +623,11 @@ cs4231_sbus_rint(void *cookie)
 	struct cs4231_softc *sc = cookie;
 	struct cs_transfer *t;
 
-	KERNEL_LOCK(1, NULL);
+	mutex_spin_enter(sc-sc_ad1848.sc_intr_lock);
 	t = sc-sc_capture;
 	if (t-t_intr != NULL)
 		(*t-t_intr)(t-t_arg);
-	KERNEL_UNLOCK_ONE(NULL);
+	mutex_spin_exit(sc-sc_ad1848.sc_intr_lock);
 	return 0;
 }
 



CVS commit: [jmcneill-audiomp3] src/sys/arch/amiga/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 11:43:55 UTC 2011

Modified Files:
src/sys/arch/amiga/dev [jmcneill-audiomp3]: repulse.c

Log Message:
complete the port to audiomp:  don't forget to take sc_intr_lock in the
hardware interrupt routines.


To generate a diff of this commit:
cvs rdiff -u -r1.17.4.1 -r1.17.4.2 src/sys/arch/amiga/dev/repulse.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/amiga/dev/repulse.c
diff -u src/sys/arch/amiga/dev/repulse.c:1.17.4.1 src/sys/arch/amiga/dev/repulse.c:1.17.4.2
--- src/sys/arch/amiga/dev/repulse.c:1.17.4.1	Sun Nov 20 10:27:36 2011
+++ src/sys/arch/amiga/dev/repulse.c	Sun Nov 20 11:43:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: repulse.c,v 1.17.4.1 2011/11/20 10:27:36 mrg Exp $ */
+/*	$NetBSD: repulse.c,v 1.17.4.2 2011/11/20 11:43:55 mrg Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: repulse.c,v 1.17.4.1 2011/11/20 10:27:36 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: repulse.c,v 1.17.4.2 2011/11/20 11:43:55 mrg Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -965,6 +965,9 @@ rep_intr(void *tag)
 	foundone = 0;
 
 	sc = tag;
+
+	mutex_spin_enter(sc-sc_intr_lock);
+
 	bp = sc-sc_boardp;
 	status = bp-rhw_status;
 
@@ -984,5 +987,7 @@ rep_intr(void *tag)
 		(*sc-sc_captmore)(sc-sc_captarg);
 	}
 
+	mutex_spin_exit(sc-sc_intr_lock);
+
 	return foundone;
 }



CVS commit: [jmcneill-audiomp3] src/sys/dev/ic

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 12:04:14 UTC 2011

Modified Files:
src/sys/dev/ic [jmcneill-audiomp3]: am7930.c

Log Message:
IPL_SCHED is enough.


To generate a diff of this commit:
cvs rdiff -u -r1.50.56.1 -r1.50.56.2 src/sys/dev/ic/am7930.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/am7930.c
diff -u src/sys/dev/ic/am7930.c:1.50.56.1 src/sys/dev/ic/am7930.c:1.50.56.2
--- src/sys/dev/ic/am7930.c:1.50.56.1	Sun Nov 20 10:56:18 2011
+++ src/sys/dev/ic/am7930.c	Sun Nov 20 12:04:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: am7930.c,v 1.50.56.1 2011/11/20 10:56:18 mrg Exp $	*/
+/*	$NetBSD: am7930.c,v 1.50.56.2 2011/11/20 12:04:14 mrg Exp $	*/
 
 /*
  * Copyright (c) 1995 Rolf Grossmann
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: am7930.c,v 1.50.56.1 2011/11/20 10:56:18 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: am7930.c,v 1.50.56.2 2011/11/20 12:04:14 mrg Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -191,8 +191,7 @@ am7930_init(struct am7930_softc *sc, int
 	}
 
 	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
-	/* We used to take splaudio() in commit_settings */
-	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_VM);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
 }
 
 int



CVS commit: [jmcneill-audiomp3] src/sys/arch/sparc/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 12:04:42 UTC 2011

Modified Files:
src/sys/arch/sparc/dev [jmcneill-audiomp3]: audioamd.c

Log Message:
use the sc_intr_lock when calling the rint/tint functions.


To generate a diff of this commit:
cvs rdiff -u -r1.26.4.1 -r1.26.4.2 src/sys/arch/sparc/dev/audioamd.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/sparc/dev/audioamd.c
diff -u src/sys/arch/sparc/dev/audioamd.c:1.26.4.1 src/sys/arch/sparc/dev/audioamd.c:1.26.4.2
--- src/sys/arch/sparc/dev/audioamd.c:1.26.4.1	Sun Nov 20 10:56:18 2011
+++ src/sys/arch/sparc/dev/audioamd.c	Sun Nov 20 12:04:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: audioamd.c,v 1.26.4.1 2011/11/20 10:56:18 mrg Exp $	*/
+/*	$NetBSD: audioamd.c,v 1.26.4.2 2011/11/20 12:04:42 mrg Exp $	*/
 /*	NetBSD: am7930_sparc.c,v 1.44 1999/03/14 22:29:00 jonathan Exp 	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: audioamd.c,v 1.26.4.1 2011/11/20 10:56:18 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: audioamd.c,v 1.26.4.2 2011/11/20 12:04:42 mrg Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -477,16 +477,16 @@ am7930swintr(void *sc0)
 	DPRINTFN(1, (audiointr: sc=%p\n, sc););
 
 	au = sc-sc_au;
-	mutex_spin_enter(sc-sc_lock);
+
+	mutex_spin_enter(sc-sc_am7930.sc_lock);
 	if (au-au_rdata  au-au_rend  sc-sc_rintr != NULL) {
-		mutex_spin_exit(sc-sc_lock);
 		(*sc-sc_rintr)(sc-sc_rarg);
-		mutex_spin_enter(sc-sc_lock);
 	}
 	pint = (au-au_pdata  au-au_pend  sc-sc_pintr != NULL);
-	mutex_spin_exit(sc-sc_lock);
 	if (pint)
 		(*sc-sc_pintr)(sc-sc_parg);
+
+	mutex_spin_exit(sc-sc_am7930.sc_lock);
 }
 
 



CVS commit: [jmcneill-audiomp3] src/sys/dev/sbus

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 12:07:13 UTC 2011

Modified Files:
src/sys/dev/sbus [jmcneill-audiomp3]: dbri.c

Log Message:
convert spl*() to use the sc_intr_lock mutex, and hold it in a couple
of other places we should as well.


To generate a diff of this commit:
cvs rdiff -u -r1.33.6.1 -r1.33.6.2 src/sys/dev/sbus/dbri.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/sbus/dbri.c
diff -u src/sys/dev/sbus/dbri.c:1.33.6.1 src/sys/dev/sbus/dbri.c:1.33.6.2
--- src/sys/dev/sbus/dbri.c:1.33.6.1	Sun Nov 20 10:48:54 2011
+++ src/sys/dev/sbus/dbri.c	Sun Nov 20 12:07:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbri.c,v 1.33.6.1 2011/11/20 10:48:54 mrg Exp $	*/
+/*	$NetBSD: dbri.c,v 1.33.6.2 2011/11/20 12:07:13 mrg Exp $	*/
 
 /*
  * Copyright (C) 1997 Rudolf Koenig (rfkoe...@immd4.informatik.uni-erlangen.de)
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.33.6.1 2011/11/20 10:48:54 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.33.6.2 2011/11/20 12:07:13 mrg Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -472,6 +472,8 @@ dbri_intr(void *hdl)
 	bus_space_handle_t ioh = sc-sc_ioh;
 	int x;
 
+	mutex_spin_enter(sc-sc_intr_lock);
+
 	/* clear interrupt */
 	x = bus_space_read_4(iot, ioh, DBRI_REG1);
 	if (x  (DBRI_MRR | DBRI_MLE | DBRI_LBG | DBRI_MBE)) {
@@ -506,6 +508,8 @@ dbri_intr(void *hdl)
 
 	dbri_process_interrupt_buffer(sc);
 
+	mutex_spin_exit(sc-sc_intr_lock);
+
 	return (1);
 }
 
@@ -598,9 +602,8 @@ dbri_command_send(struct dbri_softc *sc,
 	bus_space_handle_t ioh = sc-sc_ioh;
 	bus_space_tag_t iot = sc-sc_iot;
 	int maxloops = 100;
-	int x;
 
-	x = splsched();
+	mutex_spin_enter(sc-sc_intr_lock);
 
 	sc-sc_locked--;
 
@@ -638,7 +641,7 @@ dbri_command_send(struct dbri_softc *sc,
 		}
 	}
 
-	splx(x);
+	mutex_spin_exit(sc-sc_intr_lock);
 
 	return;
 }
@@ -1266,7 +1269,7 @@ setup_ring_xmit(struct dbri_softc *sc, i
 		void (*callback)(void *), void *callback_args)
 {
 	volatile uint32_t *cmd;
-	int x, i;
+	int i;
 	int td;
 	int td_first, td_last;
 	bus_addr_t dmabuf, dmabase;
@@ -1316,7 +1319,7 @@ setup_ring_xmit(struct dbri_softc *sc, i
 	dd-callback = callback;
 	dd-callback_args = callback_args;
 
-	x = splsched();
+	mutex_spin_enter(sc-sc_intr_lock);
 
 	/* the pipe shouldn't be active */
 	if (pipe_active(sc, pipe)) {
@@ -1352,7 +1355,7 @@ setup_ring_xmit(struct dbri_softc *sc, i
 		DPRINTF(%s: starting DMA\n, __func__);
 	}
 
-	splx(x);
+	mutex_spin_exit(sc-sc_intr_lock);
 
 	return;
 }
@@ -1362,7 +1365,7 @@ setup_ring_recv(struct dbri_softc *sc, i
 		void (*callback)(void *), void *callback_args)
 {
 	volatile uint32_t *cmd;
-	int x, i;
+	int i;
 	int td_first, td_last;
 	bus_addr_t dmabuf, dmabase;
 	struct dbri_desc *dd = sc-sc_desc[which];
@@ -1407,7 +1410,7 @@ setup_ring_recv(struct dbri_softc *sc, i
 	dd-callback = callback;
 	dd-callback_args = callback_args;
 
-	x = splsched();
+	mutex_spin_enter(sc-sc_intr_lock);
 
 	/* the pipe shouldn't be active */
 	if (pipe_active(sc, pipe)) {
@@ -1443,7 +1446,7 @@ setup_ring_recv(struct dbri_softc *sc, i
 		DPRINTF(%s: starting DMA\n, __func__);
 	}
 
-	splx(x);
+	mutex_spin_exit(sc-sc_intr_lock);
 
 	return;
 }
@@ -2211,10 +2214,9 @@ dbri_resume(device_t self, const pmf_qua
 	aprint_verbose(resume: %d\n, sc-sc_refcount);
 	if (sc-sc_playing) {
 		volatile uint32_t *cmd;
-		int s;
 
 		dbri_bring_up(sc);
-		s = splsched();
+		mutex_spin_enter(sc-sc_intr_lock);
 		cmd = dbri_command_lock(sc);
 		*(cmd++) = DBRI_CMD(DBRI_COMMAND_SDP,
 		0, sc-sc_pipe[4].sdp |
@@ -2223,7 +2225,7 @@ dbri_resume(device_t self, const pmf_qua
 		*(cmd++) = sc-sc_dmabase +
 		dbri_dma_off(xmit, 0);
 		dbri_command_send(sc, cmd);
-		splx(s);
+		mutex_spin_exit(sc-sc_intr_lock);
 	}
 	return true;
 }



CVS commit: [jmcneill-audiomp3] src/sys/arch/sgimips/hpc

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 12:07:27 UTC 2011

Modified Files:
src/sys/arch/sgimips/hpc [jmcneill-audiomp3]: haltwo.c haltwovar.h

Log Message:
adapt to audiomp api changes


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.4.1 src/sys/arch/sgimips/hpc/haltwo.c
cvs rdiff -u -r1.7 -r1.7.6.1 src/sys/arch/sgimips/hpc/haltwovar.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/sgimips/hpc/haltwo.c
diff -u src/sys/arch/sgimips/hpc/haltwo.c:1.20 src/sys/arch/sgimips/hpc/haltwo.c:1.20.4.1
--- src/sys/arch/sgimips/hpc/haltwo.c:1.20	Fri Jul  1 18:53:46 2011
+++ src/sys/arch/sgimips/hpc/haltwo.c	Sun Nov 20 12:07:27 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: haltwo.c,v 1.20 2011/07/01 18:53:46 dyoung Exp $ */
+/* $NetBSD: haltwo.c,v 1.20.4.1 2011/11/20 12:07:27 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2003 Ilpo Ruotsalainen
@@ -30,13 +30,13 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: haltwo.c,v 1.20 2011/07/01 18:53:46 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: haltwo.c,v 1.20.4.1 2011/11/20 12:07:27 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
 #include sys/device.h
 #include sys/audioio.h
-#include sys/malloc.h
+#include sys/kmem.h
 #include dev/audio_if.h
 #include dev/auconv.h
 #include dev/mulaw.h
@@ -68,13 +68,14 @@ static int haltwo_getdev(void *, struct 
 static int haltwo_set_port(void *, mixer_ctrl_t *);
 static int haltwo_get_port(void *, mixer_ctrl_t *);
 static int haltwo_query_devinfo(void *, mixer_devinfo_t *);
-static void *haltwo_malloc(void *, int, size_t, struct malloc_type *, int);
-static void haltwo_free(void *, void *, struct malloc_type *);
+static void *haltwo_malloc(void *, int, size_t);
+static void haltwo_free(void *, void *, size_t);
 static int haltwo_get_props(void *);
 static int haltwo_trigger_output(void *, void *, void *, int, void (*)(void *),
 	void *, const audio_params_t *);
 static int haltwo_trigger_input(void *, void *, void *, int, void (*)(void *),
 	void *, const audio_params_t *);
+static void haltwo_get_locks(void *, kmutex_t **, kmutex_t **);
 static bool haltwo_shutdown(device_t, int);
 
 static const struct audio_hw_if haltwo_hw_if = {
@@ -104,7 +105,9 @@ static const struct audio_hw_if haltwo_h
 	haltwo_get_props,
 	haltwo_trigger_output,
 	haltwo_trigger_input,
-	NULL  /* dev_ioctl */
+	NULL, /* dev_ioctl */
+	NULL, /* powerstate */
+	haltwo_get_locks,
 };
 
 static const struct audio_device haltwo_device = {
@@ -300,6 +303,9 @@ haltwo_attach(device_t parent, device_t 
 	sc-sc_st = haa-ha_st;
 	sc-sc_dma_tag = haa-ha_dmat;
 
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+
 	if (bus_space_subregion(haa-ha_st, haa-ha_sh, haa-ha_devoff,
 	HPC3_PBUS_CH0_DEVREGS_SIZE, sc-sc_ctl_sh)) {
 		aprint_error(: unable to map control registers\n);
@@ -325,7 +331,7 @@ haltwo_attach(device_t parent, device_t 
 
 	rev = haltwo_read(sc, ctl, HAL2_REG_CTL_REV);
 
-	if (cpu_intr_establish(haa-ha_irq, IPL_AUDIO, haltwo_intr, sc)
+	if (cpu_intr_establish(haa-ha_irq, IPL_SCHED, haltwo_intr, sc)
 	== NULL) {
 		aprint_error(: unable to establish interrupt\n);
 		return;
@@ -372,6 +378,9 @@ haltwo_intr(void *v)
 
 	sc = v;
 	ret = 0;
+
+	mutex_spin_enter(sc-sc_intr_lock);
+
 	if (bus_space_read_4(sc-sc_st, sc-sc_dma_sh, HPC3_PBUS_CH0_CTL)
 	 HPC3_PBUS_DMACTL_IRQ) {
 		sc-sc_dac.intr(sc-sc_dac.intr_arg);
@@ -380,6 +389,8 @@ haltwo_intr(void *v)
 	} else
 		DPRINTF((haltwo_intr: Huh?\n));
 
+	mutex_spin_exit(sc-sc_intr_lock);
+
 	return ret;
 }
 
@@ -637,26 +648,25 @@ haltwo_alloc_dmamem(struct haltwo_softc 
 	p-size = size;
 
 	/* XXX Check align/boundary XXX */
-	/* XXX Pass flags and use them instead BUS_DMA_NOWAIT? XXX */
 	err = bus_dmamem_alloc(sc-sc_dma_tag, p-size, 0, 0, p-dma_segs,
-	HALTWO_MAX_DMASEGS, p-dma_segcount, BUS_DMA_NOWAIT);
+	HALTWO_MAX_DMASEGS, p-dma_segcount, BUS_DMA_WAITOK);
 	if (err)
 		goto out;
 
 	/* XXX BUS_DMA_COHERENT? XXX */
 	err = bus_dmamem_map(sc-sc_dma_tag, p-dma_segs, p-dma_segcount,
-	p-size, p-kern_addr, BUS_DMA_NOWAIT | BUS_DMA_COHERENT);
+	p-size, p-kern_addr, BUS_DMA_WAITOK | BUS_DMA_COHERENT);
 	if (err)
 		goto out_free;
 
 	/* XXX Just guessing ... XXX */
 	err = bus_dmamap_create(sc-sc_dma_tag, p-size, HALTWO_MAX_DMASEGS,
-	PAGE_SIZE, 0, BUS_DMA_NOWAIT, p-dma_map);
+	PAGE_SIZE, 0, BUS_DMA_WAITOK, p-dma_map);
 	if (err)
 		goto out_free;
 
 	err = bus_dmamap_load(sc-sc_dma_tag, p-dma_map, p-kern_addr,
-	p-size, NULL, BUS_DMA_NOWAIT);
+	p-size, NULL, BUS_DMA_WAITOK);
 	if (err)
 		goto out_destroy;
 
@@ -673,21 +683,20 @@ out:
 }
 
 static void *
-haltwo_malloc(void *v, int direction, size_t size, struct malloc_type *type,
-		int flags)
+haltwo_malloc(void *v, int direction, size_t size)
 {
 	struct haltwo_softc *sc;
 	struct haltwo_dmabuf *p;
 
 	

CVS commit: [jmcneill-audiomp3] src/sys/dev/isa

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 12:08:19 UTC 2011

Modified Files:
src/sys/dev/isa [jmcneill-audiomp3]: pcppi.c pcppivar.h

Log Message:
port the changes from ad-audiomp2 branch.  this mostly replaces the
changes i'd made to pcppi to achieve a similar result.

XXX: these actually could be pulled down to -current today, i think.
no actual dependancies on audiomp branch itself.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.6.1 src/sys/dev/isa/pcppi.c
cvs rdiff -u -r1.10.6.1 -r1.10.6.2 src/sys/dev/isa/pcppivar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/isa/pcppi.c
diff -u src/sys/dev/isa/pcppi.c:1.37 src/sys/dev/isa/pcppi.c:1.37.6.1
--- src/sys/dev/isa/pcppi.c:1.37	Tue May 24 09:28:03 2011
+++ src/sys/dev/isa/pcppi.c	Sun Nov 20 12:08:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pcppi.c,v 1.37 2011/05/24 09:28:03 mrg Exp $ */
+/* $NetBSD: pcppi.c,v 1.37.6.1 2011/11/20 12:08:19 mrg Exp $ */
 
 /*
  * Copyright (c) 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pcppi.c,v 1.37 2011/05/24 09:28:03 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: pcppi.c,v 1.37.6.1 2011/11/20 12:08:19 mrg Exp $);
 
 #include attimer.h
 
@@ -42,6 +42,7 @@ __KERNEL_RCSID(0, $NetBSD: pcppi.c,v 1.
 #include sys/bus.h
 #include sys/mutex.h
 #include sys/condvar.h
+#include sys/tty.h
 
 #include dev/ic/attimervar.h
 
@@ -66,16 +67,14 @@ CFATTACH_DECL3_NEW(pcppi, sizeof(struct 
 DVF_DETACH_SHUTDOWN);
 
 static int pcppisearch(device_t, cfdata_t, const int *, void *);
-static void pcppi_bell_stop_unlocked(void*);
-static void pcppi_bell_stop(void*);
+static void pcppi_bell_stop(struct pcppi_softc *);
+static void pcppi_bell_callout(void *);
 
 #if NATTIMER  0
 static void pcppi_attach_speaker(device_t);
 static void pcppi_detach_speaker(struct pcppi_softc *);
 #endif
 
-#define PCPPIPRI (PZERO - 1)
-
 int
 pcppi_match(device_t parent, cfdata_t match, void *aux)
 {
@@ -175,6 +174,7 @@ pcppi_isa_attach(device_t parent, device
 void
 pcppi_childdet(device_t self, device_t child)
 {
+
 	/* we hold no child references, so do nothing */
 }
 
@@ -196,14 +196,16 @@ pcppi_detach(device_t self, int flags)
 #if NPCKBD  0
 	pckbd_unhook_bell(pcppi_pckbd_bell, sc);
 #endif
+	mutex_spin_enter(tty_lock);
 	pcppi_bell_stop(sc);
+	mutex_spin_exit(tty_lock);
 
-	callout_stop(sc-sc_bell_ch);
+	callout_halt(sc-sc_bell_ch, NULL);
 	callout_destroy(sc-sc_bell_ch);
-	bus_space_unmap(sc-sc_iot, sc-sc_ppi_ioh, sc-sc_size);
 
-	mutex_destroy(sc-sc_lock);
-	cv_destroy(sc-sc_stop_cv);
+	cv_destroy(sc-sc_slp);
+
+	bus_space_unmap(sc-sc_iot, sc-sc_ppi_ioh, sc-sc_size);
 
 	return 0;
 }
@@ -214,12 +216,11 @@ pcppi_attach(struct pcppi_softc *sc)
 struct pcppi_attach_args pa;
 	device_t self = sc-sc_dv;
 
-callout_init(sc-sc_bell_ch, 0);
-
-sc-sc_bellactive = sc-sc_bellpitch = sc-sc_slp = 0;
+	callout_init(sc-sc_bell_ch, CALLOUT_MPSAFE);
+	callout_setfunc(sc-sc_bell_ch, pcppi_bell_callout, sc);
+	cv_init(sc-sc_slp, bell);
 
-	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_VM);
-	cv_init(sc-sc_stop_cv, bell);
+sc-sc_bellactive = sc-sc_bellpitch = 0;
 
 #if NPCKBD  0
 	/* Provide a beeper for the PC Keyboard, if there isn't one already. */
@@ -274,21 +275,27 @@ pcppi_attach_speaker(device_t self)
 void
 pcppi_bell(pcppi_tag_t self, int pitch, int period, int slp)
 {
+
+	mutex_spin_enter(tty_lock);
+	pcppi_bell_locked(self, pitch, period, slp);
+	mutex_spin_exit(tty_lock);
+}
+
+void
+pcppi_bell_locked(pcppi_tag_t self, int pitch, int period, int slp)
+{
 	struct pcppi_softc *sc = self;
 
-	mutex_enter(sc-sc_lock);
 	if (sc-sc_bellactive) {
 		if (sc-sc_timeout) {
 			sc-sc_timeout = 0;
 			callout_stop(sc-sc_bell_ch);
 		}
-		if (sc-sc_slp)
-			cv_broadcast(sc-sc_stop_cv);
+		cv_broadcast(sc-sc_slp);
 	}
 	if (pitch == 0 || period == 0) {
-		pcppi_bell_stop_unlocked(sc);
+		pcppi_bell_stop(sc);
 		sc-sc_bellpitch = 0;
-		mutex_exit(sc-sc_lock);
 		return;
 	}
 	if (!sc-sc_bellactive || sc-sc_bellpitch != pitch) {
@@ -306,24 +313,32 @@ pcppi_bell(pcppi_tag_t self, int pitch, 
 	sc-sc_bellactive = 1;
 	if (slp  PCPPI_BELL_POLL) {
 		delay((period * 100) / hz);
-		pcppi_bell_stop_unlocked(sc);
+		pcppi_bell_stop(sc);
 	} else {
 		sc-sc_timeout = 1;
-		callout_reset(sc-sc_bell_ch, period, pcppi_bell_stop, sc);
+		callout_schedule(sc-sc_bell_ch, period);
 		if (slp  PCPPI_BELL_SLEEP) {
-			sc-sc_slp = 1;
-			cv_wait_sig(sc-sc_stop_cv, sc-sc_lock);
-			sc-sc_slp = 0;
+			cv_wait_sig(sc-sc_slp, tty_lock);
 		}
 	}
-	mutex_exit(sc-sc_lock);
 }
 
 static void
-pcppi_bell_stop_unlocked(void *arg)
+pcppi_bell_callout(void *arg)
 {
 	struct pcppi_softc *sc = arg;
 
+	mutex_spin_enter(tty_lock);
+	if (sc-sc_timeout != 0) {
+		pcppi_bell_stop(sc);
+	}
+	mutex_spin_exit(tty_lock);
+}
+
+static void
+pcppi_bell_stop(struct pcppi_softc *sc)
+{
+

CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 12:09:13 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
haltwo is done


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.1 src/sys/dev/TODO.audiomp:1.1.2.2
--- src/sys/dev/TODO.audiomp:1.1.2.1	Sun Nov 20 11:26:35 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 12:09:13 2011
@@ -11,7 +11,7 @@ arch/hpcmips/vr/vraiu.c
 arch/macppc/dev/awacs.c
 arch/macppc/dev/snapper.c
 arch/prep/isa/paud_isa.c
-arch/sgimips/hpc/haltwo.c
+arch/sgimips/hpc/haltwo.c	done
 arch/sgimips/mace/mavb.c
 arch/sparc/dev/audioamd.c	done
 arch/x68k/dev/vs.c



CVS commit: src/sys/net

2011-11-20 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Nov 20 12:15:38 UTC 2011

Modified Files:
src/sys/net: if_ecosubr.c

Log Message:
Fix build failed.  Include if_inarp.h.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/net/if_ecosubr.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/net/if_ecosubr.c
diff -u src/sys/net/if_ecosubr.c:1.35 src/sys/net/if_ecosubr.c:1.36
--- src/sys/net/if_ecosubr.c:1.35	Mon Apr  5 07:22:22 2010
+++ src/sys/net/if_ecosubr.c	Sun Nov 20 12:15:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ecosubr.c,v 1.35 2010/04/05 07:22:22 joerg Exp $	*/
+/*	$NetBSD: if_ecosubr.c,v 1.36 2011/11/20 12:15:38 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2001 Ben Harris
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ecosubr.c,v 1.35 2010/04/05 07:22:22 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ecosubr.c,v 1.36 2011/11/20 12:15:38 kiyohara Exp $);
 
 #include opt_inet.h
 #include opt_pfil_hooks.h
@@ -86,6 +86,7 @@ __KERNEL_RCSID(0, $NetBSD: if_ecosubr.c
 #include netinet/in.h
 #include netinet/in_var.h
 #endif
+#include netinet/if_inarp.h
 
 struct eco_retryparms {
 	int	erp_delay;



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 12:17:03 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
add a column for tested and mark hdafg and ess as done.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.2 src/sys/dev/TODO.audiomp:1.1.2.3
--- src/sys/dev/TODO.audiomp:1.1.2.2	Sun Nov 20 12:09:13 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 12:17:03 2011
@@ -1,4 +1,4 @@
-driverstatus
+driverstatus		tested
 ===
 arch/amiga/dev/aucc.c
 arch/amiga/dev/repulse.c	done
@@ -23,7 +23,7 @@ dev/ic/mpu.c			done
 dev/ic/opl.c			done
 dev/ic/tms320av110.c
 dev/isa/aria.c			done
-dev/isa/ess.c			done
+dev/isa/ess.c			done		port-shark
 dev/isa/gus.c			done
 dev/isa/pas.c			done
 dev/isa/sb.c			done
@@ -50,7 +50,7 @@ dev/pci/gcscaudio.c		done
 dev/pci/neo.c			done
 dev/pci/sv.c			done
 dev/pci/yds.c			done
-dev/pci/hdaudio/hdafg.c		done
+dev/pci/hdaudio/hdafg.c		done		port-amd64
 dev/sbus/cs4231_sbus.c		done
 dev/sbus/dbri.c			done
 dev/tc/bba.c			done



CVS commit: src/sys/dev/usb

2011-11-20 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sun Nov 20 12:26:50 UTC 2011

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Added Lenovo ThinkVision LT1421 Wide entry.


To generate a diff of this commit:
cvs rdiff -u -r1.600 -r1.601 src/sys/dev/usb/usbdevs

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/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.600 src/sys/dev/usb/usbdevs:1.601
--- src/sys/dev/usb/usbdevs:1.600	Sun Nov  6 02:29:33 2011
+++ src/sys/dev/usb/usbdevs	Sun Nov 20 12:26:49 2011
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.600 2011/11/06 02:29:33 christos Exp $
+$NetBSD: usbdevs,v 1.601 2011/11/20 12:26:49 nonaka Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1145,6 +1145,7 @@ product DISPLAYLINK SWDVI	0x024c	SUNWEIT
 product DISPLAYLINK LUM70	0x02a9	Lilliput UM-70
 product DISPLAYLINK LCD8000UD_DVI	0x02b8	LCD-8000UD-DVI
 product DISPLAYLINK LDEWX015U	0x02e3	Logitec LDE-WX015U
+product DISPLAYLINK LT1421WIDE	0x03e0	Lenovo ThinkVision LT1421 Wide
 product DISPLAYLINK UM7X0	0x401a	nanovision MiMo
 
 /* D-Link products */



CVS commit: [jmcneill-audiomp3] src/sys/arch/sgimips/mace

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 12:27:21 UTC 2011

Modified Files:
src/sys/arch/sgimips/mace [jmcneill-audiomp3]: mavb.c

Log Message:
adapt to audiomp api changes


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.4.1 src/sys/arch/sgimips/mace/mavb.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/mace/mavb.c
diff -u src/sys/arch/sgimips/mace/mavb.c:1.7 src/sys/arch/sgimips/mace/mavb.c:1.7.4.1
--- src/sys/arch/sgimips/mace/mavb.c:1.7	Fri Jul  1 18:53:47 2011
+++ src/sys/arch/sgimips/mace/mavb.c	Sun Nov 20 12:27:21 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mavb.c,v 1.7 2011/07/01 18:53:47 dyoung Exp $ */
+/* $NetBSD: mavb.c,v 1.7.4.1 2011/11/20 12:27:21 jmcneill Exp $ */
 /* $OpenBSD: mavb.c,v 1.6 2005/04/15 13:05:14 mickey Exp $ */
 
 /*
@@ -21,7 +21,7 @@
 #include sys/systm.h
 #include sys/device.h
 #include sys/kernel.h
-#include sys/malloc.h
+#include sys/kmem.h
 #include sys/callout.h
 
 #include sys/bus.h
@@ -118,6 +118,8 @@ static const struct audio_format mavb_fo
 
 struct mavb_softc {
 	struct device sc_dev;
+	kmutex_t sc_lock;
+	kmutex_t sc_intr_lock;
 	bus_space_tag_t sc_st;
 	bus_space_handle_t sc_sh;
 	bus_dma_tag_t sc_dmat;
@@ -151,24 +153,26 @@ struct mavb_codecvar {
 };
 
 static stream_filter_t *mavb_factory
-(int (*)(stream_fetcher_t *, audio_stream_t *, int));
+(struct audio_softc *,
+ int (*)(struct audio_softc *, stream_fetcher_t *, audio_stream_t *, int));
 static void mavb_dtor(stream_filter_t *);
 
 /* XXX I'm going to complain every time I have to copy this macro */
 #define DEFINE_FILTER(name)		\
 static int\
-name##_fetch_to(stream_fetcher_t *, audio_stream_t *, int);		\
+name##_fetch_to(struct audio_softc *, stream_fetcher_t *,		\
+		audio_stream_t *, int);	\
 stream_filter_t *name(struct audio_softc *,\
 const audio_params_t *, const audio_params_t *);			\
 stream_filter_t *			\
 name(struct audio_softc *sc, const audio_params_t *from,		\
 const audio_params_t *to)		\
 {	\
-	return mavb_factory(name##_fetch_to);\
+	return mavb_factory(sc, name##_fetch_to);			\
 }	\
 static int\
-name##_fetch_to(stream_fetcher_t *self, audio_stream_t *dst,		\
-int max_used)
+name##_fetch_to(struct audio_softc *asc, stream_fetcher_t *self,	\
+audio_stream_t *dst, int max_used)
 
 DEFINE_FILTER(mavb_16to24)
 {
@@ -177,7 +181,7 @@ DEFINE_FILTER(mavb_16to24)
 
 	this = (stream_filter_t *)self;
 	max_used = (max_used + 1)  ~1;
-	if ((err = this-prev-fetch_to(this-prev, this-src, max_used)))
+	if ((err = this-prev-fetch_to(asc, this-prev, this-src, max_used)))
 		return err;
 	m = (dst-end - dst-start)  ~1;
 	m = min(m, max_used);
@@ -198,7 +202,7 @@ DEFINE_FILTER(mavb_mts)
 
 	this = (stream_filter_t *)self;
 	max_used = (max_used + 1)  ~1;
-	if ((err = this-prev-fetch_to(this-prev, this-src, max_used)))
+	if ((err = this-prev-fetch_to(asc, this-prev, this-src, max_used)))
 		return err;
 	m = (dst-end - dst-start)  ~1;
 	m = min(m, max_used);
@@ -213,11 +217,11 @@ DEFINE_FILTER(mavb_mts)
 }
 
 static stream_filter_t *
-mavb_factory(int (*fetch_to)(stream_fetcher_t *, audio_stream_t *, int))
+mavb_factory(struct audio_softc *asc, int (*fetch_to)(struct audio_softc *, stream_fetcher_t *, audio_stream_t *, int))
 {
 	struct mavb_codecvar *this;
 
-	this = malloc(sizeof(*this), M_DEVBUF, M_WAITOK | M_ZERO);
+	this = kmem_zalloc(sizeof(*this), KM_SLEEP);
 	this-base.base.fetch_to = fetch_to;
 	this-base.dtor = mavb_dtor;
 	this-base.set_fetcher = stream_filter_set_fetcher;
@@ -231,7 +235,7 @@ mavb_dtor(stream_filter_t *this)
 {
 
 	if (this != NULL)
-		free(this, M_DEVBUF);
+		kmem_free(this, sizeof(*this));
 }
 
 typedef uint64_t ad1843_addr_t;
@@ -265,6 +269,7 @@ int mavb_trigger_output(void *, void *, 
 			void *, const audio_params_t *);
 int mavb_trigger_input(void *, void *, void *, int, void (*)(void *),
 		   void *, const audio_params_t *);
+void mavb_get_locks(void *, kmutex_t **, kmutex_t **);
 
 struct audio_hw_if mavb_sa_hw_if = {
 	mavb_open,
@@ -294,6 +299,8 @@ struct audio_hw_if mavb_sa_hw_if = {
 	mavb_trigger_output,
 	mavb_trigger_input,
 	NULL,
+	NULL,
+	mavb_get_locks,
 };
 
 struct audio_device mavb_device = {
@@ -855,6 +862,8 @@ mavb_dma_output(struct mavb_softc *sc)
 	uint8_t *src, *dst;
 	int count;
 
+	KASSERT(mutex_owned(sc-sc_intr_lock));
+
 	write_ptr = bus_space_read_8(st, sh, MAVB_CHANNEL2_WRITE_PTR);
 	depth = bus_space_read_8(st, sh, MAVB_CHANNEL2_DEPTH);
 
@@ -900,6 +909,8 @@ mavb_trigger_output(void *hdl, void *sta
 
 	sc-sc_count = 0;
 
+	mutex_spin_enter(sc-sc_intr_lock);
+
 	bus_space_write_8(sc-sc_st, sc-sc_sh, MAVB_CHANNEL2_CONTROL,
 	MAVB_CHANNEL_RESET);
 	delay(1000);
@@ -909,6 +920,9 @@ mavb_trigger_output(void *hdl, void *sta
 
 	bus_space_write_8(sc-sc_st, sc-sc_sh, MAVB_CHANNEL2_CONTROL,
 	

CVS commit: src/sys/dev/usb

2011-11-20 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sun Nov 20 12:27:36 UTC 2011

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.593 -r1.594 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.594 -r1.595 src/sys/dev/usb/usbdevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.593 src/sys/dev/usb/usbdevs.h:1.594
--- src/sys/dev/usb/usbdevs.h:1.593	Sun Nov  6 02:30:06 2011
+++ src/sys/dev/usb/usbdevs.h	Sun Nov 20 12:27:36 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.593 2011/11/06 02:30:06 christos Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.594 2011/11/20 12:27:36 nonaka Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.600 2011/11/06 02:29:33 christos Exp
+ *	NetBSD: usbdevs,v 1.601 2011/11/20 12:26:49 nonaka Exp
  */
 
 /*
@@ -1152,6 +1152,7 @@
 #define	USB_PRODUCT_DISPLAYLINK_LUM70	0x02a9		/* Lilliput UM-70 */
 #define	USB_PRODUCT_DISPLAYLINK_LCD8000UD_DVI	0x02b8		/* LCD-8000UD-DVI */
 #define	USB_PRODUCT_DISPLAYLINK_LDEWX015U	0x02e3		/* Logitec LDE-WX015U */
+#define	USB_PRODUCT_DISPLAYLINK_LT1421WIDE	0x03e0		/* Lenovo ThinkVision LT1421 Wide */
 #define	USB_PRODUCT_DISPLAYLINK_UM7X0	0x401a		/* nanovision MiMo */
 
 /* D-Link products */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.594 src/sys/dev/usb/usbdevs_data.h:1.595
--- src/sys/dev/usb/usbdevs_data.h:1.594	Sun Nov  6 02:30:06 2011
+++ src/sys/dev/usb/usbdevs_data.h	Sun Nov 20 12:27:36 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.594 2011/11/06 02:30:06 christos Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.595 2011/11/20 12:27:36 nonaka Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.600 2011/11/06 02:29:33 christos Exp
+ *	NetBSD: usbdevs,v 1.601 2011/11/20 12:26:49 nonaka Exp
  */
 
 /*
@@ -3635,6 +3635,10 @@ const struct usb_product usb_products[] 
 	Logitec LDE-WX015U,
 	},
 	{
+	USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LT1421WIDE,
+	Lenovo ThinkVision LT1421 Wide,
+	},
+	{
 	USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_UM7X0,
 	nanovision MiMo,
 	},
@@ -8571,4 +8575,4 @@ const struct usb_product usb_products[] 
 	Prestige,
 	},
 };
-const int usb_nproducts = 1635;
+const int usb_nproducts = 1636;



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 12:28:26 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
mavb is done


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.3 src/sys/dev/TODO.audiomp:1.1.2.4
--- src/sys/dev/TODO.audiomp:1.1.2.3	Sun Nov 20 12:17:03 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 12:28:26 2011
@@ -12,7 +12,7 @@ arch/macppc/dev/awacs.c
 arch/macppc/dev/snapper.c
 arch/prep/isa/paud_isa.c
 arch/sgimips/hpc/haltwo.c	done
-arch/sgimips/mace/mavb.c
+arch/sgimips/mace/mavb.c	done
 arch/sparc/dev/audioamd.c	done
 arch/x68k/dev/vs.c
 arch/zaurus/dev/zaudio.c



CVS commit: src/sys/dev/usb

2011-11-20 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sun Nov 20 12:29:34 UTC 2011

Modified Files:
src/sys/dev/usb: udl.c

Log Message:
Added Lenovo ThinkVision LT1421 Wide entry.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/usb/udl.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/udl.c
diff -u src/sys/dev/usb/udl.c:1.5 src/sys/dev/usb/udl.c:1.6
--- src/sys/dev/usb/udl.c:1.5	Fri Jul 22 12:40:55 2011
+++ src/sys/dev/usb/udl.c	Sun Nov 20 12:29:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: udl.c,v 1.5 2011/07/22 12:40:55 nonaka Exp $	*/
+/*	$NetBSD: udl.c,v 1.6 2011/11/20 12:29:33 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2009 FUKAUMI Naoki.
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: udl.c,v 1.5 2011/07/22 12:40:55 nonaka Exp $);
+__KERNEL_RCSID(0, $NetBSD: udl.c,v 1.6 2011/11/20 12:29:33 nonaka Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -322,6 +322,7 @@ static const struct usb_devno udl_devs[]
 	{ USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LUM70 },
 	{ USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LCD8000UD_DVI },
 	{ USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LDEWX015U },
+	{ USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LT1421WIDE },
 	{ USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_UM7X0 }
 };
 



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 12:37:56 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
i tested eap


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.4 src/sys/dev/TODO.audiomp:1.1.2.5
--- src/sys/dev/TODO.audiomp:1.1.2.4	Sun Nov 20 12:28:26 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 12:37:56 2011
@@ -40,7 +40,7 @@ dev/pci/azalia.c		done
 dev/pci/cmpci.c			done
 dev/pci/cs4280.c		done
 dev/pci/cs4281.c		done
-dev/pci/eap.c			done
+dev/pci/eap.c			done		port-i386
 dev/pci/emuxki.c		done
 dev/pci/esa.c			done
 dev/pci/esm.c			done
@@ -50,7 +50,7 @@ dev/pci/gcscaudio.c		done
 dev/pci/neo.c			done
 dev/pci/sv.c			done
 dev/pci/yds.c			done
-dev/pci/hdaudio/hdafg.c		done		port-amd64
+dev/pci/hdaudio/hdafg.c		done		port-i386
 dev/sbus/cs4231_sbus.c		done
 dev/sbus/dbri.c			done
 dev/tc/bba.c			done



CVS commit: [jmcneill-audiomp3] src/sys/arch/amiga/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 12:41:59 UTC 2011

Modified Files:
src/sys/arch/amiga/dev [jmcneill-audiomp3]: aucc.c toccata.c

Log Message:
port these to audiomp:  support get_locks, and take the intr_lock
in the interrupt handler.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.104.1 src/sys/arch/amiga/dev/aucc.c
cvs rdiff -u -r1.14 -r1.14.4.1 src/sys/arch/amiga/dev/toccata.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/amiga/dev/aucc.c
diff -u src/sys/arch/amiga/dev/aucc.c:1.40 src/sys/arch/amiga/dev/aucc.c:1.40.104.1
--- src/sys/arch/amiga/dev/aucc.c:1.40	Wed Mar  8 23:46:22 2006
+++ src/sys/arch/amiga/dev/aucc.c	Sun Nov 20 12:41:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: aucc.c,v 1.40 2006/03/08 23:46:22 lukem Exp $ */
+/*	$NetBSD: aucc.c,v 1.40.104.1 2011/11/20 12:41:59 mrg Exp $ */
 
 /*
  * Copyright (c) 1999 Bernardo Innocenti
@@ -53,7 +53,7 @@
 #if NAUCC  0
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aucc.c,v 1.40 2006/03/08 23:46:22 lukem Exp $);
+__KERNEL_RCSID(0, $NetBSD: aucc.c,v 1.40.104.1 2011/11/20 12:41:59 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -91,12 +91,6 @@ int auccdebug = 1;
 #define DPRINTF(x)
 #endif
 
-#ifdef splaudio
-#undef splaudio
-#endif
-
-#define splaudio() spl4();
-
 /* clock frequency.. */
 extern int eclockfreq;
 
@@ -122,6 +116,9 @@ struct aucc_softc {
 	int	sc_channelmask;		/* which channels are used ? */
 	void (*sc_decodefunc)(u_char **, u_char *, int);
 /* pointer to format conversion routine */
+
+	kmutex_t sc_lock;
+	kmutex_t sc_intr_lock;
 };
 
 /* interrupt interfaces */
@@ -205,6 +202,7 @@ void	aucc_encode(int, int, int, int, u_c
 int	aucc_set_params(void *, int, int, audio_params_t *, audio_params_t *,
 			stream_filter_list_t *, stream_filter_list_t *);
 int	aucc_get_props(void *);
+void	aucc_get_locks(void *, kmutex_t **, kmutex_t **);
 
 
 static void aucc_decode_slinear8_1ch(u_char **, u_char *, int);
@@ -262,6 +260,8 @@ const struct audio_hw_if sa_hw_if = {
 	NULL,
 	NULL,
 	NULL,
+	NULL,
+	aucc_get_locks,
 };
 
 /* autoconfig routines */
@@ -343,6 +343,9 @@ init_aucc(struct aucc_softc *sc)
 	custom.intena = AUCC_ALLINTF;
 	custom.dmacon = AUCC_ALLDMAF;
 
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+
 	return err;
 }
 
@@ -907,6 +910,16 @@ aucc_get_props(void *addr)
 	return 0;
 }
 
+
+void
+aucc_get_locks(void *opaque, kmutex_t **intr, kmutex_t **thread)
+{
+	struct aucc_softc *sc = opaque;
+
+	*intr = sc-sc_intr_lock;
+	*thread = sc-sc_lock;
+}
+
 int
 aucc_query_devinfo(void *addr, register mixer_devinfo_t *dip)
 {
@@ -958,6 +971,7 @@ aucc_inthdl(int ch)
 	int i;
 	int mask;
 
+	mutex_spin_enter(aucc-sc_intr_lock);
 	mask = aucc-sc_channel[ch].nd_mask;
 	/*
 	 * for all channels in this maskgroup:
@@ -991,6 +1005,7 @@ aucc_inthdl(int ch)
 		(aucc-sc_channel[ch].nd_intrdata);
 	} else
 		DPRINTF((zero int handler\n));
+	mutex_spin_exit(aucc-sc_intr_lock);
 	DPRINTF((ints done\n));
 }
 

Index: src/sys/arch/amiga/dev/toccata.c
diff -u src/sys/arch/amiga/dev/toccata.c:1.14 src/sys/arch/amiga/dev/toccata.c:1.14.4.1
--- src/sys/arch/amiga/dev/toccata.c:1.14	Tue Jul 19 15:55:27 2011
+++ src/sys/arch/amiga/dev/toccata.c	Sun Nov 20 12:41:59 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: toccata.c,v 1.14 2011/07/19 15:55:27 dyoung Exp $ */
+/* $NetBSD: toccata.c,v 1.14.4.1 2011/11/20 12:41:59 mrg Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: toccata.c,v 1.14 2011/07/19 15:55:27 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: toccata.c,v 1.14.4.1 2011/11/20 12:41:59 mrg Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -174,6 +174,8 @@ int toccata_set_port(void *, mixer_ctrl_
 int toccata_get_port(void *, mixer_ctrl_t *);
 int toccata_query_devinfo(void *, mixer_devinfo_t *);
 
+void toccata_get_locks(void *, kmutex_t **, kmutex_t **);
+
 const struct audio_hw_if audiocs_hw_if = {
 	toccata_open,
 	toccata_close,
@@ -205,6 +207,9 @@ const struct audio_hw_if audiocs_hw_if =
 	toccata_get_props,
 	0,	/* trigger_output */
 	0,
+	0,
+	0,
+	toccata_get_locks,
 };
 
 struct toccata_softc {
@@ -219,6 +224,9 @@ struct toccata_softc {
 
 	void			(*sc_playmore)(void *);
 	void			 *sc_playarg;
+
+	kmutex_t		sc_lock;
+	kmutex_t		sc_intr_lock;
 };
 
 int toccata_match(device_t, cfdata_t, void *);
@@ -275,6 +283,9 @@ toccata_attach(device_t parent, device_t
 	sc-sc_captbuf = 0;
 	sc-sc_playmore = 0;
 
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+
 	sc-sc_isr.isr_ipl = 6;
 	sc-sc_isr.isr_arg = sc;
 	sc-sc_isr.isr_intr = toccata_intr;
@@ -294,14 +305,20 @@ toccata_intr(void *tag) {
 	int i;
 
 	sc = tag;
+
+	mutex_spin_enter(sc-sc_intr_lock);
+
 	status 

CVS commit: [netbsd-4-0] src/dist/bind

2011-11-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 20 13:02:17 UTC 2011

Modified Files:
src/dist/bind [netbsd-4-0]: CHANGES
src/dist/bind/bin/named [netbsd-4-0]: query.c
src/dist/bind/bin/nsupdate [netbsd-4-0]: nsupdate.8
src/dist/bind/lib/dns [netbsd-4-0]: master.c rbtdb.c
src/dist/bind/lib/isc/nothreads [netbsd-4-0]: condition.c mutex.c
src/dist/bind/lib/isc/unix [netbsd-4-0]: time.c
src/dist/bind/lib/lwres/include/lwres [netbsd-4-0]: lwres.h

Log Message:
Apply patch, requested by christos in ticket #1437:
src/dist/bind/CHANGES
src/dist/bind/bin/named/query.c
src/dist/bind/bin/nsupdate/nsupdate.8
src/dist/bind/lib/dns/master.c
src/dist/bind/lib/dns/rbtdb.c
src/dist/bind/lib/isc/nothreads/condition.c
src/dist/bind/lib/isc/nothreads/mutex.c
src/dist/bind/lib/isc/unix/time.c
src/dist/bind/lib/lwres/include/lwres/lwres.h
Cache lookup could return RRSIG data associated with nonexistent
records, leading to an assertion failure.  Fixes CVE-2011-4313.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4.4.2.2.5 -r1.1.1.4.4.2.2.6 src/dist/bind/CHANGES
cvs rdiff -u -r1.3.2.1.2.3 -r1.3.2.1.2.4 src/dist/bind/bin/named/query.c
cvs rdiff -u -r1.1.1.3.4.1.2.2 -r1.1.1.3.4.1.2.3 \
src/dist/bind/bin/nsupdate/nsupdate.8
cvs rdiff -u -r1.1.1.4.4.1.2.2 -r1.1.1.4.4.1.2.3 \
src/dist/bind/lib/dns/master.c
cvs rdiff -u -r1.1.1.4.4.1.2.4 -r1.1.1.4.4.1.2.5 \
src/dist/bind/lib/dns/rbtdb.c
cvs rdiff -u -r1.1.1.3.4.1 -r1.1.1.3.4.1.2.1 \
src/dist/bind/lib/isc/nothreads/condition.c \
src/dist/bind/lib/isc/nothreads/mutex.c
cvs rdiff -u -r1.1.1.3.4.1.2.1 -r1.1.1.3.4.1.2.2 \
src/dist/bind/lib/isc/unix/time.c
cvs rdiff -u -r1.1.1.3.4.1 -r1.1.1.3.4.1.2.1 \
src/dist/bind/lib/lwres/include/lwres/lwres.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/bind/CHANGES
diff -u src/dist/bind/CHANGES:1.1.1.4.4.2.2.5 src/dist/bind/CHANGES:1.1.1.4.4.2.2.6
--- src/dist/bind/CHANGES:1.1.1.4.4.2.2.5	Sat Jun 18 10:38:27 2011
+++ src/dist/bind/CHANGES	Sun Nov 20 13:02:15 2011
@@ -1,3 +1,7 @@
+3218.   [security]  Cache lookup could return RRSIG data associated with
+nonexistent records, leading to an assertion
+failure. [RT #26590]
+
 	--- 9.4-ESV-R4-P1 released ---
 
 3121.   [security]  An authoritative name server sending a negative

Index: src/dist/bind/bin/named/query.c
diff -u src/dist/bind/bin/named/query.c:1.3.2.1.2.3 src/dist/bind/bin/named/query.c:1.3.2.1.2.4
--- src/dist/bind/bin/named/query.c:1.3.2.1.2.3	Sun Jan 23 21:51:24 2011
+++ src/dist/bind/bin/named/query.c	Sun Nov 20 13:02:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: query.c,v 1.3.2.1.2.3 2011/01/23 21:51:24 bouyer Exp $	*/
+/*	$NetBSD: query.c,v 1.3.2.1.2.4 2011/11/20 13:02:15 bouyer Exp $	*/
 
 /*
  * Copyright (C) 2004-2010  Internet Systems Consortium, Inc. (ISC)
@@ -1253,11 +1253,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			/*
-			 * Negative cache entries don't have sigrdatasets.
-			 */
-			INSIST(sigrdataset == NULL ||
-			   ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL 
+			dns_rdataset_isassociated(sigrdataset))
+dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1298,8 +1296,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			INSIST(sigrdataset == NULL ||
-			   ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL 
+			dns_rdataset_isassociated(sigrdataset))
+dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1748,10 +1747,8 @@ query_addadditional2(void *arg, dns_name
 		goto setcache;
 	if (result == DNS_R_NCACHENXRRSET) {
 		dns_rdataset_disassociate(rdataset);
-		/*
-		 * Negative cache entries don't have sigrdatasets.
-		 */
-		INSIST(! dns_rdataset_isassociated(sigrdataset));
+		if (dns_rdataset_isassociated(sigrdataset))
+			dns_rdataset_disassociate(sigrdataset);
 	}
 	if (result == ISC_R_SUCCESS) {
 		/* Remember the result as a cache */

Index: src/dist/bind/bin/nsupdate/nsupdate.8
diff -u src/dist/bind/bin/nsupdate/nsupdate.8:1.1.1.3.4.1.2.2 src/dist/bind/bin/nsupdate/nsupdate.8:1.1.1.3.4.1.2.3
--- src/dist/bind/bin/nsupdate/nsupdate.8:1.1.1.3.4.1.2.2	Sun Jan 23 21:51:27 2011
+++ src/dist/bind/bin/nsupdate/nsupdate.8	Sun Nov 20 13:02:16 2011
@@ -1,2 +1,443 @@
-.\	$NetBSD: nsupdate.8,v 1.1.1.3.4.1.2.2 2011/01/23 21:51:27 bouyer Exp $
+.\	$NetBSD: nsupdate.8,v 1.1.1.3.4.1.2.3 2011/11/20 13:02:16 bouyer Exp $
 .\
+.\ Copyright (C) 2004-2010 Internet Systems Consortium, Inc. (ISC)
+.\ 

CVS commit: [netbsd-4] src/dist/bind

2011-11-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 20 13:02:27 UTC 2011

Modified Files:
src/dist/bind [netbsd-4]: CHANGES
src/dist/bind/bin/named [netbsd-4]: query.c
src/dist/bind/bin/nsupdate [netbsd-4]: nsupdate.8
src/dist/bind/lib/dns [netbsd-4]: master.c rbtdb.c
src/dist/bind/lib/isc/nothreads [netbsd-4]: condition.c mutex.c
src/dist/bind/lib/isc/unix [netbsd-4]: time.c
src/dist/bind/lib/lwres/include/lwres [netbsd-4]: lwres.h

Log Message:
Apply patch, requested by christos in ticket #1437:
src/dist/bind/CHANGES
src/dist/bind/bin/named/query.c
src/dist/bind/bin/nsupdate/nsupdate.8
src/dist/bind/lib/dns/master.c
src/dist/bind/lib/dns/rbtdb.c
src/dist/bind/lib/isc/nothreads/condition.c
src/dist/bind/lib/isc/nothreads/mutex.c
src/dist/bind/lib/isc/unix/time.c
src/dist/bind/lib/lwres/include/lwres/lwres.h
Cache lookup could return RRSIG data associated with nonexistent
records, leading to an assertion failure.  Fixes CVE-2011-4313.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4.4.7 -r1.1.1.4.4.8 src/dist/bind/CHANGES
cvs rdiff -u -r1.3.2.4 -r1.3.2.5 src/dist/bind/bin/named/query.c
cvs rdiff -u -r1.1.1.3.4.3 -r1.1.1.3.4.4 \
src/dist/bind/bin/nsupdate/nsupdate.8
cvs rdiff -u -r1.1.1.4.4.3 -r1.1.1.4.4.4 src/dist/bind/lib/dns/master.c
cvs rdiff -u -r1.1.1.4.4.5 -r1.1.1.4.4.6 src/dist/bind/lib/dns/rbtdb.c
cvs rdiff -u -r1.1.1.3.4.1 -r1.1.1.3.4.2 \
src/dist/bind/lib/isc/nothreads/condition.c \
src/dist/bind/lib/isc/nothreads/mutex.c
cvs rdiff -u -r1.1.1.3.4.2 -r1.1.1.3.4.3 src/dist/bind/lib/isc/unix/time.c
cvs rdiff -u -r1.1.1.3.4.1 -r1.1.1.3.4.2 \
src/dist/bind/lib/lwres/include/lwres/lwres.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/bind/CHANGES
diff -u src/dist/bind/CHANGES:1.1.1.4.4.7 src/dist/bind/CHANGES:1.1.1.4.4.8
--- src/dist/bind/CHANGES:1.1.1.4.4.7	Sat Jun 18 10:36:30 2011
+++ src/dist/bind/CHANGES	Sun Nov 20 13:02:25 2011
@@ -1,3 +1,7 @@
+3218.   [security]  Cache lookup could return RRSIG data associated with
+nonexistent records, leading to an assertion
+failure. [RT #26590]
+
 	--- 9.4-ESV-R4-P1 released ---
 
 3121.   [security]  An authoritative name server sending a negative

Index: src/dist/bind/bin/named/query.c
diff -u src/dist/bind/bin/named/query.c:1.3.2.4 src/dist/bind/bin/named/query.c:1.3.2.5
--- src/dist/bind/bin/named/query.c:1.3.2.4	Sun Jan 23 21:47:10 2011
+++ src/dist/bind/bin/named/query.c	Sun Nov 20 13:02:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: query.c,v 1.3.2.4 2011/01/23 21:47:10 bouyer Exp $	*/
+/*	$NetBSD: query.c,v 1.3.2.5 2011/11/20 13:02:26 bouyer Exp $	*/
 
 /*
  * Copyright (C) 2004-2010  Internet Systems Consortium, Inc. (ISC)
@@ -1253,11 +1253,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			/*
-			 * Negative cache entries don't have sigrdatasets.
-			 */
-			INSIST(sigrdataset == NULL ||
-			   ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL 
+			dns_rdataset_isassociated(sigrdataset))
+dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1298,8 +1296,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			INSIST(sigrdataset == NULL ||
-			   ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL 
+			dns_rdataset_isassociated(sigrdataset))
+dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1748,10 +1747,8 @@ query_addadditional2(void *arg, dns_name
 		goto setcache;
 	if (result == DNS_R_NCACHENXRRSET) {
 		dns_rdataset_disassociate(rdataset);
-		/*
-		 * Negative cache entries don't have sigrdatasets.
-		 */
-		INSIST(! dns_rdataset_isassociated(sigrdataset));
+		if (dns_rdataset_isassociated(sigrdataset))
+			dns_rdataset_disassociate(sigrdataset);
 	}
 	if (result == ISC_R_SUCCESS) {
 		/* Remember the result as a cache */

Index: src/dist/bind/bin/nsupdate/nsupdate.8
diff -u src/dist/bind/bin/nsupdate/nsupdate.8:1.1.1.3.4.3 src/dist/bind/bin/nsupdate/nsupdate.8:1.1.1.3.4.4
--- src/dist/bind/bin/nsupdate/nsupdate.8:1.1.1.3.4.3	Sun Jan 23 21:47:11 2011
+++ src/dist/bind/bin/nsupdate/nsupdate.8	Sun Nov 20 13:02:26 2011
@@ -1,2 +1,443 @@
-.\	$NetBSD: nsupdate.8,v 1.1.1.3.4.3 2011/01/23 21:47:11 bouyer Exp $
+.\	$NetBSD: nsupdate.8,v 1.1.1.3.4.4 2011/11/20 13:02:26 bouyer Exp $
 .\
+.\ Copyright (C) 2004-2010 Internet Systems Consortium, Inc. (ISC)
+.\ Copyright (C) 2000-2003 Internet Software Consortium.
+.\ 
+.\ Permission to use, copy, modify, and/or distribute this software for any
+.\ 

CVS commit: [netbsd-4-0] src/doc

2011-11-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 20 13:04:55 UTC 2011

Modified Files:
src/doc [netbsd-4-0]: CHANGES-4.0.2

Log Message:
Ticket 1437


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.91 -r1.1.2.92 src/doc/CHANGES-4.0.2

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-4.0.2
diff -u src/doc/CHANGES-4.0.2:1.1.2.91 src/doc/CHANGES-4.0.2:1.1.2.92
--- src/doc/CHANGES-4.0.2:1.1.2.91	Sat Nov 19 14:40:08 2011
+++ src/doc/CHANGES-4.0.2	Sun Nov 20 13:04:55 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.0.2,v 1.1.2.91 2011/11/19 14:40:08 bouyer Exp $
+#	$NetBSD: CHANGES-4.0.2,v 1.1.2.92 2011/11/20 13:04:55 bouyer Exp $
 
 A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2
 release:
@@ -1299,3 +1299,17 @@ dist/openpam/lib/openpam_configure.c		1.
 	(CVE-2011-4122)
 	[drochner, ticket #1439]
 
+src/dist/bind/CHANGES		patch
+src/dist/bind/bin/named/query.c	patch
+src/dist/bind/bin/nsupdate/nsupdate.8patch
+src/dist/bind/lib/dns/master.c	patch
+src/dist/bind/lib/dns/rbtdb.c	patch
+src/dist/bind/lib/isc/nothreads/condition.c			patch
+src/dist/bind/lib/isc/nothreads/mutex.cpatch
+src/dist/bind/lib/isc/unix/time.cpatch
+src/dist/bind/lib/lwres/include/lwres/lwres.h			patch
+
+	Cache lookup could return RRSIG data associated with nonexistent
+	records, leading to an assertion failure.  Fixes CVE-2011-4313.
+	[christos, ticket #1437]
+



CVS commit: [netbsd-4] src/doc

2011-11-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 20 13:05:03 UTC 2011

Modified Files:
src/doc [netbsd-4]: CHANGES-4.1

Log Message:
Ticket 1437


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.230 -r1.1.2.231 src/doc/CHANGES-4.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-4.1
diff -u src/doc/CHANGES-4.1:1.1.2.230 src/doc/CHANGES-4.1:1.1.2.231
--- src/doc/CHANGES-4.1:1.1.2.230	Sat Nov 19 14:40:07 2011
+++ src/doc/CHANGES-4.1	Sun Nov 20 13:05:03 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.1,v 1.1.2.230 2011/11/19 14:40:07 bouyer Exp $
+#	$NetBSD: CHANGES-4.1,v 1.1.2.231 2011/11/20 13:05:03 bouyer Exp $
 
 A complete list of changes from the NetBSD 4.0 release to the NetBSD 4.1
 release:
@@ -4560,3 +4560,17 @@ dist/openpam/lib/openpam_configure.c		1.
 	(CVE-2011-4122)
 	[drochner, ticket #1439]
 
+src/dist/bind/CHANGES   patch  
+src/dist/bind/bin/named/query.c patch
+src/dist/bind/bin/nsupdate/nsupdate.8   patch
+src/dist/bind/lib/dns/master.c  patch
+src/dist/bind/lib/dns/rbtdb.c   patch
+src/dist/bind/lib/isc/nothreads/condition.c patch
+src/dist/bind/lib/isc/nothreads/mutex.c patch
+src/dist/bind/lib/isc/unix/time.c   patch
+src/dist/bind/lib/lwres/include/lwres/lwres.h   patch
+
+	Cache lookup could return RRSIG data associated with nonexistent
+	records, leading to an assertion failure.  Fixes CVE-2011-4313.
+	[christos, ticket #1437]
+



CVS commit: [jmcneill-audiomp3] src/sys/arch/arm/xscale

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 13:13:43 UTC 2011

Modified Files:
src/sys/arch/arm/xscale [jmcneill-audiomp3]: pxa2x0_ac97.c

Log Message:
port to audiomp: alloc/free changes, get_locks support, no more IPL_AUDIO,
convert splaudio() - sc_intr_lock usage, take sc_intr_lock in acu_intr().


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/arch/arm/xscale/pxa2x0_ac97.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_ac97.c
diff -u src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.9 src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.9.4.1
--- src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.9	Fri Jul  1 20:32:51 2011
+++ src/sys/arch/arm/xscale/pxa2x0_ac97.c	Sun Nov 20 13:13:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_ac97.c,v 1.9 2011/07/01 20:32:51 dyoung Exp $	*/
+/*	$NetBSD: pxa2x0_ac97.c,v 1.9.4.1 2011/11/20 13:13:43 mrg Exp $	*/
 
 /*
  * Copyright (c) 2003, 2005 Wasabi Systems, Inc.
@@ -42,6 +42,7 @@
 #include sys/malloc.h
 #include sys/select.h
 #include sys/audioio.h
+#include sys/kmem.h
 
 #include machine/intr.h
 #include sys/bus.h
@@ -111,6 +112,10 @@ struct acu_softc {
 
 	/* auconv encodings */
 	struct audio_encoding_set *sc_encodings;
+
+	/* MPSAFE interfaces */
+	kmutex_t sc_lock;
+	kmutex_t sc_intr_lock;
 };
 
 static int	pxaacu_match(device_t, cfdata_t, void *);
@@ -143,11 +148,12 @@ static int acu_getdev(void *, struct aud
 static int acu_mixer_set_port(void *, mixer_ctrl_t *);
 static int acu_mixer_get_port(void *, mixer_ctrl_t *);
 static int acu_query_devinfo(void *, mixer_devinfo_t *);
-static void *acu_malloc(void *, int, size_t, struct malloc_type *, int);
-static void acu_free(void *, void *, struct malloc_type *);
+static void *acu_malloc(void *, int, size_t);
+static void acu_free(void *, void *, size_t);
 static size_t acu_round_buffersize(void *, int, size_t);
 static paddr_t acu_mappage(void *, void *, off_t, int);
 static int acu_get_props(void *);
+static void acu_get_locks(void *, kmutex_t **, kmutex_t **);
 
 struct audio_hw_if acu_hw_if = {
 	acu_open,
@@ -177,6 +183,8 @@ struct audio_hw_if acu_hw_if = {
 	acu_trigger_output,
 	acu_trigger_input,
 	NULL,
+	NULL,
+	acu_get_locks,
 };
 
 struct audio_device acu_device = {
@@ -274,7 +282,7 @@ pxaacu_attach(device_t parent, device_t 
 		return;
 	}
 
-	sc-sc_irqcookie = pxa2x0_intr_establish(pxa-pxa_intr, IPL_AUDIO,
+	sc-sc_irqcookie = pxa2x0_intr_establish(pxa-pxa_intr, IPL_SCHED,
 	acu_intr, sc);
 	KASSERT(sc-sc_irqcookie != NULL);
 
@@ -311,7 +319,7 @@ pxaacu_attach(device_t parent, device_t 
 	sc-sc_in_reset = 0;
 	sc-sc_dac_rate = sc-sc_adc_rate = 0;
 
-	if (ac97_attach(sc-sc_host_if, sc-sc_dev)) {
+	if (ac97_attach(sc-sc_host_if, sc-sc_dev, sc-sc_lock)) {
 		aprint_error_dev(self, Failed to attach primary codec\n);
  fail:
 		acu_reg_write(sc, AC97_GCR, 0);
@@ -359,7 +367,7 @@ acu_codec_read(void *arg, u_int8_t codec
 {
 	struct acu_softc *sc = arg;
 	u_int32_t val;
-	int s, reg, rv = 1;
+	int reg, rv = 1;
 
 	/*
 	 * If we're currently closed, return non-zero. The ac97 frontend
@@ -370,7 +378,7 @@ acu_codec_read(void *arg, u_int8_t codec
 
 	reg = AC97_CODEC_BASE(0) + codec_reg * 2;
 
-	s = splaudio();
+	mutex_spin_enter(sc-sc_intr_lock);
 
 	if (!acu_codec_ready(sc) || (acu_reg_read(sc, AC97_CAR)  CAR_CAIP))
 		goto out_nocar;
@@ -403,7 +411,7 @@ acu_codec_read(void *arg, u_int8_t codec
 out:
 	acu_reg_write(sc, AC97_CAR, 0);
 out_nocar:
-	splx(s);
+	mutex_spin_exit(sc-sc_intr_lock);
 	delay(10);
 	return (rv);
 }
@@ -413,7 +421,6 @@ acu_codec_write(void *arg, u_int8_t code
 {
 	struct acu_softc *sc = arg;
 	u_int16_t rv;
-	int s;
 
 	/*
 	 * If we're currently closed, chances are the user is just
@@ -424,10 +431,10 @@ acu_codec_write(void *arg, u_int8_t code
 	if (sc-sc_in_reset)
 		return (0);
 
-	s = splaudio();
+	mutex_spin_enter(sc-sc_intr_lock);
 
 	if (!acu_codec_ready(sc) || (acu_reg_read(sc, AC97_CAR)  CAR_CAIP)) {
-		splx(s);
+		mutex_spin_exit(sc-sc_intr_lock);
 		return (1);
 	}
 
@@ -443,7 +450,7 @@ acu_codec_write(void *arg, u_int8_t code
 	(void) acu_wait_gsr(sc, GSR_CDONE);
 	acu_reg_write(sc, AC97_CAR, 0);
 
-	splx(s);
+	mutex_spin_exit(sc-sc_intr_lock);
 	delay(10);
 	return (0);
 }
@@ -475,6 +482,7 @@ acu_intr(void *arg)
 	struct acu_softc *sc = arg;
 	u_int32_t gsr, reg;
 
+	mutex_spin_enter(sc-sc_intr_lock);
 	gsr = acu_reg_read(sc, AC97_GSR);
 
 	/*
@@ -503,6 +511,8 @@ acu_intr(void *arg)
 		aprint_error_dev(sc-sc_dev, Rx PCM Fifo overrun\n);
 	}
 
+	mutex_spin_exit(sc-sc_intr_lock);
+
 	return (1);
 }
 
@@ -659,16 +669,16 @@ acu_query_devinfo(void *arg, mixer_devin
 }
 
 static void *
-acu_malloc(void *arg, int direction, size_t size,
-struct malloc_type *pool, int flags)
+acu_malloc(void *arg, int direction, size_t size)
 {
 	struct acu_softc *sc = arg;
 	struct acu_dma *ad;
 	int error;
 
-	if ((ad = malloc(sizeof(*ad), pool, 

CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 13:14:33 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
note pxa2x0_ac97 now compiles and should be done


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.7 src/sys/dev/TODO.audiomp:1.1.2.8
--- src/sys/dev/TODO.audiomp:1.1.2.7	Sun Nov 20 12:59:31 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 13:14:33 2011
@@ -4,7 +4,7 @@ arch/amiga/dev/aucc.c		done
 arch/amiga/dev/repulse.c	done
 arch/amiga/dev/toccata.c	done
 arch/arm/iomd/vidcaudio.c	done
-arcm/arm/xscale/pxa2x0_ac97.c
+arcm/arm/xscale/pxa2x0_ac97.c	done
 arch/dreamcast/dev/g2/aica.c
 arch/hp700/gsc/harmony.c
 arch/hpcmips/vr/vraiu.c



CVS commit: [jmcneill-audiomp3] src/sys/arch/zaurus/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 13:30:46 UTC 2011

Modified Files:
src/sys/arch/zaurus/dev [jmcneill-audiomp3]: zaudio.c

Log Message:
adapt to audiomp api changes


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.4.1 src/sys/arch/zaurus/dev/zaudio.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/zaurus/dev/zaudio.c
diff -u src/sys/arch/zaurus/dev/zaudio.c:1.15 src/sys/arch/zaurus/dev/zaudio.c:1.15.4.1
--- src/sys/arch/zaurus/dev/zaudio.c:1.15	Thu Jun 23 10:56:03 2011
+++ src/sys/arch/zaurus/dev/zaudio.c	Sun Nov 20 13:30:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: zaudio.c,v 1.15 2011/06/23 10:56:03 nonaka Exp $	*/
+/*	$NetBSD: zaudio.c,v 1.15.4.1 2011/11/20 13:30:46 jmcneill Exp $	*/
 /*	$OpenBSD: zaurus_audio.c,v 1.8 2005/08/18 13:23:02 robert Exp $	*/
 
 /*
@@ -51,13 +51,13 @@
 #include opt_zaudio.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: zaudio.c,v 1.15 2011/06/23 10:56:03 nonaka Exp $);
+__KERNEL_RCSID(0, $NetBSD: zaudio.c,v 1.15.4.1 2011/11/20 13:30:46 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
 #include sys/callout.h
 #include sys/device.h
-#include sys/malloc.h
+#include sys/kmem.h
 #include sys/kernel.h
 #include sys/audioio.h
 #include sys/mutex.h
@@ -104,6 +104,8 @@ struct zaudio_volume {
 
 struct zaudio_softc {
 	device_t		sc_dev;
+	kmutex_t		sc_lock;
+	kmutex_t		sc_intr_lock;
 
 	/* i2s device softc */
 	/* NB: pxa2x0_i2s requires this to be the second struct member */
@@ -218,6 +220,7 @@ static void zaudio_freem(void  *, void *
 static size_t zaudio_round_buffersize(void *, int, size_t);
 static paddr_t zaudio_mappage(void *, void *, off_t, int);
 static int zaudio_get_props(void *);
+static void zaudio_get_locks(void *, kmutex_t **, kmutex_t **);
 
 struct audio_hw_if wm8750_hw_if = {
 	.open			= zaudio_open,
@@ -248,6 +251,7 @@ struct audio_hw_if wm8750_hw_if = {
 	.trigger_input		= NULL,
 	.dev_ioctl		= NULL,
 	.powerstate		= NULL,
+	.get_locks		= zaudio_get_locks,
 };
 
 static const uint16_t playback_regs[][2] = {
@@ -338,6 +342,8 @@ zaudio_attach(device_t parent, device_t 
 
 	sc-sc_dev = self;
 	sc-sc_i2c = ia-ia_tag;
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
 
 	aprint_normal(: I2S, WM8750 Audio\n);
 	aprint_naive(\n);
@@ -888,7 +894,9 @@ zaudio_halt_output(void *hdl)
 	struct zaudio_softc *sc = hdl;
 	int rv;
 
+	mutex_spin_enter(sc-sc_intr_lock);
 	rv = pxa2x0_i2s_halt_output(sc-sc_i2s);
+	mutex_spin_exit(sc-sc_intr_lock);
 	if (!sc-sc_recording)
 		zaudio_standby(sc);
 	sc-sc_playing = 0;
@@ -902,7 +910,9 @@ zaudio_halt_input(void *hdl)
 	struct zaudio_softc *sc = hdl;
 	int rv;
 
+	mutex_spin_enter(sc-sc_intr_lock);
 	rv = pxa2x0_i2s_halt_input(sc-sc_i2s);
+	mutex_spin_exit(sc-sc_intr_lock);
 	if (!sc-sc_playing)
 		zaudio_standby(sc);
 	sc-sc_recording = 0;
@@ -1270,12 +1280,16 @@ zaudio_start_output(void *hdl, void *blo
 	}
 
 	/* Start DMA via I2S */
+	mutex_spin_enter(sc-sc_intr_lock);
 	rv = pxa2x0_i2s_start_output(sc-sc_i2s, block, bsize, intr, intrarg);
+	mutex_spin_exit(sc-sc_intr_lock);
+
 	if (rv) {
 		if (!sc-sc_recording)
 			zaudio_standby(sc);
 		sc-sc_playing = 0;
 	}
+
 	return rv;
 }
 
@@ -1293,7 +1307,10 @@ zaudio_start_input(void *hdl, void *bloc
 	}
 
 	/* Start DMA via I2S */
+	mutex_spin_enter(sc-sc_intr_lock);
 	rv = pxa2x0_i2s_start_input(sc-sc_i2s, block, bsize, intr, intrarg);
+	mutex_spin_exit(sc-sc_intr_lock);
+
 	if (rv) {
 		if (!sc-sc_playing)
 			zaudio_standby(sc);
@@ -1301,3 +1318,12 @@ zaudio_start_input(void *hdl, void *bloc
 	}
 	return rv;
 }
+
+static void
+zaudio_get_locks(void *hdl, kmutex_t **intr, kmutex_t **thread)
+{
+	struct zaudio_softc *sc = hdl;
+
+	*intr = sc-sc_intr_lock;
+	*thread = sc-sc_lock;
+}



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 13:31:19 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
zaudio is done


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.8 src/sys/dev/TODO.audiomp:1.1.2.9
--- src/sys/dev/TODO.audiomp:1.1.2.8	Sun Nov 20 13:14:33 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 13:31:19 2011
@@ -15,7 +15,7 @@ arch/sgimips/hpc/haltwo.c	done
 arch/sgimips/mace/mavb.c	done
 arch/sparc/dev/audioamd.c	done
 arch/x68k/dev/vs.c
-arch/zaurus/dev/zaudio.c
+arch/zaurus/dev/zaudio.c	done
 dev/bluetooth/btsco.c		done
 dev/ebus/cs4231_ebus.c		done
 dev/ic/interwave.c		done



CVS commit: [jmcneill-audiomp3] src/sys/arch

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 13:47:07 UTC 2011

Modified Files:
src/sys/arch/arm/xscale [jmcneill-audiomp3]: pxa2x0_ac97.c
pxa2x0_dmac.c pxa2x0_dmac.h pxa2x0_i2s.c pxa2x0_i2s.h pxa2x0_mci.c
src/sys/arch/zaurus/dev [jmcneill-audiomp3]: zaudio.c

Log Message:
port zaudio to audiomp api changes for real this time


To generate a diff of this commit:
cvs rdiff -u -r1.9.4.1 -r1.9.4.2 src/sys/arch/arm/xscale/pxa2x0_ac97.c
cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/arch/arm/xscale/pxa2x0_dmac.c
cvs rdiff -u -r1.3 -r1.3.84.1 src/sys/arch/arm/xscale/pxa2x0_dmac.h
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/arch/arm/xscale/pxa2x0_i2s.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/sys/arch/arm/xscale/pxa2x0_i2s.h
cvs rdiff -u -r1.8 -r1.8.6.1 src/sys/arch/arm/xscale/pxa2x0_mci.c
cvs rdiff -u -r1.15.4.1 -r1.15.4.2 src/sys/arch/zaurus/dev/zaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_ac97.c
diff -u src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.9.4.1 src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.9.4.2
--- src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.9.4.1	Sun Nov 20 13:13:43 2011
+++ src/sys/arch/arm/xscale/pxa2x0_ac97.c	Sun Nov 20 13:47:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_ac97.c,v 1.9.4.1 2011/11/20 13:13:43 mrg Exp $	*/
+/*	$NetBSD: pxa2x0_ac97.c,v 1.9.4.2 2011/11/20 13:47:07 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2003, 2005 Wasabi Systems, Inc.
@@ -679,28 +679,28 @@ acu_malloc(void *arg, int direction, siz
 		return (NULL);
 
 	/* XXX */
-	if ((ad-ad_dx = pxa2x0_dmac_allocate_xfer(M_NOWAIT)) == NULL)
+	if ((ad-ad_dx = pxa2x0_dmac_allocate_xfer()) == NULL)
 		goto error;
 
 	ad-ad_size = size;
 
 	error = bus_dmamem_alloc(sc-sc_dmat, size, 16, 0, ad-ad_segs,
-	ACU_N_SEGS, ad-ad_nsegs, BUS_DMA_NOWAIT);
+	ACU_N_SEGS, ad-ad_nsegs, BUS_DMA_WAITOK);
 	if (error)
 		goto free_xfer;
 
 	error = bus_dmamem_map(sc-sc_dmat, ad-ad_segs, ad-ad_nsegs, size,
-	ad-ad_addr, BUS_DMA_NOWAIT | BUS_DMA_COHERENT | BUS_DMA_NOCACHE);
+	ad-ad_addr, BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_NOCACHE);
 	if (error)
 		goto free_dmamem;
 
 	error = bus_dmamap_create(sc-sc_dmat, size, 1, size, 0,
-	BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, ad-ad_map);
+	BUS_DMA_WAITOK | BUS_DMA_ALLOCNOW, ad-ad_map);
 	if (error)
 		goto unmap_dmamem;
 
 	error = bus_dmamap_load(sc-sc_dmat, ad-ad_map, ad-ad_addr, size,
-	NULL, BUS_DMA_NOWAIT);
+	NULL, BUS_DMA_WAITOK);
 	if (error) {
 		bus_dmamap_destroy(sc-sc_dmat, ad-ad_map);
 unmap_dmamem:	bus_dmamem_unmap(sc-sc_dmat, ad-ad_addr, size);

Index: src/sys/arch/arm/xscale/pxa2x0_dmac.c
diff -u src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.8 src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.8.4.1
--- src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.8	Fri Jul  1 20:32:51 2011
+++ src/sys/arch/arm/xscale/pxa2x0_dmac.c	Sun Nov 20 13:47:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_dmac.c,v 1.8 2011/07/01 20:32:51 dyoung Exp $	*/
+/*	$NetBSD: pxa2x0_dmac.c,v 1.8.4.1 2011/11/20 13:47:07 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2003, 2005 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 #include sys/systm.h
 #include sys/device.h
 #include sys/kernel.h
-#include sys/malloc.h
+#include sys/kmem.h
 #include sys/queue.h
 
 #include uvm/uvm_param.h	/* For PAGE_SIZE */
@@ -741,11 +741,11 @@ dmac_dmover_done(struct dmac_xfer *dx, i
 #endif
 
 struct dmac_xfer *
-pxa2x0_dmac_allocate_xfer(int flags)
+pxa2x0_dmac_allocate_xfer(void)
 {
 	struct dmac_xfer_state *dxs;
 
-	dxs = malloc(sizeof(struct dmac_xfer_state), M_DEVBUF, flags);
+	dxs = kmem_alloc(sizeof(*dxs), KM_SLEEP);
 
 	return ((struct dmac_xfer *)dxs);
 }
@@ -753,12 +753,13 @@ pxa2x0_dmac_allocate_xfer(int flags)
 void
 pxa2x0_dmac_free_xfer(struct dmac_xfer *dx)
 {
+	struct dmac_xfer_state *dxs = (struct dmac_xfer_state *)dx;
 
 	/*
 	 * XXX: Should verify the DMAC is not actively using this
 	 * structure before freeing...
 	 */
-	free(dx, M_DEVBUF);
+	kmem_free(dxs, sizeof(*dxs));
 }
 
 static inline int

Index: src/sys/arch/arm/xscale/pxa2x0_dmac.h
diff -u src/sys/arch/arm/xscale/pxa2x0_dmac.h:1.3 src/sys/arch/arm/xscale/pxa2x0_dmac.h:1.3.84.1
--- src/sys/arch/arm/xscale/pxa2x0_dmac.h:1.3	Wed Feb 21 22:59:39 2007
+++ src/sys/arch/arm/xscale/pxa2x0_dmac.h	Sun Nov 20 13:47:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_dmac.h,v 1.3 2007/02/21 22:59:39 thorpej Exp $	*/
+/*	$NetBSD: pxa2x0_dmac.h,v 1.3.84.1 2011/11/20 13:47:07 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2003, 2005 Wasabi Systems, Inc.
@@ -147,7 +147,7 @@ struct dmac_xfer {
 #define DMAC_DESC_DST 1
 };
 
-extern struct dmac_xfer *pxa2x0_dmac_allocate_xfer(int);
+extern struct dmac_xfer *pxa2x0_dmac_allocate_xfer(void);
 extern void pxa2x0_dmac_free_xfer(struct dmac_xfer *);
 extern int pxa2x0_dmac_start_xfer(struct dmac_xfer *);
 extern void pxa2x0_dmac_abort_xfer(struct dmac_xfer *);

Index: src/sys/arch/arm/xscale/pxa2x0_i2s.c
diff -u 

CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 14:13:25 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
build.sh -m prep tools failed for me so mark paud_isa toolchain-fails


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.9 src/sys/dev/TODO.audiomp:1.1.2.10
--- src/sys/dev/TODO.audiomp:1.1.2.9	Sun Nov 20 13:31:19 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 14:13:25 2011
@@ -10,7 +10,7 @@ arch/hp700/gsc/harmony.c
 arch/hpcmips/vr/vraiu.c
 arch/macppc/dev/awacs.c
 arch/macppc/dev/snapper.c
-arch/prep/isa/paud_isa.c
+arch/prep/isa/paud_isa.c	toolchain-fails
 arch/sgimips/hpc/haltwo.c	done
 arch/sgimips/mace/mavb.c	done
 arch/sparc/dev/audioamd.c	done



CVS commit: [jmcneill-audiomp3] src/sys/arch/hpcmips/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 14:16:56 UTC 2011

Modified Files:
src/sys/arch/hpcmips/dev [jmcneill-audiomp3]: ucbsnd.c

Log Message:
splaudio - splvm


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.32.1 src/sys/arch/hpcmips/dev/ucbsnd.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/hpcmips/dev/ucbsnd.c
diff -u src/sys/arch/hpcmips/dev/ucbsnd.c:1.19 src/sys/arch/hpcmips/dev/ucbsnd.c:1.19.32.1
--- src/sys/arch/hpcmips/dev/ucbsnd.c:1.19	Thu Jun 12 16:50:53 2008
+++ src/sys/arch/hpcmips/dev/ucbsnd.c	Sun Nov 20 14:16:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucbsnd.c,v 1.19 2008/06/12 16:50:53 tsutsui Exp $ */
+/*	$NetBSD: ucbsnd.c,v 1.19.32.1 2011/11/20 14:16:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ucbsnd.c,v 1.19 2008/06/12 16:50:53 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: ucbsnd.c,v 1.19.32.1 2011/11/20 14:16:55 jmcneill Exp $);
 
 #include opt_use_poll.h
 
@@ -522,7 +522,7 @@ ucbsndopen(dev_t dev, int flags, int ifm
 	if (sc == NULL)
 		return (ENXIO);
 	
-	s = splaudio();
+	s = splvm();
 	ringbuf_reset(sc-sc_rb);
 	splx(s);
 
@@ -573,7 +573,7 @@ ucbsndwrite_subr(struct ucbsnd_softc *sc
 	
 	ringbuf_producer_return(sc-sc_rb, bufsize);
 
-	s = splaudio();
+	s = splvm();
 	if (sc-sa_state == UCBSND_IDLE  ringbuf_full(sc-sc_rb)) {
 		sc-sa_transfer_mode = UCBSND_TRANSFERMODE_DMA;
 		sc-sa_state = UCBSND_INIT;
@@ -630,7 +630,7 @@ ucbsndwrite(dev_t dev, struct uio *uio, 
 	return (error);
  errout:
 	printf(%s: timeout. reset ring-buffer.\n, sc-sc_dev.dv_xname);
-	s = splaudio();
+	s = splvm();
 	ringbuf_reset(sc-sc_rb);
 	splx(s);
 
@@ -705,7 +705,7 @@ ringbuf_producer_get(struct ring_buf *rb
 	u_int32_t ret;
 	int s;
 
-	s = splaudio();
+	s = splvm();
 	ret = ringbuf_full(rb) ? 0 : 
 	rb-rb_buf + rb-rb_inp * rb-rb_blksize;
 	splx(s);
@@ -720,7 +720,7 @@ ringbuf_producer_return(struct ring_buf 
 
 	assert(cnt = rb-rb_blksize);
 
-	s = splaudio();
+	s = splvm();
 	rb-rb_outp++;
 	
 	rb-rb_bufcnt[rb-rb_inp] = cnt;



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 14:27:09 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
vraiu is done


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.10 src/sys/dev/TODO.audiomp:1.1.2.11
--- src/sys/dev/TODO.audiomp:1.1.2.10	Sun Nov 20 14:13:25 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 14:27:09 2011
@@ -7,7 +7,7 @@ arch/arm/iomd/vidcaudio.c	done
 arcm/arm/xscale/pxa2x0_ac97.c	done
 arch/dreamcast/dev/g2/aica.c
 arch/hp700/gsc/harmony.c
-arch/hpcmips/vr/vraiu.c
+arch/hpcmips/vr/vraiu.c		done
 arch/macppc/dev/awacs.c
 arch/macppc/dev/snapper.c
 arch/prep/isa/paud_isa.c	toolchain-fails



CVS commit: [jmcneill-audiomp3] src/sys/arch/dreamcast/dev/g2

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 15:00:35 UTC 2011

Modified Files:
src/sys/arch/dreamcast/dev/g2 [jmcneill-audiomp3]: aica.c

Log Message:
adapt to audiomp api changes


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.4.1 src/sys/arch/dreamcast/dev/g2/aica.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/dreamcast/dev/g2/aica.c
diff -u src/sys/arch/dreamcast/dev/g2/aica.c:1.21 src/sys/arch/dreamcast/dev/g2/aica.c:1.21.4.1
--- src/sys/arch/dreamcast/dev/g2/aica.c:1.21	Tue Jul 19 15:52:29 2011
+++ src/sys/arch/dreamcast/dev/g2/aica.c	Sun Nov 20 15:00:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: aica.c,v 1.21 2011/07/19 15:52:29 dyoung Exp $	*/
+/*	$NetBSD: aica.c,v 1.21.4.1 2011/11/20 15:00:35 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2003 SHIMIZU Ryo r...@misakimix.org
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aica.c,v 1.21 2011/07/19 15:52:29 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: aica.c,v 1.21.4.1 2011/11/20 15:00:35 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -57,6 +57,8 @@ __KERNEL_RCSID(0, $NetBSD: aica.c,v 1.2
 
 struct aica_softc {
 	device_t		sc_dev;		/* base device */
+	kmutex_t		sc_lock;
+	kmutex_t		sc_intr_lock;
 	bus_space_tag_t		sc_memt;
 	bus_space_handle_t	sc_aica_regh;
 	bus_space_handle_t	sc_aica_memh;
@@ -160,6 +162,7 @@ int aica_get_port(void *, mixer_ctrl_t *
 int aica_query_devinfo(void *, mixer_devinfo_t *);
 void aica_encode(int, int, int, int, u_char *, u_short **);
 int aica_get_props(void *);
+void aica_get_locks(void *, kmutex_t **, kmutex_t **);
 
 const struct audio_hw_if aica_hw_if = {
 	aica_open,
@@ -191,6 +194,8 @@ const struct audio_hw_if aica_hw_if = {
 	aica_trigger_output,
 	aica_trigger_input,
 	NULL,/* aica_dev_ioctl */
+	NULL,/* aica_powerstate */
+	aica_get_locks,
 };
 
 int
@@ -217,6 +222,9 @@ aica_attach(device_t parent, device_t se
 	sc-sc_dev = self;
 	sc-sc_memt = ga-ga_memt;
 
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+
 	if (bus_space_map(sc-sc_memt, AICA_REG_ADDR, 0x3000, 0,
 	sc-sc_aica_regh) != 0) {
 		aprint_error(: can't map AICA register space\n);
@@ -597,6 +605,9 @@ aica_intr(void *arg)
 	struct aica_softc *sc;
 
 	sc = arg;
+
+	mutex_spin_enter(sc-sc_intr_lock);
+
 	aica_fillbuffer(sc);
 
 	/* call audio interrupt handler (audio_pint()) */
@@ -606,6 +617,9 @@ aica_intr(void *arg)
 
 	/* clear SPU interrupt */
 	bus_space_write_4(sc-sc_memt, sc-sc_aica_regh, 0x28bc, 0x20);
+
+	mutex_spin_exit(sc-sc_intr_lock);
+
 	return 1;
 }
 
@@ -763,3 +777,13 @@ aica_get_props(void *addr)
 
 	return 0;
 }
+
+void
+aica_get_locks(void *addr, kmutex_t **intr, kmutex_t **thread)
+{
+	struct aica_softc *sc;
+
+	sc = addr;
+	*intr = sc-sc_intr_lock;
+	*thread = sc-sc_lock;
+}



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 15:00:49 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
aica is done


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.11 src/sys/dev/TODO.audiomp:1.1.2.12
--- src/sys/dev/TODO.audiomp:1.1.2.11	Sun Nov 20 14:27:09 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 15:00:49 2011
@@ -5,7 +5,7 @@ arch/amiga/dev/repulse.c	done
 arch/amiga/dev/toccata.c	done
 arch/arm/iomd/vidcaudio.c	done
 arcm/arm/xscale/pxa2x0_ac97.c	done
-arch/dreamcast/dev/g2/aica.c
+arch/dreamcast/dev/g2/aica.c	done
 arch/hp700/gsc/harmony.c
 arch/hpcmips/vr/vraiu.c		done
 arch/macppc/dev/awacs.c



CVS commit: [jmcneill-audiomp3] src/sys/arch/hp700/gsc

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 15:23:46 UTC 2011

Modified Files:
src/sys/arch/hp700/gsc [jmcneill-audiomp3]: harmony.c harmonyvar.h

Log Message:
adapt to audiomp api changes


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.4.1 src/sys/arch/hp700/gsc/harmony.c
cvs rdiff -u -r1.4 -r1.4.38.1 src/sys/arch/hp700/gsc/harmonyvar.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/hp700/gsc/harmony.c
diff -u src/sys/arch/hp700/gsc/harmony.c:1.23 src/sys/arch/hp700/gsc/harmony.c:1.23.4.1
--- src/sys/arch/hp700/gsc/harmony.c:1.23	Fri Jul  1 18:33:09 2011
+++ src/sys/arch/hp700/gsc/harmony.c	Sun Nov 20 15:23:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: harmony.c,v 1.23 2011/07/01 18:33:09 dyoung Exp $	*/
+/*	$NetBSD: harmony.c,v 1.23.4.1 2011/11/20 15:23:46 jmcneill Exp $	*/
 
 /*	$OpenBSD: harmony.c,v 1.23 2004/02/13 21:28:19 mickey Exp $	*/
 
@@ -70,7 +70,7 @@
 #include sys/ioctl.h
 #include sys/device.h
 #include sys/proc.h
-#include sys/malloc.h
+#include sys/kmem.h
 #include uvm/uvm_extern.h
 
 #if NRND  0
@@ -108,14 +108,15 @@ int	harmony_getdev(void *, struct audio_
 int	harmony_set_port(void *, mixer_ctrl_t *);
 int	harmony_get_port(void *, mixer_ctrl_t *);
 int	harmony_query_devinfo(void *, mixer_devinfo_t *);
-void *	harmony_allocm(void *, int, size_t, struct malloc_type *, int);
-void	harmony_freem(void *, void *, struct malloc_type *);
+void *	harmony_allocm(void *, int, size_t);
+void	harmony_freem(void *, void *, size_t);
 size_t	harmony_round_buffersize(void *, int, size_t);
 int	harmony_get_props(void *);
 int	harmony_trigger_output(void *, void *, void *, int,
 void (*)(void *), void *, const audio_params_t *);
 int	harmony_trigger_input(void *, void *, void *, int,
 void (*)(void *), void *, const audio_params_t *);
+void	harmony_get_locks(void *, kmutex_t **, kmutex_t **);
 
 const struct audio_hw_if harmony_sa_hw_if = {
 	harmony_open,
@@ -144,6 +145,9 @@ const struct audio_hw_if harmony_sa_hw_i
 	harmony_get_props,
 	harmony_trigger_output,
 	harmony_trigger_input,
+	NULL,
+	NULL,
+	harmony_get_locks,
 };
 
 int harmony_match(device_t, struct cfdata *, void *);
@@ -209,6 +213,9 @@ harmony_attach(device_t parent, device_t
 	sc-sc_bt = ga-ga_iot;
 	sc-sc_dmat = ga-ga_dmatag;
 
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+
 	if (bus_space_map(sc-sc_bt, ga-ga_hpa, HARMONY_NREGS, 0,
 	sc-sc_bh) != 0) {
 		aprint_error(: couldn't map registers\n);
@@ -230,14 +237,14 @@ harmony_attach(device_t parent, device_t
 
 	if (bus_dmamem_alloc(sc-sc_dmat, sizeof(struct harmony_empty),
 	PAGE_SIZE, 0, sc-sc_empty_seg, 1, sc-sc_empty_rseg,
-	BUS_DMA_NOWAIT) != 0) {
+	BUS_DMA_WAITOK) != 0) {
 		aprint_error(: could not alloc DMA memory\n);
 		bus_space_unmap(sc-sc_bt, sc-sc_bh, HARMONY_NREGS);
 		return;
 	}
 	if (bus_dmamem_map(sc-sc_dmat, sc-sc_empty_seg, 1,
 	sizeof(struct harmony_empty), (void **)sc-sc_empty_kva,
-	BUS_DMA_NOWAIT) != 0) {
+	BUS_DMA_WAITOK) != 0) {
 		aprint_error(: couldn't map DMA memory\n);
 		bus_dmamem_free(sc-sc_dmat, sc-sc_empty_seg,
 		sc-sc_empty_rseg);
@@ -245,7 +252,7 @@ harmony_attach(device_t parent, device_t
 		return;
 	}
 	if (bus_dmamap_create(sc-sc_dmat, sizeof(struct harmony_empty), 1,
-	sizeof(struct harmony_empty), 0, BUS_DMA_NOWAIT,
+	sizeof(struct harmony_empty), 0, BUS_DMA_WAITOK,
 	sc-sc_empty_map) != 0) {
 		aprint_error(: can't create DMA map\n);
 		bus_dmamem_unmap(sc-sc_dmat, (void *)sc-sc_empty_kva,
@@ -256,7 +263,7 @@ harmony_attach(device_t parent, device_t
 		return;
 	}
 	if (bus_dmamap_load(sc-sc_dmat, sc-sc_empty_map, sc-sc_empty_kva,
-	sizeof(struct harmony_empty), NULL, BUS_DMA_NOWAIT) != 0) {
+	sizeof(struct harmony_empty), NULL, BUS_DMA_WAITOK) != 0) {
 		aprint_error(: can't load DMA map\n);
 		bus_dmamap_destroy(sc-sc_dmat, sc-sc_empty_map);
 		bus_dmamem_unmap(sc-sc_dmat, (void *)sc-sc_empty_kva,
@@ -283,7 +290,7 @@ harmony_attach(device_t parent, device_t
 	offsetof(struct harmony_empty, playback[0][0]),
 	PLAYBACK_EMPTYS * HARMONY_BUFSIZE, BUS_DMASYNC_PREWRITE);
 
-	(void) hp700_intr_establish(IPL_AUDIO, harmony_intr, sc, ga-ga_ir,
+	(void) hp700_intr_establish(IPL_SCHED, harmony_intr, sc, ga-ga_ir,
 	 ga-ga_irq);
 
 	/* set defaults */
@@ -372,6 +379,8 @@ harmony_intr(void *vsc)
 	ADD_CLKALLICA(sc);
 #endif
 
+	mutex_spin_enter(sc-sc_intr_lock);
+
 	harmony_intr_disable(sc);
 
 	dstatus = READ_REG(sc, HARMONY_DSTATUS);
@@ -394,6 +403,8 @@ harmony_intr(void *vsc)
 
 	harmony_intr_enable(sc);
 
+	mutex_spin_exit(sc-sc_intr_lock);
+
 	return r;
 }
 
@@ -1044,32 +1055,31 @@ harmony_query_devinfo(void *vsc, mixer_d
 }
 
 void *
-harmony_allocm(void *vsc, int dir, size_t size, struct malloc_type *pool,
-int flags)
+harmony_allocm(void *vsc, int dir, size_t size)
 

CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 15:24:01 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
harmony is done


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.12 src/sys/dev/TODO.audiomp:1.1.2.13
--- src/sys/dev/TODO.audiomp:1.1.2.12	Sun Nov 20 15:00:49 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 15:24:01 2011
@@ -6,7 +6,7 @@ arch/amiga/dev/toccata.c	done
 arch/arm/iomd/vidcaudio.c	done
 arcm/arm/xscale/pxa2x0_ac97.c	done
 arch/dreamcast/dev/g2/aica.c	done
-arch/hp700/gsc/harmony.c
+arch/hp700/gsc/harmony.c	done
 arch/hpcmips/vr/vraiu.c		done
 arch/macppc/dev/awacs.c
 arch/macppc/dev/snapper.c



CVS commit: src/sys/lib/libkern

2011-11-20 Thread Lars Heidieker
Module Name:src
Committed By:   para
Date:   Sun Nov 20 15:37:31 UTC 2011

Modified Files:
src/sys/lib/libkern: arc4random.c

Log Message:
make it compile without DIAGNOSTIC defined


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/lib/libkern/arc4random.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/lib/libkern/arc4random.c
diff -u src/sys/lib/libkern/arc4random.c:1.22 src/sys/lib/libkern/arc4random.c:1.23
--- src/sys/lib/libkern/arc4random.c:1.22	Sat Nov 19 22:51:25 2011
+++ src/sys/lib/libkern/arc4random.c	Sun Nov 20 15:37:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc4random.c,v 1.22 2011/11/19 22:51:25 tls Exp $	*/
+/*	$NetBSD: arc4random.c,v 1.23 2011/11/20 15:37:31 para Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc.
@@ -133,8 +133,10 @@ arc4_randrekey(void *arg)
 	u_int8_t key[256];
 	int n, ask_for_more = 0;
 #ifdef _KERNEL
+#ifdef DIAGNOSTIC
 	rngtest_t rt;
 #endif
+#endif
 #if NRND  0
 	static int callback_pending;
 	int r;



CVS commit: src/sys/arch/news68k

2011-11-20 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Nov 20 15:38:00 UTC 2011

Modified Files:
src/sys/arch/news68k/conf: GENERIC INSTALL files.news68k majors.news68k
src/sys/arch/news68k/dev: if_le.c kb_hb.c si.c zs.c
src/sys/arch/news68k/include: cpu.h vmparam.h
src/sys/arch/news68k/news68k: locore.s machdep.c pmap_bootstrap.c
Added Files:
src/sys/arch/news68k/news68k: romcalls.S romcons.c

Log Message:
Add preliminary PROM internal function based framebuffer console support,
which was demonstrated at Open Source Conference 2011 Kansai @ Kyoto
back in July:
http://www.NetBSD.org/gallery/events.html#opensourceconf2011-Kansai

- map 0xc000-0x PA region (which is mirror of PA 0x0-0x3fff)
  to the same VA via %tt0 and %tt1 registers and move KVA space accordingly
  (like luna68k does for its devices)
- save trap #0 vector for PROM function calls in early bootstrap
  and register it to trap #14 to call it from kernel for console output
- add dumb romcall based tty attachment taken from src/sys/dev/ofw/ofcons.c
- add rom function call stubs from news68k/stand/common/romcalls.S
- remove IIOV() macro for device registers where now mapped PA==VA via %tt1

XXX: romcons is not enabled yet because there is no generic interface
XXX: to attach wskbd(4) to non wsdisplay(4) devices like this romcons.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/news68k/conf/GENERIC
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/news68k/conf/INSTALL
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/news68k/conf/files.news68k
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/news68k/conf/majors.news68k
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/news68k/dev/if_le.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/news68k/dev/kb_hb.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/news68k/dev/si.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/news68k/dev/zs.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/news68k/include/cpu.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/news68k/include/vmparam.h
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/news68k/news68k/locore.s
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/news68k/news68k/machdep.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/news68k/news68k/pmap_bootstrap.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/news68k/news68k/romcalls.S \
src/sys/arch/news68k/news68k/romcons.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/news68k/conf/GENERIC
diff -u src/sys/arch/news68k/conf/GENERIC:1.106 src/sys/arch/news68k/conf/GENERIC:1.107
--- src/sys/arch/news68k/conf/GENERIC:1.106	Sun Mar  6 17:08:28 2011
+++ src/sys/arch/news68k/conf/GENERIC	Sun Nov 20 15:38:00 2011
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.106 2011/03/06 17:08:28 bouyer Exp $
+# $NetBSD: GENERIC,v 1.107 2011/11/20 15:38:00 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include		arch/news68k/conf/std.news68k
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.106 $
+#ident 		GENERIC-$Revision: 1.107 $
 
 maxusers	8
 
@@ -221,6 +221,9 @@ ch*	at scsibus? target ? lun ?		# SCSI c
 ss*	at scsibus? target ? lun ?		# SCSI scanners
 uk*	at scsibus? target ? lun ?		# unknown SCSI devices
 
+# PROM console support
+#romcons0 at mainbus0
+
 #
 # accept filters
 pseudo-device   accf_data		# dataready accept filter

Index: src/sys/arch/news68k/conf/INSTALL
diff -u src/sys/arch/news68k/conf/INSTALL:1.53 src/sys/arch/news68k/conf/INSTALL:1.54
--- src/sys/arch/news68k/conf/INSTALL:1.53	Sun Mar 13 12:58:02 2011
+++ src/sys/arch/news68k/conf/INSTALL	Sun Nov 20 15:38:00 2011
@@ -1,4 +1,4 @@
-# 	$NetBSD: INSTALL,v 1.53 2011/03/13 12:58:02 he Exp $
+# 	$NetBSD: INSTALL,v 1.54 2011/11/20 15:38:00 tsutsui Exp $
 
 #	config for bootable floppy kernel
 #
@@ -146,6 +146,9 @@ sd*	at scsibus? target ? lun ?		# SCSI d
 st*	at scsibus? target ? lun ?		# SCSI tapes
 cd*	at scsibus? target ? lun ?		# SCSI CD-ROMs
 
+# PROM console support
+#romcons0 at mainbus0
+
 # Misc.
 pseudo-device	loop			# loopback interface; required
 pseudo-device	pty		2	# pseudo-terminals (Sysinst needs two)

Index: src/sys/arch/news68k/conf/files.news68k
diff -u src/sys/arch/news68k/conf/files.news68k:1.32 src/sys/arch/news68k/conf/files.news68k:1.33
--- src/sys/arch/news68k/conf/files.news68k:1.32	Sun Jun 12 03:35:44 2011
+++ src/sys/arch/news68k/conf/files.news68k	Sun Nov 20 15:38:00 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.news68k,v 1.32 2011/06/12 03:35:44 rmind Exp $
+#	$NetBSD: files.news68k,v 1.33 2011/11/20 15:38:00 tsutsui Exp $
 
 #	NEWS68K-specific configuration info
 
@@ -19,6 +19,7 @@ file	arch/news68k/news68k/isr.c
 file	arch/news68k/news68k/machdep.c
 file	arch/news68k/news68k/mainbus.c
 file	arch/news68k/news68k/pmap_bootstrap.c	compile-with ${NOPROF_C}
+file	arch/news68k/news68k/romcalls.S
 file	arch/news68k/news68k/trap.c
 file	arch/m68k/m68k/cacheops.c
 file	

CVS commit: [jmcneill-audiomp3] src/sys

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 15:48:53 UTC 2011

Modified Files:
src/sys/arch/amiga/dev [jmcneill-audiomp3]: melody.c
src/sys/arch/amigappc/amigappc [jmcneill-audiomp3]: machdep.c
src/sys/dev/ic [jmcneill-audiomp3]: tms320av110.c tms320av110var.h

Log Message:
adapt to audiomp api changes


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.4.1 src/sys/arch/amiga/dev/melody.c
cvs rdiff -u -r1.48 -r1.48.4.1 src/sys/arch/amigappc/amigappc/machdep.c
cvs rdiff -u -r1.21 -r1.21.36.1 src/sys/dev/ic/tms320av110.c
cvs rdiff -u -r1.10 -r1.10.36.1 src/sys/dev/ic/tms320av110var.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/amiga/dev/melody.c
diff -u src/sys/arch/amiga/dev/melody.c:1.16 src/sys/arch/amiga/dev/melody.c:1.16.4.1
--- src/sys/arch/amiga/dev/melody.c:1.16	Tue Jul 19 15:55:27 2011
+++ src/sys/arch/amiga/dev/melody.c	Sun Nov 20 15:48:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: melody.c,v 1.16 2011/07/19 15:55:27 dyoung Exp $ */
+/*	$NetBSD: melody.c,v 1.16.4.1 2011/11/20 15:48:52 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: melody.c,v 1.16 2011/07/19 15:55:27 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: melody.c,v 1.16.4.1 2011/11/20 15:48:52 jmcneill Exp $);
 
 /*
  * Melody audio driver.
@@ -111,6 +111,10 @@ melody_attach(struct device *parent, str
 	sc-sc_tav.sc_dif = 0;
 	sc-sc_tav.sc_pcm_div = 12;
 
+	mutex_init(sc-sc_tav.sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_tav.sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+	cv_init(sc-sc_tav.sc_cv, device_xname(self));
+
 	/*
 	 * Attach option boards now. They might provide additional
 	 * functionality to our audio part.

Index: src/sys/arch/amigappc/amigappc/machdep.c
diff -u src/sys/arch/amigappc/amigappc/machdep.c:1.48 src/sys/arch/amigappc/amigappc/machdep.c:1.48.4.1
--- src/sys/arch/amigappc/amigappc/machdep.c:1.48	Sun Jul 17 20:54:36 2011
+++ src/sys/arch/amigappc/amigappc/machdep.c	Sun Nov 20 15:48:53 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.48 2011/07/17 20:54:36 joerg Exp $ */
+/* $NetBSD: machdep.c,v 1.48.4.1 2011/11/20 15:48:53 jmcneill Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.48 2011/07/17 20:54:36 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.48.4.1 2011/11/20 15:48:53 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/mount.h
@@ -241,7 +241,7 @@ amigappc_install_handlers(void)
 	intr_establish(1, IST_LEVEL, IPL_BIO, lev1_intr, NULL);
 	intr_establish(2, IST_LEVEL, IPL_BIO, ports_intr, isr_ports);
 	intr_establish(3, IST_LEVEL, IPL_TTY, lev3_intr, NULL);
-	intr_establish(4, IST_LEVEL, IPL_AUDIO, lev4_intr, NULL);
+	intr_establish(4, IST_LEVEL, IPL_SCHED, lev4_intr, NULL);
 	intr_establish(5, IST_LEVEL, IPL_SERIAL, lev5_intr, NULL);
 	intr_establish(6, IST_LEVEL, IPL_SERIAL, exter_intr, isr_exter);
 }

Index: src/sys/dev/ic/tms320av110.c
diff -u src/sys/dev/ic/tms320av110.c:1.21 src/sys/dev/ic/tms320av110.c:1.21.36.1
--- src/sys/dev/ic/tms320av110.c:1.21	Mon Apr 28 20:23:51 2008
+++ src/sys/dev/ic/tms320av110.c	Sun Nov 20 15:48:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tms320av110.c,v 1.21 2008/04/28 20:23:51 martin Exp $	*/
+/*	$NetBSD: tms320av110.c,v 1.21.36.1 2011/11/20 15:48:52 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tms320av110.c,v 1.21 2008/04/28 20:23:51 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: tms320av110.c,v 1.21.36.1 2011/11/20 15:48:52 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -72,6 +72,7 @@ int tav_set_port(void *, mixer_ctrl_t *)
 int tav_get_port(void *, mixer_ctrl_t *);
 int tav_query_devinfo(void *, mixer_devinfo_t *);
 int tav_get_props(void *);
+void tav_get_locks(void *, kmutex_t **, kmutex_t **);
 
 const struct audio_hw_if tav_audio_if = {
 	tav_open,
@@ -98,7 +99,11 @@ const struct audio_hw_if tav_audio_if = 
 	0 /* round_buffersize */,	/* optional */
 	0 /* mappage */,		/* optional */
 	tav_get_props,
-	0 /* dev_ioctl */		/* optional */
+	0, /* trigger_output */
+	0, /* trigger_input */
+	0, /* dev_ioctl */		/* optional */
+	0, /* powerhook */		/* optional */
+	tav_get_locks,
 };
 
 void
@@ -146,6 +151,9 @@ tms320av110_intr(void *p)
 	uint16_t intlist;
 
 	sc = p;
+
+	mutex_spin_enter(sc-sc_intr_lock);
+
 	intlist = tav_read_short(sc-sc_iot, sc-sc_ioh, TAV_INTR)
 	/*  tav_read_short(sc-sc_iot, sc-sc_ioh, TAV_INTR_EN)*/;
 
@@ -161,9 +169,11 @@ tms320av110_intr(void *p)
 	}
 
 	if (intlist  TAV_INTR_PCM_OUTPUT_UNDERFLOW) {
-		 wakeup(sc);
+		 cv_broadcast(sc-sc_cv);
 	}
 
+	mutex_spin_exit(sc-sc_intr_lock);
+
 	return 1;
 }
 
@@ -211,8 +221,10 @@ tav_drain(void *hdl)
 	iot = 

CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 15:49:16 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
tms320av110 (melody) is done


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.13 src/sys/dev/TODO.audiomp:1.1.2.14
--- src/sys/dev/TODO.audiomp:1.1.2.13	Sun Nov 20 15:24:01 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 15:49:16 2011
@@ -21,7 +21,7 @@ dev/ebus/cs4231_ebus.c		done
 dev/ic/interwave.c		done
 dev/ic/mpu.c			done
 dev/ic/opl.c			done
-dev/ic/tms320av110.c
+dev/ic/tms320av110.c		done
 dev/isa/aria.c			done
 dev/isa/ess.c			done		port-shark
 dev/isa/gus.c			done



CVS commit: [jmcneill-audiomp3] src/sys/arch/sgimips/mace

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 16:07:27 UTC 2011

Modified Files:
src/sys/arch/sgimips/mace [jmcneill-audiomp3]: mavb.c

Log Message:
fix size passed to kmem_free in stream filter dtor


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.1 -r1.7.4.2 src/sys/arch/sgimips/mace/mavb.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/mace/mavb.c
diff -u src/sys/arch/sgimips/mace/mavb.c:1.7.4.1 src/sys/arch/sgimips/mace/mavb.c:1.7.4.2
--- src/sys/arch/sgimips/mace/mavb.c:1.7.4.1	Sun Nov 20 12:27:21 2011
+++ src/sys/arch/sgimips/mace/mavb.c	Sun Nov 20 16:07:27 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mavb.c,v 1.7.4.1 2011/11/20 12:27:21 jmcneill Exp $ */
+/* $NetBSD: mavb.c,v 1.7.4.2 2011/11/20 16:07:27 jmcneill Exp $ */
 /* $OpenBSD: mavb.c,v 1.6 2005/04/15 13:05:14 mickey Exp $ */
 
 /*
@@ -235,7 +235,7 @@ mavb_dtor(stream_filter_t *this)
 {
 
 	if (this != NULL)
-		kmem_free(this, sizeof(*this));
+		kmem_free(this, sizeof(struct mavb_codecvar));
 }
 
 typedef uint64_t ad1843_addr_t;



CVS commit: [jmcneill-audiomp3] src/sys

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 16:18:15 UTC 2011

Modified Files:
src/sys/arch/x68k/dev [jmcneill-audiomp3]: vs.c vsvar.h
src/sys/dev/ic [jmcneill-audiomp3]: msm6258.c

Log Message:
adapt to audiomp api changes


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.4.1 src/sys/arch/x68k/dev/vs.c
cvs rdiff -u -r1.10 -r1.10.4.1 src/sys/arch/x68k/dev/vsvar.h
cvs rdiff -u -r1.16 -r1.16.4.1 src/sys/dev/ic/msm6258.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/vs.c
diff -u src/sys/arch/x68k/dev/vs.c:1.34 src/sys/arch/x68k/dev/vs.c:1.34.4.1
--- src/sys/arch/x68k/dev/vs.c:1.34	Sun Oct 16 03:10:18 2011
+++ src/sys/arch/x68k/dev/vs.c	Sun Nov 20 16:18:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vs.c,v 1.34 2011/10/16 03:10:18 isaki Exp $	*/
+/*	$NetBSD: vs.c,v 1.34.4.1 2011/11/20 16:18:15 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2001 Tetsuya Isaki. All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vs.c,v 1.34 2011/10/16 03:10:18 isaki Exp $);
+__KERNEL_RCSID(0, $NetBSD: vs.c,v 1.34.4.1 2011/11/20 16:18:15 jmcneill Exp $);
 
 #include audio.h
 #include vs.h
@@ -39,6 +39,7 @@ __KERNEL_RCSID(0, $NetBSD: vs.c,v 1.34 
 #include sys/param.h
 #include sys/systm.h
 #include sys/device.h
+#include sys/kmem.h
 
 #include sys/audioio.h
 #include dev/audio_if.h
@@ -83,17 +84,18 @@ static int  vs_trigger_input(void *, voi
 	void (*)(void *), void *, const audio_params_t *);
 static int  vs_halt_output(void *);
 static int  vs_halt_input(void *);
-static int  vs_allocmem(struct vs_softc *, size_t, size_t, size_t, int,
+static int  vs_allocmem(struct vs_softc *, size_t, size_t, size_t,
 	struct vs_dma *);
 static void vs_freemem(struct vs_dma *);
 static int  vs_getdev(void *, struct audio_device *);
 static int  vs_set_port(void *, mixer_ctrl_t *);
 static int  vs_get_port(void *, mixer_ctrl_t *);
 static int  vs_query_devinfo(void *, mixer_devinfo_t *);
-static void *vs_allocm(void *, int, size_t, struct malloc_type *, int);
-static void vs_freem(void *, void *, struct malloc_type *);
+static void *vs_allocm(void *, int, size_t);
+static void vs_freem(void *, void *, size_t);
 static size_t vs_round_buffersize(void *, int, size_t);
 static int  vs_get_props(void *);
+static void vs_get_locks(void *, kmutex_t **, kmutex_t **);
 
 /* lower functions */
 static int vs_round_sr(u_long);
@@ -135,6 +137,8 @@ static const struct audio_hw_if vs_hw_if
 	vs_trigger_output,
 	vs_trigger_input,
 	NULL,
+	NULL,
+	vs_get_locks,
 };
 
 static struct audio_device vs_device = {
@@ -229,6 +233,8 @@ vs_attach(device_t parent, device_t self
 	sc-sc_hw_if = vs_hw_if;
 	sc-sc_addr = (void *) ia-ia_addr;
 	sc-sc_dmas = NULL;
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
 
 	/* XXX */
 	bus_space_map(iot, PPI_ADDR, PPI_MAPSIZE, BUS_SPACE_MAP_SHIFTED,
@@ -255,6 +261,9 @@ vs_dmaintr(void *hdl)
 
 	DPRINTF(2, (vs_dmaintr\n));
 	sc = hdl;
+
+	mutex_spin_enter(sc-sc_intr_lock);
+
 	if (sc-sc_pintr) {
 		/* start next transfer */
 		sc-sc_current.dmap += sc-sc_current.blksize;
@@ -281,6 +290,8 @@ vs_dmaintr(void *hdl)
 		printf(vs_dmaintr: spurious interrupt\n);
 	}
 
+	mutex_spin_exit(sc-sc_intr_lock);
+
 	return 1;
 }
 
@@ -617,38 +628,37 @@ vs_halt_input(void *hdl)
 
 static int
 vs_allocmem(struct vs_softc *sc, size_t size, size_t align, size_t boundary,
-	int flags, struct vs_dma *vd)
+	struct vs_dma *vd)
 {
-	int error, wait;
+	int error;
 
 #ifdef DIAGNOSTIC
 	if (size  DMAC_MAXSEGSZ)
 		panic (vs_allocmem: maximum size exceeded, %d, (int) size);
 #endif
 
-	wait = (flags  M_NOWAIT) ? BUS_DMA_NOWAIT : BUS_DMA_WAITOK;
 	vd-vd_size = size;
 
 	error = bus_dmamem_alloc(vd-vd_dmat, vd-vd_size, align, boundary,
  vd-vd_segs,
  sizeof (vd-vd_segs) / sizeof (vd-vd_segs[0]),
- vd-vd_nsegs, wait);
+ vd-vd_nsegs, BUS_DMA_WAITOK);
 	if (error)
 		goto out;
 
 	error = bus_dmamem_map(vd-vd_dmat, vd-vd_segs, vd-vd_nsegs,
 			   vd-vd_size, vd-vd_addr,
-			   wait | BUS_DMA_COHERENT);
+			   BUS_DMA_WAITOK | BUS_DMA_COHERENT);
 	if (error)
 		goto free;
 
 	error = bus_dmamap_create(vd-vd_dmat, vd-vd_size, 1, DMAC_MAXSEGSZ,
-  0, wait, vd-vd_map);
+  0, BUS_DMA_WAITOK, vd-vd_map);
 	if (error)
 		goto unmap;
 
 	error = bus_dmamap_load(vd-vd_dmat, vd-vd_map, vd-vd_addr,
-vd-vd_size, NULL, wait);
+vd-vd_size, NULL, BUS_DMA_WAITOK);
 	if (error)
 		goto destroy;
 
@@ -712,21 +722,20 @@ vs_query_devinfo(void *hdl, mixer_devinf
 }
 
 static void *
-vs_allocm(void *hdl, int direction, size_t size, struct malloc_type *type,
-int flags)
+vs_allocm(void *hdl, int direction, size_t size)
 {
 	struct vs_softc *sc;
 	struct vs_dma *vd;
 	int error;
 
-	if ((vd = malloc(size, type, flags)) == NULL)
+	if ((vd = kmem_alloc(sizeof(*vd), KM_SLEEP)) == NULL)

CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 16:18:32 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
vs is done


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.14 src/sys/dev/TODO.audiomp:1.1.2.15
--- src/sys/dev/TODO.audiomp:1.1.2.14	Sun Nov 20 15:49:16 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 16:18:32 2011
@@ -14,7 +14,7 @@ arch/prep/isa/paud_isa.c	toolchain-fails
 arch/sgimips/hpc/haltwo.c	done
 arch/sgimips/mace/mavb.c	done
 arch/sparc/dev/audioamd.c	done
-arch/x68k/dev/vs.c
+arch/x68k/dev/vs.c		done
 arch/zaurus/dev/zaudio.c	done
 dev/bluetooth/btsco.c		done
 dev/ebus/cs4231_ebus.c		done



CVS commit: [jmcneill-audiomp3] src/sys/arch/prep/isa

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 16:34:08 UTC 2011

Modified Files:
src/sys/arch/prep/isa [jmcneill-audiomp3]: paud_isa.c

Log Message:
adapt to audiomp api changes


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.4.1 src/sys/arch/prep/isa/paud_isa.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/prep/isa/paud_isa.c
diff -u src/sys/arch/prep/isa/paud_isa.c:1.14 src/sys/arch/prep/isa/paud_isa.c:1.14.4.1
--- src/sys/arch/prep/isa/paud_isa.c:1.14	Fri Jul  1 16:57:29 2011
+++ src/sys/arch/prep/isa/paud_isa.c	Sun Nov 20 16:34:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: paud_isa.c,v 1.14 2011/07/01 16:57:29 dyoung Exp $	*/
+/*	$NetBSD: paud_isa.c,v 1.14.4.1 2011/11/20 16:34:08 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: paud_isa.c,v 1.14 2011/07/01 16:57:29 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: paud_isa.c,v 1.14.4.1 2011/11/20 16:34:08 jmcneill Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -39,7 +39,7 @@ __KERNEL_RCSID(0, $NetBSD: paud_isa.c,v
 #include sys/systm.h
 #include sys/errno.h
 #include sys/device.h
-#include sys/malloc.h
+#include sys/kmem.h
 
 #include sys/bus.h
 #include machine/intr.h
@@ -87,6 +87,7 @@ static struct audio_device paud_device =
 	
 };
 
+static int paud_intr(void *);
 static int paud_getdev(void *, struct audio_device *);
 static int paud_mixer_set_port(void *, mixer_ctrl_t *);
 static int paud_mixer_get_port(void *, mixer_ctrl_t *);
@@ -120,6 +121,8 @@ static const struct audio_hw_if paud_hw_
 	ad1848_isa_trigger_output,
 	ad1848_isa_trigger_input,
 	NULL,
+	NULL,
+	ad1848_get_locks,
 };
 
 /* autoconfig routines */
@@ -158,6 +161,9 @@ paud_attach_isa(device_t parent, device_
 	sc-sc_ad1848.sc_iot = ia-ia_iot;
 	sc-sc_ic = ia-ia_ic;
 
+	mutex_init(sc-sc_ad1848.sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_ad1848.sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+
 	if (ad1848_isa_mapprobe(sc, ia-ia_io[0].ir_addr) == 0) {
 		aprint_error(: attach failed\n);
 		return;
@@ -165,7 +171,7 @@ paud_attach_isa(device_t parent, device_
 	sc-sc_playdrq = ia-ia_drq[0].ir_drq;
 	sc-sc_recdrq = ia-ia_drq[1].ir_drq;
 	sc-sc_ih = isa_intr_establish(ia-ia_ic, ia-ia_irq[0].ir_irq,
-	IST_EDGE, IPL_AUDIO, ad1848_isa_intr, sc);
+	IST_EDGE, IPL_SCHED, paud_intr, sc);
 	ad1848_isa_attach(sc);
 	aprint_normal(\n);
 	audio_attach_mi(paud_hw_if, sc-sc_ad1848, self);
@@ -173,6 +179,19 @@ paud_attach_isa(device_t parent, device_
 }
 
 static int
+paud_intr(void *addr)
+{
+	struct ad1848_isa_softc *sc = addr;
+	int ret;
+
+	mutex_spin_enter(sc-sc_ad1848.sc_intr_lock);
+	ret = ad1848_isa_intr(sc);
+	mutex_spin_exit(sc-sc_ad1848.sc_intr_lock);
+
+	return ret;
+}
+
+static int
 paud_getdev(void *addr, struct audio_device *retp)
 {
 



CVS commit: src/etc/etc.news68k

2011-11-20 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Nov 20 17:18:34 UTC 2011

Modified Files:
src/etc/etc.news68k: MAKEDEV.conf

Log Message:
Create romcons device node.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/etc/etc.news68k/MAKEDEV.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/etc.news68k/MAKEDEV.conf
diff -u src/etc/etc.news68k/MAKEDEV.conf:1.2 src/etc/etc.news68k/MAKEDEV.conf:1.3
--- src/etc/etc.news68k/MAKEDEV.conf:1.2	Sun Oct 19 19:07:27 2003
+++ src/etc/etc.news68k/MAKEDEV.conf	Sun Nov 20 17:18:34 2011
@@ -1,8 +1,9 @@
-# $NetBSD: MAKEDEV.conf,v 1.2 2003/10/19 19:07:27 jdolecek Exp $
+# $NetBSD: MAKEDEV.conf,v 1.3 2011/11/20 17:18:34 tsutsui Exp $
 
 all_md)
 	makedev sd0 sd1 sd2 sd3 cd0 st0 st1
 	makedev tty0 tty1
+	makedev romcons
 	makedev scsibus0 scsibus1 scsibus2 scsibus3
 	makedev raid0 raid1 raid2 raid3
 	;;
@@ -10,4 +11,9 @@ all_md)
 floppy)
 	makedev std sd0 sd1 sd2 sd3 cd0 st0 st1
 	makedev opty tty0 tty1 md0
+	makedev romcons
+	;;
+
+romcons)
+	mkdev romcons		c 81 0
 	;;



CVS commit: src/etc/etc.news68k

2011-11-20 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Nov 20 17:21:16 UTC 2011

Modified Files:
src/etc/etc.news68k: ttys

Log Message:
Add an entry for romcons.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/etc/etc.news68k/ttys

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/etc.news68k/ttys
diff -u src/etc/etc.news68k/ttys:1.8 src/etc/etc.news68k/ttys:1.9
--- src/etc/etc.news68k/ttys:1.8	Tue Oct  7 10:00:02 2008
+++ src/etc/etc.news68k/ttys	Sun Nov 20 17:21:15 2011
@@ -1,11 +1,12 @@
 #
 #	@(#)ttys	5.1 (Berkeley) 4/17/89
-#	$NetBSD: ttys,v 1.8 2008/10/07 10:00:02 abs Exp $
+#	$NetBSD: ttys,v 1.9 2011/11/20 17:21:15 tsutsui Exp $
 #
 # name	gettytype	status		comments
 #
 # Note: the console redirects to one of: kd, ttya, ttyb
 console	/usr/libexec/getty std.9600	vt100	on  secure
 constty	/usr/libexec/getty std.9600	vt100	off secure
+romcons	/usr/libexec/getty std.9600	news	off secure
 ttyZ0	/usr/libexec/getty std.9600	vt100	off secure
 ttyZ1	/usr/libexec/getty std.9600	unknown	on secure



CVS commit: [jmcneill-audiomp3] src/sys/arch/sgimips/mace

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 18:25:46 UTC 2011

Modified Files:
src/sys/arch/sgimips/mace [jmcneill-audiomp3]: mavb.c

Log Message:
no need to enter intr_lock from trigger_output, it's already held


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.2 -r1.7.4.3 src/sys/arch/sgimips/mace/mavb.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/mace/mavb.c
diff -u src/sys/arch/sgimips/mace/mavb.c:1.7.4.2 src/sys/arch/sgimips/mace/mavb.c:1.7.4.3
--- src/sys/arch/sgimips/mace/mavb.c:1.7.4.2	Sun Nov 20 16:07:27 2011
+++ src/sys/arch/sgimips/mace/mavb.c	Sun Nov 20 18:25:46 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mavb.c,v 1.7.4.2 2011/11/20 16:07:27 jmcneill Exp $ */
+/* $NetBSD: mavb.c,v 1.7.4.3 2011/11/20 18:25:46 jmcneill Exp $ */
 /* $OpenBSD: mavb.c,v 1.6 2005/04/15 13:05:14 mickey Exp $ */
 
 /*
@@ -909,8 +909,6 @@ mavb_trigger_output(void *hdl, void *sta
 
 	sc-sc_count = 0;
 
-	mutex_spin_enter(sc-sc_intr_lock);
-
 	bus_space_write_8(sc-sc_st, sc-sc_sh, MAVB_CHANNEL2_CONTROL,
 	MAVB_CHANNEL_RESET);
 	delay(1000);
@@ -921,8 +919,6 @@ mavb_trigger_output(void *hdl, void *sta
 	bus_space_write_8(sc-sc_st, sc-sc_sh, MAVB_CHANNEL2_CONTROL,
 	MAVB_CHANNEL_DMA_ENABLE | MAVB_CHANNEL_INT_50);
 
-	mutex_spin_exit(sc-sc_intr_lock);
-
 	return 0;
 }
 



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 19:26:34 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
i tested sb under qemu


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.16 -r1.1.2.17 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.16 src/sys/dev/TODO.audiomp:1.1.2.17
--- src/sys/dev/TODO.audiomp:1.1.2.16	Sun Nov 20 16:34:23 2011
+++ src/sys/dev/TODO.audiomp	Sun Nov 20 19:26:34 2011
@@ -26,7 +26,7 @@ dev/isa/aria.c			done
 dev/isa/ess.c			done		port-shark
 dev/isa/gus.c			done
 dev/isa/pas.c			done
-dev/isa/sb.c			done
+dev/isa/sb.c			done		port-i386
 dev/isa/wss.c			done
 dev/isa/ym.c			done
 dev/isapnp/mpu_isapnp.c		done



CVS commit: src/sys/arch

2011-11-20 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sun Nov 20 19:41:27 UTC 2011

Modified Files:
src/sys/arch/x86/include: pmap.h
src/sys/arch/x86/x86: pmap.c
src/sys/arch/xen/x86: xen_pmap.c
src/sys/arch/xen/xen: xen_machdep.c

Log Message:
Expose pmap_pdp_cache publicly to x86/xen pmap. Provide suspend/resume
callbacks for Xen pmap.

Turn static internal callbacks of pmap_pdp_cache.

XXX the implementation of pool_cache_invalidate(9) is still wrong, and
IMHO this needs fixing before -6. See
http://mail-index.netbsd.org/tech-kern/2011/11/18/msg011924.html


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.141 -r1.142 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/x86/xen_pmap.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/xen/xen_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/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.45 src/sys/arch/x86/include/pmap.h:1.46
--- src/sys/arch/x86/include/pmap.h:1.45	Tue Nov  8 17:16:52 2011
+++ src/sys/arch/x86/include/pmap.h	Sun Nov 20 19:41:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.45 2011/11/08 17:16:52 cherry Exp $	*/
+/*	$NetBSD: pmap.h,v 1.46 2011/11/20 19:41:27 jym Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -125,6 +125,11 @@ extern struct pmap_head pmaps;
 extern kmutex_t pmaps_lock;/* protects pmaps */
 
 /*
+ * pool_cache(9) that PDPs are allocated from 
+ */
+extern struct pool_cache pmap_pdp_cache;
+
+/*
  * the pmap structure
  *
  * note that the pm_obj contains the lock pointer, the reference count,
@@ -261,8 +266,6 @@ u_int		x86_mmap_flags(paddr_t);
 
 bool		pmap_is_curpmap(struct pmap *);
 
-void		pmap_invalidate_pool_caches(void);
-
 vaddr_t reserve_dumppages(vaddr_t); /* XXX: not a pmap fn */
 
 typedef enum tlbwhy {
@@ -411,15 +414,7 @@ vaddr_t	pmap_map(vaddr_t, paddr_t, paddr
 void	pmap_cpu_init_late(struct cpu_info *);
 bool	sse2_idlezero_page(void *);
 
-
 #ifdef XEN
-
-void	pmap_unmap_all_apdp_pdes(void);
-#ifdef PAE
-void	pmap_map_recursive_entries(void);
-void	pmap_unmap_recursive_entries(void);
-#endif /* PAE */
-
 #include sys/bitops.h
 
 #define XPTE_MASK	L1_FRAME
@@ -468,9 +463,17 @@ xpmap_update (pt_entry_t *pte, pt_entry_
 paddr_t	vtomach(vaddr_t);
 #define vtomfn(va) (vtomach(va)  PAGE_SHIFT)
 
+void	pmap_xen_resume(void);
+void	pmap_xen_suspend(void);
+
 void	pmap_apte_flush(struct pmap *);
 void	pmap_unmap_apdp(void);
 
+#ifdef PAE
+void	pmap_map_recursive_entries(void);
+void	pmap_unmap_recursive_entries(void);
+#endif /* PAE */
+
 #endif	/* XEN */
 
 /* pmap functions with machine addresses */

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.141 src/sys/arch/x86/x86/pmap.c:1.142
--- src/sys/arch/x86/x86/pmap.c:1.141	Tue Nov  8 17:16:52 2011
+++ src/sys/arch/x86/x86/pmap.c	Sun Nov 20 19:41:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.141 2011/11/08 17:16:52 cherry Exp $	*/
+/*	$NetBSD: pmap.c,v 1.142 2011/11/20 19:41:27 jym Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.141 2011/11/08 17:16:52 cherry Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.142 2011/11/20 19:41:27 jym Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -508,17 +508,14 @@ static char *csrcp, *cdstp, *zerop, *ptp
 
 int pmap_enter_default(pmap_t, vaddr_t, paddr_t, vm_prot_t, u_int);
 
-/*
- * pool and cache that PDPs are allocated from
- */
-
-static struct pool_cache pmap_pdp_cache;
-int	pmap_pdp_ctor(void *, void *, int);
-void	pmap_pdp_dtor(void *, void *);
+/* PDP pool_cache(9) and its callbacks */
+struct pool_cache pmap_pdp_cache;
+static int  pmap_pdp_ctor(void *, void *, int);
+static void pmap_pdp_dtor(void *, void *);
 #ifdef PAE
 /* need to allocate items of 4 pages */
-void *pmap_pdp_alloc(struct pool *, int);
-void pmap_pdp_free(struct pool *, void *);
+static void *pmap_pdp_alloc(struct pool *, int);
+static void pmap_pdp_free(struct pool *, void *);
 static struct pool_allocator pmap_pdp_allocator = {
 	.pa_alloc = pmap_pdp_alloc,
 	.pa_free = pmap_pdp_free,
@@ -2014,7 +2011,7 @@ pmap_get_ptp(struct pmap *pmap, vaddr_t 
 /*
  * pmap_pdp_ctor: constructor for the PDP cache.
  */
-int
+static int
 pmap_pdp_ctor(void *arg, void *v, int flags)
 {
 	pd_entry_t *pdir = v;
@@ -2121,7 +2118,7 @@ pmap_pdp_ctor(void *arg, void *v, int fl
  * pmap_pdp_dtor: destructor for the PDP cache.
  */
 
-void
+static void
 pmap_pdp_dtor(void *arg, void *v)
 {
 #ifdef XEN
@@ -2152,7 +2149,7 @@ pmap_pdp_dtor(void *arg, void *v)
 
 /* pmap_pdp_alloc: Allocate a page for the pdp memory pool. */
 
-void *
+static void *
 pmap_pdp_alloc(struct pool *pp, int flags)
 {
 	return (void *)uvm_km_alloc(kernel_map,
@@ -2165,7 +2162,7 @@ 

CVS commit: [jmcneill-audiomp3] src/sys/dev/isa

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 19:44:50 UTC 2011

Modified Files:
src/sys/dev/isa [jmcneill-audiomp3]: sbdsp.c

Log Message:
improve the last change, after discussing it with rmind


To generate a diff of this commit:
cvs rdiff -u -r1.134.12.2 -r1.134.12.3 src/sys/dev/isa/sbdsp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/isa/sbdsp.c
diff -u src/sys/dev/isa/sbdsp.c:1.134.12.2 src/sys/dev/isa/sbdsp.c:1.134.12.3
--- src/sys/dev/isa/sbdsp.c:1.134.12.2	Sun Nov 20 19:26:05 2011
+++ src/sys/dev/isa/sbdsp.c	Sun Nov 20 19:44:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbdsp.c,v 1.134.12.2 2011/11/20 19:26:05 jmcneill Exp $	*/
+/*	$NetBSD: sbdsp.c,v 1.134.12.3 2011/11/20 19:44:50 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2008 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sbdsp.c,v 1.134.12.2 2011/11/20 19:26:05 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: sbdsp.c,v 1.134.12.3 2011/11/20 19:44:50 jmcneill Exp $);
 
 #include midi.h
 #include mpu.h
@@ -1095,7 +1095,11 @@ sbdsp_rdsp(struct sbdsp_softc *sc)
 void
 sbdsp_pause(struct sbdsp_softc *sc)
 {
-	delay(10);	/* 1/10th of a second */
+
+	KASSERT(mutex_owned(sc-sc_intr_lock));
+	mutex_spin_exit(sc-sc_intr_lock);
+	(void)kpause(sbpause, false, hz/8, sc-sc_lock);
+	mutex_spin_enter(sc-sc_intr_lock);
 }
 
 /*



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 20:00:15 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: sequencer.c

Log Message:
avoid passing size 0 to kmem_alloc when the sequencer device is opened and
no midi devices are attached


To generate a diff of this commit:
cvs rdiff -u -r1.52.14.1 -r1.52.14.2 src/sys/dev/sequencer.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/sequencer.c
diff -u src/sys/dev/sequencer.c:1.52.14.1 src/sys/dev/sequencer.c:1.52.14.2
--- src/sys/dev/sequencer.c:1.52.14.1	Sat Nov 19 21:49:35 2011
+++ src/sys/dev/sequencer.c	Sun Nov 20 20:00:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sequencer.c,v 1.52.14.1 2011/11/19 21:49:35 jmcneill Exp $	*/
+/*	$NetBSD: sequencer.c,v 1.52.14.2 2011/11/20 20:00:15 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sequencer.c,v 1.52.14.1 2011/11/19 21:49:35 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: sequencer.c,v 1.52.14.2 2011/11/20 20:00:15 jmcneill Exp $);
 
 #include sequencer.h
 
@@ -268,17 +268,22 @@ sequenceropen(dev_t dev, int flags, int 
 	SEQ_QINIT(sc-outq);
 	sc-lowat = SEQ_MAXQ / 2;
 
-	mutex_exit(sc-lock);
-	sc-devs = kmem_alloc(sc-ndevs * sizeof(struct midi_dev *), KM_SLEEP);
-	for (unit = 0; unit  sc-ndevs; unit++) {
-		md = midiseq_open(unit, flags);
-		if (md) {
-			sc-devs[sc-nmidi++] = md;
-			md-seq = sc;
-			md-doingsysex = 0;
+	if (sc-ndevs  0) {
+		mutex_exit(sc-lock);
+		sc-devs = kmem_alloc(sc-ndevs * sizeof(struct midi_dev *),
+		KM_SLEEP);
+		for (unit = 0; unit  sc-ndevs; unit++) {
+			md = midiseq_open(unit, flags);
+			if (md) {
+sc-devs[sc-nmidi++] = md;
+md-seq = sc;
+md-doingsysex = 0;
+			}
 		}
+		mutex_enter(sc-lock);
+	} else {
+		sc-devs = NULL;
 	}
-	mutex_enter(sc-lock);
 
 	/* Only now redirect input from MIDI devices. */
 	for (unit = 0; unit  sc-nmidi; unit++) {
@@ -385,7 +390,11 @@ sequencerclose(dev_t dev, int flags, int
 
 	for (unit = 0; unit  sc-nmidi; unit++)
 		midiseq_close(sc-devs[unit]);
-	kmem_free(sc-devs, sc-ndevs * sizeof(struct midi_dev *));
+	if (sc-devs != NULL) {
+		KASSERT(sc-ndevs  0);
+		kmem_free(sc-devs, sc-ndevs * sizeof(struct midi_dev *));
+		sc-devs = NULL;
+	}
 
 	mutex_enter(sc-lock);
 	sc-isopen = 0;



CVS commit: src/external/mit/xorg/bin/x11perf

2011-11-20 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Nov 20 21:02:23 UTC 2011

Modified Files:
src/external/mit/xorg/bin/x11perf: Makefile

Log Message:
Add missing CLEANFILES+=x11perfcomp


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/bin/x11perf/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/bin/x11perf/Makefile
diff -u src/external/mit/xorg/bin/x11perf/Makefile:1.2 src/external/mit/xorg/bin/x11perf/Makefile:1.3
--- src/external/mit/xorg/bin/x11perf/Makefile:1.2	Wed Aug  3 02:55:30 2011
+++ src/external/mit/xorg/bin/x11perf/Makefile	Sun Nov 20 21:02:23 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2011/08/03 02:55:30 mrg Exp $
+#	$NetBSD: Makefile,v 1.3 2011/11/20 21:02:23 dholland Exp $
 
 .include bsd.own.mk
 
@@ -24,6 +24,8 @@ SCRIPTSDIR_fillblnk.sh=	${X11LIBDIR}/x11
 SCRIPTSDIR_perfboth.sh=	${X11LIBDIR}/x11perfcomp
 SCRIPTSDIR_perfratio.sh=${X11LIBDIR}/x11perfcomp
 
+CLEANFILES+=	x11perfcomp
+
 LDADD+=	-lXft -lfontconfig -lfreetype -lexpat -lXrender
 DPADD+=	${LIBXFT} ${LIBFONTCONFIG} ${LIBFREETYPE} ${LIBEXPAT} ${LIBXRENDER}
 LDADD+=	-lXmuu -lXt -lSM -lICE -lXext -lX11 -lm



CVS commit: src/sys/kern

2011-11-20 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Sun Nov 20 21:27:26 UTC 2011

Modified Files:
src/sys/kern: subr_kmem.c

Log Message:
Use va_copy to avoid undefined behaviour in handling the
va_list arg.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/kern/subr_kmem.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_kmem.c
diff -u src/sys/kern/subr_kmem.c:1.36 src/sys/kern/subr_kmem.c:1.37
--- src/sys/kern/subr_kmem.c:1.36	Fri Sep  2 22:25:08 2011
+++ src/sys/kern/subr_kmem.c	Sun Nov 20 21:27:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kmem.c,v 1.36 2011/09/02 22:25:08 dyoung Exp $	*/
+/*	$NetBSD: subr_kmem.c,v 1.37 2011/11/20 21:27:26 apb Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.36 2011/09/02 22:25:08 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.37 2011/11/20 21:27:26 apb Exp $);
 
 #include sys/param.h
 #include sys/callback.h
@@ -473,20 +473,22 @@ char *
 kmem_asprintf(const char *fmt, ...)
 {
 	int size, str_len;
-	va_list va;
+	va_list va, va2;
 	char *str;
 	char buf[1];
 	
 	va_start(va, fmt);
+	va_copy(va2, va);
 	str_len = vsnprintf(buf, sizeof(buf), fmt, va) + 1;
 	va_end(va);
 
 	str = kmem_alloc(str_len, KM_SLEEP);
 
-	if ((size = vsnprintf(str, str_len, fmt, va)) == -1) {
+	if ((size = vsnprintf(str, str_len, fmt, va2)) == -1) {
 		kmem_free(str, str_len);
 		return NULL;
 	}
+	va_end(va2);
 
 	return str;
 }



CVS commit: src

2011-11-20 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Nov 20 21:43:35 UTC 2011

Modified Files:
src/common/include/quota: quota.h quotaprop.h
src/lib/libquota: getnfsquota.c
src/sys/compat/common: vfs_syscalls_50.c
src/sys/sys: quota.h
src/sys/ufs/ufs: quota1.h quota1_subr.c

Log Message:
Reshuffle decls among the quota headers so everything is in the place
it should be:
   - stuff for the proplib interface goes in quota/quotaprop.h
   - stuff for userlevel only goes in quota/quota.h
   - stuff shared between user and kernel goes in sys/quota.h

Note that quota/quota.h and quota/quotaprop.h are expected to be
moved or removed later on... one thing at a time.

Update include directives in other files as needed.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/include/quota/quota.h \
src/common/include/quota/quotaprop.h
cvs rdiff -u -r1.2 -r1.3 src/lib/libquota/getnfsquota.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/common/vfs_syscalls_50.c
cvs rdiff -u -r1.4 -r1.5 src/sys/sys/quota.h
cvs rdiff -u -r1.3 -r1.4 src/sys/ufs/ufs/quota1.h
cvs rdiff -u -r1.4 -r1.5 src/sys/ufs/ufs/quota1_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/include/quota/quota.h
diff -u src/common/include/quota/quota.h:1.2 src/common/include/quota/quota.h:1.3
--- src/common/include/quota/quota.h:1.2	Tue Jun  7 14:56:12 2011
+++ src/common/include/quota/quota.h	Sun Nov 20 21:43:34 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: quota.h,v 1.2 2011/06/07 14:56:12 bouyer Exp $ */
+/* $NetBSD: quota.h,v 1.3 2011/11/20 21:43:34 dholland Exp $ */
 /*-
   * Copyright (c) 2010 Manuel Bouyer
   * All rights reserved.
@@ -25,14 +25,16 @@
   * POSSIBILITY OF SUCH DAMAGE.
   */
 
-#ifndef _QUOTA_QUOTA_H
-#define _QUOTA_QUOTA_H
+#ifndef _QUOTA_QUOTA_H_
+#define _QUOTA_QUOTA_H_
+
 #include sys/types.h
-#include quota/quotaprop.h
+#include sys/quota.h
+
+/*
+ * Return codes for quota_check_limit()
+ */
 
-/* check a quota usage against limits (assumes UFS semantic) */
-int quota_check_limit(uint64_t, uint64_t,  uint64_t, uint64_t, time_t, time_t);
-/* return values for above */
 #define QL_S_ALLOW_OK	0x00 /* below soft limit */
 #define QL_S_ALLOW_SOFT	0x01 /* over soft limit */
 #define QL_S_DENY_GRACE	0x02 /* over soft limit, grace time expired */
@@ -43,6 +45,9 @@ int quota_check_limit(uint64_t, uint64_t
 #define QL_STATUS(x)	((x)  0x0f)
 #define QL_FLAGS(x)	((x)  0xf0)
 
+/* check a quota usage against limits (assumes UFS semantic) */
+int quota_check_limit(uint64_t, uint64_t,  uint64_t, uint64_t, time_t, time_t);
+
 /*
  * retrieve quotas with ufs semantics from vfs, for the given id and class.
  * second argument points to a struct ufs_quota_entry array of QUOTA_NLIMITS
@@ -56,4 +61,4 @@ int getnfsquota(const char *, struct ufs
 /* call one of the above, if appropriate, after a statvfs(2) */
 int getfsquota(const char *, struct ufs_quota_entry *, uid_t, const char *);
 
-#endif /* _QUOTA_QUOTA_H */
+#endif /* _QUOTA_QUOTA_H_ */
Index: src/common/include/quota/quotaprop.h
diff -u src/common/include/quota/quotaprop.h:1.2 src/common/include/quota/quotaprop.h:1.3
--- src/common/include/quota/quotaprop.h:1.2	Tue Jun  7 14:56:12 2011
+++ src/common/include/quota/quotaprop.h	Sun Nov 20 21:43:34 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: quotaprop.h,v 1.2 2011/06/07 14:56:12 bouyer Exp $ */
+/* $NetBSD: quotaprop.h,v 1.3 2011/11/20 21:43:34 dholland Exp $ */
 /*-
   * Copyright (c) 2010 Manuel Bouyer
   * All rights reserved.
@@ -25,33 +25,25 @@
   * POSSIBILITY OF SUCH DAMAGE.
   */
 
-#ifndef _QUOTA_QUOTAPROP_H
-#define _QUOTA_QUOTAPROP_H
-#include prop/proplib.h
-#include sys/quota.h
-
-int quotaprop_dict_get_uint64(prop_dictionary_t, uint64_t[],
-const char *[], int, bool);
-int proptoquota64(prop_dictionary_t, uint64_t *[], const char *[], int,
-const char *[], int);
+#ifndef _QUOTA_QUOTAPROP_H_
+#define _QUOTA_QUOTAPROP_H_
 
-int quota_get_cmds(prop_dictionary_t, prop_array_t *);
-prop_dictionary_t quota_prop_create(void);
-bool quota_prop_add_command(prop_array_t, const char *, const char *,
-prop_array_t);
-
-prop_dictionary_t limits64toprop(uint64_t[], const char *[], int);
-prop_dictionary_t quota64toprop(uid_t, int, uint64_t *[], const char *[], int,
-const char *[], int);
+#include prop/proplib.h
 
-/* structure used to describe a UFS-like quota entry */
-struct ufs_quota_entry {
-uint64_t ufsqe_hardlimit; /* absolute limit */
-	uint64_t ufsqe_softlimit; /* overflowable limit */
-	uint64_t ufsqe_cur; /* current usage */
-	int64_t ufsqe_time; /* grace expiration date for softlimit overflow */
-	int64_t ufsqe_grace; /* allowed time for softlimit overflow */
-};
+/* strings used in dictionary for the different quota class */
+#define QUOTADICT_CLASS_USER user
+#define QUOTADICT_CLASS_GROUP group
+
+/* strings used in dictionary for the different limit types */

CVS commit: src/distrib/sets/lists/xcomp

2011-11-20 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sun Nov 20 21:50:39 UTC 2011

Modified Files:
src/distrib/sets/lists/xcomp: md.sparc

Log Message:
Add Xorg modules debug entries.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/distrib/sets/lists/xcomp/md.sparc

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/xcomp/md.sparc
diff -u src/distrib/sets/lists/xcomp/md.sparc:1.9 src/distrib/sets/lists/xcomp/md.sparc:1.10
--- src/distrib/sets/lists/xcomp/md.sparc:1.9	Sun Mar 14 23:19:18 2010
+++ src/distrib/sets/lists/xcomp/md.sparc	Sun Nov 20 21:50:38 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: md.sparc,v 1.9 2010/03/14 23:19:18 mrg Exp $
+#	$NetBSD: md.sparc,v 1.10 2011/11/20 21:50:38 njoly Exp $
 ./usr/libdata/debug/usr/X11R7/bin/Xorg.debug		-unknown-	debug,xorg
 ./usr/libdata/debug/usr/X11R7/bin/Xvfb.debug		-unknown-	debug,xorg
 ./usr/libdata/debug/usr/X11R7/bin/cvt.debug		-unknown-	debug,xorg
@@ -7,3 +7,79 @@
 ./usr/libdata/debug/usr/X11R7/bin/scanpci.debug		-unknown-	obsolete
 ./usr/libdata/debug/usr/X11R7/bin/xf86cfg.debug		-unknown-	obsolete
 ./usr/libdata/debug/usr/X11R7/bin/xf86config.debug	-unknown-	obsolete
+./usr/libdata/debug/usr/X11R7/lib/modules/dri/libmach64_dri.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/dri/libmga_dri.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/dri/libr128_dri.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/dri/libr200_dri.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/dri/libr300_dri.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/dri/libr600_dri.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/dri/libradeon_dri.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libag10e_drv.so.0.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libati_drv.so.6.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libglint_drv.so.1.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libkbd_drv.so.1.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libmach64_drv.so.6.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libmga_drv.so.1.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libmouse_drv.so.1.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libpnozz_drv.so.0.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libr128_drv.so.6.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libradeon_drv.so.6.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libsuncg14_drv.so.1.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libsuncg6_drv.so.1.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libsunffb_drv.so.1.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libsunleo_drv.so.1.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libsuntcx_drv.so.1.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libws_drv.so.1.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libwsfb_drv.so.0.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libdbe.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libdri.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libdri2.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libextmod.so.0.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libglx.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/librecord.so.0.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libshadow.so.0.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/libexa.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/libfb.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/libi2c.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/libshadowfb.so.0.debug	-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/libvbe.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/libvgahw.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/libxaa.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/dri/libmach64_dri.so.0.debug		-unknown-	xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/dri/libmga_dri.so.0.debug		-unknown-	xorg,debug

CVS commit: src/sys/dev/usb

2011-11-20 Thread Gavan Fantom
Module Name:src
Committed By:   gavan
Date:   Sun Nov 20 22:27:39 UTC 2011

Modified Files:
src/sys/dev/usb: ugen.c

Log Message:
Implement timeouts when blocking the calling process with tsleep.

Fixes PR kern/33452


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/usb/ugen.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/ugen.c
diff -u src/sys/dev/usb/ugen.c:1.111 src/sys/dev/usb/ugen.c:1.112
--- src/sys/dev/usb/ugen.c:1.111	Wed Nov  3 22:34:23 2010
+++ src/sys/dev/usb/ugen.c	Sun Nov 20 22:27:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ugen.c,v 1.111 2010/11/03 22:34:23 dyoung Exp $	*/
+/*	$NetBSD: ugen.c,v 1.112 2011/11/20 22:27:39 gavan Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ugen.c,v 1.111 2010/11/03 22:34:23 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: ugen.c,v 1.112 2011/11/20 22:27:39 gavan Exp $);
 
 #include opt_compat_netbsd.h
 
@@ -619,7 +619,7 @@ ugen_do_read(struct ugen_softc *sc, int 
 			}
 			sce-state |= UGEN_ASLP;
 			DPRINTFN(5, (ugenread: sleep on %p\n, sce));
-			error = tsleep(sce, PZERO | PCATCH, ugenri, 0);
+			error = tsleep(sce, PZERO | PCATCH, ugenri, mstohz(sce-timeout));
 			DPRINTFN(5, (ugenread: woke, error=%d\n, error));
 			if (sc-sc_dying)
 error = EIO;
@@ -664,7 +664,7 @@ ugen_do_read(struct ugen_softc *sc, int 
 		 (ugenread: sleep on %p\n,
 		  sce));
 	error = tsleep(sce, PZERO | PCATCH,
-		   ugenrb, 0);
+		   ugenrb, mstohz(sce-timeout));
 	DPRINTFN(5,
 		 (ugenread: woke, error=%d\n,
 		  error));
@@ -755,7 +755,7 @@ ugen_do_read(struct ugen_softc *sc, int 
 			}
 			sce-state |= UGEN_ASLP;
 			DPRINTFN(5, (ugenread: sleep on %p\n, sce));
-			error = tsleep(sce, PZERO | PCATCH, ugenri, 0);
+			error = tsleep(sce, PZERO | PCATCH, ugenri, mstohz(sce-timeout));
 			DPRINTFN(5, (ugenread: woke, error=%d\n, error));
 			if (sc-sc_dying)
 error = EIO;
@@ -862,7 +862,7 @@ ugen_do_write(struct ugen_softc *sc, int
 		 (ugenwrite: sleep on %p\n,
 		  sce));
 	error = tsleep(sce, PZERO | PCATCH,
-		   ugenwb, 0);
+		   ugenwb, mstohz(sce-timeout));
 	DPRINTFN(5,
 		 (ugenwrite: woke, error=%d\n,
 		  error));



CVS commit: src/sys/sys

2011-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 20 22:50:12 UTC 2011

Modified Files:
src/sys/sys: kmem.h

Log Message:
mark printf function


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/sys/kmem.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/kmem.h
diff -u src/sys/sys/kmem.h:1.4 src/sys/sys/kmem.h:1.5
--- src/sys/sys/kmem.h:1.4	Thu Feb 11 18:13:46 2010
+++ src/sys/sys/kmem.h	Sun Nov 20 17:50:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kmem.h,v 1.4 2010/02/11 23:13:46 haad Exp $	*/
+/*	$NetBSD: kmem.h,v 1.5 2011/11/20 22:50:12 christos Exp $	*/
 
 /*-
  * Copyright (c)2006 YAMAMOTO Takashi,
@@ -39,7 +39,8 @@ void kmem_free(void *, size_t);
 void kmem_init(void);
 size_t kmem_roundup_size(size_t);
 
-char *kmem_asprintf(const char *, ...);
+char *kmem_asprintf(const char *, ...)
+ __attribute__((__format__(__printf__, 1, 2)));
 /*
  * km_flag_t
  *



CVS commit: src/sys/kern

2011-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 20 22:58:31 UTC 2011

Modified Files:
src/sys/kern: subr_kmem.c

Log Message:
simplify, no need for va_copy here. Add KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/kern/subr_kmem.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_kmem.c
diff -u src/sys/kern/subr_kmem.c:1.37 src/sys/kern/subr_kmem.c:1.38
--- src/sys/kern/subr_kmem.c:1.37	Sun Nov 20 16:27:26 2011
+++ src/sys/kern/subr_kmem.c	Sun Nov 20 17:58:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kmem.c,v 1.37 2011/11/20 21:27:26 apb Exp $	*/
+/*	$NetBSD: subr_kmem.c,v 1.38 2011/11/20 22:58:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.37 2011/11/20 21:27:26 apb Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.38 2011/11/20 22:58:31 christos Exp $);
 
 #include sys/param.h
 #include sys/callback.h
@@ -472,23 +472,21 @@ kmem_size_check(const void *p, size_t sz
 char *
 kmem_asprintf(const char *fmt, ...)
 {
-	int size, str_len;
-	va_list va, va2;
+	int size, len;
+	va_list va;
 	char *str;
-	char buf[1];
 	
 	va_start(va, fmt);
-	va_copy(va2, va);
-	str_len = vsnprintf(buf, sizeof(buf), fmt, va) + 1;
+	len = vsnprintf(NULL, 0, fmt, va);
 	va_end(va);
 
-	str = kmem_alloc(str_len, KM_SLEEP);
+	str = kmem_alloc(len + 1, KM_SLEEP);
 
-	if ((size = vsnprintf(str, str_len, fmt, va2)) == -1) {
-		kmem_free(str, str_len);
-		return NULL;
-	}
-	va_end(va2);
+	va_start(va, fmt);
+	size = vsnprintf(str, len + 1, fmt, va);
+	va_end(va);
+
+	KASSERT(size == len);
 
 	return str;
 }



CVS commit: src/sys/kern

2011-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 20 23:01:19 UTC 2011

Modified Files:
src/sys/kern: subr_prf.c

Log Message:
snprintf/vsnprintf can accept NULL/0 buffers and work properly as expected.
Before they used to return incorrect length on short buffers. Remove unused
error path.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/kern/subr_prf.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_prf.c
diff -u src/sys/kern/subr_prf.c:1.143 src/sys/kern/subr_prf.c:1.144
--- src/sys/kern/subr_prf.c:1.143	Thu Sep 29 16:52:39 2011
+++ src/sys/kern/subr_prf.c	Sun Nov 20 18:01:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.143 2011/09/29 20:52:39 christos Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.144 2011/11/20 23:01:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_prf.c,v 1.143 2011/09/29 20:52:39 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_prf.c,v 1.144 2011/11/20 23:01:18 christos Exp $);
 
 #include opt_ddb.h
 #include opt_ipkdb.h
@@ -1024,8 +1024,9 @@ sprintf(char *bf, const char *fmt, ...)
 	va_start(ap, fmt);
 	retval = kprintf(fmt, TOBUFONLY, NULL, bf, ap);
 	va_end(ap);
-	*(bf + retval) = 0;	/* null terminate */
-	return(retval);
+	if (bf)
+		bf[retval] = '\0';	/* nul terminate */
+	return retval;
 }
 
 /*
@@ -1038,8 +1039,9 @@ vsprintf(char *bf, const char *fmt, va_l
 	int retval;
 
 	retval = kprintf(fmt, TOBUFONLY, NULL, bf, ap);
-	*(bf + retval) = 0;	/* null terminate */
-	return (retval);
+	if (bf)
+		bf[retval] = '\0';	/* nul terminate */
+	return retval;
 }
 
 /*
@@ -1052,14 +1054,13 @@ snprintf(char *bf, size_t size, const ch
 	va_list ap;
 	char *p;
 
-	if (size  1)
-		return (-1);
-	p = bf + size - 1;
+	p = bf + size;
 	va_start(ap, fmt);
 	retval = kprintf(fmt, TOBUFONLY, p, bf, ap);
 	va_end(ap);
-	*(p) = 0;	/* null terminate */
-	return(retval);
+	if (bf  p  bf + size)
+		*p = '\0';	/* nul terminate */
+	return retval;
 }
 
 /*
@@ -1071,12 +1072,11 @@ vsnprintf(char *bf, size_t size, const c
 	int retval;
 	char *p;
 
-	if (size  1)
-		return (-1);
-	p = bf + size - 1;
+	p = bf + size;
 	retval = kprintf(fmt, TOBUFONLY, p, bf, ap);
-	*(p) = 0;	/* null terminate */
-	return(retval);
+	if (bf  p  bf + size)
+		*p = '\0';	/* nul terminate */
+	return retval;
 }
 
 /*
@@ -1134,13 +1134,10 @@ vsnprintf(char *bf, size_t size, const c
 
 #define KPRINTF_PUTCHAR(C) {		\
 	if (oflags == TOBUFONLY) {	\
-		if ((vp != NULL)  (sbuf == tailp)) {			\
-			ret += 1;		/* indicate error */	\
-			goto overflow;	\
-		}			\
-		*sbuf++ = (C);		\
+		if ((vp == NULL) || (sbuf  tailp)) 			\
+			*sbuf++ = (C);	\
 	} else {			\
-		putchar((C), oflags, (struct tty *)vp);			\
+		putchar((C), oflags, vp);\
 	}\
 }
 
@@ -1181,9 +1178,10 @@ kprintf(const char *fmt0, int oflags, vo
 	char bf[KPRINTF_BUFSIZE]; /* space for %c, %[diouxX] */
 	char *tailp;		/* tail pointer for snprintf */
 
-	tailp = NULL;	/* XXX: shutup gcc */
 	if (oflags == TOBUFONLY  (vp != NULL))
 		tailp = *(char **)vp;
+	else
+		tailp = NULL;
 
 	cp = NULL;	/* XXX: shutup gcc */
 	size = 0;	/* XXX: shutup gcc */
@@ -1526,7 +1524,5 @@ done:
 	if ((oflags == TOBUFONLY)  (vp != NULL))
 		*(char **)vp = sbuf;
 	(*v_flush)();
-overflow:
-	return (ret);
-	/* NOTREACHED */
+	return ret;
 }



CVS commit: src/sys/sys

2011-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 20 23:37:00 UTC 2011

Modified Files:
src/sys/sys: aio.h buf.h kernhist.h lockdebug.h lwp.h malloc.h mbuf.h
module.h mqueue.h namei.h pool.h sched.h sleepq.h vmem.h vnode.h
wapbl.h

Log Message:
add more missing printf attributes.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/sys/aio.h
cvs rdiff -u -r1.116 -r1.117 src/sys/sys/buf.h
cvs rdiff -u -r1.2 -r1.3 src/sys/sys/kernhist.h
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/lockdebug.h src/sys/sys/wapbl.h
cvs rdiff -u -r1.156 -r1.157 src/sys/sys/lwp.h
cvs rdiff -u -r1.107 -r1.108 src/sys/sys/malloc.h
cvs rdiff -u -r1.146 -r1.147 src/sys/sys/mbuf.h
cvs rdiff -u -r1.28 -r1.29 src/sys/sys/module.h
cvs rdiff -u -r1.14 -r1.15 src/sys/sys/mqueue.h src/sys/sys/vmem.h
cvs rdiff -u -r1.77 -r1.78 src/sys/sys/namei.h
cvs rdiff -u -r1.70 -r1.71 src/sys/sys/pool.h
cvs rdiff -u -r1.73 -r1.74 src/sys/sys/sched.h
cvs rdiff -u -r1.19 -r1.20 src/sys/sys/sleepq.h
cvs rdiff -u -r1.233 -r1.234 src/sys/sys/vnode.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/aio.h
diff -u src/sys/sys/aio.h:1.9 src/sys/sys/aio.h:1.10
--- src/sys/sys/aio.h:1.9	Sat Jan 10 21:45:55 2009
+++ src/sys/sys/aio.h	Sun Nov 20 18:37:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: aio.h,v 1.9 2009/01/11 02:45:55 christos Exp $	*/
+/*	$NetBSD: aio.h,v 1.10 2011/11/20 23:37:00 christos Exp $	*/
 
 /*
  * Copyright (c) 2007, Mindaugas Rasiukevicius rmind at NetBSD org
@@ -115,7 +115,8 @@ struct aioproc {
 
 extern u_int aio_listio_max;
 /* Prototypes */
-void	aio_print_jobs(void (*pr)(const char *, ...));
+void	aio_print_jobs(void (*)(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2;
 int	aio_suspend1(struct lwp *, struct aiocb **, int, struct timespec *);
 
 #endif /* _KERNEL */

Index: src/sys/sys/buf.h
diff -u src/sys/sys/buf.h:1.116 src/sys/sys/buf.h:1.117
--- src/sys/sys/buf.h:1.116	Wed Apr 27 05:47:25 2011
+++ src/sys/sys/buf.h	Sun Nov 20 18:37:00 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.h,v 1.116 2011/04/27 09:47:25 hannken Exp $ */
+/* $NetBSD: buf.h,v 1.117 2011/11/20 23:37:00 christos Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2007, 2008 The NetBSD Foundation, Inc.
@@ -290,7 +290,8 @@ u_long	buf_memcalc(void);
 int	buf_drain(int);
 int	buf_setvalimit(vsize_t);
 #if defined(DDB) || defined(DEBUGPRINT)
-void	vfs_buf_print(buf_t *, int, void (*)(const char *, ...));
+void	vfs_buf_print(buf_t *, int, void (*)(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2;
 #endif
 buf_t	*getiobuf(struct vnode *, bool);
 void	putiobuf(buf_t *);

Index: src/sys/sys/kernhist.h
diff -u src/sys/sys/kernhist.h:1.2 src/sys/sys/kernhist.h:1.3
--- src/sys/sys/kernhist.h:1.2	Fri Jun 10 10:59:35 2011
+++ src/sys/sys/kernhist.h	Sun Nov 20 18:37:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernhist.h,v 1.2 2011/06/10 14:59:35 matt Exp $	*/
+/*	$NetBSD: kernhist.h,v 1.3 2011/11/20 23:37:00 christos Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -189,7 +189,8 @@ kernhist_entry_print(const struct kern_h
 }
 
 #if defined(DDB)
-void	kernhist_print(void (*)(const char *, ...));
+void	kernhist_print(void (*)(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2;
 #endif /* DDB */
 
 #endif /* KERNHIST */

Index: src/sys/sys/lockdebug.h
diff -u src/sys/sys/lockdebug.h:1.11 src/sys/sys/lockdebug.h:1.12
--- src/sys/sys/lockdebug.h:1.11	Sat Mar  7 16:59:25 2009
+++ src/sys/sys/lockdebug.h	Sun Nov 20 18:37:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: lockdebug.h,v 1.11 2009/03/07 21:59:25 ad Exp $	*/
+/*	$NetBSD: lockdebug.h,v 1.12 2011/11/20 23:37:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -55,7 +55,8 @@ typedef	struct lockops {
 void	lockdebug_abort(volatile void *, lockops_t *,
 			const char *, const char *);
 
-void	lockdebug_lock_print(void *, void (*)(const char *, ...));
+void	lockdebug_lock_print(void *, void (*)(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2;
 
 #ifdef LOCKDEBUG
 
Index: src/sys/sys/wapbl.h
diff -u src/sys/sys/wapbl.h:1.11 src/sys/sys/wapbl.h:1.12
--- src/sys/sys/wapbl.h:1.11	Wed Apr 21 12:51:24 2010
+++ src/sys/sys/wapbl.h	Sun Nov 20 18:37:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wapbl.h,v 1.11 2010/04/21 16:51:24 pooka Exp $	*/
+/*	$NetBSD: wapbl.h,v 1.12 2011/11/20 23:37:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003,2008 The NetBSD Foundation, Inc.
@@ -170,7 +170,8 @@ void	wapbl_register_deallocation(struct 
 void	wapbl_jlock_assert(struct wapbl *wl);
 void	wapbl_junlock_assert(struct wapbl *wl);
 
-void	wapbl_print(struct wapbl *wl, int full, void (*pr)(const char *, ...));
+void	wapbl_print(struct wapbl *wl, int full, void (*pr)(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2;
 
 #if defined(WAPBL_DEBUG) || 

CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2011-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 21 00:24:24 UTC 2011

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: spa_config.c

Log Message:
close file in a way that it does not trigger an assertion :-)
now zpool create works again.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c:1.4 src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c:1.5
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c:1.4	Wed Mar  9 18:49:06 2011
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c	Sun Nov 20 19:24:24 2011
@@ -179,8 +179,7 @@ spa_config_write(spa_config_dirent_t *dp
 		VOP_FSYNC(vp, FSYNC, kcred, NULL) == 0) {
 			(void) vn_rename(temp, dp-scd_path, UIO_SYSSPACE);
 		}
-		(void) VOP_CLOSE(vp, oflags, 1, 0, kcred, NULL);
-		VN_RELE(vp);
+		vn_close(vp, FWRITE, kcred);
 	}
 
 	(void) vn_remove(temp, UIO_SYSSPACE, RMFILE);



CVS commit: src/sys/kern

2011-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 21 01:44:27 UTC 2011

Modified Files:
src/sys/kern: subr_prf.c

Log Message:
- use va_copy where needed
- always nul terminate vsnprintf()
- make snprintf() call vsnprintf()


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/kern/subr_prf.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_prf.c
diff -u src/sys/kern/subr_prf.c:1.144 src/sys/kern/subr_prf.c:1.145
--- src/sys/kern/subr_prf.c:1.144	Sun Nov 20 18:01:18 2011
+++ src/sys/kern/subr_prf.c	Sun Nov 20 20:44:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.144 2011/11/20 23:01:18 christos Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.145 2011/11/21 01:44:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_prf.c,v 1.144 2011/11/20 23:01:18 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_prf.c,v 1.145 2011/11/21 01:44:26 christos Exp $);
 
 #include opt_ddb.h
 #include opt_ipkdb.h
@@ -348,15 +348,18 @@ log(int level, const char *fmt, ...)
 void
 vlog(int level, const char *fmt, va_list ap)
 {
+	va_list cap;
 
+	va_copy(cap, ap);
 	kprintf_lock();
 
 	klogpri(level);		/* log the level first */
 	kprintf(fmt, TOLOG, NULL, NULL, ap);
 	if (!log_open)
-		kprintf(fmt, TOCONS, NULL, NULL, ap);
+		kprintf(fmt, TOCONS, NULL, NULL, cap);
 
 	kprintf_unlock();
+	va_end(cap);
 
 	logwakeup();		/* wake up anyone waiting for log msgs */
 }
@@ -627,11 +630,14 @@ db_printf(const char *fmt, ...)
 void
 db_vprintf(const char *fmt, va_list ap)
 {
+	va_list cap;
 
+	va_copy(cap, ap);
 	/* No mutex needed; DDB pauses all processors. */
 	kprintf(fmt, TODDB, NULL, NULL, ap);
 	if (db_tee_msgbuf)
-		kprintf(fmt, TOLOG, NULL, NULL, ap);
+		kprintf(fmt, TOLOG, NULL, NULL, cap);
+	va_end(cap);
 }
 
 #endif /* DDB */
@@ -1052,14 +1058,11 @@ snprintf(char *bf, size_t size, const ch
 {
 	int retval;
 	va_list ap;
-	char *p;
 
-	p = bf + size;
 	va_start(ap, fmt);
-	retval = kprintf(fmt, TOBUFONLY, p, bf, ap);
+	retval = vsnprintf(bf, size, fmt, ap);
 	va_end(ap);
-	if (bf  p  bf + size)
-		*p = '\0';	/* nul terminate */
+
 	return retval;
 }
 
@@ -1074,8 +1077,13 @@ vsnprintf(char *bf, size_t size, const c
 
 	p = bf + size;
 	retval = kprintf(fmt, TOBUFONLY, p, bf, ap);
-	if (bf  p  bf + size)
-		*p = '\0';	/* nul terminate */
+	if (bf  size  0) {
+		/* nul terminate */
+		if (p  bf + size)
+			*p = '\0';
+		else
+			*--p = '\0';
+	}
 	return retval;
 }
 



CVS commit: src/sys/sys

2011-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 21 04:36:06 UTC 2011

Modified Files:
src/sys/sys: aio.h buf.h kernhist.h kmem.h kthread.h lockdebug.h lwp.h
malloc.h mbuf.h module.h mqueue.h namei.h pool.h sched.h sleepq.h
syslog.h systm.h tprintf.h vmem.h vnode.h wapbl.h

Log Message:
change printf gcc attribute to __printflike(), requested by joerg.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/aio.h
cvs rdiff -u -r1.117 -r1.118 src/sys/sys/buf.h
cvs rdiff -u -r1.3 -r1.4 src/sys/sys/kernhist.h
cvs rdiff -u -r1.5 -r1.6 src/sys/sys/kmem.h
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/kthread.h
cvs rdiff -u -r1.12 -r1.13 src/sys/sys/lockdebug.h src/sys/sys/wapbl.h
cvs rdiff -u -r1.157 -r1.158 src/sys/sys/lwp.h
cvs rdiff -u -r1.108 -r1.109 src/sys/sys/malloc.h
cvs rdiff -u -r1.147 -r1.148 src/sys/sys/mbuf.h
cvs rdiff -u -r1.29 -r1.30 src/sys/sys/module.h
cvs rdiff -u -r1.15 -r1.16 src/sys/sys/mqueue.h src/sys/sys/vmem.h
cvs rdiff -u -r1.78 -r1.79 src/sys/sys/namei.h
cvs rdiff -u -r1.71 -r1.72 src/sys/sys/pool.h
cvs rdiff -u -r1.74 -r1.75 src/sys/sys/sched.h
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/sleepq.h
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/syslog.h
cvs rdiff -u -r1.251 -r1.252 src/sys/sys/systm.h
cvs rdiff -u -r1.17 -r1.18 src/sys/sys/tprintf.h
cvs rdiff -u -r1.234 -r1.235 src/sys/sys/vnode.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/aio.h
diff -u src/sys/sys/aio.h:1.10 src/sys/sys/aio.h:1.11
--- src/sys/sys/aio.h:1.10	Sun Nov 20 18:37:00 2011
+++ src/sys/sys/aio.h	Sun Nov 20 23:36:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: aio.h,v 1.10 2011/11/20 23:37:00 christos Exp $	*/
+/*	$NetBSD: aio.h,v 1.11 2011/11/21 04:36:05 christos Exp $	*/
 
 /*
  * Copyright (c) 2007, Mindaugas Rasiukevicius rmind at NetBSD org
@@ -115,8 +115,7 @@ struct aioproc {
 
 extern u_int aio_listio_max;
 /* Prototypes */
-void	aio_print_jobs(void (*)(const char *, ...)
-__attribute__((__format__(__printf__, 1, 2;
+void	aio_print_jobs(void (*)(const char *, ...) __printflike(1, 2));
 int	aio_suspend1(struct lwp *, struct aiocb **, int, struct timespec *);
 
 #endif /* _KERNEL */

Index: src/sys/sys/buf.h
diff -u src/sys/sys/buf.h:1.117 src/sys/sys/buf.h:1.118
--- src/sys/sys/buf.h:1.117	Sun Nov 20 18:37:00 2011
+++ src/sys/sys/buf.h	Sun Nov 20 23:36:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.h,v 1.117 2011/11/20 23:37:00 christos Exp $ */
+/* $NetBSD: buf.h,v 1.118 2011/11/21 04:36:05 christos Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2007, 2008 The NetBSD Foundation, Inc.
@@ -291,7 +291,7 @@ int	buf_drain(int);
 int	buf_setvalimit(vsize_t);
 #if defined(DDB) || defined(DEBUGPRINT)
 void	vfs_buf_print(buf_t *, int, void (*)(const char *, ...)
-__attribute__((__format__(__printf__, 1, 2;
+__printflike(1, 2));
 #endif
 buf_t	*getiobuf(struct vnode *, bool);
 void	putiobuf(buf_t *);

Index: src/sys/sys/kernhist.h
diff -u src/sys/sys/kernhist.h:1.3 src/sys/sys/kernhist.h:1.4
--- src/sys/sys/kernhist.h:1.3	Sun Nov 20 18:37:00 2011
+++ src/sys/sys/kernhist.h	Sun Nov 20 23:36:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernhist.h,v 1.3 2011/11/20 23:37:00 christos Exp $	*/
+/*	$NetBSD: kernhist.h,v 1.4 2011/11/21 04:36:05 christos Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -189,8 +189,7 @@ kernhist_entry_print(const struct kern_h
 }
 
 #if defined(DDB)
-void	kernhist_print(void (*)(const char *, ...)
-__attribute__((__format__(__printf__, 1, 2;
+void	kernhist_print(void (*)(const char *, ...) __printflike(1, 2));
 #endif /* DDB */
 
 #endif /* KERNHIST */

Index: src/sys/sys/kmem.h
diff -u src/sys/sys/kmem.h:1.5 src/sys/sys/kmem.h:1.6
--- src/sys/sys/kmem.h:1.5	Sun Nov 20 17:50:12 2011
+++ src/sys/sys/kmem.h	Sun Nov 20 23:36:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kmem.h,v 1.5 2011/11/20 22:50:12 christos Exp $	*/
+/*	$NetBSD: kmem.h,v 1.6 2011/11/21 04:36:05 christos Exp $	*/
 
 /*-
  * Copyright (c)2006 YAMAMOTO Takashi,
@@ -39,8 +39,7 @@ void kmem_free(void *, size_t);
 void kmem_init(void);
 size_t kmem_roundup_size(size_t);
 
-char *kmem_asprintf(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2)));
+char *kmem_asprintf(const char *, ...) __printflike(1, 2);
 /*
  * km_flag_t
  *

Index: src/sys/sys/kthread.h
diff -u src/sys/sys/kthread.h:1.11 src/sys/sys/kthread.h:1.12
--- src/sys/sys/kthread.h:1.11	Sun Aug  7 10:03:16 2011
+++ src/sys/sys/kthread.h	Sun Nov 20 23:36:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kthread.h,v 1.11 2011/08/07 14:03:16 rmind Exp $	*/
+/*	$NetBSD: kthread.h,v 1.12 2011/11/21 04:36:05 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc.
@@ -52,9 +52,7 @@
 void	kthread_sysinit(void);
 
 int	kthread_create(pri_t, int, struct cpu_info *,
-		   void (*)(void *), void *,
-		   lwp_t **, const char *, ...)
-	

CVS commit: src/external/cddl/osnet/sys/sys

2011-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 21 05:50:12 UTC 2011

Modified Files:
src/external/cddl/osnet/sys/sys: zfs_context.h

Log Message:
correct declaration of vn_close()
XXX: Should all those dup declarations be here?


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/cddl/osnet/sys/sys/zfs_context.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/cddl/osnet/sys/sys/zfs_context.h
diff -u src/external/cddl/osnet/sys/sys/zfs_context.h:1.10 src/external/cddl/osnet/sys/sys/zfs_context.h:1.11
--- src/external/cddl/osnet/sys/sys/zfs_context.h:1.10	Sun Jul 17 16:54:33 2011
+++ src/external/cddl/osnet/sys/sys/zfs_context.h	Mon Nov 21 00:50:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: zfs_context.h,v 1.10 2011/07/17 20:54:33 joerg Exp $	*/
+/*	$NetBSD: zfs_context.h,v 1.11 2011/11/21 05:50:11 christos Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -380,7 +380,7 @@ extern int vn_openat(char *path, int x1,
 int x2, int x3, vnode_t *vp, int unk);
 extern int vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len,
 offset_t offset, int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp);
-extern void vn_close(vnode_t *vp);
+extern void vn_close(vnode_t *vp, int flags, kauth_cred_t cred);
 extern int vn_getattr(vnode_t *vp, vattr_t *va);
 
 #define	vn_remove(path, x1, x2)		remove(path)



CVS commit: [jmcneill-audiomp3] src/sys/dev/ic

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 08:39:59 UTC 2011

Modified Files:
src/sys/dev/ic [jmcneill-audiomp3]: opl.c

Log Message:
XXX: don't KASSERT() if sc-lock is NULL, this is going to happen
XXX: during autoconfig match() where we've faked up a sc anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.37.14.1 -r1.37.14.2 src/sys/dev/ic/opl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [jmcneill-audiomp3] src/sys/dev/isa

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 08:40:52 UTC 2011

Modified Files:
src/sys/dev/isa [jmcneill-audiomp3]: ess.c

Log Message:
make sure to return from the end of essattach() before destroying
the callouts and mutexes.  with an uncommited audio.c change, i can
now play audio on my shark with the branch.


To generate a diff of this commit:
cvs rdiff -u -r1.78.10.1 -r1.78.10.2 src/sys/dev/isa/ess.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 09:37:04 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: audio_if.h

Log Message:
don't need to forward declare 'struct malloc_type' anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.66.14.1 -r1.66.14.2 src/sys/dev/audio_if.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 09:40:20 UTC 2011

Modified Files:
src/sys/dev/ebus [jmcneill-audiomp3]: cs4231_ebus.c
src/sys/dev/ic [jmcneill-audiomp3]: cs4231.c cs4231var.h
src/sys/dev/sbus [jmcneill-audiomp3]: cs4231_sbus.c

Log Message:
make audiocs(4) compile.  i don't have anything handy to actually test
this easily, but this was just updating the alloc/free to kmem and
hooking into ad1848_get_locks().


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.4.1 src/sys/dev/ebus/cs4231_ebus.c
cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/dev/ic/cs4231.c
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/dev/ic/cs4231var.h
cvs rdiff -u -r1.48 -r1.48.4.1 src/sys/dev/sbus/cs4231_sbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [jmcneill-audiomp3] src/sys/arch/amiga/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 10:27:36 UTC 2011

Modified Files:
src/sys/arch/amiga/dev [jmcneill-audiomp3]: repulse.c

Log Message:
port this to audiomp branch.  no allocm/freem here, no detach, so just
add/initialise sc_lock and sc_intr_lock, and add get_locks() support.

XXX: untested, but amiga kernels compile now.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.4.1 src/sys/arch/amiga/dev/repulse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/kern

2011-11-20 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sun Nov 20 10:32:33 UTC 2011

Modified Files:
src/sys/kern: kern_verifiedexec.c

Log Message:
Fix locking against self in veriexec_fp_calc().


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/kern/kern_verifiedexec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [jmcneill-audiomp3] src/sys/dev/sbus

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 10:48:55 UTC 2011

Modified Files:
src/sys/dev/sbus [jmcneill-audiomp3]: dbri.c dbrivar.h

Log Message:
port to audiomp:  update allocm/freem, and add get_locks() support.
bots on my ss20, but i haven't really tested it yet.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.6.1 src/sys/dev/sbus/dbri.c
cvs rdiff -u -r1.12 -r1.12.10.1 src/sys/dev/sbus/dbrivar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [yamt-pagecache] src/sys/miscfs/genfs

2011-11-20 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sun Nov 20 10:49:21 UTC 2011

Modified Files:
src/sys/miscfs/genfs [yamt-pagecache]: genfs_io.c genfs_node.h

Log Message:
- simplify code
- comments


To generate a diff of this commit:
cvs rdiff -u -r1.53.2.2 -r1.53.2.3 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.20 -r1.20.8.1 src/sys/miscfs/genfs/genfs_node.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [yamt-pagecache] src/sys

2011-11-20 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sun Nov 20 10:52:35 UTC 2011

Modified Files:
src/sys/kern [yamt-pagecache]: init_main.c
src/sys/uvm [yamt-pagecache]: uvm.h uvm_extern.h uvm_init.c uvm_loan.c
uvm_meter.c uvm_page.c uvm_page.h uvm_page_status.c

Log Message:
- fix page loaning  XXX make O-A loaning further
- add some statistics


To generate a diff of this commit:
cvs rdiff -u -r1.436.2.1 -r1.436.2.2 src/sys/kern/init_main.c
cvs rdiff -u -r1.62.4.2 -r1.62.4.3 src/sys/uvm/uvm.h
cvs rdiff -u -r1.176.2.3 -r1.176.2.4 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.41 -r1.41.4.1 src/sys/uvm/uvm_init.c
cvs rdiff -u -r1.81.2.3 -r1.81.2.4 src/sys/uvm/uvm_loan.c
cvs rdiff -u -r1.56.4.4 -r1.56.4.5 src/sys/uvm/uvm_meter.c
cvs rdiff -u -r1.178.2.6 -r1.178.2.7 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.73.2.6 -r1.73.2.7 src/sys/uvm/uvm_page.h
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/uvm/uvm_page_status.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [jmcneill-audiomp3] src/sys

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 10:56:19 UTC 2011

Modified Files:
src/sys/arch/sparc/dev [jmcneill-audiomp3]: audioamd.c
src/sys/dev/ic [jmcneill-audiomp3]: am7930.c am7930var.h
src/sys/dev/tc [jmcneill-audiomp3]: bba.c

Log Message:
port the am7930 drivers to audiomp.  sparc and pmax GENERIC builds,
but i am unable to test these drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/arch/sparc/dev/audioamd.c
cvs rdiff -u -r1.50 -r1.50.56.1 src/sys/dev/ic/am7930.c
cvs rdiff -u -r1.12 -r1.12.4.1 src/sys/dev/ic/am7930var.h
cvs rdiff -u -r1.38 -r1.38.4.1 src/sys/dev/tc/bba.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 20 10:58:11 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: audio.c

Log Message:
change the locking protocol for audio_get_props().  make it always
assert that the thread lock is held before entry, and arrange to
make this always so.


To generate a diff of this commit:
cvs rdiff -u -r1.253.4.1 -r1.253.4.2 src/sys/dev/audio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [jmcneill-audiomp3] src/sys/dev/pci/hdaudio

2011-11-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 20 11:09:26 UTC 2011

Modified Files:
src/sys/dev/pci/hdaudio [jmcneill-audiomp3]: hdafg.c

Log Message:
need to hold intr_lock while calling audio_pint/audio_rint


To generate a diff of this commit:
cvs rdiff -u -r1.10.4.1 -r1.10.4.2 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.



  1   2   >