CVS commit: src/sys/dev/ic

2011-12-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Dec  7 08:49:29 UTC 2011

Modified Files:
src/sys/dev/ic: sm502reg.h

Log Message:
add a bunch of register definitions


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/sm502reg.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/ic/sm502reg.h
diff -u src/sys/dev/ic/sm502reg.h:1.4 src/sys/dev/ic/sm502reg.h:1.5
--- src/sys/dev/ic/sm502reg.h:1.4	Tue Nov  8 06:56:36 2011
+++ src/sys/dev/ic/sm502reg.h	Wed Dec  7 08:49:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sm502reg.h,v 1.4 2011/11/08 06:56:36 macallan Exp $	*/
+/*	$NetBSD: sm502reg.h,v 1.5 2011/12/07 08:49:29 macallan Exp $	*/
 
 /*
  * Copyright (c) 2009 Michael Lorenz
@@ -59,6 +59,7 @@
 #define 	SM502_SYSCTL_DISABLE_VSYNC	0x8000
 
 #define SM502_MISC_CONTROL		0x0004
+#define 	SM502_DAC_POWER_DOWN		0x1000
 /* each bit: 0 - GPIO, 1 - other stuff */
 #define SM502_GPIO0_CONTROL		0x0008
 #define SM502_GPIO1_CONTROL		0x000c
@@ -112,6 +113,20 @@
 #define SM502_DEBUG_CONTROL		0x0034
 
 #define SM502_CURRENT_GATE		0x0038
+#define		SM502_GATE_AUDIO_ENABLE		0x0004
+#define		SM502_GATE_8051_ENABLE		0x0002
+#define		SM502_GATE_USB_SLAVE_ENABLE	0x1000
+#define		SM502_GATE_USB_HOST_ENABLE	0x0800
+#define		SM502_GATE_SSP_ENABLE		0x0400
+#define		SM502_GATE_UART1_ENABLE		0x0100
+#define		SM502_GATE_UART0_ENABLE		0x0080
+#define		SM502_GATE_GPIO_ENABLE		0x0040
+#define		SM502_GATE_ZV_ENABLE		0x0020
+#define		SM502_GATE_CSC_ENABLE		0x0010
+#define		SM502_GATE_2D_ENGINE_ENABLE	0x0008
+#define		SM502_GATE_DISPLAY_ENABLE	0x0004
+#define		SM502_GATE_MEMORY_ENABLE	0x0002
+#define		SM502_GATE_HOST_ENABLE		0x0001
 #define SM502_CURRENT_CLOCK		0x003c
 #define SM502_POWER_MODE0_GATE		0x0040
 #define SM502_POWER_MODE0_CLOCK		0x0044
@@ -364,4 +379,63 @@
 
 #define	SM502_DATAPORT		0x11
 
+/* AC97 Link */
+#define SM502_AC97_TX_TAG	0x0A0100
+#define		SM502_AC97_FRAME_VALID	0x8000
+#define		SM502_AC97_S1_VALID	0x4000
+#define		SM502_AC97_S2_VALID	0x2000
+#define		SM502_AC97_S3_VALID	0x1000
+#define		SM502_AC97_S4_VALID	0x0800
+#define SM502_AC97_TX_ADDR	0x0A0104
+#define		SM502_AC97_READ		0x0010	/* write otherwise */
+#define		SM502_AC97_ADDR_MASK	0x000fe000
+#define SM502_AC97_TX_DATA	0x0A0108
+#define		SM502_AC97_DATA_MASK	0x0000
+#define SM502_AC97_TX_LEFT	0x0A010C
+#define SM502_AC97_TX_RIGHT	0x0A0110
+#define SM502_AC97_RX_TAG	0x0A0140
+#define SM502_AC97_RX_ADDR	0x0A0144
+#define SM502_AC97_RX_DATA	0x0A0148
+#define SM502_AC97_RX_LEFT	0x0A014C
+#define SM502_AC97_RX_RIGHT	0x0A0150
+#define SM502_AC97_CONTROL	0x0A0180
+#define		SM502_AC97_DROP_COUNT	0xfc00
+#define		SM502_AC97_STOP_SYNC	0x0200
+#define		SM502_AC97_BCLK_RUNNING	0x0100
+#define		SM502_AC97_WAKEUP_REQ	0x0080
+#define		SM502_AC97_STATUS_MASK	0x0030
+#define		SM502_AC97_STATUS_OFF	0x
+#define		SM502_AC97_STATUS_RESET	0x0010
+#define		SM502_AC97_STATUS_WAIT	0x0020
+#define		SM502_AC97_STATUS_ON	0x0030
+#define		SM502_AC97_WI_ENABLE	0x0008	/* wakeup interrupt */
+#define		SM502_AC97_WARM_RESET	0x0004	/* 1uS at least */
+#define		SM502_AC97_COLD_RESET	0x0002	/* 1uS at least */
+#define		SM502_AC97_ENABLE	0x0001
+
+#define SM502_AUDIO_GPIO_MASK	0x1f00	/* pins used */
+
+/* 8051 Microcontroller */
+#define SM502_uC_RESET		0x000b
+#define 	SM502_uC_ENABLE		0x0001	/* reset otherwise */
+#define SM502_uC_MODE_SELECT	0x000b0004
+#define 	SM502_uC_CLOCK_MASK	0x0003
+#define 	SM502_uC_CLOCK_DIV2	0x
+#define 	SM502_uC_CLOCK_DIV3	0x0001
+#define 	SM502_uC_CLOCK_DIV4	0x0002
+#define 	SM502_uC_CLOCK_DIV5	0x0003
+#define 	SM502_uC_CODEC_I2S	0x0004	/* AC97 otherwise */
+#define 	SM502_uC_AUDIO_TEST	0x0008	/* test mode */
+#define 	SM502_uC_IO_8BIT	0x0010	/* 12 bit otherwise */
+#define 	SM502_uC_SRAM_DISABLE	0x0020
+#define 	SM502_uC_USB_WAIT_MASK	0x00c0
+#define 	SM502_uC_USB_NO_WAIT	0x
+#define 	SM502_uC_USB_1_WAIT	0x0040
+#define 	SM502_uC_USB_2_WAIT	0x0080
+#define SM502_uC_8051_INTR	0x000b0008
+#define SM502_uC_CPU_INTR	0x000b000c
+
+#define SM502_uC_SRAM_PROG	0x00dc	/* only readable in RESET */
+#define SM502_uC_SRAM_DATA	0x00dc3000
+
 #endif /* SM502REG_H */



CVS commit: src/sys/dev/pci

2011-12-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Dec  7 09:08:00 UTC 2011

Modified Files:
src/sys/dev/pci: voyager.c voyagervar.h

