CVS commit: src/sys

2012-10-29 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Oct 29 12:51:39 UTC 2012

Modified Files:
src/sys/arch/hpcsh/dev: psh3pwr.c
src/sys/arch/hpcsh/dev/hd64465: hd64465pcmcia.c
src/sys/arch/mvme68k/dev: pcc.c
src/sys/arch/sgimips/dev: zs_kbd.c
src/sys/arch/sh3/dev: sci.c
src/sys/arch/shark/shark: scr.c
src/sys/dev/pci: if_lmc.c

Log Message:
fix device/softc split errors.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hpcsh/dev/psh3pwr.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mvme68k/dev/pcc.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sgimips/dev/zs_kbd.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/sh3/dev/sci.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/shark/shark/scr.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/if_lmc.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/hpcsh/dev/psh3pwr.c
diff -u src/sys/arch/hpcsh/dev/psh3pwr.c:1.5 src/sys/arch/hpcsh/dev/psh3pwr.c:1.6
--- src/sys/arch/hpcsh/dev/psh3pwr.c:1.5	Sat Oct 27 17:17:56 2012
+++ src/sys/arch/hpcsh/dev/psh3pwr.c	Mon Oct 29 12:51:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: psh3pwr.c,v 1.5 2012/10/27 17:17:56 chs Exp $	*/
+/*	$NetBSD: psh3pwr.c,v 1.6 2012/10/29 12:51:38 chs Exp $	*/
 /*
  * Copyright (c) 2005, 2007 KIYOHARA Takashi
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: psh3pwr.c,v 1.5 2012/10/27 17:17:56 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: psh3pwr.c,v 1.6 2012/10/29 12:51:38 chs Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -150,9 +150,9 @@ psh3pwr_attach(device_t parent, device_t
 	aprint_normal(\n);
 
 	sc-sc_ih_pout = intc_intr_establish(SH7709_INTEVT2_IRQ0,
-	IST_EDGE, IPL_TTY, psh3pwr_intr_plug_out, sc);
+	IST_EDGE, IPL_TTY, psh3pwr_intr_plug_out, self);
 	sc-sc_ih_pin = intc_intr_establish(SH7709_INTEVT2_IRQ1,
-	IST_EDGE, IPL_TTY, psh3pwr_intr_plug_in, sc);
+	IST_EDGE, IPL_TTY, psh3pwr_intr_plug_in, self);
 
 	/* : WindowsCE sets this bit. */
 	aprint_normal_dev(self, plug status: %s\n,
@@ -164,10 +164,8 @@ psh3pwr_attach(device_t parent, device_t
 
 
 static int
-psh3pwr_intr_plug_out(void *self)
+psh3pwr_intr_plug_out(void *dev)
 {
-	struct psh3pwr_softc *sc __attribute__((__unused__)) =
-	(struct psh3pwr_softc *)self;
 	uint8_t irr0, scpdr;
 
 	irr0 = _reg_read_1(SH7709_IRR0);
@@ -180,16 +178,14 @@ psh3pwr_intr_plug_out(void *self)
 	scpdr = _reg_read_1(SH7709_SCPDR);
 	_reg_write_1(SH7709_SCPDR, scpdr | PSH3PWR_PLUG_OUT);
 
-	DPRINTF((%s: plug out\n, device_xname(sc-sc_dev)));
+	DPRINTF((%s: plug out\n, device_xname(dev)));
 
 	return 1;
 }
 
 static int
-psh3pwr_intr_plug_in(void *self)
+psh3pwr_intr_plug_in(void *dev)
 {
-	struct psh3pwr_softc *sc __attribute__((__unused__)) =
-	(struct psh3pwr_softc *)self;
 	uint8_t irr0, scpdr;
 
 	irr0 = _reg_read_1(SH7709_IRR0);
@@ -201,13 +197,13 @@ psh3pwr_intr_plug_in(void *self)
 	scpdr = _reg_read_1(SH7709_SCPDR);
 	_reg_write_1(SH7709_SCPDR, scpdr  ~PSH3PWR_PLUG_OUT);
 
-	DPRINTF((%s: plug in\n, device_xname(sc-sc_dev)));
+	DPRINTF((%s: plug in\n, device_xname(dev)));
 
 	return 1;
 }
 
 void
-psh3pwr_sleep(void *self)
+psh3pwr_sleep(void *v)
 {
 	/* splhigh on entry */
 	extern void pfckbd_poll_hitachi_power(void);

Index: src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c
diff -u src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c:1.29 src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c:1.30
--- src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c:1.29	Sat Oct 27 17:17:56 2012
+++ src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c	Mon Oct 29 12:51:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64465pcmcia.c,v 1.29 2012/10/27 17:17:56 chs Exp $	*/
+/*	$NetBSD: hd64465pcmcia.c,v 1.30 2012/10/29 12:51:38 chs Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hd64465pcmcia.c,v 1.29 2012/10/27 17:17:56 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: hd64465pcmcia.c,v 1.30 2012/10/29 12:51:38 chs Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -289,7 +289,7 @@ hd64465pcmcia_print(void *arg, const cha
 }
 
 int
-hd64465pcmcia_submatch(device_t parent, cfdata_tcf, const int *ldesc, void *aux)
+hd64465pcmcia_submatch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
 	struct pcmciabus_attach_args *paa = aux;
 	struct hd64465pcmcia_channel *ch =

Index: src/sys/arch/mvme68k/dev/pcc.c
diff -u src/sys/arch/mvme68k/dev/pcc.c:1.32 src/sys/arch/mvme68k/dev/pcc.c:1.33
--- src/sys/arch/mvme68k/dev/pcc.c:1.32	Sat Oct 27 17:18:04 2012
+++ src/sys/arch/mvme68k/dev/pcc.c	Mon Oct 29 12:51:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcc.c,v 1.32 2012/10/27 17:18:04 chs Exp $	*/
+/*	$NetBSD: pcc.c,v 1.33 2012/10/29 12:51:38 chs Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997 The NetBSD Foundation, 

CVS commit: src/sys/arch

2012-10-29 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Oct 29 12:52:44 UTC 2012

Modified Files:
src/sys/arch/macppc/macppc: failsafe.c
src/sys/arch/powerpc/oea: ofw_consinit.c

Log Message:
fix compile problems (for POWERMAC_G5).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/macppc/macppc/failsafe.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/oea/ofw_consinit.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/macppc/macppc/failsafe.c
diff -u src/sys/arch/macppc/macppc/failsafe.c:1.2 src/sys/arch/macppc/macppc/failsafe.c:1.3
--- src/sys/arch/macppc/macppc/failsafe.c:1.2	Wed Aug 23 05:58:39 2006
+++ src/sys/arch/macppc/macppc/failsafe.c	Mon Oct 29 12:52:43 2012
@@ -39,7 +39,9 @@
 #include sys/conf.h
 #include dev/cons.h
 #include sys/tty.h
+
 #include powerpc/cpu.h
+#include machine/psl.h
 
 #if defined (PMAC_G5)
 extern void mfhid4(volatile uint64_t * ret_hid4);

Index: src/sys/arch/powerpc/oea/ofw_consinit.c
diff -u src/sys/arch/powerpc/oea/ofw_consinit.c:1.14 src/sys/arch/powerpc/oea/ofw_consinit.c:1.15
--- src/sys/arch/powerpc/oea/ofw_consinit.c:1.14	Sat Oct 13 17:58:55 2012
+++ src/sys/arch/powerpc/oea/ofw_consinit.c	Mon Oct 29 12:52:43 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_consinit.c,v 1.14 2012/10/13 17:58:55 jdc Exp $ */
+/* $NetBSD: ofw_consinit.c,v 1.15 2012/10/29 12:52:43 chs Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ofw_consinit.c,v 1.14 2012/10/13 17:58:55 jdc Exp $);
+__KERNEL_RCSID(0, $NetBSD: ofw_consinit.c,v 1.15 2012/10/29 12:52:43 chs Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -150,6 +150,7 @@ cninit(void)
 
 #ifdef PMAC_G5
 		/* The MMU hasn't been initialized yet, use failsafe for now */
+		extern struct consdev failsafe_cons;
 		cp = failsafe_cons;
 		cn_tab = cp;
 		(*cp-cn_probe)(cp);



CVS commit: src/sys/arch

2012-10-29 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Oct 29 12:55:42 UTC 2012

Modified Files:
src/sys/arch/sun3/dev: fd.c
src/sys/arch/vax/vax: ka730.c ubi.c

Log Message:
fix compile problems.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/sun3/dev/fd.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/vax/vax/ka730.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/vax/vax/ubi.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/sun3/dev/fd.c
diff -u src/sys/arch/sun3/dev/fd.c:1.73 src/sys/arch/sun3/dev/fd.c:1.74
--- src/sys/arch/sun3/dev/fd.c:1.73	Sat Oct 13 06:37:16 2012
+++ src/sys/arch/sun3/dev/fd.c	Mon Oct 29 12:55:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.73 2012/10/13 06:37:16 tsutsui Exp $	*/
+/*	$NetBSD: fd.c,v 1.74 2012/10/29 12:55:41 chs Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fd.c,v 1.73 2012/10/13 06:37:16 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: fd.c,v 1.74 2012/10/29 12:55:41 chs Exp $);
 
 #include opt_ddb.h
 
@@ -1766,10 +1766,11 @@ fdioctl(dev_t dev, u_long cmd, void *add
 		for (k = 0; k  fdc-sc_nstat; k++)
 			printf( %x, fdc-sc_status[k]);
 		printf(\n);
-		}
 		return 0;
+		}
 
 	case _IOW('f', 101, int):
+		{
 		struct fdc_softc *fdc =
 		device_private(device_parent(fd-sc_dv));
 
@@ -1777,6 +1778,7 @@ fdioctl(dev_t dev, u_long cmd, void *add
 		fdc-sc_cfg |= (*(int *)addr  CFG_THRHLD_MASK);
 		fdconf(fdc);
 		return 0;
+		}
 
 	case _IO('f', 102):
 		{
@@ -1789,10 +1791,11 @@ fdioctl(dev_t dev, u_long cmd, void *add
 		printf(sensei(%d regs): , fdc-sc_nstat);
 		for (k=0; k  fdc-sc_nstat; k++)
 			printf( 0x%x, fdc-sc_status[k]);
-		}
 		printf(\n);
 		return 0;
+		}
 #endif
+
 	default:
 		return ENOTTY;
 	}

Index: src/sys/arch/vax/vax/ka730.c
diff -u src/sys/arch/vax/vax/ka730.c:1.3 src/sys/arch/vax/vax/ka730.c:1.4
--- src/sys/arch/vax/vax/ka730.c:1.3	Sun Jun  5 16:59:21 2011
+++ src/sys/arch/vax/vax/ka730.c	Mon Oct 29 12:55:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ka730.c,v 1.3 2011/06/05 16:59:21 matt Exp $ */
+/*	$NetBSD: ka730.c,v 1.4 2012/10/29 12:55:41 chs Exp $ */
 /*
  * Copyright (c) 1982, 1986, 1988 The Regents of the University of California.
  * All rights reserved.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ka730.c,v 1.3 2011/06/05 16:59:21 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: ka730.c,v 1.4 2012/10/29 12:55:41 chs Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -108,7 +108,7 @@ struct	cpu_dep ka730_calls = {
 };
 
 void
-ka730_conf()
+ka730_conf(void)
 {
 	/* Call ctuattach() here so it can setup its vectors. */
 	ctuattach();
@@ -154,7 +154,7 @@ ka730_memenable(device_t parent, device_
 
 /* log crd errors */
 void
-ka730_memerr()
+ka730_memerr(void)
 {
 }
 
@@ -186,7 +186,7 @@ ka730_mchk(void *cmcf)
 }
 
 void
-ka730_clrf()
+ka730_clrf(void)
 {
 	int s = splhigh();
 

Index: src/sys/arch/vax/vax/ubi.c
diff -u src/sys/arch/vax/vax/ubi.c:1.4 src/sys/arch/vax/vax/ubi.c:1.5
--- src/sys/arch/vax/vax/ubi.c:1.4	Sun Jun  5 16:59:21 2011
+++ src/sys/arch/vax/vax/ubi.c	Mon Oct 29 12:55:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubi.c,v 1.4 2011/06/05 16:59:21 matt Exp $ */
+/*	$NetBSD: ubi.c,v 1.5 2012/10/29 12:55:41 chs Exp $ */
 /*
  * Copyright (c) 1999 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ubi.c,v 1.4 2011/06/05 16:59:21 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: ubi.c,v 1.5 2012/10/29 12:55:41 chs Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -78,7 +78,7 @@ ubi_attach(device_t parent, device_t sel
 
 	printf(\n);
 
-sa.sa_base = NEX730;
+sa.sa_base = (bus_addr_t)NEX730;
 
 #define NEXPAGES (sizeof(struct nexus) / VAX_NBPG)
 



CVS commit: src/sys/dev/pci

2012-10-29 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Oct 29 12:59:44 UTC 2012

Modified Files:
src/sys/dev/pci: coram.c

Log Message:
remove an unnecessary cast.
use the standard name for the third arg to attach.
adjust some whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/coram.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/coram.c
diff -u src/sys/dev/pci/coram.c:1.10 src/sys/dev/pci/coram.c:1.11
--- src/sys/dev/pci/coram.c:1.10	Mon Jan 30 19:41:18 2012
+++ src/sys/dev/pci/coram.c	Mon Oct 29 12:59:43 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: coram.c,v 1.10 2012/01/30 19:41:18 drochner Exp $ */
+/* $NetBSD: coram.c,v 1.11 2012/10/29 12:59:43 chs Exp $ */
 
 /*
  * Copyright (c) 2008, 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coram.c,v 1.10 2012/01/30 19:41:18 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: coram.c,v 1.11 2012/10/29 12:59:43 chs Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -157,10 +157,10 @@ coram_match(device_t parent, cfdata_t ma
 }
 
 static void
-coram_attach(device_t parent, device_t self, void *v)
+coram_attach(device_t parent, device_t self, void *aux)
 {
 	struct coram_softc *sc = device_private(self);
-	const struct pci_attach_args *pa = v;
+	const struct pci_attach_args *pa = aux;
 	pci_intr_handle_t ih;
 	pcireg_t reg;
 	const char *intrstr;
@@ -193,8 +193,7 @@ coram_attach(device_t parent, device_t s
 		return;
 	}
 	intrstr = pci_intr_string(pa-pa_pc, ih);
-	sc-sc_ih = pci_intr_establish(pa-pa_pc, ih, IPL_VM,
-	coram_intr, (void *)self);
+	sc-sc_ih = pci_intr_establish(pa-pa_pc, ih, IPL_VM, coram_intr, self);
 	if (sc-sc_ih == NULL) {
 		aprint_error_dev(self, couldn't establish interrupt);
 		if (intrstr != NULL)
@@ -214,7 +213,8 @@ coram_attach(device_t parent, device_t s
 		cic = sc-sc_iic[i];
 
 		cic-cic_sc = sc;
-		if(bus_space_subregion(sc-sc_memt, sc-sc_memh, I2C_BASE + (I2C_SIZE * i), I2C_SIZE, cic-cic_regh))
+		if (bus_space_subregion(sc-sc_memt, sc-sc_memh,
+		I2C_BASE + (I2C_SIZE * i), I2C_SIZE, cic-cic_regh))
 			panic(failed to subregion i2c);
 
 		mutex_init(cic-cic_busmutex, MUTEX_DRIVER, IPL_NONE);
@@ -228,8 +228,8 @@ coram_attach(device_t parent, device_t s
 		memset(iba, 0, sizeof(iba));
 		iba.iba_tag = cic-cic_i2c;
 		iba.iba_type = I2C_TYPE_SMBUS;
-		cic-cic_i2cdev = config_found_ia(self, i2cbus,
-		iba, iicbus_print);
+		cic-cic_i2cdev = config_found_ia(self, i2cbus, iba,
+		iicbus_print);
 #endif
 	}
 
@@ -251,7 +251,8 @@ coram_attach(device_t parent, device_t s
 //	seeprom_bootstrap_read(sc-sc_i2c, 0x50, 0, 256, foo, 256);
 
 	iic_acquire_bus(sc-sc_i2c, I2C_F_POLL);
-	iic_exec(sc-sc_i2c, I2C_OP_READ_WITH_STOP, 0x50, bar, 1, foo, 256, I2C_F_POLL);
+	iic_exec(sc-sc_i2c, I2C_OP_READ_WITH_STOP, 0x50, bar, 1, foo, 256,
+	I2C_F_POLL);
 	iic_release_bus(sc-sc_i2c, I2C_F_POLL);
 
 	printf(\n);



CVS commit: src/sys/dev/tc

2012-10-29 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Oct 29 13:19:15 UTC 2012

Removed Files:
src/sys/dev/tc: ascvar.h

Log Message:
remove unused file.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r0 src/sys/dev/tc/ascvar.h

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



CVS commit: src/sys

2012-10-29 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Oct 29 13:30:25 UTC 2012

Modified Files:
src/sys/arch/arm/omap: omap3_sdhc.c omap3_sdmmcreg.h
src/sys/dev/sdmmc: sdhc.c sdhcvar.h

Log Message:
Support omap3 SDHC driver.  tested on OVERO only.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/omap3_sdhc.c \
src/sys/arch/arm/omap/omap3_sdmmcreg.h
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/sdmmc/sdhcvar.h

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

Modified files:

Index: src/sys/arch/arm/omap/omap3_sdhc.c
diff -u src/sys/arch/arm/omap/omap3_sdhc.c:1.1 src/sys/arch/arm/omap/omap3_sdhc.c:1.2
--- src/sys/arch/arm/omap/omap3_sdhc.c:1.1	Thu Jul 12 03:08:26 2012
+++ src/sys/arch/arm/omap/omap3_sdhc.c	Mon Oct 29 13:30:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdhc.c,v 1.1 2012/07/12 03:08:26 matt Exp $	*/
+/*	$NetBSD: omap3_sdhc.c,v 1.2 2012/10/29 13:30:25 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: omap3_sdhc.c,v 1.1 2012/07/12 03:08:26 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: omap3_sdhc.c,v 1.2 2012/10/29 13:30:25 kiyohara Exp $);
 
 #include opt_omap.h
 
@@ -48,8 +48,20 @@ __KERNEL_RCSID(0, $NetBSD: omap3_sdhc.c
 #include dev/sdmmc/sdhcreg.h
 #include dev/sdmmc/sdhcvar.h
 
+#define CLKD(kz)	(sc-sc.sc_clkbase / (kz))
+
+#define SDHC_READ(sc, reg) \
+	bus_space_read_4((sc)-sc_bst, (sc)-sc_sdhc_bsh, (reg))
+#define SDHC_WRITE(sc, reg, val) \
+	bus_space_write_4((sc)-sc_bst, (sc)-sc_sdhc_bsh, (reg), (val))
+
 static int obiosdhc_match(device_t, cfdata_t, void *);
 static void obiosdhc_attach(device_t, device_t, void *);
+static int obiosdhc_detach(device_t, int);
+
+static int obiosdhc_rod(struct sdhc_softc *, int);
+static int obiosdhc_write_protect(struct sdhc_softc *);
+static int obiosdhc_card_detect(struct sdhc_softc *);
 
 struct obiosdhc_softc {
 	struct sdhc_softc	sc;
@@ -61,7 +73,7 @@ struct obiosdhc_softc {
 };
 
 CFATTACH_DECL_NEW(obiosdhc, sizeof(struct obiosdhc_softc),
-obiosdhc_match, obiosdhc_attach, NULL, NULL);
+obiosdhc_match, obiosdhc_attach, obiosdhc_detach, NULL);
 
 static int
 obiosdhc_match(device_t parent, cfdata_t cf, void *aux)
@@ -85,18 +97,26 @@ obiosdhc_attach(device_t parent, device_
 {
 	struct obiosdhc_softc * const sc = device_private(self);
 	struct obio_attach_args * const oa = aux;
-	int error;
+	uint32_t clkd, stat;
+	int error, timo, clksft, n;
 
 	sc-sc.sc_dmat = oa-obio_dmat;
 	sc-sc.sc_dev = self;
 	//sc-sc.sc_flags |= SDHC_FLAG_USE_DMA;
 	sc-sc.sc_flags |= SDHC_FLAG_32BIT_ACCESS;
-	sc-sc.sc_flags |= SDHC_FLAG_HAVE_CGM;
 	sc-sc.sc_flags |= SDHC_FLAG_NO_LED_ON;
+	sc-sc.sc_flags |= SDHC_FLAG_RSP136_CRC;
+	sc-sc.sc_flags |= SDHC_FLAG_SINGLE_ONLY;
 	sc-sc.sc_host = sc-sc_hosts;
 	sc-sc.sc_clkbase = 96000;	/* 96MHZ */
+	sc-sc.sc_clkmsk = 0xffc0;
+	sc-sc.sc_vendor_rod = obiosdhc_rod;
+	sc-sc.sc_vendor_write_protect = obiosdhc_write_protect;
+	sc-sc.sc_vendor_card_detect = obiosdhc_card_detect;
 	sc-sc_bst = oa-obio_iot;
 
+	clksft = ffs(sc-sc.sc_clkmsk) - 1;
+
 	error = bus_space_map(sc-sc_bst, oa-obio_addr, oa-obio_size, 0,
 	sc-sc_bsh);
 	if (error) {
@@ -111,7 +131,25 @@ obiosdhc_attach(device_t parent, device_
 	aprint_naive(: SDHC controller\n);
 	aprint_normal(: SDHC controller\n);
 
-	sc-sc_ih = intr_establish(oa-obio_intr, IPL_VM, IST_LEVEL, 
+	/* XX: Turn-on regurator via I2C. */
+	/* XX: And enable ICLOCK/FCLOCK. */
+
+	/* MMCHS Soft reset */
+	bus_space_write_4(sc-sc_bst, sc-sc_bsh, MMCHS_SYSCONFIG,
+	SYSCONFIG_SOFTRESET);
+	timo = 300;	/*  3 sec. */
+	while (timo--) {
+		if (bus_space_read_4(sc-sc_bst, sc-sc_bsh, MMCHS_SYSSTATUS) 
+		SYSSTATUS_RESETDONE)
+			break;
+		delay(1);
+	}
+	if (timo == 0)
+		aprint_error_dev(self, Soft reset timeout\n);
+	bus_space_write_4(sc-sc_bst, sc-sc_bsh, MMCHS_SYSCONFIG,
+	SYSCONFIG_ENAWAKEUP | SYSCONFIG_AUTOIDLE);
+
+	sc-sc_ih = intr_establish(oa-obio_intr, IPL_VM, IST_LEVEL,
 	sdhc_intr, sc-sc);
 	if (sc-sc_ih == NULL) {
 		aprint_error_dev(self, failed to establish interrupt %d\n,
@@ -128,6 +166,74 @@ obiosdhc_attach(device_t parent, device_
 		error);
 		goto fail;
 	}
+
+	/* Set SDVS 1.8v and DTW 1bit mode */
+	SDHC_WRITE(sc, SDHC_HOST_CTL,
+	SDHC_VOLTAGE_1_8V  (SDHC_VOLTAGE_SHIFT + 8));
+	bus_space_write_4(sc-sc_bst, sc-sc_bsh, MMCHS_CON,
+	bus_space_read_4(sc-sc_bst, sc-sc_bsh, MMCHS_CON) | CON_OD);
+	SDHC_WRITE(sc, SDHC_CLOCK_CTL,
+	SDHC_READ(sc, SDHC_CLOCK_CTL) | SDHC_INTCLK_ENABLE |
+			SDHC_SDCLK_ENABLE);
+	SDHC_WRITE(sc, SDHC_HOST_CTL,
+	SDHC_READ(sc, SDHC_HOST_CTL) | SDHC_BUS_POWER  8);
+	SDHC_WRITE(sc, SDHC_CLOCK_CTL,
+	SDHC_READ(sc, SDHC_CLOCK_CTL) | CLKD(150)  clksft);
+
+	/*
+	 * 22.6.1.3.1.5 MMCHS Controller INIT Procedure Start
+	 

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

2012-10-29 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Oct 29 13:36:59 UTC 2012

Modified Files:
src/sys/arch/evbarm/conf: OVERO

Log Message:
Add sdmmc.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/OVERO

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

Modified files:

Index: src/sys/arch/evbarm/conf/OVERO
diff -u src/sys/arch/evbarm/conf/OVERO:1.18 src/sys/arch/evbarm/conf/OVERO:1.19
--- src/sys/arch/evbarm/conf/OVERO:1.18	Wed Oct 17 14:48:11 2012
+++ src/sys/arch/evbarm/conf/OVERO	Mon Oct 29 13:36:59 2012
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: OVERO,v 1.18 2012/10/17 14:48:11 apb Exp $
+#	$NetBSD: OVERO,v 1.19 2012/10/29 13:36:59 kiyohara Exp $
 #
 #	OVERO -- Gumstix. Inc. Overo platforms kernel
 #
@@ -208,6 +208,13 @@ omapwdt32k*	at obio1 addr 0x48314000 siz
 # Power, Reset and Clock Management
 prcm*		at obio1 addr 0x48306000 size 0x2000	# PRM Module
 
+# SDHC controllers
+sdhc0		at obio0 addr 0x4809c000 size 0x0400 intr 83
+#sdhc1		at obio0 addr 0x480b4000 size 0x0400 intr 86	# Wifi
+
+sdmmc*		at sdhc?			# SD/MMC bus
+ld*		at sdmmc?
+
 # On-board USB
 #ehci*		at obio0 addr 0x48064800 size 0x0400 intr 77
 #ohci*		at obio0 addr 0x48064400 size 0x0400 intr 76



CVS commit: src/sys/arch/hpcsh/dev/hd64465

2012-10-29 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Oct 29 13:40:56 UTC 2012

Modified Files:
src/sys/arch/hpcsh/dev/hd64465: hd64465pcmcia.c

Log Message:
third try is the charm: really make this build again.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.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/hpcsh/dev/hd64465/hd64465pcmcia.c
diff -u src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c:1.30 src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c:1.31
--- src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c:1.30	Mon Oct 29 12:51:38 2012
+++ src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c	Mon Oct 29 13:40:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64465pcmcia.c,v 1.30 2012/10/29 12:51:38 chs Exp $	*/
+/*	$NetBSD: hd64465pcmcia.c,v 1.31 2012/10/29 13:40:56 chs Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hd64465pcmcia.c,v 1.30 2012/10/29 12:51:38 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: hd64465pcmcia.c,v 1.31 2012/10/29 13:40:56 chs Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -119,6 +119,7 @@ struct hd64465pcmcia_event {
 };
 
 struct hd64465pcmcia_softc {
+	device_t sc_dev;
 	enum hd64465_module_id sc_module_id;
 	int sc_shutdown;
 



CVS commit: src/sys/arch/hpcsh/dev/hd64465

2012-10-29 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Oct 29 13:46:26 UTC 2012

Modified Files:
src/sys/arch/hpcsh/dev/hd64465: hd64465pcmcia.c

Log Message:
and finally, initialize sc_dev now that I added it back.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.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/hpcsh/dev/hd64465/hd64465pcmcia.c
diff -u src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c:1.31 src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c:1.32
--- src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c:1.31	Mon Oct 29 13:40:56 2012
+++ src/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c	Mon Oct 29 13:46:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64465pcmcia.c,v 1.31 2012/10/29 13:40:56 chs Exp $	*/
+/*	$NetBSD: hd64465pcmcia.c,v 1.32 2012/10/29 13:46:26 chs Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hd64465pcmcia.c,v 1.31 2012/10/29 13:40:56 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: hd64465pcmcia.c,v 1.32 2012/10/29 13:46:26 chs Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -214,6 +214,7 @@ hd64465pcmcia_attach(device_t parent, de
 	struct hd64465pcmcia_softc *sc = device_private(self);
 	int error;
 
+	sc-sc_dev = self;
 	sc-sc_module_id = ha-ha_module_id;
 
 	printf(\n);



CVS commit: src/sys/arch

2012-10-29 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Oct 29 14:01:33 UTC 2012

Modified Files:
src/sys/arch/arm/at91: at91bus.c
src/sys/arch/evbarm/evbarm: initarm_common.c

Log Message:
add missing arg to cpu_setttb().


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/at91/at91bus.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/evbarm/initarm_common.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/at91/at91bus.c
diff -u src/sys/arch/arm/at91/at91bus.c:1.14 src/sys/arch/arm/at91/at91bus.c:1.15
--- src/sys/arch/arm/at91/at91bus.c:1.14	Sat Sep  1 14:48:06 2012
+++ src/sys/arch/arm/at91/at91bus.c	Mon Oct 29 14:01:33 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: at91bus.c,v 1.14 2012/09/01 14:48:06 matt Exp $	*/
+/*	$NetBSD: at91bus.c,v 1.15 2012/10/29 14:01:33 chs Exp $	*/
 
 /*
  * Copyright (c) 2007 Embedtronics Oy
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: at91bus.c,v 1.14 2012/09/01 14:48:06 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: at91bus.c,v 1.15 2012/10/29 14:01:33 chs Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -448,7 +448,7 @@ at91bus_setup(BootConfig *mem)
 	printf(switching to new L1 page table  @%#lx..., kernel_l1pt.pv_pa);
 #endif
 	cpu_domains((DOMAIN_CLIENT  (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT);
-	cpu_setttb(kernel_l1pt.pv_pa);
+	cpu_setttb(kernel_l1pt.pv_pa, true);
 	cpu_tlb_flushID();
 	cpu_domains(DOMAIN_CLIENT  (PMAP_DOMAIN_KERNEL*2));
 

Index: src/sys/arch/evbarm/evbarm/initarm_common.c
diff -u src/sys/arch/evbarm/evbarm/initarm_common.c:1.11 src/sys/arch/evbarm/evbarm/initarm_common.c:1.12
--- src/sys/arch/evbarm/evbarm/initarm_common.c:1.11	Sun Jul 29 00:07:07 2012
+++ src/sys/arch/evbarm/evbarm/initarm_common.c	Mon Oct 29 14:01:33 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: initarm_common.c,v 1.11 2012/07/29 00:07:07 matt Exp $	*/
+/*	$NetBSD: initarm_common.c,v 1.12 2012/10/29 14:01:33 chs Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: initarm_common.c,v 1.11 2012/07/29 00:07:07 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: initarm_common.c,v 1.12 2012/10/29 14:01:33 chs Exp $);
 
 #include sys/systm.h
 #include sys/param.h
@@ -402,7 +402,7 @@ initarm_common(const struct initarm_conf
 
 	/* Switch tables */
 	cpu_domains((DOMAIN_CLIENT  (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT);
-	cpu_setttb(kernel_l1pt.pv_pa);
+	cpu_setttb(kernel_l1pt.pv_pa, true);
 	cpu_tlb_flushID();
 	cpu_domains(DOMAIN_CLIENT  (PMAP_DOMAIN_KERNEL*2));
 



CVS commit: src

2012-10-29 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Oct 29 14:09:38 UTC 2012

Modified Files:
src/common/lib/libc/arch/arm/atomic: atomic_cas_32.S atomic_cas_64.S
atomic_cas_8.S atomic_inc_32.S atomic_inc_64.S
src/sys/arch/arm/arm: bcopyinout.S

Log Message:
_ARCH_ARM_6 - _ARM_ARCH_6


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S \
src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S \
src/common/lib/libc/arch/arm/atomic/atomic_inc_32.S
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/arm/atomic/atomic_inc_64.S
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/arm/bcopyinout.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S:1.3 src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S:1.4
--- src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S:1.3	Fri Aug 31 23:41:52 2012
+++ src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S	Mon Oct 29 14:09:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_cas_32.S,v 1.3 2012/08/31 23:41:52 matt Exp $	*/
+/*	$NetBSD: atomic_cas_32.S,v 1.4 2012/10/29 14:09:38 chs Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -68,4 +68,4 @@ STRONG_ALIAS(_atomic_cas_uint_ni,_atomic
 STRONG_ALIAS(_atomic_cas_ulong_ni,_atomic_cas_32)
 STRONG_ALIAS(_atomic_cas_ptr,_atomic_cas_32)
 
-#endif /* _ARCH_ARM_6 */
+#endif /* _ARM_ARCH_6 */
Index: src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S:1.3 src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S:1.4
--- src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S:1.3	Fri Aug 31 23:41:52 2012
+++ src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S	Mon Oct 29 14:09:38 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_cas_8.S,v 1.3 2012/08/31 23:41:52 matt Exp $ */
+/* $NetBSD: atomic_cas_8.S,v 1.4 2012/10/29 14:09:38 chs Exp $ */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -56,4 +56,4 @@ ATOMIC_OP_ALIAS(atomic_cas_8,_atomic_cas
 STRONG_ALIAS(_atomic_cas_char,_atomic_cas_8)
 STRONG_ALIAS(_atomic_cas_uchar,_atomic_cas_8)
 
-#endif /* _ARCH_ARM_6 */
+#endif /* _ARM_ARCH_6 */
Index: src/common/lib/libc/arch/arm/atomic/atomic_inc_32.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_inc_32.S:1.3 src/common/lib/libc/arch/arm/atomic/atomic_inc_32.S:1.4
--- src/common/lib/libc/arch/arm/atomic/atomic_inc_32.S:1.3	Fri Aug 31 23:41:52 2012
+++ src/common/lib/libc/arch/arm/atomic/atomic_inc_32.S	Mon Oct 29 14:09:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_inc_32.S,v 1.3 2012/08/31 23:41:52 matt Exp $	*/
+/*	$NetBSD: atomic_inc_32.S,v 1.4 2012/10/29 14:09:38 chs Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -76,4 +76,4 @@ STRONG_ALIAS(_atomic_inc_uint_nv,_atomic
 STRONG_ALIAS(_atomic_inc_ulong_nv,_atomic_inc_32_nv)
 STRONG_ALIAS(_atomic_inc_ptr_nv,_atomic_inc_32_nv)
 
-#endif /* _ARCH_ARM_6 */
+#endif /* _ARM_ARCH_6 */

Index: src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S:1.1 src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S:1.2
--- src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S:1.1	Tue Sep 11 20:51:25 2012
+++ src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S	Mon Oct 29 14:09:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_cas_64.S,v 1.1 2012/09/11 20:51:25 matt Exp $	*/
+/*	$NetBSD: atomic_cas_64.S,v 1.2 2012/10/29 14:09:38 chs Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -66,4 +66,4 @@ ENTRY_NP(_atomic_cas_64)
 
 ATOMIC_OP_ALIAS(atomic_cas_64,_atomic_cas_64)
 
-#endif /* _ARCH_ARM_6 */
+#endif /* _ARM_ARCH_6 */

Index: src/common/lib/libc/arch/arm/atomic/atomic_inc_64.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_inc_64.S:1.2 src/common/lib/libc/arch/arm/atomic/atomic_inc_64.S:1.3
--- src/common/lib/libc/arch/arm/atomic/atomic_inc_64.S:1.2	Thu Sep 13 00:36:12 2012
+++ src/common/lib/libc/arch/arm/atomic/atomic_inc_64.S	Mon Oct 29 14:09:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_inc_64.S,v 1.2 2012/09/13 00:36:12 matt Exp $	*/
+/*	$NetBSD: atomic_inc_64.S,v 1.3 2012/10/29 14:09:38 chs Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -69,4 +69,4 @@ ENTRY_NP(_atomic_inc_64_nv)
 	END(_atomic_inc_64_nv)
 ATOMIC_OP_ALIAS(atomic_inc_64_nv,_atomic_inc_64_nv)
 
-#endif /* _ARCH_ARM_6 */
+#endif /* _ARM_ARCH_6 */

Index: src/sys/arch/arm/arm/bcopyinout.S
diff -u src/sys/arch/arm/arm/bcopyinout.S:1.18 src/sys/arch/arm/arm/bcopyinout.S:1.19
--- src/sys/arch/arm/arm/bcopyinout.S:1.18	Tue Jul 31 06:54:16 2012
+++ src/sys/arch/arm/arm/bcopyinout.S	Mon Oct 29 14:09:38 

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

2012-10-29 Thread Radoslaw Kujawa
Module Name:src
Committed By:   rkujawa
Date:   Mon Oct 29 14:13:22 UTC 2012

Modified Files:
src/sys/arch/bebox/include: cpu.h

Log Message:
Include bebox.h only in kernel. Make bebox port build again.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/bebox/include/cpu.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/bebox/include/cpu.h
diff -u src/sys/arch/bebox/include/cpu.h:1.14 src/sys/arch/bebox/include/cpu.h:1.15
--- src/sys/arch/bebox/include/cpu.h:1.14	Sat Oct 20 14:53:37 2012
+++ src/sys/arch/bebox/include/cpu.h	Mon Oct 29 14:13:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.14 2012/10/20 14:53:37 kiyohara Exp $	*/
+/*	$NetBSD: cpu.h,v 1.15 2012/10/29 14:13:22 rkujawa Exp $	*/
 
 /*
  * Copyright (C) 1995-1997 Wolfgang Solfrank.
@@ -36,16 +36,17 @@
 #if defined(_KERNEL)  !defined(_MODULE)
 #define	CPU_MAXNUM	2
 extern char bootpath[];
-#endif
 
 #ifdef MULTIPROCESSOR
 #define MD_TLBSYNC()	bebox_tlbisync()
 #endif
 
 #include machine/bebox.h
+#endif
 
 #include powerpc/cpu.h
 
+#if defined(_KERNEL)  !defined(_MODULE)
 static __inline void
 bebox_tlbisync(void)
 {
@@ -57,5 +58,6 @@ bebox_tlbisync(void)
 	/* Deassert #TLBISYNC */
 	SET_BEBOX_REG(CPU_CONTROL, TLBISYNC_FROM(cpuid));
 }
+#endif
 
 #endif	/* _BEBOX_CPU_H_ */



CVS commit: [agc-netpgp-standalone] src/crypto/external/bsd/netpgp/dist/src

2012-10-29 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Oct 29 15:46:50 UTC 2012

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libbn [agc-netpgp-standalone]:
bignum.c misc.c
src/crypto/external/bsd/netpgp/dist/src/libdigest 
[agc-netpgp-standalone]:
digest.c tiger.c
src/crypto/external/bsd/netpgp/dist/src/librsa [agc-netpgp-standalone]:
rsa.c
src/crypto/external/bsd/netpgp/dist/src/libverify 
[agc-netpgp-standalone]:
b64.c

Log Message:
Do some argument checking in public functions (exported by library interface)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 \
src/crypto/external/bsd/netpgp/dist/src/libbn/bignum.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/crypto/external/bsd/netpgp/dist/src/libbn/misc.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/crypto/external/bsd/netpgp/dist/src/libdigest/digest.c \
src/crypto/external/bsd/netpgp/dist/src/libdigest/tiger.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 \
src/crypto/external/bsd/netpgp/dist/src/librsa/rsa.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/crypto/external/bsd/netpgp/dist/src/libverify/b64.c

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libbn/bignum.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libbn/bignum.c:1.1.2.2 src/crypto/external/bsd/netpgp/dist/src/libbn/bignum.c:1.1.2.3
--- src/crypto/external/bsd/netpgp/dist/src/libbn/bignum.c:1.1.2.2	Fri Sep 21 03:03:52 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libbn/bignum.c	Mon Oct 29 15:46:50 2012
@@ -5270,13 +5270,15 @@ BN_dup(const BIGNUM *a)
 void
 BN_swap(BIGNUM *a, BIGNUM *b)
 {
-  	mp_exch(a, b);
+	if (a  b) {
+		mp_exch(a, b);
+	}
 }
 
 int
 BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
 {
-	if (a == NULL || n  0) {
+	if (r == NULL || a == NULL || n  0) {
 		return 0;
 	}
 	BN_copy(r, a);
@@ -5286,7 +5288,7 @@ BN_lshift(BIGNUM *r, const BIGNUM *a, in
 int
 BN_lshift1(BIGNUM *r, BIGNUM *a)
 {
-	if (a == NULL) {
+	if (r == NULL || a == NULL) {
 		return 0;
 	}
 	BN_copy(r, a);
@@ -5296,7 +5298,7 @@ BN_lshift1(BIGNUM *r, BIGNUM *a)
 int
 BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
 {
-	if (a == NULL || n  0) {
+	if (r == NULL || a == NULL || n  0) {
 		return MP_VAL;
 	}
 	BN_copy(r, a);
@@ -5306,7 +5308,7 @@ BN_rshift(BIGNUM *r, const BIGNUM *a, in
 int
 BN_rshift1(BIGNUM *r, BIGNUM *a)
 {
-	if (a == NULL) {
+	if (r == NULL || a == NULL) {
 		return 0;
 	}
 	BN_copy(r, a);
@@ -5316,6 +5318,9 @@ BN_rshift1(BIGNUM *r, BIGNUM *a)
 int
 BN_set_word(BIGNUM *a, BN_ULONG w)
 {
+	if (a == NULL) {
+		return 0;
+	}
 	mp_set(a, w);
 	return 1;
 }
@@ -5509,13 +5514,13 @@ BN_CTX_end(BN_CTX *ctx)
 char *
 BN_bn2hex(const BIGNUM *a)
 {
-	return formatbn(a, 16);
+	return (a == NULL) ? NULL : formatbn(a, 16);
 }
 
 char *
 BN_bn2dec(const BIGNUM *a)
 {
-	return formatbn(a, 10);
+	return (a == NULL) ? NULL : formatbn(a, 10);
 }
 
 #ifndef _KERNEL
@@ -5542,6 +5547,9 @@ BN_rand(BIGNUM *rnd, int bits, int top, 
 	int		digits;
 	int		i;
 
+	if (rnd == NULL) {
+		return 0;
+	}
 	mp_init_size(rnd, digits = howmany(bits, DIGIT_BIT));
 	for (i = 0 ; i  digits ; i++) {
 		r = (uint64_t)arc4random();

Index: src/crypto/external/bsd/netpgp/dist/src/libbn/misc.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libbn/misc.c:1.1.2.1 src/crypto/external/bsd/netpgp/dist/src/libbn/misc.c:1.1.2.2
--- src/crypto/external/bsd/netpgp/dist/src/libbn/misc.c:1.1.2.1	Sun May  6 17:34:56 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libbn/misc.c	Mon Oct 29 15:46:50 2012
@@ -73,9 +73,11 @@ logmessage(const int level, const char *
 	va_list	args;
 
 	USE_ARG(level);
-	va_start(args, fmt);
-	vfprintf(stderr, fmt, args);
-	va_end(args);
+	if (fmt != NULL) {
+		va_start(args, fmt);
+		vfprintf(stderr, fmt, args);
+		va_end(args);
+	}
 }
 #endif
 
@@ -91,6 +93,12 @@ hexdump(FILE *fp, const char *header, co
 	size_t	i;
 	char	line[LINELEN + 1];
 
+	if (src == NULL) {
+		return;
+	}
+	if (fp == NULL) {
+		fp = stdout;
+	}
 	(void) fprintf(fp, %s%s, (header) ? header : , (header) ? \n : );
 	(void) fprintf(fp, [% PRIsize u char%s]\n, length, (length == 1) ?  : s);
 	for (i = 0 ; i  length ; i++) {

Index: src/crypto/external/bsd/netpgp/dist/src/libdigest/digest.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libdigest/digest.c:1.1.2.1 src/crypto/external/bsd/netpgp/dist/src/libdigest/digest.c:1.1.2.2
--- src/crypto/external/bsd/netpgp/dist/src/libdigest/digest.c:1.1.2.1	Sat Oct 20 04:54:40 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libdigest/digest.c	Mon Oct 29 15:46:49 2012
@@ -89,55 +89,73 @@ static uint8_t prefix_sha512[] = {
 void 
 MD5_Init(MD5_CTX *context)
 {
-	MD5Init(context);
+	if (context) {
+		MD5Init(context);
+	}
 }
 
 void   

CVS commit: src

2012-10-29 Thread Lars Heidieker
Module Name:src
Committed By:   para
Date:   Mon Oct 29 16:00:05 UTC 2012

Modified Files:
src/sys/uvm: uvm_map.c uvm_map.h
src/usr.bin/pmap: pmap.c

Log Message:
get rid of not used uvm_map flag (UVM_MAP_KMAPENT)


To generate a diff of this commit:
cvs rdiff -u -r1.322 -r1.323 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.71 -r1.72 src/sys/uvm/uvm_map.h
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/pmap/pmap.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/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.322 src/sys/uvm/uvm_map.c:1.323
--- src/sys/uvm/uvm_map.c:1.322	Tue Sep  4 13:37:42 2012
+++ src/sys/uvm/uvm_map.c	Mon Oct 29 16:00:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.322 2012/09/04 13:37:42 matt Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.323 2012/10/29 16:00:05 para Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_map.c,v 1.322 2012/09/04 13:37:42 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_map.c,v 1.323 2012/10/29 16:00:05 para Exp $);
 
 #include opt_ddb.h
 #include opt_uvmhist.h
@@ -2221,10 +2221,7 @@ uvm_unmap_remove(struct vm_map *map, vad
 			 */
 			KASSERT(vm_map_pmap(map) == pmap_kernel());
 
-			if ((entry-flags  UVM_MAP_KMAPENT) == 0) {
-uvm_km_pgremove_intrsafe(map, entry-start,
-entry-end);
-			}
+			uvm_km_pgremove_intrsafe(map, entry-start, entry-end);
 		} else if (UVM_ET_ISOBJ(entry) 
 			   UVM_OBJ_IS_KERN_OBJECT(entry-object.uvm_obj)) {
 			panic(%s: kernel object %p %p\n,
@@ -2242,26 +2239,23 @@ uvm_unmap_remove(struct vm_map *map, vad
 		}
 
 #if defined(DEBUG)
-		if ((entry-flags  UVM_MAP_KMAPENT) == 0) {
-
-			/*
-			 * check if there's remaining mapping,
-			 * which is a bug in caller.
-			 */
+		/*
+		 * check if there's remaining mapping,
+		 * which is a bug in caller.
+		 */
 
-			vaddr_t va;
-			for (va = entry-start; va  entry-end;
-			va += PAGE_SIZE) {
-if (pmap_extract(vm_map_pmap(map), va, NULL)) {
-	panic(%s: %#PRIxVADDR has mapping,
-	__func__, va);
-}
+		vaddr_t va;
+		for (va = entry-start; va  entry-end;
+		va += PAGE_SIZE) {
+			if (pmap_extract(vm_map_pmap(map), va, NULL)) {
+panic(%s: %#PRIxVADDR has mapping,
+__func__, va);
 			}
+		}
 
-			if (VM_MAP_IS_KERNEL(map)) {
-uvm_km_check_empty(map, entry-start,
-entry-end);
-			}
+		if (VM_MAP_IS_KERNEL(map)) {
+			uvm_km_check_empty(map, entry-start,
+			entry-end);
 		}
 #endif /* defined(DEBUG) */
 

Index: src/sys/uvm/uvm_map.h
diff -u src/sys/uvm/uvm_map.h:1.71 src/sys/uvm/uvm_map.h:1.72
--- src/sys/uvm/uvm_map.h:1.71	Sun Feb 19 00:05:56 2012
+++ src/sys/uvm/uvm_map.h	Mon Oct 29 16:00:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.h,v 1.71 2012/02/19 00:05:56 rmind Exp $	*/
+/*	$NetBSD: uvm_map.h,v 1.72 2012/10/29 16:00:05 para Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -150,7 +150,6 @@ struct vm_map_entry {
 	u_int8_t		flags;		/* flags */
 
 #define	UVM_MAP_KERNEL		0x01		/* kernel map entry */
-#define	UVM_MAP_KMAPENT		0x02		/* contains map entries */
 #define	UVM_MAP_STATIC		0x04		/* special static entries */
 #define	UVM_MAP_NOMERGE		0x08		/* this entry is not mergable */
 

Index: src/usr.bin/pmap/pmap.c
diff -u src/usr.bin/pmap/pmap.c:1.49 src/usr.bin/pmap/pmap.c:1.50
--- src/usr.bin/pmap/pmap.c:1.49	Sun Feb 19 02:47:53 2012
+++ src/usr.bin/pmap/pmap.c	Mon Oct 29 16:00:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.49 2012/02/19 02:47:53 rmind Exp $ */
+/*	$NetBSD: pmap.c,v 1.50 2012/10/29 16:00:05 para Exp $ */
 
 /*
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: pmap.c,v 1.49 2012/02/19 02:47:53 rmind Exp $);
+__RCSID($NetBSD: pmap.c,v 1.50 2012/10/29 16:00:05 para Exp $);
 #endif
 
 #include string.h
@@ -304,7 +304,6 @@ dump_vm_map_entry(kvm_t *kd, struct kinf
 		printf(%*sflags = %x %s%s%s%s  }\n, indent(2), ,
 		   vme-flags,
 		   vme-flags  UVM_MAP_KERNEL ?  KERNEL : ,
-		   vme-flags  UVM_MAP_KMAPENT ?  KMAPENT : ,
 		   vme-flags  UVM_MAP_STATIC ?  STATIC : ,
 		   vme-flags  UVM_MAP_NOMERGE ?  NOMERGE : );
 	}



CVS commit: src/usr.bin/pmap

2012-10-29 Thread Lars Heidieker
Module Name:src
Committed By:   para
Date:   Mon Oct 29 16:25:27 UTC 2012

Modified Files:
src/usr.bin/pmap: pmap.c

Log Message:
fix format string


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/pmap/pmap.c

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

Modified files:

Index: src/usr.bin/pmap/pmap.c
diff -u src/usr.bin/pmap/pmap.c:1.50 src/usr.bin/pmap/pmap.c:1.51
--- src/usr.bin/pmap/pmap.c:1.50	Mon Oct 29 16:00:05 2012
+++ src/usr.bin/pmap/pmap.c	Mon Oct 29 16:25:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.50 2012/10/29 16:00:05 para Exp $ */
+/*	$NetBSD: pmap.c,v 1.51 2012/10/29 16:25:25 para Exp $ */
 
 /*
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: pmap.c,v 1.50 2012/10/29 16:00:05 para Exp $);
+__RCSID($NetBSD: pmap.c,v 1.51 2012/10/29 16:25:25 para Exp $);
 #endif
 
 #include string.h
@@ -301,7 +301,7 @@ dump_vm_map_entry(kvm_t *kd, struct kinf
 		printf(%*saref = { ar_pageoff = %x, ar_amap = %p },,
 		   indent(2), , vme-aref.ar_pageoff, vme-aref.ar_amap);
 		printf( advice = %d,\n, vme-advice);
-		printf(%*sflags = %x %s%s%s%s  }\n, indent(2), ,
+		printf(%*sflags = %x %s%s%s  }\n, indent(2), ,
 		   vme-flags,
 		   vme-flags  UVM_MAP_KERNEL ?  KERNEL : ,
 		   vme-flags  UVM_MAP_STATIC ?  STATIC : ,



CVS commit: src/sys/arch/arm/omap

2012-10-29 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Mon Oct 29 18:11:36 UTC 2012

Modified Files:
src/sys/arch/arm/omap: omapfb.c

Log Message:
don't try to init more than 256 CLUT entries, no matter what colour depth
we're in


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/omap/omapfb.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/omap/omapfb.c
diff -u src/sys/arch/arm/omap/omapfb.c:1.3 src/sys/arch/arm/omap/omapfb.c:1.4
--- src/sys/arch/arm/omap/omapfb.c:1.3	Fri Jul  1 20:30:21 2011
+++ src/sys/arch/arm/omap/omapfb.c	Mon Oct 29 18:11:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: omapfb.c,v 1.3 2011/07/01 20:30:21 dyoung Exp $	*/
+/*	$NetBSD: omapfb.c,v 1.4 2012/10/29 18:11:36 macallan Exp $	*/
 
 /*
  * Copyright (c) 2010 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: omapfb.c,v 1.3 2011/07/01 20:30:21 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: omapfb.c,v 1.4 2012/10/29 18:11:36 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -540,7 +540,7 @@ omapfb_restore_palette(struct omapfb_sof
 {
 	int i;
 
-	for (i = 0; i  (1  sc-sc_depth); i++) {
+	for (i = 0; i  256; i++) {
 		omapfb_putpalreg(sc, i, sc-sc_cmap_red[i],
 		sc-sc_cmap_green[i], sc-sc_cmap_blue[i]);
 	}



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

2012-10-29 Thread Radoslaw Kujawa
Module Name:src
Committed By:   rkujawa
Date:   Mon Oct 29 23:45:34 UTC 2012

Modified Files:
src/sys/arch/amiga/dev: xsurf.c

Log Message:
Apparently, clockport present at offset 0xC00 is the first clockport.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/dev/xsurf.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/xsurf.c
diff -u src/sys/arch/amiga/dev/xsurf.c:1.1 src/sys/arch/amiga/dev/xsurf.c:1.2
--- src/sys/arch/amiga/dev/xsurf.c:1.1	Tue May 15 17:35:44 2012
+++ src/sys/arch/amiga/dev/xsurf.c	Mon Oct 29 23:45:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: xsurf.c,v 1.1 2012/05/15 17:35:44 rkujawa Exp $ */
+/*	$NetBSD: xsurf.c,v 1.2 2012/10/29 23:45:34 rkujawa Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xsurf.c,v 1.1 2012/05/15 17:35:44 rkujawa Exp $);
+__KERNEL_RCSID(0, $NetBSD: xsurf.c,v 1.2 2012/10/29 23:45:34 rkujawa Exp $);
 
 /*
  * X-Surf driver, split from ne_zbus. 
@@ -124,7 +124,7 @@ xsurf_attach(device_t parent, device_t s
 	aprint_normal(: Individual Computers X-Surf\n);
 
 	/* Add clockport. */
-	xaa_gencp1.xaa_base = (bus_addr_t)zap-va + XSURF_CP1_BASE;
+	xaa_gencp1.xaa_base = (bus_addr_t)zap-va + XSURF_CP2_BASE;
 	strcpy(xaa_gencp1.xaa_name, gencp_xsurf);
 	config_found_ia(sc-sc_dev, xsurfbus, xaa_gencp1, xsurf_print);
 
@@ -135,7 +135,7 @@ xsurf_attach(device_t parent, device_t s
 	}
 
 	/* Otherwise add one more clockport and continue... */
-	xaa_gencp2.xaa_base = (bus_addr_t)zap-va + XSURF_CP2_BASE;
+	xaa_gencp2.xaa_base = (bus_addr_t)zap-va + XSURF_CP1_BASE;
 	strcpy(xaa_gencp2.xaa_name, gencp_xsurf);
 	config_found_ia(sc-sc_dev, xsurfbus, xaa_gencp2, xsurf_print);
 		



CVS commit: src/sys/dev/raidframe

2012-10-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Oct 30 00:33:11 UTC 2012

Modified Files:
src/sys/dev/raidframe: rf_driver.c

Log Message:
fix a problem in half-configured raid devices, found when a raidctl -c
failed, and a raidctl -C was run afterwards, triggering mutex locking
issues.  fix this by moving alloc and destroy of mutex/condvar for a
raid device into separate functions, and call the destroy function from
the DO_RAID_FAIL() macro.

probably needs a netbsd-6 pullup.  sigh.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/dev/raidframe/rf_driver.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/raidframe/rf_driver.c
diff -u src/sys/dev/raidframe/rf_driver.c:1.129 src/sys/dev/raidframe/rf_driver.c:1.130
--- src/sys/dev/raidframe/rf_driver.c:1.129	Fri May 27 22:48:24 2011
+++ src/sys/dev/raidframe/rf_driver.c	Tue Oct 30 00:33:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_driver.c,v 1.129 2011/05/27 22:48:24 yamt Exp $	*/
+/*	$NetBSD: rf_driver.c,v 1.130 2012/10/30 00:33:11 mrg Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -66,7 +66,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.129 2011/05/27 22:48:24 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.130 2012/10/30 00:33:11 mrg Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_raid_diagnostic.h
@@ -153,6 +153,8 @@ static RF_ShutdownList_t *globalShutdown
 static int rf_ConfigureRDFreeList(RF_ShutdownList_t ** listp);
 static int rf_AllocEmergBuffers(RF_Raid_t *);
 static void rf_FreeEmergBuffers(RF_Raid_t *);
+static void rf_destroy_mutex_cond(RF_Raid_t *);
+static void rf_alloc_mutex_cond(RF_Raid_t *);
 
 /* called at system boot time */
 int
@@ -255,16 +257,7 @@ rf_Shutdown(RF_Raid_t *raidPtr)
 
 	rf_ShutdownList(raidPtr-shutdownList);
 
-	rf_destroy_cond2(raidPtr-waitForReconCond);
-	rf_destroy_cond2(raidPtr-adding_hot_spare_cv);
-
-	rf_destroy_mutex2(raidPtr-access_suspend_mutex);
-	rf_destroy_cond2(raidPtr-access_suspend_cv);
-
-	rf_destroy_cond2(raidPtr-outstandingCond);
-	rf_destroy_mutex2(raidPtr-rad_lock);
-
-	rf_destroy_mutex2(raidPtr-mutex);
+	rf_destroy_mutex_cond(raidPtr);
 
 	rf_UnconfigureArray();
 
@@ -289,6 +282,7 @@ rf_Shutdown(RF_Raid_t *raidPtr)
 	rf_FreeEmergBuffers(raidPtr); \
 	rf_ShutdownList(raidPtr-shutdownList); \
 	rf_UnconfigureArray(); \
+	rf_destroy_mutex_cond(raidPtr); \
 }
 
 #define DO_RAID_INIT_CONFIGURE(f) { \
@@ -341,7 +335,8 @@ rf_Configure(RF_Raid_t *raidPtr, RF_Conf
 	}
 	rf_unlock_mutex2(configureMutex);
 
-	rf_init_mutex2(raidPtr-mutex, IPL_VM);
+	rf_alloc_mutex_cond(raidPtr);
+
 	/* set up the cleanup list.  Do this after ConfigureDebug so that
 	 * value of memDebug will be set */
 
@@ -363,17 +358,9 @@ rf_Configure(RF_Raid_t *raidPtr, RF_Conf
 	DO_RAID_INIT_CONFIGURE(rf_ConfigureEngine);
 	DO_RAID_INIT_CONFIGURE(rf_ConfigureStripeLocks);
 
-	rf_init_cond2(raidPtr-outstandingCond, rfocond);
-	rf_init_mutex2(raidPtr-rad_lock, IPL_VM);
-
 	raidPtr-nAccOutstanding = 0;
 	raidPtr-waitShutdown = 0;
 
-	rf_init_mutex2(raidPtr-access_suspend_mutex, IPL_VM);
-	rf_init_cond2(raidPtr-access_suspend_cv, rfquiesce);
-
-	rf_init_cond2(raidPtr-waitForReconCond, rfrcnw);
-
 	if (ac!=NULL) {
 		/* We have an AutoConfig structure..  Don't do the
 		   normal disk configuration... call the auto config
@@ -406,8 +393,6 @@ rf_Configure(RF_Raid_t *raidPtr, RF_Conf
 	raidPtr-adding_hot_spare = 0;
 	raidPtr-recon_in_progress = 0;
 
-	rf_init_cond2(raidPtr-adding_hot_spare_cv, raidhs);
-
 	raidPtr-maxOutstanding = cfgPtr-maxOutstandingDiskReqs;
 
 	/* autoconfigure and root_partition will actually get filled in
@@ -925,3 +910,36 @@ rf_print_unable_to_add_shutdown(const ch
 	RF_ERRORMSG3(Unable to add to shutdown list file %s line %d rc=%d\n,
 		 file, line, rc);
 }
+
+static void
+rf_alloc_mutex_cond(RF_Raid_t *raidPtr)
+{
+
+	rf_init_mutex2(raidPtr-mutex, IPL_VM);
+
+	rf_init_cond2(raidPtr-outstandingCond, rfocond);
+	rf_init_mutex2(raidPtr-rad_lock, IPL_VM);
+
+	rf_init_mutex2(raidPtr-access_suspend_mutex, IPL_VM);
+	rf_init_cond2(raidPtr-access_suspend_cv, rfquiesce);
+
+	rf_init_cond2(raidPtr-waitForReconCond, rfrcnw);
+
+	rf_init_cond2(raidPtr-adding_hot_spare_cv, raidhs);
+}
+
+static void
+rf_destroy_mutex_cond(RF_Raid_t *raidPtr)
+{
+
+	rf_destroy_cond2(raidPtr-waitForReconCond);
+	rf_destroy_cond2(raidPtr-adding_hot_spare_cv);
+
+	rf_destroy_mutex2(raidPtr-access_suspend_mutex);
+	rf_destroy_cond2(raidPtr-access_suspend_cv);
+
+	rf_destroy_cond2(raidPtr-outstandingCond);
+	rf_destroy_mutex2(raidPtr-rad_lock);
+
+	rf_destroy_mutex2(raidPtr-mutex);
+}



CVS commit: src/sys/arch/amiga/clockport

2012-10-29 Thread Radoslaw Kujawa
Module Name:src
Committed By:   rkujawa
Date:   Tue Oct 30 01:17:24 UTC 2012

Modified Files:
src/sys/arch/amiga/clockport: clockport.c clockportvar.h

Log Message:
Add sc_dev removed previously in a moment of insanity. How did this ever work
is beyond me.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/clockport/clockport.c \
src/sys/arch/amiga/clockport/clockportvar.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/clockport/clockport.c
diff -u src/sys/arch/amiga/clockport/clockport.c:1.4 src/sys/arch/amiga/clockport/clockport.c:1.5
--- src/sys/arch/amiga/clockport/clockport.c:1.4	Sat Oct 27 17:17:26 2012
+++ src/sys/arch/amiga/clockport/clockport.c	Tue Oct 30 01:17:24 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: clockport.c,v 1.4 2012/10/27 17:17:26 chs Exp $ */
+/*  $NetBSD: clockport.c,v 1.5 2012/10/30 01:17:24 rkujawa Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -62,6 +62,7 @@ clockport_attach(device_t parent, device
 aprint_normal(\n);
 
 	sc = device_private(self);
+	sc-sc_dev = self;
 	sc-cpb_aa = (struct clockportbus_attach_args *) aux;
 
 	config_search_ia(clockport_submatch, self, clockport, 0);
Index: src/sys/arch/amiga/clockport/clockportvar.h
diff -u src/sys/arch/amiga/clockport/clockportvar.h:1.4 src/sys/arch/amiga/clockport/clockportvar.h:1.5
--- src/sys/arch/amiga/clockport/clockportvar.h:1.4	Mon Jul  9 19:32:26 2012
+++ src/sys/arch/amiga/clockport/clockportvar.h	Tue Oct 30 01:17:24 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: clockportvar.h,v 1.4 2012/07/09 19:32:26 rkujawa Exp $ */
+/*  $NetBSD: clockportvar.h,v 1.5 2012/10/30 01:17:24 rkujawa Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -38,6 +38,7 @@ struct gencp_softc {
 };
 
 struct clockportbus_softc {
+	device_t	sc_dev;
 
 	struct clockportbus_attach_args *cpb_aa;
 };



CVS commit: [agc-netpgp-standalone] src/crypto/external/bsd/netpgp

2012-10-29 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Tue Oct 30 02:10:43 UTC 2012

Modified Files:
src/crypto/external/bsd/netpgp/bin/netpgpverify [agc-netpgp-standalone]:
Makefile expected16 expected17 expected18 expected21 expected22
expected24 expected32 expected34
src/crypto/external/bsd/netpgp/dist/src/libbn [agc-netpgp-standalone]:
bignum.c
src/crypto/external/bsd/netpgp/dist/src/libverify 
[agc-netpgp-standalone]:
libverify.c verify.h
src/crypto/external/bsd/netpgp/lib/verify [agc-netpgp-standalone]:
Makefile
Removed Files:
src/crypto/external/bsd/netpgp/dist/src/libverify 
[agc-netpgp-standalone]:
verify.c

Log Message:
changes to libnetpgpverify:

+ isolate the RSA verification code (the DSA verification code was
isolated previously), and include it in our sources, rather than
including the source for librsa, (and thus bringing in all the code
for signing and encryption/decryption) - no crypto is involved in
signature verification, just the digest calculation, and the BIGNUM
expmod.

+ check some more arguments

+ order the user ids as expected in public keys (i.e.  if there's a
primary user id signature sub-packet, honor it), and fix up the
regression test results accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 \
src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/crypto/external/bsd/netpgp/bin/netpgpverify/expected16 \
src/crypto/external/bsd/netpgp/bin/netpgpverify/expected17 \
src/crypto/external/bsd/netpgp/bin/netpgpverify/expected18 \
src/crypto/external/bsd/netpgp/bin/netpgpverify/expected21 \
src/crypto/external/bsd/netpgp/bin/netpgpverify/expected22 \
src/crypto/external/bsd/netpgp/bin/netpgpverify/expected24 \
src/crypto/external/bsd/netpgp/bin/netpgpverify/expected32 \
src/crypto/external/bsd/netpgp/bin/netpgpverify/expected34
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 \
src/crypto/external/bsd/netpgp/dist/src/libbn/bignum.c
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 \
src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
cvs rdiff -u -r1.1.2.1 -r0 \
src/crypto/external/bsd/netpgp/dist/src/libverify/verify.c
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 \
src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 \
src/crypto/external/bsd/netpgp/lib/verify/Makefile

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

Modified files:

Index: src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile
diff -u src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile:1.1.2.5 src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile:1.1.2.6
--- src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile:1.1.2.5	Wed Oct 24 02:18:56 2012
+++ src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile	Tue Oct 30 02:10:42 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.2.5 2012/10/24 02:18:56 agc Exp $
+# $NetBSD: Makefile,v 1.1.2.6 2012/10/30 02:10:42 agc Exp $
 
 .include bsd.own.mk
 
@@ -114,3 +114,6 @@ t: ${PROG}
 	env LD_LIBRARY_PATH=${LIBNETPGPVERIFYDIR} ./${PROG} -k dsa-pubring.gpg in2.asc  output45
 	diff expected45 output45
 	rm -f output45
+	env LD_LIBRARY_PATH=${LIBNETPGPVERIFYDIR} ./${PROG} -k problem-pubring.gpg NetBSD-6.0_hashes.asc  output46
+	diff expected46 output46
+	rm -f output46

Index: src/crypto/external/bsd/netpgp/bin/netpgpverify/expected16
diff -u src/crypto/external/bsd/netpgp/bin/netpgpverify/expected16:1.1.2.1 src/crypto/external/bsd/netpgp/bin/netpgpverify/expected16:1.1.2.2
--- src/crypto/external/bsd/netpgp/bin/netpgpverify/expected16:1.1.2.1	Wed Oct 24 02:18:56 2012
+++ src/crypto/external/bsd/netpgp/bin/netpgpverify/expected16	Tue Oct 30 02:10:43 2012
@@ -1,9 +1,9 @@
 Good signature for b.gpg made Mon Sep 10 00:15:38 2012
 signature  2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
 fingerprint:  d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823 
+uid  Alistair Crooks a...@alistaircrooks.com
 uid  Alistair Crooks a...@pkgsrc.org
 uid  Alistair Crooks a...@netbsd.org
-uid  Alistair Crooks a...@alistaircrooks.com
 uid  Alistair Crooks a...@netflix.com
 encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12
 fingerprint:  57c0 c1e6 bf71 8845 416b 9522 79de b61e 488e ee74 
Index: src/crypto/external/bsd/netpgp/bin/netpgpverify/expected17
diff -u src/crypto/external/bsd/netpgp/bin/netpgpverify/expected17:1.1.2.1 src/crypto/external/bsd/netpgp/bin/netpgpverify/expected17:1.1.2.2
--- src/crypto/external/bsd/netpgp/bin/netpgpverify/expected17:1.1.2.1	Wed Oct 24 02:18:56 2012
+++ src/crypto/external/bsd/netpgp/bin/netpgpverify/expected17	Tue Oct 30 02:10:43 2012
@@ -1,9 +1,9 @@
 Good signature for a.gpg made Sun Sep  9 17:44:11 2012
 signature  2048/RSA (Encrypt or Sign) 1b68dcfcc0596823