Log Message:
consolidate bit twiddling functions into one generic case and a bunch of
macros, use them


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/voyager.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/voyagervar.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/pci/voyager.c
diff -u src/sys/dev/pci/voyager.c:1.6 src/sys/dev/pci/voyager.c:1.7
--- src/sys/dev/pci/voyager.c:1.6	Thu Oct 20 22:04:10 2011
+++ src/sys/dev/pci/voyager.c	Wed Dec  7 09:08:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: voyager.c,v 1.6 2011/10/20 22:04:10 macallan Exp $	*/
+/*	$NetBSD: voyager.c,v 1.7 2011/12/07 09:08:00 macallan Exp $	*/
 
 /*
  * Copyright (c) 2009, 2011 Michael Lorenz
@@ -26,7 +26,7 @@
  */
  
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: voyager.c,v 1.6 2011/10/20 22:04:10 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: voyager.c,v 1.7 2011/12/07 09:08:00 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -222,13 +222,20 @@ voyager_attach(device_t parent, device_t
 	config_found_ia(sc-sc_dev, voyagerbus, vaa, voyager_print);
 	strcpy(vaa.vaa_name, pwmclock);
 	config_found_ia(sc-sc_dev, voyagerbus, vaa, voyager_print);
+	strcpy(vaa.vaa_name, vac);
+	config_found_ia(sc-sc_dev, voyagerbus, vaa, voyager_print);
+
+	/* we use this mutex wether there's an i2c bus or not */
+	mutex_init(sc-sc_i2c_lock, MUTEX_DEFAULT, IPL_NONE);
 
+	/*
+	 * see if the i2c pins are configured as gpio and if so, use them
+	 * should probably be a compile time option
+	 */
 	reg = bus_space_read_4(sc-sc_memt, sc-sc_regh, SM502_GPIO0_CONTROL);
 	if ((reg  GPIO_I2C_BITS) == 0) {
 		/* both bits as outputs */
-		reg = bus_space_read_4(sc-sc_memt, sc-sc_regh, SM502_GPIO_DIR0);
-		reg |= GPIO_I2C_BITS;
-		bus_space_write_4(sc-sc_memt, sc-sc_regh, SM502_GPIO_DIR0, reg);
+		voyager_gpio_dir(sc, 0x, GPIO_I2C_BITS);
 		
 		/* Fill in the i2c tag */
 		sc-sc_i2c.ic_cookie = sc;
@@ -240,10 +247,12 @@ voyager_attach(device_t parent, device_t
 		sc-sc_i2c.ic_read_byte = voyager_i2c_read_byte;
 		sc-sc_i2c.ic_write_byte = voyager_i2c_write_byte;
 		sc-sc_i2c.ic_exec = NULL;
-		mutex_init(sc-sc_i2c_lock, MUTEX_DEFAULT, IPL_NONE);
 		iba.iba_tag = sc-sc_i2c;
 		config_found_ia(self, i2cbus, iba, iicbus_print);
 	}
+	voyager_control_gpio(sc, ~(1  16), 0);
+	voyager_gpio_dir(sc, 0x, 1  16);
+	voyager_write_gpio(sc, 0x, 1  16);
 }
 
 static int
@@ -354,34 +363,18 @@ voyager_i2c_write_byte(void *cookie, uin
 	return ret;
 }
 
-/* gpio stuff */
 void
-voyager_write_gpio(void *cookie, uint32_t mask, uint32_t bits)
+voyager_twiddle_bits(void *cookie, int regnum, uint32_t mask, uint32_t bits)
 {
 	struct voyager_softc *sc = cookie;
 	uint32_t reg;
 
 	/* don't interfere with i2c ops */
 	mutex_enter(sc-sc_i2c_lock);
-	reg = bus_space_read_4(sc-sc_memt, sc-sc_regh, SM502_GPIO_DATA0);
-	reg = mask;
-	reg |= bits;
-	bus_space_write_4(sc-sc_memt, sc-sc_regh, SM502_GPIO_DATA0, reg);
-	mutex_exit(sc-sc_i2c_lock);
-}
-
-void
-voyager_control_gpio(void *cookie, uint32_t mask, uint32_t bits)
-{
-	struct voyager_softc *sc = cookie;
-	uint32_t reg;
-
-	/* don't interfere with i2c ops */
-	mutex_enter(sc-sc_i2c_lock);
-	reg = bus_space_read_4(sc-sc_memt, sc-sc_regh, SM502_GPIO0_CONTROL);
+	reg = bus_space_read_4(sc-sc_memt, sc-sc_regh, regnum);
 	reg = mask;
 	reg |= bits;
-	bus_space_write_4(sc-sc_memt, sc-sc_regh, SM502_GPIO0_CONTROL, reg);
+	bus_space_write_4(sc-sc_memt, sc-sc_regh, regnum, reg);
 	mutex_exit(sc-sc_i2c_lock);
 }
 

Index: src/sys/dev/pci/voyagervar.h
diff -u src/sys/dev/pci/voyagervar.h:1.3 src/sys/dev/pci/voyagervar.h:1.4
--- src/sys/dev/pci/voyagervar.h:1.3	Tue Oct 18 17:57:40 2011
+++ src/sys/dev/pci/voyagervar.h	Wed Dec  7 09:08:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: voyagervar.h,v 1.3 2011/10/18 17:57:40 macallan Exp $	*/
+/*	$NetBSD: voyagervar.h,v 1.4 2011/12/07 09:08:00 macallan Exp $	*/
 
 /*
  * Copyright (c) 2011 Michael Lorenz
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: voyagervar.h,v 1.3 2011/10/18 17:57:40 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: voyagervar.h,v 1.4 2011/12/07 09:08:00 macallan Exp $);
 
 #ifndef VOYAGERVAR_H
 #define VOYAGERVAR_H
@@ -45,10 +45,19 @@ struct voyager_attach_args {
 	char			vaa_name[32];
 };
 
+void voyager_twiddle_bits(void *, int, uint32_t, uint32_t);
+
 /* set gpio bits - (register  param1) | param2 */
-void voyager_write_gpio(void *, uint32_t, uint32_t);
+#define voyager_write_gpio(cookie, m_and, m_or) \
+	voyager_twiddle_bits(cookie, SM502_GPIO_DATA0, m_and, m_or)
 /* control gpio pin usage - 0 is gpio, 1 is other stuff ( like PWM ) */
-void voyager_control_gpio(void *, uint32_t, uint32_t);
+#define voyager_control_gpio(cookie, m_and, m_or) \
+	

CVS commit: src/sys/arch/xen/xen

2011-12-07 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Wed Dec  7 12:31:51 UTC 2011

Modified Files:
src/sys/arch/xen/xen: evtchn.c

Log Message:
Move to kmem_zalloc() instead of malloc().


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/xen/xen/evtchn.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/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.56 src/sys/arch/xen/xen/evtchn.c:1.57
--- src/sys/arch/xen/xen/evtchn.c:1.56	Sat Nov 19 17:13:39 2011
+++ src/sys/arch/xen/xen/evtchn.c	Wed Dec  7 12:31:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.56 2011/11/19 17:13:39 cherry Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.57 2011/12/07 12:31:51 cherry Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.56 2011/11/19 17:13:39 cherry Exp $);
+__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.57 2011/12/07 12:31:51 cherry Exp $);
 
 #include opt_xen.h
 #include isa.h
@@ -66,7 +66,7 @@ __KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1
 #include sys/systm.h
 #include sys/device.h
 #include sys/proc.h
-#include sys/malloc.h
+#include sys/kmem.h
 #include sys/reboot.h
 #include sys/mutex.h
 
@@ -561,7 +561,7 @@ pirq_establish(int pirq, int evtch, int 
 	}
 
 	if (event_set_handler(evtch, pirq_interrupt, ih, level, evname) != 0) {
-		free(ih, M_DEVBUF);
+		kmem_free(ih, sizeof (struct iplsource));
 		return NULL;
 	}
 
@@ -659,8 +659,7 @@ event_set_handler(int evtch, int (*func)
 	printf(event_set_handler evtch %d handler %p level %d\n, evtch,
 	   handler, level);
 #endif
-	ih = malloc(sizeof (struct intrhand), M_DEVBUF,
-	M_WAITOK|M_ZERO);
+	ih = kmem_zalloc(sizeof (struct intrhand), KM_NOSLEEP);
 	if (ih == NULL)
 		panic(can't allocate fixed interrupt source);
 
@@ -685,8 +684,8 @@ event_set_handler(int evtch, int (*func)
 
 	/* register handler for event channel */
 	if (evtsource[evtch] == NULL) {
-		evts = malloc(sizeof (struct evtsource),
-		M_DEVBUF, M_WAITOK|M_ZERO);
+		evts = kmem_zalloc(sizeof (struct evtsource),
+		KM_NOSLEEP);
 		if (evts == NULL)
 			panic(can't allocate fixed interrupt source);
 
@@ -742,8 +741,8 @@ event_set_iplhandler(struct cpu_info *ci
 
 	KASSERT(ci == ih-ih_cpu);
 	if (ci-ci_isources[level] == NULL) {
-		ipls = malloc(sizeof (struct iplsource),
-		M_DEVBUF, M_WAITOK|M_ZERO);
+		ipls = kmem_zalloc(sizeof (struct iplsource),
+		KM_NOSLEEP);
 		if (ipls == NULL)
 			panic(can't allocate fixed interrupt source);
 		ipls-ipl_recurse = xenev_stubs[level].ist_recurse;
@@ -795,11 +794,11 @@ event_remove_handler(int evtch, int (*fu
 	if (ih == NULL)
 		panic(event_remove_handler);
 	*ihp = ih-ih_ipl_next;
-	free(ih, M_DEVBUF);
+	kmem_free(ih, sizeof (struct iplsource));
 	if (evts-ev_handlers == NULL) {
 		xen_atomic_clear_bit(ci-ci_evtmask[0], evtch);
 		evcnt_detach(evts-ev_evcnt);
-		free(evts, M_DEVBUF);
+		kmem_free(evts, sizeof (struct evtsource));
 		evtsource[evtch] = NULL;
 	} else {
 		intr_calculatemasks(evts, evtch, ci);



CVS commit: src/sys/arch/xen/xen

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 13:49:04 UTC 2011

Modified Files:
src/sys/arch/xen/xen: evtchn.c

Log Message:
build fix: add back sys/malloc.h. malloc(9) is still in use.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/xen/xen/evtchn.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/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.57 src/sys/arch/xen/xen/evtchn.c:1.58
--- src/sys/arch/xen/xen/evtchn.c:1.57	Wed Dec  7 12:31:51 2011
+++ src/sys/arch/xen/xen/evtchn.c	Wed Dec  7 13:49:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.57 2011/12/07 12:31:51 cherry Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.58 2011/12/07 13:49:04 cegger Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.57 2011/12/07 12:31:51 cherry Exp $);
+__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.58 2011/12/07 13:49:04 cegger Exp $);
 
 #include opt_xen.h
 #include isa.h
@@ -66,6 +66,7 @@ __KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1
 #include sys/systm.h
 #include sys/device.h
 #include sys/proc.h
+#include sys/malloc.h
 #include sys/kmem.h
 #include sys/reboot.h
 #include sys/mutex.h



CVS commit: src/sys/arch/xen/include/xen-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 14:41:19 UTC 2011

Update of /cvsroot/src/sys/arch/xen/include/xen-public
In directory ivanova.netbsd.org:/tmp/cvs-serv11047

Log Message:
Welcome to Xen 4.1.2 headers.

New interfaces for PV drivers:
- Xen transcedent memory
- USB IO
- SCSI IO

PCI IO improvements:
- PCI MSI support
- PCI Express AER support

New features:
- xen honors flags to be placed into guest kernel available pte bits
  if enabled (for grant table)
- support for 128 vcpus
  (old interface is still present and supports up to 32 vcpus)
- PCI passthrough: new hypercalls to support SR-IOV
- new hypercall for physical cpu hotplugging
- new hypercall for physical page offlining
- fixes to compile with clang
- machine check recovery mechanism

Status:

Vendor Tag: Xen
Release Tags:   xen-4_1_2

C src/sys/arch/xen/include/xen-public/grant_table.h
U src/sys/arch/xen/include/xen-public/xencomm.h
N src/sys/arch/xen/include/xen-public/tmem.h
C src/sys/arch/xen/include/xen-public/dom0_ops.h
U src/sys/arch/xen/include/xen-public/nmi.h
U src/sys/arch/xen/include/xen-public/kexec.h
U src/sys/arch/xen/include/xen-public/platform.h
U src/sys/arch/xen/include/xen-public/sysctl.h
C src/sys/arch/xen/include/xen-public/event_channel.h
U src/sys/arch/xen/include/xen-public/features.h
U src/sys/arch/xen/include/xen-public/COPYING
C src/sys/arch/xen/include/xen-public/physdev.h
U src/sys/arch/xen/include/xen-public/version.h
U src/sys/arch/xen/include/xen-public/elfnote.h
U src/sys/arch/xen/include/xen-public/callback.h
U src/sys/arch/xen/include/xen-public/memory.h
N src/sys/arch/xen/include/xen-public/mem_event.h
C src/sys/arch/xen/include/xen-public/trace.h
U src/sys/arch/xen/include/xen-public/xen-compat.h
U src/sys/arch/xen/include/xen-public/sched.h
U src/sys/arch/xen/include/xen-public/vcpu.h
C src/sys/arch/xen/include/xen-public/arch-x86_32.h
C src/sys/arch/xen/include/xen-public/arch-x86_64.h
U src/sys/arch/xen/include/xen-public/arch-ia64.h
U src/sys/arch/xen/include/xen-public/xenoprof.h
C src/sys/arch/xen/include/xen-public/xen.h
U src/sys/arch/xen/include/xen-public/domctl.h
U src/sys/arch/xen/include/xen-public/xsm/flask_op.h
U src/sys/arch/xen/include/xen-public/xsm/acm.h
U src/sys/arch/xen/include/xen-public/xsm/acm_ops.h
U src/sys/arch/xen/include/xen-public/io/console.h
U src/sys/arch/xen/include/xen-public/io/tpmif.h
U src/sys/arch/xen/include/xen-public/io/ring.h
U src/sys/arch/xen/include/xen-public/io/protocols.h
U src/sys/arch/xen/include/xen-public/io/pciif.h
N src/sys/arch/xen/include/xen-public/io/usbif.h
U src/sys/arch/xen/include/xen-public/io/kbdif.h
U src/sys/arch/xen/include/xen-public/io/fbif.h
C src/sys/arch/xen/include/xen-public/io/blkif.h
U src/sys/arch/xen/include/xen-public/io/xenbus.h
N src/sys/arch/xen/include/xen-public/io/vscsiif.h
U src/sys/arch/xen/include/xen-public/io/fsif.h
U src/sys/arch/xen/include/xen-public/io/xs_wire.h
C src/sys/arch/xen/include/xen-public/io/netif.h
U src/sys/arch/xen/include/xen-public/hvm/hvm_info_table.h
U src/sys/arch/xen/include/xen-public/hvm/save.h
U src/sys/arch/xen/include/xen-public/hvm/params.h
U src/sys/arch/xen/include/xen-public/hvm/ioreq.h
U src/sys/arch/xen/include/xen-public/hvm/hvm_op.h
U src/sys/arch/xen/include/xen-public/hvm/e820.h
U src/sys/arch/xen/include/xen-public/arch-ia64/sioemu.h
U src/sys/arch/xen/include/xen-public/arch-ia64/debug_op.h
U src/sys/arch/xen/include/xen-public/arch-ia64/hvm/save.h
U src/sys/arch/xen/include/xen-public/arch-ia64/hvm/memmap.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_64.h
U src/sys/arch/xen/include/xen-public/arch-x86/cpuid.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_32.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-mca.h
U src/sys/arch/xen/include/xen-public/arch-x86/hvm/save.h

10 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jXen:yesterday -jXen src/sys/arch/xen/include/xen-public



CVS commit: src/sys/arch/xen/include/xen-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 15:04:19 UTC 2011

Modified Files:
src/sys/arch/xen/include/xen-public: event_channel.h grant_table.h
physdev.h trace.h xen.h
src/sys/arch/xen/include/xen-public/arch-x86: xen-x86_32.h
src/sys/arch/xen/include/xen-public/io: blkif.h netif.h xs_wire.h

Log Message:
merge.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/xen-public/event_channel.h \
src/sys/arch/xen/include/xen-public/grant_table.h \
src/sys/arch/xen/include/xen-public/physdev.h \
src/sys/arch/xen/include/xen-public/trace.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/include/xen-public/xen.h
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_32.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/xen-public/io/blkif.h \
src/sys/arch/xen/include/xen-public/io/netif.h
cvs rdiff -u -r1.1.1.2 -r1.2 src/sys/arch/xen/include/xen-public/io/xs_wire.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/xen/include/xen-public/event_channel.h
diff -u src/sys/arch/xen/include/xen-public/event_channel.h:1.5 src/sys/arch/xen/include/xen-public/event_channel.h:1.6
--- src/sys/arch/xen/include/xen-public/event_channel.h:1.5	Wed Dec  7 13:24:04 2011
+++ src/sys/arch/xen/include/xen-public/event_channel.h	Wed Dec  7 15:04:18 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: event_channel.h,v 1.5 2011/12/07 13:24:04 cegger Exp $ */
+/* $NetBSD: event_channel.h,v 1.6 2011/12/07 15:04:18 cegger Exp $ */
 /**
  * event_channel.h
  * 
@@ -28,6 +28,8 @@
 #ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__
 #define __XEN_PUBLIC_EVENT_CHANNEL_H__
 
+#include xen.h
+
 /*
  * Prototype for this hypercall is:
  *  int event_channel_op(int cmd, void *args)
Index: src/sys/arch/xen/include/xen-public/grant_table.h
diff -u src/sys/arch/xen/include/xen-public/grant_table.h:1.5 src/sys/arch/xen/include/xen-public/grant_table.h:1.6
--- src/sys/arch/xen/include/xen-public/grant_table.h:1.5	Wed Dec  7 13:24:04 2011
+++ src/sys/arch/xen/include/xen-public/grant_table.h	Wed Dec  7 15:04:18 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: grant_table.h,v 1.5 2011/12/07 13:24:04 cegger Exp $ */
+/* $NetBSD: grant_table.h,v 1.6 2011/12/07 15:04:18 cegger Exp $ */
 /**
  * grant_table.h
  * 
@@ -29,6 +29,7 @@
 #ifndef __XEN_PUBLIC_GRANT_TABLE_H__
 #define __XEN_PUBLIC_GRANT_TABLE_H__
 
+#include xen.h
 
 /***
  * GRANT TABLE REPRESENTATION
@@ -85,12 +86,26 @@
  */
 
 /*
+ * Reference to a grant entry in a specified domain's grant table.
+ */
+typedef uint32_t grant_ref_t;
+
+/*
  * A grant table comprises a packed array of grant entries in one or more
  * page frames shared between Xen and a guest.
  * [XEN]: This field is written by Xen and read by the sharing guest.
  * [GST]: This field is written by the guest and read by Xen.
  */
-struct grant_entry {
+
+/*
+ * Version 1 of the grant table entry structure is maintained purely
+ * for backwards compatibility.  New guests should use version 2.
+ */
+#if __XEN_INTERFACE_VERSION__  0x0003020a
+#define grant_entry_v1 grant_entry
+#define grant_entry_v1_t grant_entry_t
+#endif
+struct grant_entry_v1 {
 /* GTF_xxx: various type and flag information.  [XEN,GST] */
 uint16_t flags;
 /* The domain being granted foreign privileges. [GST] */
@@ -101,7 +116,7 @@ struct grant_entry {
  */
 uint32_t frame;
 };
-typedef struct grant_entry grant_entry_t;
+typedef struct grant_entry_v1 grant_entry_v1_t;
 
 /*
  * Type of grant entry.
@@ -109,10 +124,13 @@ typedef struct grant_entry grant_entry_t
  *  GTF_permit_access: Allow @domid to map/access @frame.
  *  GTF_accept_transfer: Allow @domid to transfer ownership of one page frame
  *   to this guest. Xen writes the page number to @frame.
+ *  GTF_transitive: Allow @domid to transitively access a subrange of
+ *  @trans_grant in @trans_domid.  No mappings are allowed.
  */
 #define GTF_invalid (0U0)
 #define GTF_permit_access   (1U0)
 #define GTF_accept_transfer (2U0)
+#define GTF_transitive  (3U0)
 #define GTF_type_mask   (3U0)
 
 /*
@@ -121,6 +139,9 @@ typedef struct grant_entry grant_entry_t
  *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
  *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
  *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags for the grant [GST]
+ *  GTF_sub_page: Grant access to only a subrange of the page.  @domid
+ *will only be allowed to copy from the grant, and not
+ *map it. [GST]
  */
 #define _GTF_readonly   (2)
 #define GTF_readonly(1U_GTF_readonly)
@@ -134,6 

CVS commit: src/sys/arch

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 15:47:43 UTC 2011

Modified Files:
src/sys/arch/amd64/amd64: genassym.cf
src/sys/arch/i386/i386: genassym.cf
src/sys/arch/x86/include: cpu.h
src/sys/arch/x86/x86: pmap.c
src/sys/arch/xen/include: granttables.h hypervisor.h xenbus.h
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h
src/sys/arch/xen/x86: cpu.c xen_ipi.c xen_pmap.c
src/sys/arch/xen/xen: clock.c evtchn.c hypervisor.c if_xennet_xenbus.c
pciback.c xbd_xenbus.c xbdback_xenbus.c xencons.c xpci_xenbus.c

Log Message:
switch from xen3-public to xen-public.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/i386/i386/genassym.cf
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/include/granttables.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/include/xenbus.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/include/i386/hypercalls.h
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/xen/x86/cpu.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/x86/xen_ipi.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/x86/xen_pmap.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/xen/xen/clock.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/xen/xen/evtchn.c \
src/sys/arch/xen/xen/hypervisor.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/xen/pciback.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/xen/xen/xbd_xenbus.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/xen/xen/xbdback_xenbus.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/xen/xen/xencons.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/xen/xpci_xenbus.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/amd64/amd64/genassym.cf
diff -u src/sys/arch/amd64/amd64/genassym.cf:1.48 src/sys/arch/amd64/amd64/genassym.cf:1.49
--- src/sys/arch/amd64/amd64/genassym.cf:1.48	Fri Jul  1 19:24:14 2011
+++ src/sys/arch/amd64/amd64/genassym.cf	Wed Dec  7 15:47:41 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.48 2011/07/01 19:24:14 dyoung Exp $
+#	$NetBSD: genassym.cf,v 1.49 2011/12/07 15:47:41 cegger Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -119,7 +119,7 @@ include machine/i82093var.h
 endif
 
 ifdef XEN
-include xen/xen3-public/xen.h
+include xen/xen-public/xen.h
 endif  
 
 include sys/bus.h

Index: src/sys/arch/i386/i386/genassym.cf
diff -u src/sys/arch/i386/i386/genassym.cf:1.90 src/sys/arch/i386/i386/genassym.cf:1.91
--- src/sys/arch/i386/i386/genassym.cf:1.90	Fri Jul  1 18:14:15 2011
+++ src/sys/arch/i386/i386/genassym.cf	Wed Dec  7 15:47:42 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.90 2011/07/01 18:14:15 dyoung Exp $
+#	$NetBSD: genassym.cf,v 1.91 2011/12/07 15:47:42 cegger Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -99,7 +99,7 @@ include machine/types.h
 include machine/segments.h
 
 ifdef XEN
-include xen/xen3-public/sched.h
+include xen/xen-public/sched.h
 endif
 
 if defined(_KERNEL)  defined(_KERNEL_OPT)

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.43 src/sys/arch/x86/include/cpu.h:1.44
--- src/sys/arch/x86/include/cpu.h:1.43	Sat Nov 19 17:13:39 2011
+++ src/sys/arch/x86/include/cpu.h	Wed Dec  7 15:47:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.43 2011/11/19 17:13:39 cherry Exp $	*/
+/*	$NetBSD: cpu.h,v 1.44 2011/12/07 15:47:42 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -68,8 +68,8 @@
 #include sys/device_if.h /* for device_t */
 
 #ifdef XEN
-#include xen/xen3-public/xen.h
-#include xen/xen3-public/event_channel.h
+#include xen/xen-public/xen.h
+#include xen/xen-public/event_channel.h
 #endif /* XEN */
 
 struct intrsource;

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.143 src/sys/arch/x86/x86/pmap.c:1.144
--- src/sys/arch/x86/x86/pmap.c:1.143	Sun Dec  4 16:24:13 2011
+++ src/sys/arch/x86/x86/pmap.c	Wed Dec  7 15:47:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.143 2011/12/04 16:24:13 chs Exp $	*/
+/*	$NetBSD: pmap.c,v 1.144 2011/12/07 15:47:42 cegger 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.143 2011/12/04 16:24:13 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.144 2011/12/07 15:47:42 cegger Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -209,7 +209,7 @@ __KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.1
 #include x86/i82489var.h
 
 #ifdef XEN
-#include 

CVS commit: src/sys/arch/xen/include

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 16:01:39 UTC 2011

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h

Log Message:
switch from xen3-public to xen-public.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/include/i386/hypercalls.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/xen/include/amd64/hypercalls.h
diff -u src/sys/arch/xen/include/amd64/hypercalls.h:1.7 src/sys/arch/xen/include/amd64/hypercalls.h:1.8
--- src/sys/arch/xen/include/amd64/hypercalls.h:1.7	Wed Dec  7 15:47:42 2011
+++ src/sys/arch/xen/include/amd64/hypercalls.h	Wed Dec  7 16:01:39 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.7 2011/12/07 15:47:42 cegger Exp $ */
+/* $NetBSD: hypercalls.h,v 1.8 2011/12/07 16:01:39 cegger Exp $ */
 /**
  * hypercall.h
  * 
@@ -399,7 +399,7 @@ HYPERVISOR_dom0_op(
 }
 #endif	/* __XEN_INTERFACE_VERSION__ */
 
-#include xen/xen3-public/arch-x86/xen-mca.h
+#include xen/xen-public/arch-x86/xen-mca.h
 
 static inline int
 HYPERVISOR_machine_check(struct xen_mc *mc)

Index: src/sys/arch/xen/include/i386/hypercalls.h
diff -u src/sys/arch/xen/include/i386/hypercalls.h:1.13 src/sys/arch/xen/include/i386/hypercalls.h:1.14
--- src/sys/arch/xen/include/i386/hypercalls.h:1.13	Wed Dec  7 15:47:42 2011
+++ src/sys/arch/xen/include/i386/hypercalls.h	Wed Dec  7 16:01:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypercalls.h,v 1.13 2011/12/07 15:47:42 cegger Exp $	*/
+/*	$NetBSD: hypercalls.h,v 1.14 2011/12/07 16:01:39 cegger Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -173,7 +173,7 @@ HYPERVISOR_get_debugreg(int reg)
 return ret;
 }
 
-#include xen/xen3-public/arch-x86/xen-mca.h
+#include xen/xen-public/arch-x86/xen-mca.h
 
 static __inline int
 HYPERVISOR_machine_check(struct xen_mc *mc)



CVS commit: src/sys/arch/xen/include/xen3-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 16:11:02 UTC 2011

Removed Files:
src/sys/arch/xen/include/xen3-public: COPYING arch-ia64.h arch-x86_32.h
arch-x86_64.h callback.h dom0_ops.h domctl.h elfnote.h elfstructs.h
event_channel.h features.h grant_table.h kexec.h libelf.h memory.h
nmi.h physdev.h platform.h sched.h sysctl.h trace.h vcpu.h
version.h xen-compat.h xen.h xencomm.h xenoprof.h
src/sys/arch/xen/include/xen3-public/arch-ia64: debug_op.h sioemu.h
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm: memmap.h save.h
src/sys/arch/xen/include/xen3-public/arch-x86: cpuid.h xen-mca.h
xen-x86_32.h xen-x86_64.h xen.h
src/sys/arch/xen/include/xen3-public/arch-x86/hvm: save.h
src/sys/arch/xen/include/xen3-public/hvm: e820.h hvm_info_table.h
hvm_op.h ioreq.h params.h save.h vmx_assist.h
src/sys/arch/xen/include/xen3-public/io: blkif.h console.h fbif.h
fsif.h kbdif.h netif.h pciif.h protocols.h ring.h tpmif.h xenbus.h
xs_wire.h
src/sys/arch/xen/include/xen3-public/xsm: acm.h acm_ops.h flask_op.h

Log Message:
remove xen3-public


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/sys/arch/xen/include/xen3-public/COPYING \
src/sys/arch/xen/include/xen3-public/callback.h \
src/sys/arch/xen/include/xen3-public/elfstructs.h \
src/sys/arch/xen/include/xen3-public/nmi.h \
src/sys/arch/xen/include/xen3-public/xenoprof.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen3-public/arch-ia64.h \
src/sys/arch/xen/include/xen3-public/physdev.h \
src/sys/arch/xen/include/xen3-public/trace.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen3-public/arch-x86_32.h \
src/sys/arch/xen/include/xen3-public/memory.h \
src/sys/arch/xen/include/xen3-public/sched.h \
src/sys/arch/xen/include/xen3-public/vcpu.h
cvs rdiff -u -r1.5 -r0 src/sys/arch/xen/include/xen3-public/arch-x86_64.h \
src/sys/arch/xen/include/xen3-public/dom0_ops.h \
src/sys/arch/xen/include/xen3-public/event_channel.h \
src/sys/arch/xen/include/xen3-public/version.h \
src/sys/arch/xen/include/xen3-public/xen-compat.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/domctl.h \
src/sys/arch/xen/include/xen3-public/features.h \
src/sys/arch/xen/include/xen3-public/kexec.h \
src/sys/arch/xen/include/xen3-public/libelf.h \
src/sys/arch/xen/include/xen3-public/platform.h \
src/sys/arch/xen/include/xen3-public/sysctl.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen3-public/elfnote.h \
src/sys/arch/xen/include/xen3-public/xencomm.h
cvs rdiff -u -r1.8 -r0 src/sys/arch/xen/include/xen3-public/grant_table.h
cvs rdiff -u -r1.9 -r0 src/sys/arch/xen/include/xen3-public/xen.h
cvs rdiff -u -r1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/debug_op.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/sioemu.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm/memmap.h
cvs rdiff -u -r1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm/save.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/cpuid.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-mca.h
cvs rdiff -u -r1.4 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-x86_32.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-x86_64.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen.h
cvs rdiff -u -r1.2 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/hvm/save.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/hvm/e820.h \
src/sys/arch/xen/include/xen3-public/hvm/hvm_op.h \
src/sys/arch/xen/include/xen3-public/hvm/ioreq.h \
src/sys/arch/xen/include/xen3-public/hvm/params.h \
src/sys/arch/xen/include/xen3-public/hvm/vmx_assist.h
cvs rdiff -u -r1.3 -r0 \
src/sys/arch/xen/include/xen3-public/hvm/hvm_info_table.h \
src/sys/arch/xen/include/xen3-public/hvm/save.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen3-public/io/blkif.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/io/console.h \
src/sys/arch/xen/include/xen3-public/io/kbdif.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/xen/include/xen3-public/io/fbif.h \
src/sys/arch/xen/include/xen3-public/io/protocols.h
cvs rdiff -u -r1.1.1.1 -r0 src/sys/arch/xen/include/xen3-public/io/fsif.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen3-public/io/netif.h \
src/sys/arch/xen/include/xen3-public/io/xenbus.h
cvs rdiff -u -r1.5 -r0 src/sys/arch/xen/include/xen3-public/io/pciif.h \
src/sys/arch/xen/include/xen3-public/io/tpmif.h
cvs rdiff -u -r1.12 -r0 src/sys/arch/xen/include/xen3-public/io/ring.h
cvs rdiff -u -r1.9 -r0 src/sys/arch/xen/include/xen3-public/io/xs_wire.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen3-public/xsm/acm.h \

CVS commit: src/sys/dev

2011-12-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Dec  7 17:38:50 UTC 2011

Modified Files:
src/sys/dev/isa: opl_wss.c opl_ym.c
src/sys/dev/pci: opl_cmpci.c opl_fms.c opl_sv.c opl_yds.c

Log Message:
Initialize the opl softc lock pointer to the parent's interrupt lock.
Briefly tested only on wss@isapnp.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/isa/opl_wss.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/isa/opl_ym.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/opl_cmpci.c \
src/sys/dev/pci/opl_fms.c src/sys/dev/pci/opl_yds.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/opl_sv.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/opl_wss.c
diff -u src/sys/dev/isa/opl_wss.c:1.13 src/sys/dev/isa/opl_wss.c:1.14
--- src/sys/dev/isa/opl_wss.c:1.13	Mon Apr 28 20:23:52 2008
+++ src/sys/dev/isa/opl_wss.c	Wed Dec  7 17:38:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: opl_wss.c,v 1.13 2008/04/28 20:23:52 martin Exp $	*/
+/*	$NetBSD: opl_wss.c,v 1.14 2011/12/07 17:38:50 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: opl_wss.c,v 1.13 2008/04/28 20:23:52 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: opl_wss.c,v 1.14 2011/12/07 17:38:50 jakllsch Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -81,6 +81,7 @@ opl_wss_attach(device_t parent, device_t
 	sc-ioh = ssc-sc_opl_ioh;
 	sc-iot = ssc-sc_iot;
 	sc-offs = 0;
+	sc-lock = ssc-sc_ad1848.sc_ad1848.sc_intr_lock;
 	strcpy(sc-syn.name, WSS );
 
 	opl_attach(sc);

Index: src/sys/dev/isa/opl_ym.c
diff -u src/sys/dev/isa/opl_ym.c:1.16 src/sys/dev/isa/opl_ym.c:1.17
--- src/sys/dev/isa/opl_ym.c:1.16	Mon Apr 28 20:23:52 2008
+++ src/sys/dev/isa/opl_ym.c	Wed Dec  7 17:38:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: opl_ym.c,v 1.16 2008/04/28 20:23:52 martin Exp $	*/
+/*	$NetBSD: opl_ym.c,v 1.17 2011/12/07 17:38:50 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: opl_ym.c,v 1.16 2008/04/28 20:23:52 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: opl_ym.c,v 1.17 2011/12/07 17:38:50 jakllsch Exp $);
 
 #include mpu_ym.h
 
@@ -91,6 +91,7 @@ opl_ym_attach(device_t parent, device_t 
 	sc-powerctl = opl_ym_power_ctl;
 	sc-powerarg = ssc;
 #endif
+	sc-lock = ssc-sc_ad1848.sc_ad1848.sc_intr_lock;
 	snprintf(sc-syn.name, sizeof(sc-syn.name), %s ,
 	ssc-sc_ad1848.sc_ad1848.chip_name);
 

Index: src/sys/dev/pci/opl_cmpci.c
diff -u src/sys/dev/pci/opl_cmpci.c:1.15 src/sys/dev/pci/opl_cmpci.c:1.16
--- src/sys/dev/pci/opl_cmpci.c:1.15	Mon Apr 28 20:23:55 2008
+++ src/sys/dev/pci/opl_cmpci.c	Wed Dec  7 17:38:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: opl_cmpci.c,v 1.15 2008/04/28 20:23:55 martin Exp $	*/
+/*	$NetBSD: opl_cmpci.c,v 1.16 2011/12/07 17:38:50 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: opl_cmpci.c,v 1.15 2008/04/28 20:23:55 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: opl_cmpci.c,v 1.16 2011/12/07 17:38:50 jakllsch Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -77,6 +77,7 @@ opl_cmpci_attach(device_t parent, device
 	sc-ioh = ssc-sc_ioh;
 	sc-iot = ssc-sc_iot;
 	sc-offs = CMPCI_REG_FM_BASE;
+	sc-lock = ssc-sc_intr_lock;
 	strcpy(sc-syn.name, CMPCI );
 
 	opl_attach(sc);
Index: src/sys/dev/pci/opl_fms.c
diff -u src/sys/dev/pci/opl_fms.c:1.15 src/sys/dev/pci/opl_fms.c:1.16
--- src/sys/dev/pci/opl_fms.c:1.15	Mon Apr 28 20:23:55 2008
+++ src/sys/dev/pci/opl_fms.c	Wed Dec  7 17:38:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: opl_fms.c,v 1.15 2008/04/28 20:23:55 martin Exp $	*/
+/*	$NetBSD: opl_fms.c,v 1.16 2011/12/07 17:38:50 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: opl_fms.c,v 1.15 2008/04/28 20:23:55 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: opl_fms.c,v 1.16 2011/12/07 17:38:50 jakllsch Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -77,6 +77,7 @@ opl_fms_attach(device_t parent, device_t
 	sc-ioh = ssc-sc_opl_ioh;
 	sc-iot = ssc-sc_iot;
 	sc-offs = 0;
+	sc-lock = ssc-sc_intr_lock;
 	strcpy(sc-syn.name, FMS );
 	/*sc-spkrctl = 0;
 	  sc-spkrarg = 0;*/
Index: src/sys/dev/pci/opl_yds.c
diff -u src/sys/dev/pci/opl_yds.c:1.15 src/sys/dev/pci/opl_yds.c:1.16
--- src/sys/dev/pci/opl_yds.c:1.15	Mon Apr 28 20:23:55 2008
+++ src/sys/dev/pci/opl_yds.c	Wed Dec  7 17:38:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: opl_yds.c,v 1.15 2008/04/28 20:23:55 martin Exp $	*/
+/*	$NetBSD: opl_yds.c,v 1.16 2011/12/07 17:38:50 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: opl_yds.c,v 1.15 2008/04/28 20:23:55 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: 

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

2011-12-07 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Wed Dec  7 22:14:43 UTC 2011

Modified Files:
src/distrib/sets/lists/modules: md.evbppc

Log Message:
Add the secmodel_extensions variants of the kernel modules.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/sets/lists/modules/md.evbppc

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

Modified files:

Index: src/distrib/sets/lists/modules/md.evbppc
diff -u src/distrib/sets/lists/modules/md.evbppc:1.17 src/distrib/sets/lists/modules/md.evbppc:1.18
--- src/distrib/sets/lists/modules/md.evbppc:1.17	Tue Nov 29 10:05:28 2011
+++ src/distrib/sets/lists/modules/md.evbppc	Wed Dec  7 22:14:43 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.evbppc,v 1.17 2011/11/29 10:05:28 he Exp $
+# $NetBSD: md.evbppc,v 1.18 2011/12/07 22:14:43 he Exp $
 ./stand/powerpc-4xx			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules	base-kernel-modules	kmod,compatmodules
@@ -136,6 +136,8 @@
 ./stand/powerpc-4xx/@OSRELEASE@/modules/sdt/sdt.kmod			base-kernel-modules	kmod,compatmodules,dtrace
 ./stand/powerpc-4xx/@OSRELEASE@/modules/secmodel_bsd44			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/secmodel_bsd44/secmodel_bsd44.kmod	base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/secmodel_extensions		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/secmodel_extensions/secmodel_extensions.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/secmodel_overlay			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/secmodel_overlay/secmodel_overlay.kmod	base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/securelevel			base-kernel-modules	kmod,compatmodules
@@ -307,6 +309,8 @@
 ./stand/powerpc-booke/@OSRELEASE@/modules/sdt/sdt.kmod			base-kernel-modules	kmod,compatmodules,dtrace
 ./stand/powerpc-booke/@OSRELEASE@/modules/secmodel_bsd44		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/secmodel_bsd44/secmodel_bsd44.kmod	base-kernel-modules	kmod,compatmodules
+./stand/powerpc-booke/@OSRELEASE@/modules/secmodel_extensions		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-booke/@OSRELEASE@/modules/secmodel_extensions/secmodel_extensions.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/secmodel_overlay		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/secmodel_overlay/secmodel_overlay.kmod	base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/securelevel			base-kernel-modules	kmod,compatmodules



CVS commit: [jmcneill-usbmp] src/sys/dev/usb

2011-12-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Dec  7 22:52:17 UTC 2011

Modified Files:
src/sys/dev/usb [jmcneill-usbmp]: usb.c

Log Message:
kill some #ifdef USB_DEBUG with some compiler smarts.


To generate a diff of this commit:
cvs rdiff -u -r1.125.6.2 -r1.125.6.3 src/sys/dev/usb/usb.c

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

Modified files:

Index: src/sys/dev/usb/usb.c
diff -u src/sys/dev/usb/usb.c:1.125.6.2 src/sys/dev/usb/usb.c:1.125.6.3
--- src/sys/dev/usb/usb.c:1.125.6.2	Tue Dec  6 02:10:01 2011
+++ src/sys/dev/usb/usb.c	Wed Dec  7 22:52:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb.c,v 1.125.6.2 2011/12/06 02:10:01 mrg Exp $	*/
+/*	$NetBSD: usb.c,v 1.125.6.3 2011/12/07 22:52:17 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2002, 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usb.c,v 1.125.6.2 2011/12/06 02:10:01 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: usb.c,v 1.125.6.3 2011/12/07 22:52:17 mrg Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_usb.h
@@ -83,6 +83,7 @@ int	usb_noexplore = 0;
 #else
 #define DPRINTF(x)
 #define DPRINTFN(n,x)
+#define	usb_noexplore 0
 #endif
 
 struct usb_softc {
@@ -372,17 +373,10 @@ usb_event_thread(void *arg)
 	config_pending_decr();
 
 	while (!sc-sc_dying) {
-#ifdef USB_DEBUG
 		if (usb_noexplore  2)
-#endif
-		usb_discover(sc);
-#ifdef USB_DEBUG
+			usb_discover(sc);
 		(void)tsleep(sc-sc_bus-needs_explore, PWAIT, usbevt,
 		usb_noexplore ? 0 : hz * 60);
-#else
-		(void)tsleep(sc-sc_bus-needs_explore, PWAIT, usbevt,
-		hz * 60);
-#endif
 		DPRINTFN(2,(usb_event_thread: woke up\n));
 	}
 	sc-sc_event_thread = NULL;
@@ -777,10 +771,8 @@ usb_discover(struct usb_softc *sc)
 {
 
 	DPRINTFN(2,(usb_discover\n));
-#ifdef USB_DEBUG
 	if (usb_noexplore  1)
 		return;
-#endif
 	/*
 	 * We need mutual exclusion while traversing the device tree,
 	 * but this is guaranteed since this function is only called



CVS commit: src/usr.sbin/sup/source

2011-12-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec  7 22:52:54 UTC 2011

Modified Files:
src/usr.sbin/sup/source: setproctitle.c

Log Message:
be more portable, explain what we are doing, simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sup/source/setproctitle.c

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

Modified files:

Index: src/usr.sbin/sup/source/setproctitle.c
diff -u src/usr.sbin/sup/source/setproctitle.c:1.3 src/usr.sbin/sup/source/setproctitle.c:1.4
--- src/usr.sbin/sup/source/setproctitle.c:1.3	Mon Apr 28 16:24:17 2008
+++ src/usr.sbin/sup/source/setproctitle.c	Wed Dec  7 17:52:54 2011
@@ -27,10 +27,13 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include sys/param.h
 #include stdio.h
 #include stdlib.h
 #include string.h
 #include stdarg.h
+#include limits.h
+#include unistd.h
 
 #ifdef NEED_SETPROCTITLE
 
@@ -42,18 +45,42 @@ setproctitle(const char *fmt, ...)
 	va_list ap;
 	char buf[1024];
 	int len;
-	char *pname, *p;
-	char **args = __environ - 2;
+	char *pname, *p, *s;
+	/*
+	 * Assumes that stack grows down, and than environ has not bee
+	 * reallocated because of setenv() required growth. Stack layout:
+	 * 
+	 * argc
+	 * argv[0]
+	 * ...
+	 * argv[n]
+	 * NULL
+	 * environ[0]
+	 * ...
+	 * environ[n]
+	 * NULL
+	 */
 
+	/* 1 for the first entry, 1 for the NULL */
+	char **args = __environ - 2, *s;
+#ifdef _SC_ARG_MAX
+	s = (char *)sysconf(_SC_ARG_MAX);
+#elifdef ARG_MAX
+	s = (char *)ARG_MAX;
+#elifdef NCARGS
+	s = (char *)NCARGS;
+#else
+	s = (char *)(256 * 1024);
+#endif
 	/*
 	 * Keep going while it looks like a pointer. We'll stop at argc,
-	 * Assume that we have  10K args.
+	 * Which is a lot smaller than a pointer, limited by ARG_MAX
 	 */
-	while (*args  (char *)10240)
+	while (*args  s)
 		args--;
 
-	pname = *++args;
-	*(int *)((int *)pname - 1) = 1; /* *argc = 1; */
+	*(int *)args = 1; /* *argc = 1; */
+	pname = *++args;  /* pname = argv[0] */
  
 	/* Just the last component of the name */
 	if ((p = strrchr(pname, '/')) != NULL)



CVS commit: src/sys/arch/evbppc/conf

2011-12-07 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Dec  8 01:08:19 UTC 2011

Modified Files:
src/sys/arch/evbppc/conf: EXPLORA451

Log Message:
Bump SYMTAB_SPACE.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/evbppc/conf/EXPLORA451

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/evbppc/conf/EXPLORA451
diff -u src/sys/arch/evbppc/conf/EXPLORA451:1.45 src/sys/arch/evbppc/conf/EXPLORA451:1.46
--- src/sys/arch/evbppc/conf/EXPLORA451:1.45	Tue Nov 22 21:25:12 2011
+++ src/sys/arch/evbppc/conf/EXPLORA451	Thu Dec  8 01:08:18 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: EXPLORA451,v 1.45 2011/11/22 21:25:12 tls Exp $
+#	$NetBSD: EXPLORA451,v 1.46 2011/12/08 01:08:18 he Exp $
 #
 #	GENERIC -- everything that's currently supported
 #
@@ -52,7 +52,7 @@ options 	DDB_HISTORY_SIZE=512	# enable h
 #options 	KGDB		# remote debugger
 #options 	KGDB_DEVNAME=\com\,KGDB_DEVADDR=0x3f8,KGDB_DEVRATE=9600
 makeoptions	DEBUG=-g	# compile full symbol table
-options 	SYMTAB_SPACE=42
+options 	SYMTAB_SPACE=43
 
 # Compatibility options
 options 	COMPAT_NOMID	# compatibility with 386BSD, BSDI, NetBSD 0.8,



CVS commit: src/doc

2011-12-07 Thread Takahiro Kambe
Module Name:src
Committed By:   taca
Date:   Thu Dec  8 01:11:47 UTC 2011

Modified Files:
src/doc: 3RDPARTY

Log Message:
ISC DHCP 4.2.3-P1 and 4.1-ESV-R4 has released.


To generate a diff of this commit:
cvs rdiff -u -r1.890 -r1.891 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.890 src/doc/3RDPARTY:1.891
--- src/doc/3RDPARTY:1.890	Thu Nov 24 16:48:50 2011
+++ src/doc/3RDPARTY	Thu Dec  8 01:11:47 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.890 2011/11/24 16:48:50 taca Exp $
+#	$NetBSD: 3RDPARTY,v 1.891 2011/12/08 01:11:47 taca Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -255,7 +255,7 @@ src/lib/libc/db/db2netbsd.
 
 Package:	dhcp
 Version:	3.0.3
-Current Vers:	3.1.3/4.0.2/4.1.1-P1/4.2.3
+Current Vers:	3.1.3/4.0.2/4.1-ESV-R4/4.2.3-P1
 Maintainer:	mellon
 Archive Site:	ftp://ftp.isc.org/isc/dhcp/
 Home Page:	http://www.isc.org/software/dhcp/



CVS commit: src/etc/mtree

2011-12-07 Thread Takahiro Kambe
Module Name:src
Committed By:   taca
Date:   Thu Dec  8 01:15:03 UTC 2011

Modified Files:
src/etc/mtree: special

Log Message:
According to /etc/rc.d/mdnsd, /var/run/mdnsd is owned by _mdnsd:_mdnsd
if it created.  So, set owner/group of /var/run/mdnsd.

It stop a useless warning in /etc/security.


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/etc/mtree/special

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

Modified files:

Index: src/etc/mtree/special
diff -u src/etc/mtree/special:1.139 src/etc/mtree/special:1.140
--- src/etc/mtree/special:1.139	Sat Nov 26 01:17:17 2011
+++ src/etc/mtree/special	Thu Dec  8 01:15:02 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: special,v 1.139 2011/11/26 01:17:17 tls Exp $
+#	$NetBSD: special,v 1.140 2011/12/08 01:15:02 taca Exp $
 #	@(#)special	8.2 (Berkeley) 1/23/94
 #
 # This file may be overwritten on upgrades.
@@ -406,7 +406,7 @@
 ./var/mail			type=dir  mode=1777 ignore
 ./var/preserve			type=dir  mode=0755 ignore
 ./var/run			type=dir  mode=0755
-./var/run/mdnsd			type=dir  mode=0755 optional
+./var/run/mdnsd			type=dir  mode=0755 gname=_mdnsd uname=_mdnsd optional
 ./var/run/utmp			type=file mode=0664 gname=utmp tags=exclude
 ./var/run/utmpx			type=file mode=0664 gname=utmp tags=exclude
 ./var/spool			type=dir  mode=0755



CVS commit: [jmcneill-usbmp] src/sys/dev/usb

2011-12-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Dec  8 03:10:10 UTC 2011

Modified Files:
src/sys/dev/usb [jmcneill-usbmp]: usbdi.c usbdi_util.c utoppy.c

Log Message:
convert the remaining wakeup(xfer)'s to use the xfer-cv.

utoppy - untested.


To generate a diff of this commit:
cvs rdiff -u -r1.134.2.2 -r1.134.2.3 src/sys/dev/usb/usbdi.c
cvs rdiff -u -r1.55 -r1.55.12.1 src/sys/dev/usb/usbdi_util.c
cvs rdiff -u -r1.15 -r1.15.12.1 src/sys/dev/usb/utoppy.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/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.134.2.2 src/sys/dev/usb/usbdi.c:1.134.2.3
--- src/sys/dev/usb/usbdi.c:1.134.2.2	Thu Dec  8 02:51:08 2011
+++ src/sys/dev/usb/usbdi.c	Thu Dec  8 03:10:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.134.2.2 2011/12/08 02:51:08 mrg Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.134.2.3 2011/12/08 03:10:09 mrg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usbdi.c,v 1.134.2.2 2011/12/08 02:51:08 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: usbdi.c,v 1.134.2.3 2011/12/08 03:10:09 mrg Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_usb.h
@@ -314,11 +314,11 @@ usbd_transfer(usbd_xfer_handle xfer)
 	if (!xfer-done) {
 		if (pipe-device-bus-use_polling)
 			panic(usbd_transfer: not done);
-		if (pipe-device-bus-lock) {
+
+		if (pipe-device-bus-lock)
 			cv_wait(xfer-cv, pipe-device-bus-lock);
-		} else {
+		else
 			tsleep(xfer, PRIBIO, usbsyn, 0);
-		}
 	}
 	usbd_unlock_pipe(pipe);
 	return (xfer-status);

Index: src/sys/dev/usb/usbdi_util.c
diff -u src/sys/dev/usb/usbdi_util.c:1.55 src/sys/dev/usb/usbdi_util.c:1.55.12.1
--- src/sys/dev/usb/usbdi_util.c:1.55	Wed Nov  3 22:34:24 2010
+++ src/sys/dev/usb/usbdi_util.c	Thu Dec  8 03:10:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi_util.c,v 1.55 2010/11/03 22:34:24 dyoung Exp $	*/
+/*	$NetBSD: usbdi_util.c,v 1.55.12.1 2011/12/08 03:10:09 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usbdi_util.c,v 1.55 2010/11/03 22:34:24 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: usbdi_util.c,v 1.55.12.1 2011/12/08 03:10:09 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -39,11 +39,13 @@ __KERNEL_RCSID(0, $NetBSD: usbdi_util.c
 #include sys/malloc.h
 #include sys/proc.h
 #include sys/device.h
+#include sys/bus.h
 
 #include dev/usb/usb.h
 #include dev/usb/usbhid.h
 
 #include dev/usb/usbdi.h
+#include dev/usb/usbdivar.h
 #include dev/usb/usbdi_util.h
 
 #ifdef USB_DEBUG
@@ -419,7 +421,11 @@ Static void
 usbd_bulk_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
 		  usbd_status status)
 {
-	wakeup(xfer);
+
+	if (xfer-pipe-device-bus-lock)
+		cv_broadcast(xfer-cv);
+	else
+		wakeup(xfer);
 }
 
 usbd_status
@@ -433,14 +439,17 @@ usbd_bulk_transfer(usbd_xfer_handle xfer
 	usbd_setup_xfer(xfer, pipe, 0, buf, *size,
 			flags, timeout, usbd_bulk_transfer_cb);
 	DPRINTFN(1, (usbd_bulk_transfer: start transfer %d bytes\n, *size));
-	s = splusb();		/* don't want callback until tsleep() */
+	usbd_lock_pipe(pipe);	/* don't want callback until tsleep() */
 	err = usbd_transfer(xfer);
 	if (err != USBD_IN_PROGRESS) {
-		splx(s);
+		usbd_unlock_pipe(pipe);
 		return (err);
 	}
-	error = tsleep(xfer, PZERO | PCATCH, lbl, 0);
-	splx(s);
+	if (pipe-device-bus-lock)
+		error = cv_wait_sig(xfer-cv, pipe-device-bus-lock);
+	else
+		error = tsleep(xfer, PZERO | PCATCH, lbl, 0);
+	usbd_unlock_pipe(pipe);
 	if (error) {
 		DPRINTF((usbd_bulk_transfer: tsleep=%d\n, error));
 		usbd_abort_pipe(pipe);
@@ -461,7 +470,11 @@ Static void
 usbd_intr_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
 		  usbd_status status)
 {
-	wakeup(xfer);
+
+	if (xfer-pipe-device-bus-lock)
+		cv_broadcast(xfer-cv);
+	else
+		wakeup(xfer);
 }
 
 usbd_status
@@ -475,14 +488,17 @@ usbd_intr_transfer(usbd_xfer_handle xfer
 	usbd_setup_xfer(xfer, pipe, 0, buf, *size,
 			flags, timeout, usbd_intr_transfer_cb);
 	DPRINTFN(1, (usbd_intr_transfer: start transfer %d bytes\n, *size));
-	s = splusb();		/* don't want callback until tsleep() */
+	usbd_lock_pipe(pipe);	/* don't want callback until tsleep() */
 	err = usbd_transfer(xfer);
 	if (err != USBD_IN_PROGRESS) {
-		splx(s);
+		usbd_unlock_pipe(pipe);
 		return (err);
 	}
-	error = tsleep(xfer, PZERO | PCATCH, lbl, 0);
-	splx(s);
+	if (pipe-device-bus-lock)
+		error = cv_wait_sig(xfer-cv, pipe-device-bus-lock);
+	else
+		error = tsleep(xfer, PZERO | PCATCH, lbl, 0);
+	usbd_unlock_pipe(pipe);
 	if (error) {
 		DPRINTF((usbd_intr_transfer: tsleep=%d\n, error));
 		usbd_abort_pipe(pipe);

Index: src/sys/dev/usb/utoppy.c
diff -u src/sys/dev/usb/utoppy.c:1.15 src/sys/dev/usb/utoppy.c:1.15.12.1
--- src/sys/dev/usb/utoppy.c:1.15	Wed Nov  3 22:34:24 2010
+++ 

CVS commit: src/sys/arch/xen/xen

2011-12-07 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Thu Dec  8 03:34:48 UTC 2011

Modified Files:
src/sys/arch/xen/xen: evtchn.c

Log Message:
kmem_free() the appropriate size.

Thanks cegger@


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/xen/xen/evtchn.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/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.60 src/sys/arch/xen/xen/evtchn.c:1.61
--- src/sys/arch/xen/xen/evtchn.c:1.60	Wed Dec  7 16:26:23 2011
+++ src/sys/arch/xen/xen/evtchn.c	Thu Dec  8 03:34:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.60 2011/12/07 16:26:23 cegger Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.61 2011/12/08 03:34:44 cherry Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.60 2011/12/07 16:26:23 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.61 2011/12/08 03:34:44 cherry Exp $);
 
 #include opt_xen.h
 #include isa.h
@@ -795,7 +795,7 @@ event_remove_handler(int evtch, int (*fu
 	if (ih == NULL)
 		panic(event_remove_handler);
 	*ihp = ih-ih_ipl_next;
-	kmem_free(ih, sizeof (struct iplsource));
+	kmem_free(ih, sizeof (struct intrhand));
 	if (evts-ev_handlers == NULL) {
 		xen_atomic_clear_bit(ci-ci_evtmask[0], evtch);
 		evcnt_detach(evts-ev_evcnt);



CVS commit: [mrg-ohci-jmcneill-usbmp] src/sys/dev/usb

2011-12-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Dec  8 07:53:56 UTC 2011

Modified Files:
src/sys/dev/usb [mrg-ohci-jmcneill-usbmp]: ohci.c usbdi.c

Log Message:
there's something wrong with uaudio@ohci on the usbmp branch.
this is the minimally working port of ohci to mpusb, and it works
with uaudio but is lacking many other changes, yet.


To generate a diff of this commit:
cvs rdiff -u -r1.218.6.2 -r1.218.6.2.2.1 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.134.2.1 -r1.134.2.1.2.1 src/sys/dev/usb/usbdi.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.218.6.2 src/sys/dev/usb/ohci.c:1.218.6.2.2.1
--- src/sys/dev/usb/ohci.c:1.218.6.2	Sun Dec  4 21:02:27 2011
+++ src/sys/dev/usb/ohci.c	Thu Dec  8 07:53:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.218.6.2 2011/12/04 21:02:27 jmcneill Exp $	*/
+/*	$NetBSD: ohci.c,v 1.218.6.2.2.1 2011/12/08 07:53:56 mrg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $	*/
 
 /*
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.218.6.2 2011/12/04 21:02:27 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.218.6.2.2.1 2011/12/08 07:53:56 mrg Exp $);
 
 #include opt_usb.h
 
@@ -2245,7 +2245,7 @@ ohci_close_pipe(usbd_pipe_handle pipe, o
 	ohci_softc_t *sc = pipe-device-bus-hci_private;
 	ohci_soft_ed_t *sed = opipe-sed;
 
-	KASSERT(mutex_owned(sc-sc_lock));
+//	KASSERT(mutex_owned(sc-sc_lock));
 
 #ifdef DIAGNOSTIC
 	sed-ed.ed_flags |= HTOO32(OHCI_ED_SKIP);
@@ -3363,15 +3363,15 @@ ohci_device_setintr(ohci_softc_t *sc, st
 usbd_status
 ohci_device_isoc_transfer(usbd_xfer_handle xfer)
 {
-	ohci_softc_t *sc = xfer-pipe-device-bus-hci_private;
+	//ohci_softc_t *sc = xfer-pipe-device-bus-hci_private;
 	usbd_status err;
 
 	DPRINTFN(5,(ohci_device_isoc_transfer: xfer=%p\n, xfer));
 
 	/* Put it on our queue, */
-	mutex_enter(sc-sc_lock);
+	//mutex_enter(sc-sc_lock);
 	err = usb_insert_transfer(xfer);
-	mutex_exit(sc-sc_lock);
+	//mutex_exit(sc-sc_lock);
 
 	/* bail out on error, */
 	if (err  err != USBD_IN_PROGRESS)
@@ -3496,7 +3496,7 @@ ohci_device_isoc_enter(usbd_xfer_handle 
 	}
 #endif
 
-	mutex_enter(sc-sc_lock);
+	//mutex_enter(sc-sc_lock);
 	usb_syncmem(sed-dma, sed-offs, sizeof(sed-ed),
 	BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 	sed-ed.ed_tailp = HTOO32(nsitd-physaddr);
@@ -3505,7 +3505,7 @@ ohci_device_isoc_enter(usbd_xfer_handle 
 	usb_syncmem(sed-dma, sed-offs + offsetof(ohci_ed_t, ed_flags),
 	sizeof(sed-ed.ed_flags),
 	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
-	mutex_exit(sc-sc_lock);
+	//mutex_exit(sc-sc_lock);
 
 #ifdef OHCI_DEBUG
 	if (ohcidebug  5) {
@@ -3540,6 +3540,8 @@ ohci_device_isoc_start(usbd_xfer_handle 
 
 	/* XXX anything to do? */
 
+	mutex_exit(sc-sc_lock);
+
 	return (USBD_IN_PROGRESS);
 }
 
@@ -3553,7 +3555,7 @@ ohci_device_isoc_abort(usbd_xfer_handle 
 
 	DPRINTFN(1,(ohci_device_isoc_abort: xfer=%p\n, xfer));
 
-	KASSERT(mutex_owned(sc-sc_lock));
+	//KASSERT(mutex_owned(sc-sc_lock));
 
 	/* Transfer is already done. */
 	if (xfer-status != USBD_NOT_STARTED 
@@ -3587,22 +3589,24 @@ ohci_device_isoc_abort(usbd_xfer_handle 
 #endif
 	}
 
-	mutex_exit(sc-sc_lock);
+	//mutex_exit(sc-sc_lock);
 
 	usb_delay_ms(sc-sc_bus, OHCI_ITD_NOFFSET);
 
-	mutex_enter(sc-sc_lock);
+	//mutex_enter(sc-sc_lock);
 
 	/* Run callback. */
+mutex_enter(sc-sc_lock);
 	usb_transfer_complete(xfer);
+mutex_exit(sc-sc_lock);
 
 	sed-ed.ed_headp = HTOO32(sitd-physaddr); /* unlink TDs */
 	sed-ed.ed_flags = HTOO32(~OHCI_ED_SKIP); /* remove hardware skip */
 	usb_syncmem(sed-dma, sed-offs, sizeof(sed-ed),
 	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
- done:
-	mutex_exit(sc-sc_lock);
+ done: ;
+	//mutex_exit(sc-sc_lock);
 }
 
 void

Index: src/sys/dev/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.134.2.1 src/sys/dev/usb/usbdi.c:1.134.2.1.2.1
--- src/sys/dev/usb/usbdi.c:1.134.2.1	Sun Dec  4 13:23:17 2011
+++ src/sys/dev/usb/usbdi.c	Thu Dec  8 07:53:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.134.2.1 2011/12/04 13:23:17 jmcneill Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.134.2.1.2.1 2011/12/08 07:53:56 mrg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usbdi.c,v 1.134.2.1 2011/12/04 13:23:17 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: usbdi.c,v 1.134.2.1.2.1 2011/12/08 07:53:56 mrg Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_usb.h
@@ -878,7 +878,7 @@ usb_insert_transfer(usbd_xfer_handle xfe
 	DPRINTFN(5,(usb_insert_transfer: pipe=%p running=%d timeout=%d\n,
 		pipe, pipe-running, xfer-timeout));
 
-	KASSERT(pipe-lock == NULL || mutex_owned(pipe-lock));
+	//KASSERT(pipe-lock == NULL || mutex_owned(pipe-lock));
 
 #ifdef DIAGNOSTIC
 	if (xfer-busy_free != XFER_BUSY) {