CVS commit: src/sys/dev

2009-05-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May 16 06:44:05 UTC 2009

Modified Files:
src/sys/dev/cardbus: ahc_cardbus.c
src/sys/dev/ic: aic7xxx_osm.c aic7xxx_osm.h

Log Message:
Make ahc_detach() take struct ahc_softc * as well as ahc_attach()
and remove bogus casts around ahc_detach().

XXX: There is a pmf_device_deregister(9) call in ahc_detach()
XXX: while there is no pmf_device_register(9) in ahc_attach().
XXX: It looks more pmf(9) stuff is required for cardbus detach.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/cardbus/ahc_cardbus.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ic/aic7xxx_osm.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ic/aic7xxx_osm.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/cardbus/ahc_cardbus.c
diff -u src/sys/dev/cardbus/ahc_cardbus.c:1.27 src/sys/dev/cardbus/ahc_cardbus.c:1.28
--- src/sys/dev/cardbus/ahc_cardbus.c:1.27	Tue May  5 09:51:23 2009
+++ src/sys/dev/cardbus/ahc_cardbus.c	Sat May 16 06:44:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahc_cardbus.c,v 1.27 2009/05/05 09:51:23 cegger Exp $	*/
+/*	$NetBSD: ahc_cardbus.c,v 1.28 2009/05/16 06:44:05 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2005 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ahc_cardbus.c,v 1.27 2009/05/05 09:51:23 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ahc_cardbus.c,v 1.28 2009/05/16 06:44:05 tsutsui Exp $);
 
 #include opt_ahc_cardbus.h
 
@@ -263,7 +263,7 @@
 
 	int rv;
 
-	rv = ahc_detach((void *)ahc, flags);
+	rv = ahc_detach(ahc, flags);
 	if (rv)
 		return rv;
 

Index: src/sys/dev/ic/aic7xxx_osm.c
diff -u src/sys/dev/ic/aic7xxx_osm.c:1.30 src/sys/dev/ic/aic7xxx_osm.c:1.31
--- src/sys/dev/ic/aic7xxx_osm.c:1.30	Tue May 12 14:25:17 2009
+++ src/sys/dev/ic/aic7xxx_osm.c	Sat May 16 06:44:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic7xxx_osm.c,v 1.30 2009/05/12 14:25:17 cegger Exp $	*/
+/*	$NetBSD: aic7xxx_osm.c,v 1.31 2009/05/16 06:44:05 tsutsui Exp $	*/
 
 /*
  * Bus independent FreeBSD shim for the aic7xxx based adaptec SCSI controllers
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aic7xxx_osm.c,v 1.30 2009/05/12 14:25:17 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: aic7xxx_osm.c,v 1.31 2009/05/16 06:44:05 tsutsui Exp $);
 
 #include dev/ic/aic7xxx_osm.h
 #include dev/ic/aic7xxx_inline.h
@@ -1037,19 +1037,17 @@
 }
 
 int
-ahc_detach(device_t self, int flags)
+ahc_detach(struct ahc_softc *ahc, int flags)
 {
 	int rv = 0;
 
-	struct ahc_softc *ahc = (struct ahc_softc*)self;
-
 	ahc_intr_enable(ahc, FALSE);
 	if (ahc-sc_child != NULL)
 		rv = config_detach(ahc-sc_child, flags);
 	if (rv == 0  ahc-sc_child_b != NULL)
 		rv = config_detach(ahc-sc_child_b, flags);
 
-	pmf_device_deregister(self);
+	pmf_device_deregister(ahc-sc_dev);
 	ahc_free(ahc);
 
 	return (rv);

Index: src/sys/dev/ic/aic7xxx_osm.h
diff -u src/sys/dev/ic/aic7xxx_osm.h:1.23 src/sys/dev/ic/aic7xxx_osm.h:1.24
--- src/sys/dev/ic/aic7xxx_osm.h:1.23	Tue May 12 14:25:17 2009
+++ src/sys/dev/ic/aic7xxx_osm.h	Sat May 16 06:44:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic7xxx_osm.h,v 1.23 2009/05/12 14:25:17 cegger Exp $	*/
+/*	$NetBSD: aic7xxx_osm.h,v 1.24 2009/05/16 06:44:05 tsutsui Exp $	*/
 
 /*
  * NetBSD platform specific driver option settings, data structures,
@@ -526,7 +526,7 @@
 int	  ahc_map_int(struct ahc_softc *);
 int	  ahc_attach(struct ahc_softc *);
 int	  ahc_softc_comp(struct ahc_softc *, struct ahc_softc *);
-int	  ahc_detach(device_t, int);
+int	  ahc_detach(struct ahc_softc *, int);
 
 /** Interrupts /
 void			ahc_platform_intr(void *);



CVS commit: src/sys/dev/pci

2009-05-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May 16 07:34:05 UTC 2009

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

Log Message:
Split device_t/softc split, tested on VT6212L.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/if_vge.c

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

Modified files:

Index: src/sys/dev/pci/if_vge.c
diff -u src/sys/dev/pci/if_vge.c:1.47 src/sys/dev/pci/if_vge.c:1.48
--- src/sys/dev/pci/if_vge.c:1.47	Tue May 12 08:23:01 2009
+++ src/sys/dev/pci/if_vge.c	Sat May 16 07:34:05 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vge.c,v 1.47 2009/05/12 08:23:01 cegger Exp $ */
+/* $NetBSD: if_vge.c,v 1.48 2009/05/16 07:34:05 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_vge.c,v 1.47 2009/05/12 08:23:01 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_vge.c,v 1.48 2009/05/16 07:34:05 tsutsui Exp $);
 
 /*
  * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
@@ -190,7 +190,7 @@
 
 
 struct vge_softc {
-	struct device		sc_dev;
+	device_t		sc_dev;
 
 	bus_space_tag_t		sc_bst;		/* bus space tag */
 	bus_space_handle_t	sc_bsh;		/* bus space handle */
@@ -333,7 +333,7 @@
 static void vge_setmulti(struct vge_softc *);
 static void vge_reset(struct vge_softc *);
 
-CFATTACH_DECL(vge, sizeof(struct vge_softc),
+CFATTACH_DECL_NEW(vge, sizeof(struct vge_softc),
 vge_match, vge_attach, NULL, NULL);
 
 static inline void
@@ -446,7 +446,7 @@
 	}
 
 	if (i == VGE_TIMEOUT) {
-		aprint_error_dev(sc-sc_dev, EEPROM read timed out\n);
+		printf(%s: EEPROM read timed out\n, device_xname(sc-sc_dev));
 		return 0;
 	}
 
@@ -474,7 +474,8 @@
 	}
 
 	if (i == VGE_TIMEOUT) {
-		aprint_error_dev(sc-sc_dev, failed to idle MII autopoll\n);
+		printf(%s: failed to idle MII autopoll\n,
+		device_xname(sc-sc_dev));
 	}
 }
 
@@ -495,7 +496,8 @@
 	}
 
 	if (i == VGE_TIMEOUT) {
-		aprint_error_dev(sc-sc_dev, failed to idle MII autopoll\n);
+		printf(%s: failed to idle MII autopoll\n,
+		device_xname(sc-sc_dev));
 		return;
 	}
 
@@ -512,7 +514,8 @@
 	}
 
 	if (i == VGE_TIMEOUT) {
-		aprint_error_dev(sc-sc_dev, failed to start MII autopoll\n);
+		printf(%s: failed to start MII autopoll\n,
+		device_xname(sc-sc_dev));
 	}
 }
 
@@ -545,7 +548,7 @@
 	}
 
 	if (i == VGE_TIMEOUT)
-		aprint_error_dev(sc-sc_dev, MII read timed out\n);
+		printf(%s: MII read timed out\n, device_xname(sc-sc_dev));
 	else
 		rval = CSR_READ_2(sc, VGE_MIIDATA);
 
@@ -585,7 +588,7 @@
 	}
 
 	if (i == VGE_TIMEOUT) {
-		aprint_error_dev(sc-sc_dev, MII write timed out\n);
+		printf(%s: MII write timed out\n, device_xname(sc-sc_dev));
 	}
 
 	vge_miipoll_start(sc);
@@ -654,7 +657,8 @@
 	}
 
 	if (i == VGE_TIMEOUT) {
-		aprint_error_dev(sc-sc_dev, setting CAM filter failed\n);
+		printf(%s: setting CAM filter failed\n,
+		device_xname(sc-sc_dev));
 		error = EIO;
 		goto fail;
 	}
@@ -769,7 +773,7 @@
 	}
 
 	if (i == VGE_TIMEOUT) {
-		aprint_error_dev(sc-sc_dev, soft reset timed out);
+		printf(%s: soft reset timed out, device_xname(sc-sc_dev));
 		CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_STOP_FORCE);
 		DELAY(2000);
 	}
@@ -785,7 +789,8 @@
 	}
 
 	if (i == VGE_TIMEOUT) {
-		aprint_error_dev(sc-sc_dev, EEPROM reload timed out\n);
+		printf(%s: EEPROM reload timed out\n,
+		device_xname(sc-sc_dev));
 		return;
 	}
 
@@ -829,7 +834,8 @@
 	error = bus_dmamem_alloc(sc-sc_dmat, sizeof(struct vge_control_data),
 	 VGE_RING_ALIGN, 0, seg, 1, nseg, BUS_DMA_NOWAIT);
 	if (error) {
-		aprint_error_dev(sc-sc_dev, could not allocate control data dma memory\n);
+		aprint_error_dev(sc-sc_dev,
+		could not allocate control data dma memory\n);
 		goto fail_1;
 	}
 
@@ -839,7 +845,8 @@
 	sizeof(struct vge_control_data), (void **)sc-sc_control_data,
 	BUS_DMA_NOWAIT);
 	if (error) {
-		aprint_error_dev(sc-sc_dev, could not map control data dma memory\n);
+		aprint_error_dev(sc-sc_dev,
+		could not map control data dma memory\n);
 		goto fail_2;
 	}
 	memset(sc-sc_control_data, 0, sizeof(struct vge_control_data));
@@ -852,7 +859,8 @@
 	sizeof(struct vge_control_data), 0, BUS_DMA_NOWAIT,
 	sc-sc_cddmamap);
 	if (error) {
-		aprint_error_dev(sc-sc_dev, could not create control data dmamap\n);
+		aprint_error_dev(sc-sc_dev,
+		could not create control data dmamap\n);
 		goto fail_3;
 	}
 
@@ -861,7 +869,8 @@
 	sc-sc_control_data, sizeof(struct vge_control_data), NULL,
 	BUS_DMA_NOWAIT);
 	if (error) {
-		aprint_error_dev(sc-sc_dev, could not load control data dma memory\n);
+		aprint_error_dev(sc-sc_dev,
+		could not load control data dma memory\n);
 		goto fail_4;
 	}
 
@@ -872,7 +881,8 @@
 		VGE_TX_FRAGS, VGE_TX_MAXLEN, 0, BUS_DMA_NOWAIT,
 		sc-sc_txsoft[i].txs_dmamap);
 		if (error) {
-			aprint_error_dev(sc-sc_dev, can't create DMA map for TX descs\n);
+			aprint_error_dev(sc-sc_dev,
+			can't create 

CVS commit: src/sys/arch/amd64/amd64

2009-05-16 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat May 16 07:46:45 UTC 2009

Modified Files:
src/sys/arch/amd64/amd64: bios32.c

Log Message:
KNF, same object code generated


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/amd64/amd64/bios32.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/bios32.c
diff -u src/sys/arch/amd64/amd64/bios32.c:1.17 src/sys/arch/amd64/amd64/bios32.c:1.18
--- src/sys/arch/amd64/amd64/bios32.c:1.17	Wed Mar 18 17:06:41 2009
+++ src/sys/arch/amd64/amd64/bios32.c	Sat May 16 07:46:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bios32.c,v 1.17 2009/03/18 17:06:41 cegger Exp $	*/
+/*	$NetBSD: bios32.c,v 1.18 2009/05/16 07:46:45 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bios32.c,v 1.17 2009/03/18 17:06:41 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: bios32.c,v 1.18 2009/05/16 07:46:45 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -306,7 +306,7 @@
 	if (i == indx) {
 		if (va + len  end) {
 			ret = dest;
-			memcpy( ret, va, len);
+			memcpy(ret, va, len);
 			ret[len - 1] = '\0';
 		}
 	}



CVS commit: [jym-xensuspend] src/sys/lib/libkern

2009-05-16 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sat May 16 01:25:32 UTC 2009

Modified Files:
src/sys/lib/libkern [jym-xensuspend]: crc32.c

Log Message:
Fix a merge botch that hampered kernel's build for amd64.

Reported by christoph@ in private mail. Thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.4.8.2 -r1.4.8.3 src/sys/lib/libkern/crc32.c

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

Modified files:

Index: src/sys/lib/libkern/crc32.c
diff -u src/sys/lib/libkern/crc32.c:1.4.8.2 src/sys/lib/libkern/crc32.c:1.4.8.3
--- src/sys/lib/libkern/crc32.c:1.4.8.2	Wed May 13 17:22:15 2009
+++ src/sys/lib/libkern/crc32.c	Sat May 16 01:25:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: crc32.c,v 1.4.8.2 2009/05/13 17:22:15 jym Exp $	*/
+/*	$NetBSD: crc32.c,v 1.4.8.3 2009/05/16 01:25:32 jym Exp $	*/
 
 /* crc32.c -- compute the CRC-32 of a data stream
  *
@@ -19,8 +19,6 @@
 #include sys/param.h
 #include machine/endian.h
 
-#define z_ptrdiff_t int32_t
-
 typedef uint32_t u4;
 
 /* Definitions for doing the crc four data bytes at a time. */
@@ -30,6 +28,7 @@
 /* 
  * Tables of CRC-32s of all single-byte values, made by make_crc_table().
  */
+#include lib/libkern/libkern.h
 #include crc32.h
 
 #if BYTE_ORDER == LITTLE_ENDIAN
@@ -40,10 +39,7 @@
 #define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
 
 /* = */
-uint32_t crc32(
-uint32_t crc,
-const unsigned char *buf,
-unsigned len)
+uint32_t crc32(uint32_t crc, const uint8_t *buf, size_t len)
 {
 register u4 c;
 register const u4 *buf4;
@@ -52,7 +48,7 @@
 
 c = (u4)crc;
 c = ~c;
-while (len  ((z_ptrdiff_t)buf  3)) {
+while (len  ((uintptr_t)buf  3)) {
 c = crc_table[0][(c ^ *buf++)  0xff] ^ (c  8);
 len--;
 }
@@ -84,10 +80,7 @@
 #define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
 
 /* = */
-uint32_t crc32(
-uint32_t crc,
-const unsigned char *buf,
-unsigned len)
+uint32_t crc32(uint32_t crc, const uint8_t *buf, size_t len)
 {
 register u4 c;
 register const u4 *buf4;
@@ -96,7 +89,7 @@
 
 c = REV((u4)crc);
 c = ~c;
-while (len  ((z_ptrdiff_t)buf  3)) {
+while (len  ((uintptr_t)buf  3)) {
 c = crc_table[4][(c  24) ^ *buf++] ^ (c  8);
 len--;
 }



CVS commit: src/sys

2009-05-16 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sat May 16 08:29:54 UTC 2009

Modified Files:
src/sys/kern: vfs_subr.c
src/sys/sys: vnode.h

Log Message:
put a flag bit into v_usecount to prevent vtryget during getcleanvnode.
this fixes the following deadlock.

a thread doing getcleanvnode:
pick a vnode
acqure v_interlock
v_usecount++
call vclean

now, another thread doing cache_lookup:
picks the vnode
vtryget succeed
vn_lock succeed

now in vclean:
set VI_XLOCK (too late to be noticed by the competing thread)
wait on the vnode lock (this might violate locking order)

the use of a flag bit was suggested by Andrew Doran.  PR/41374.


To generate a diff of this commit:
cvs rdiff -u -r1.378 -r1.379 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.206 -r1.207 src/sys/sys/vnode.h

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

Modified files:

Index: src/sys/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.378 src/sys/kern/vfs_subr.c:1.379
--- src/sys/kern/vfs_subr.c:1.378	Sun May  3 16:52:54 2009
+++ src/sys/kern/vfs_subr.c	Sat May 16 08:29:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_subr.c,v 1.378 2009/05/03 16:52:54 pooka Exp $	*/
+/*	$NetBSD: vfs_subr.c,v 1.379 2009/05/16 08:29:53 yamt Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -76,12 +76,22 @@
  * change from a non-zero value to zero, again the interlock must be
  * held.
  *
- * Changing the usecount from a non-zero value to a non-zero value can
- * safely be done using atomic operations, without the interlock held.
+ * There's a flag bit, VC_XLOCK, embedded in v_usecount.
+ * To raise v_usecount, if the VC_XLOCK bit is set in it, the interlock
+ * must be held.
+ * To modify the VC_XLOCK bit, the interlock must be held.
+ * We always keep the usecount (v_usecount  VC_MASK) non-zero while the
+ * VC_XLOCK bit is set.
+ *
+ * Unless the VC_XLOCK bit is set, changing the usecount from a non-zero
+ * value to a non-zero value can safely be done using atomic operations,
+ * without the interlock held.
+ * Even if the VC_XLOCK bit is set, decreasing the usecount to a non-zero
+ * value can be done using atomic operations, without the interlock held.
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_subr.c,v 1.378 2009/05/03 16:52:54 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_subr.c,v 1.379 2009/05/16 08:29:53 yamt Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -361,8 +371,10 @@
 	 * before doing this.  If the vnode gains another reference while
 	 * being cleaned out then we lose - retry.
 	 */
-	atomic_inc_uint(vp-v_usecount);
+	atomic_add_int(vp-v_usecount, 1 + VC_XLOCK);
 	vclean(vp, DOCLOSE);
+	KASSERT(vp-v_usecount = 1 + VC_XLOCK);
+	atomic_add_int(vp-v_usecount, -VC_XLOCK);
 	if (vp-v_usecount == 1) {
 		/* We're about to dirty it. */
 		vp-v_iflag = ~VI_CLEAN;
@@ -1229,7 +1241,7 @@
 		return false;
 	}
 	for (use = vp-v_usecount;; use = next) {
-		if (use == 0) { 
+		if (use == 0 || __predict_false((use  VC_XLOCK) != 0)) {
 			/* Need interlock held if first reference. */
 			return false;
 		}
@@ -1318,9 +1330,10 @@
 	u_int use, next;
 
 	for (use = vp-v_usecount;; use = next) {
-		if (use == 1) { 
+		if (use == 1) {
 			return false;
 		}
+		KASSERT((use  VC_MASK)  1);
 		next = atomic_cas_uint(vp-v_usecount, use, use - 1);
 		if (__predict_true(next == use)) {
 			return true;

Index: src/sys/sys/vnode.h
diff -u src/sys/sys/vnode.h:1.206 src/sys/sys/vnode.h:1.207
--- src/sys/sys/vnode.h:1.206	Sun May  3 16:52:55 2009
+++ src/sys/sys/vnode.h	Sat May 16 08:29:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnode.h,v 1.206 2009/05/03 16:52:55 pooka Exp $	*/
+/*	$NetBSD: vnode.h,v 1.207 2009/05/16 08:29:53 yamt Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -250,6 +250,12 @@
 #define	VSIZENOTSET	((voff_t)-1)
 
 /*
+ * v_usecount; see the comment in vfs_subr.c
+ */
+#define	VC_XLOCK	0x8000
+#define	VC_MASK		0x7fff
+
+/*
  * Vnode attributes.  A field value of VNOVAL represents a field whose value
  * is unavailable (getattr) or which is not to be changed (setattr).
  */



CVS commit: src/sys/kern

2009-05-16 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sat May 16 08:36:32 UTC 2009

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

Log Message:
rw_vector_exit: remove a redundant condition.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/kern_rwlock.c

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

Modified files:

Index: src/sys/kern/kern_rwlock.c
diff -u src/sys/kern/kern_rwlock.c:1.31 src/sys/kern/kern_rwlock.c:1.32
--- src/sys/kern/kern_rwlock.c:1.31	Sat May  9 03:33:10 2009
+++ src/sys/kern/kern_rwlock.c	Sat May 16 08:36:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rwlock.c,v 1.31 2009/05/09 03:33:10 yamt Exp $	*/
+/*	$NetBSD: kern_rwlock.c,v 1.32 2009/05/16 08:36:32 yamt Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rwlock.c,v 1.31 2009/05/09 03:33:10 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rwlock.c,v 1.32 2009/05/16 08:36:32 yamt Exp $);
 
 #define	__RWLOCK_PRIVATE
 
@@ -498,7 +498,7 @@
 	 * set WRITE_WANTED to block out new readers, and let them
 	 * do the work of acquring the lock in rw_vector_enter().
 	 */
-	if (rcnt == 0 || (decr == RW_READ_INCR  wcnt != 0)) {
+	if (rcnt == 0 || decr == RW_READ_INCR) {
 		RW_DASSERT(rw, wcnt != 0);
 		RW_DASSERT(rw, (owner  RW_WRITE_WANTED) != 0);
 



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

2009-05-16 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat May 16 10:11:50 UTC 2009

Modified Files:
src/sys/arch/sh3/include: exception.h

Log Message:
Add SH4 INTEVT codes for GPIO.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sh3/include/exception.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/sh3/include/exception.h
diff -u src/sys/arch/sh3/include/exception.h:1.11 src/sys/arch/sh3/include/exception.h:1.12
--- src/sys/arch/sh3/include/exception.h:1.11	Mon Apr 28 20:23:35 2008
+++ src/sys/arch/sh3/include/exception.h	Sat May 16 10:11:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: exception.h,v 1.11 2008/04/28 20:23:35 martin Exp $	*/
+/*	$NetBSD: exception.h,v 1.12 2009/05/16 10:11:50 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -149,6 +149,8 @@
 #define	SH4_INTEVT_IRQ14	0x3c0
 #define	SH4_INTEVT_IRQ15	0x3e0
 
+#define	SH4_INTEVT_GPIO		0x620
+
 #define	SH4_INTEVT_PCISERR	0xa00
 #define	SH4_INTEVT_PCIDMA3	0xa20
 #define	SH4_INTEVT_PCIDMA2	0xa40



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

2009-05-16 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat May 16 10:13:13 UTC 2009

Modified Files:
src/sys/arch/sh3/include: cache_sh3.h

Log Message:
Added SH7706 cache flush op.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sh3/include/cache_sh3.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/sh3/include/cache_sh3.h
diff -u src/sys/arch/sh3/include/cache_sh3.h:1.9 src/sys/arch/sh3/include/cache_sh3.h:1.10
--- src/sys/arch/sh3/include/cache_sh3.h:1.9	Mon Apr 28 20:23:35 2008
+++ src/sys/arch/sh3/include/cache_sh3.h	Sat May 16 10:13:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache_sh3.h,v 1.9 2008/04/28 20:23:35 martin Exp $	*/
+/*	$NetBSD: cache_sh3.h,v 1.10 2009/05/16 10:13:13 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -143,6 +143,7 @@
 #define	SH7709_CACHE_FLUSH()		SH3_CACHE_8K_FLUSH(4)
 #define	SH7709_CACHE_FLUSH_RAMMODE()	SH3_CACHE_8K_FLUSH(2)
 #define	SH7709A_CACHE_FLUSH()		SH3_CACHE_16K_FLUSH()
+#define	SH7706_CACHE_FLUSH()		SH3_CACHE_16K_FLUSH()
 
 #ifndef _LOCORE
 extern void sh3_cache_config(void);



CVS commit: src/sys/arch/evbsh3/evbsh3

2009-05-16 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat May 16 10:17:39 UTC 2009

Modified Files:
src/sys/arch/evbsh3/evbsh3: machdep.c

Log Message:
Added SH7706, SH7750R, SH7751 and SH7751R support.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/evbsh3/evbsh3/machdep.c

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

Modified files:

Index: src/sys/arch/evbsh3/evbsh3/machdep.c
diff -u src/sys/arch/evbsh3/evbsh3/machdep.c:1.67 src/sys/arch/evbsh3/evbsh3/machdep.c:1.68
--- src/sys/arch/evbsh3/evbsh3/machdep.c:1.67	Wed Mar 18 10:22:28 2009
+++ src/sys/arch/evbsh3/evbsh3/machdep.c	Sat May 16 10:17:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.67 2009/03/18 10:22:28 cegger Exp $	*/
+/*	$NetBSD: machdep.c,v 1.68 2009/05/16 10:17:38 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.67 2009/03/18 10:22:28 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.68 2009/05/16 10:17:38 nonaka Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -237,6 +237,8 @@
 	sh_cpu_init(CPU_ARCH_SH3, CPU_PRODUCT_7709);
 #elif defined(SH7709A)
 	sh_cpu_init(CPU_ARCH_SH3, CPU_PRODUCT_7709A);
+#elif defined(SH7706)
+	sh_cpu_init(CPU_ARCH_SH3, CPU_PRODUCT_7706);
 #else
 #error unsupported SH3 variants
 #endif
@@ -245,6 +247,12 @@
 	sh_cpu_init(CPU_ARCH_SH4, CPU_PRODUCT_7750);	
 #elif defined(SH7750S)
 	sh_cpu_init(CPU_ARCH_SH4, CPU_PRODUCT_7750S);
+#elif defined(SH7750R)
+	sh_cpu_init(CPU_ARCH_SH4, CPU_PRODUCT_7750R);
+#elif defined(SH7751)
+	sh_cpu_init(CPU_ARCH_SH4, CPU_PRODUCT_7751);
+#elif defined(SH7751R)
+	sh_cpu_init(CPU_ARCH_SH4, CPU_PRODUCT_7751R);
 #else
 #error unsupported SH4 variants
 #endif
@@ -268,7 +276,7 @@
 	/* Initialize pmap and start to address translation */
 	pmap_bootstrap();
 
-#	/*
+	/*
 	 * XXX We can't return here, because we change stack pointer.
 	 * So jump to return address directly.
 	 */
@@ -706,10 +714,14 @@
 		break;
 	case CPU_PRODUCT_7709:
 	case CPU_PRODUCT_7709A:
+	case CPU_PRODUCT_7706:
 		evtcode = _reg_read_4(SH7709_INTEVT2);
 		break;
 	case CPU_PRODUCT_7750:
 	case CPU_PRODUCT_7750S:
+	case CPU_PRODUCT_7750R:
+	case CPU_PRODUCT_7751:
+	case CPU_PRODUCT_7751R:
 		evtcode = _reg_read_4(SH4_INTEVT);
 		break;
 	default:



CVS commit: src/sys/kern

2009-05-16 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sat May 16 12:02:00 UTC 2009

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

Log Message:
sysctl_doeproc:
- simplify.
- KERN_PROC: fix possible stale proc pointer dereference.
- KERN_PROC: don't do copyout with proc_lock held.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/kern/init_sysctl.c

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

Modified files:

Index: src/sys/kern/init_sysctl.c
diff -u src/sys/kern/init_sysctl.c:1.162 src/sys/kern/init_sysctl.c:1.163
--- src/sys/kern/init_sysctl.c:1.162	Tue May 12 11:42:12 2009
+++ src/sys/kern/init_sysctl.c	Sat May 16 12:02:00 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_sysctl.c,v 1.162 2009/05/12 11:42:12 yamt Exp $ */
+/*	$NetBSD: init_sysctl.c,v 1.163 2009/05/16 12:02:00 yamt Exp $ */
 
 /*-
  * Copyright (c) 2003, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: init_sysctl.c,v 1.162 2009/05/12 11:42:12 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: init_sysctl.c,v 1.163 2009/05/16 12:02:00 yamt Exp $);
 
 #include opt_sysv.h
 #include opt_compat_netbsd32.h
@@ -2182,21 +2182,21 @@
 static int
 sysctl_doeproc(SYSCTLFN_ARGS)
 {
-	struct eproc *eproc;
-	struct kinfo_proc2 *kproc2;
-	struct kinfo_proc *dp;
+	union {
+		struct kinfo_proc kproc;
+		struct kinfo_proc2 kproc2;
+	} *kbuf;
 	struct proc *p, *next, *marker;
-	char *where, *dp2;
+	char *where, *dp;
 	int type, op, arg, error;
-	u_int elem_size, elem_count;
+	u_int elem_size, kelem_size, elem_count;
 	size_t buflen, needed;
 	bool match, zombie, mmmbrains;
 
 	if (namelen == 1  name[0] == CTL_QUERY)
 		return (sysctl_query(SYSCTLFN_CALL(rnode)));
 
-	dp = oldp;
-	dp2 = where = oldp;
+	dp = where = oldp;
 	buflen = where != NULL ? *oldlenp : 0;
 	error = 0;
 	needed = 0;
@@ -2210,7 +2210,8 @@
 			arg = name[1];
 		else
 			arg = 0;		/* Quell compiler warning */
-		elem_size = elem_count = 0;	/* Ditto */
+		elem_count = 0;	/* Ditto */
+		kelem_size = elem_size = sizeof(kbuf-kproc);
 	} else {
 		if (namelen != 4)
 			return (EINVAL);
@@ -2218,17 +2219,12 @@
 		arg = name[1];
 		elem_size = name[2];
 		elem_count = name[3];
+		kelem_size = sizeof(kbuf-kproc2);
 	}
 
 	sysctl_unlock();
 
-	if (type == KERN_PROC) {
-		eproc = kmem_alloc(sizeof(*eproc), KM_SLEEP);
-		kproc2 = NULL;
-	} else {
-		eproc = NULL;
-		kproc2 = kmem_alloc(sizeof(*kproc2), KM_SLEEP);
-	}
+	kbuf = kmem_alloc(sizeof(*kbuf), KM_SLEEP);
 	marker = kmem_alloc(sizeof(*marker), KM_SLEEP);
 	marker-p_flag = PK_MARKER;
 
@@ -2342,51 +2338,32 @@
 			LIST_INSERT_AFTER(p, marker, p_list);
 		}
 
-		if (type == KERN_PROC) {
-			if (buflen = sizeof(struct kinfo_proc)) {
-fill_eproc(p, eproc, zombie);
-mutex_exit(p-p_lock);
-mutex_exit(proc_lock);
-error = dcopyout(l, p, dp-kp_proc,
-sizeof(struct proc));
-mutex_enter(proc_lock);
-if (error) {
-	goto bah;
-}
-error = dcopyout(l, eproc, dp-kp_eproc,
-sizeof(*eproc));
-if (error) {
-	goto bah;
-}
-dp++;
-buflen -= sizeof(struct kinfo_proc);
+		if (buflen = elem_size 
+		(type == KERN_PROC || elem_count  0)) {
+			if (type == KERN_PROC) {
+kbuf-kproc.kp_proc = *p;
+fill_eproc(p, kbuf-kproc.kp_eproc, zombie);
 			} else {
-mutex_exit(p-p_lock);
-			}
-			needed += sizeof(struct kinfo_proc);
-		} else { /* KERN_PROC2 */
-			if (buflen = elem_size  elem_count  0) {
-fill_kproc2(p, kproc2, zombie);
-mutex_exit(p-p_lock);
-mutex_exit(proc_lock);
-/*
- * Copy out elem_size, but not larger than
- * the size of a struct kinfo_proc2.
- */
-error = dcopyout(l, kproc2, dp2,
-min(sizeof(*kproc2), elem_size));
-mutex_enter(proc_lock);
-if (error) {
-	goto bah;
-}
-dp2 += elem_size;
-buflen -= elem_size;
+fill_kproc2(p, kbuf-kproc2, zombie);
 elem_count--;
-			} else {
-mutex_exit(p-p_lock);
 			}
-			needed += elem_size;
+			mutex_exit(p-p_lock);
+			mutex_exit(proc_lock);
+			/*
+			 * Copy out elem_size, but not larger than kelem_size
+			 */
+			error = dcopyout(l, kbuf, dp,
+			min(kelem_size, elem_size));
+			mutex_enter(proc_lock);
+			if (error) {
+goto bah;
+			}
+			dp += elem_size;
+			buflen -= elem_size;
+		} else {
+			mutex_exit(p-p_lock);
 		}
+		needed += elem_size;
 
 		/*
 		 * Release reference to process.
@@ -2401,10 +2378,7 @@
 	mutex_exit(proc_lock);
 
 	if (where != NULL) {
-		if (type == KERN_PROC)
-			*oldlenp = (char *)dp - where;
-		else
-			*oldlenp = dp2 - where;
+		*oldlenp = dp - where;
 		if (needed  *oldlenp) {
 			error = ENOMEM;
 			goto out;
@@ -2413,10 +2387,8 @@
 		needed += KERN_PROCSLOP;
 		*oldlenp = needed;
 	}
-	if (kproc2)
-		kmem_free(kproc2, sizeof(*kproc2));
-	if (eproc)
-		kmem_free(eproc, sizeof(*eproc));
+	if (kbuf)
+		kmem_free(kbuf, sizeof(*kbuf));
 	if (marker)
 		

CVS commit: src/doc

2009-05-16 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sat May 16 12:08:43 UTC 2009

Modified Files:
src/doc: BRANCHES

Log Message:
yamt-nfs-mp: update base


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/doc/BRANCHES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.279 src/doc/BRANCHES:1.280
--- src/doc/BRANCHES:1.279	Thu Apr 30 16:54:03 2009
+++ src/doc/BRANCHES	Sat May 16 12:08:43 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.279 2009/04/30 16:54:03 snj Exp $
+#	$NetBSD: BRANCHES,v 1.280 2009/05/16 12:08:43 yamt Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -591,7 +591,7 @@
 Status:		Active
 Start Date:	Sun Apr 27 2008
 End Date:	
-Base Tag:	yamt-nfs-mp-base2
+Base Tag:	yamt-nfs-mp-base4
 Maintainer:	YAMAMOTO Takashi y...@netbsd.org
 Scope:		src/sys  (src/common is tagged but not branched)
 Notes:		



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

2009-05-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May 16 12:57:05 UTC 2009

Modified Files:
src/sys/arch/hppa/include: reg.h

Log Message:
Note that CR27 is used for thread local storage (TLS)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hppa/include/reg.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/hppa/include/reg.h
diff -u src/sys/arch/hppa/include/reg.h:1.7 src/sys/arch/hppa/include/reg.h:1.8
--- src/sys/arch/hppa/include/reg.h:1.7	Thu Apr 30 07:01:27 2009
+++ src/sys/arch/hppa/include/reg.h	Sat May 16 12:57:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: reg.h,v 1.7 2009/04/30 07:01:27 skrll Exp $	*/
+/*	$NetBSD: reg.h,v 1.8 2009/05/16 12:57:05 skrll Exp $	*/
 
 /*	$OpenBSD: reg.h,v 1.7 2000/06/15 17:00:37 mickey Exp $	*/
 
@@ -88,8 +88,8 @@
 /* Temporary control registers */
 #define	CR_CURLWP	24	/* tr0: curlwp*/
 #define	CR_VTOP		25	/* tr1: virt to phys table address	*/
-#define	CR_TR2		26	/* tr2: (TLS?)*/
-#define	CR_TR3		27	/* tr3: (TLS?)*/
+#define	CR_TR2		26	/* tr2: temporary			*/
+#define	CR_TLS		27	/* tr3: thread local storage pointer	*/
 #define	CR_HVTP		28	/* tr4: faulted HVT slot ptr on LC cpus */
 #define	CR_TR5		29	/* tr5: emu / TLB_STATS_{PRE,AFT}	*/
 #define	CR_UPADDR	30	/* tr6: paddr of U-area of curlwp	*/



CVS commit: src/sys/dev/pci

2009-05-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May 16 13:04:26 UTC 2009

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

Log Message:
Split device_t/softc.  Tested on arc:
tga0 at pci0 dev 3 function 0: DC21030 step C, board type T8-02


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/pci/tga.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/tga.c
diff -u src/sys/dev/pci/tga.c:1.75 src/sys/dev/pci/tga.c:1.76
--- src/sys/dev/pci/tga.c:1.75	Tue May 12 08:23:01 2009
+++ src/sys/dev/pci/tga.c	Sat May 16 13:04:26 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: tga.c,v 1.75 2009/05/12 08:23:01 cegger Exp $ */
+/* $NetBSD: tga.c,v 1.76 2009/05/16 13:04:26 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tga.c,v 1.75 2009/05/12 08:23:01 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: tga.c,v 1.76 2009/05/16 13:04:26 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -64,7 +64,7 @@
 void	tgaattach(device_t, device_t, void *);
 int	tgaprint(void *, const char *);
 
-CFATTACH_DECL(tga, sizeof(struct tga_softc),
+CFATTACH_DECL_NEW(tga, sizeof(struct tga_softc),
 tgamatch, tgaattach, NULL, NULL);
 
 static void tga_init(bus_space_tag_t memt, pci_chipset_tag_t pc,
@@ -390,6 +390,8 @@
 	u_int8_t rev;
 	int console;
 
+	sc-sc_dev = self;
+
 #if defined(__alpha__) || defined(arc)
 	console = (pa-pa_tag == tga_console_dc.dc_pcitag);
 #else
@@ -405,24 +407,24 @@
 		tga_init(pa-pa_memt, pa-pa_pc, pa-pa_tag, sc-sc_dc);
 	}
 	if (sc-sc_dc-dc_vaddr == 0) {
-		printf(: couldn't map memory space; punt!\n);
+		aprint_error(: couldn't map memory space; punt!\n);
 		return;
 	}
 
 	/* XXX say what's going on. */
 	intrstr = NULL;
 	if (pci_intr_map(pa, intrh)) {
-		printf(: couldn't map interrupt);
+		aprint_error(: couldn't map interrupt);
 		return;
 	}
 	intrstr = pci_intr_string(pa-pa_pc, intrh);
 	sc-sc_intr = pci_intr_establish(pa-pa_pc, intrh, IPL_TTY, tga_intr,
 	sc-sc_dc);
 	if (sc-sc_intr == NULL) {
-		printf(: couldn't establish interrupt);
+		aprint_error(: couldn't establish interrupt);
 		if (intrstr != NULL)
-			printf(at %s, intrstr);
-		printf(\n);
+			aprint_error(at %s, intrstr);
+		aprint_error(\n);
 		return;
 	}
 
@@ -431,21 +433,21 @@
 	case 0x1:
 	case 0x2:
 	case 0x3:
-		printf(: DC21030 step %c, 'A' + rev - 1);
+		aprint_normal(: DC21030 step %c, 'A' + rev - 1);
 		break;
 	case 0x20:
-		printf(: TGA2 abstract software model);
+		aprint_normal(: TGA2 abstract software model);
 		break;
 	case 0x21:
 	case 0x22:
-		printf(: TGA2 pass %d, rev - 0x20);
+		aprint_normal(: TGA2 pass %d, rev - 0x20);
 		break;
 
 	default:
-		printf(unknown stepping (0x%x), rev);
+		aprint_normal(unknown stepping (0x%x), rev);
 		break;
 	}
-	printf(, );
+	aprint_normal(, );
 
 	/*
 	 * Get RAMDAC function vectors and call the RAMDAC functions
@@ -483,17 +485,17 @@
 	TGAWREG(sc-sc_dc, TGA_REG_SISR, 0x0001); /* XXX */
 
 	if (sc-sc_dc-dc_tgaconf == NULL) {
-		printf(unknown board configuration\n);
+		aprint_error(unknown board configuration\n);
 		return;
 	}
-	printf(board type %s\n, sc-sc_dc-dc_tgaconf-tgac_name);
-	printf(%s: %d x %d, %dbpp, %s RAMDAC\n, device_xname(sc-sc_dev),
+	aprint_normal(board type %s\n, sc-sc_dc-dc_tgaconf-tgac_name);
+	aprint_normal_dev(self, %d x %d, %dbpp, %s RAMDAC\n,
 	sc-sc_dc-dc_wid, sc-sc_dc-dc_ht,
 	sc-sc_dc-dc_tgaconf-tgac_phys_depth,
 	sc-sc_dc-dc_ramdac_funcs-ramdac_name);
 
 	if (intrstr != NULL)
-		printf(%s: interrupting at %s\n, device_xname(sc-sc_dev),
+		aprint_normal_dev(self, interrupting at %s\n,
 		intrstr);
 
 	aa.console = console;
@@ -507,9 +509,9 @@
 }
 
 static void
-tga_config_interrupts (device_t d)
+tga_config_interrupts(device_t self)
 {
-	struct tga_softc *sc = (struct tga_softc *)d;
+	struct tga_softc *sc = device_private(self);
 	sc-sc_dc-dc_intrenabled = 1;
 }
 



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

2009-05-16 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat May 16 13:36:44 UTC 2009

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

Log Message:
Correctly identify flag bit for SSSE3 (one of the 'S' was missing).  Also
rename AMD bit from SCALL/RET to SYSCALL/SYSRET to match Intel bit name.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/x86/include/specialreg.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/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.34 src/sys/arch/x86/include/specialreg.h:1.35
--- src/sys/arch/x86/include/specialreg.h:1.34	Wed May 13 22:25:51 2009
+++ src/sys/arch/x86/include/specialreg.h	Sat May 16 13:36:44 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.34 2009/05/13 22:25:51 pgoyette Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.35 2009/05/16 13:36:44 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -158,8 +158,8 @@
 #define CPUID_3DNOW2	0x4000	/* 3DNow! Instruction Extension */
 #define CPUID_3DNOW	0x8000	/* 3DNow! Instructions */
 
-#define CPUID_EXT_FLAGS	\20\14SCALL/RET\24MPC\25NOX\27MXX\32FFXSR\33P1GB \
-			\34RDTSCP\36LONG\0373DNOW2\0403DNOW
+#define CPUID_EXT_FLAGS	\20\14SYSCALL/SYSRET\24MPC\25NOX\27MXX\32FFXSR \
+			\33P1GB\34RDTSCP\36LONG\0373DNOW2\0403DNOW
 
 
 /* AMD Fn8001 %ecx features */
@@ -249,7 +249,7 @@
 #define	CPUID2_POPCNT	0x0080	
 
 #define CPUID2_FLAGS1	\20\1SSE3\2B01\3DTES64\4MONITOR\5DS-CPL\6VMX\7SMX \
-			\10EST\11TM2\12SSE3\13CID\14B11\15B12\16CX16 \
+			\10EST\11TM2\12SSSE3\13CID\14B11\15B12\16CX16 \
 			\17xTPR\20PDCM\21B16\22B17\23DCA\24SSE41\25SSE42 \
 			\26X2APIC\27MOVBE\30POPCNT\31B24\32B25\33XSAVE \
 			\34OSXSAVE\35B28\36B29\37B30\40B31



CVS commit: src/sys/dev/pci

2009-05-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May 16 14:27:30 UTC 2009

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

Log Message:
KNF and misc cosmetics.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pci/tga.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/tga.c
diff -u src/sys/dev/pci/tga.c:1.76 src/sys/dev/pci/tga.c:1.77
--- src/sys/dev/pci/tga.c:1.76	Sat May 16 13:04:26 2009
+++ src/sys/dev/pci/tga.c	Sat May 16 14:27:30 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: tga.c,v 1.76 2009/05/16 13:04:26 tsutsui Exp $ */
+/* $NetBSD: tga.c,v 1.77 2009/05/16 14:27:30 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tga.c,v 1.76 2009/05/16 13:04:26 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: tga.c,v 1.77 2009/05/16 14:27:30 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -68,47 +68,46 @@
 tgamatch, tgaattach, NULL, NULL);
 
 static void tga_init(bus_space_tag_t memt, pci_chipset_tag_t pc,
-	pcitag_t tag, struct tga_devconfig *dc);
+pcitag_t tag, struct tga_devconfig *dc);
 
 static int tga_matchcommon(bus_space_tag_t, pci_chipset_tag_t, pcitag_t);
 static void tga_mapaddrs(bus_space_tag_t memt, pci_chipset_tag_t pc,
-	pcitag_t, bus_size_t *pcisize, struct tga_devconfig *dc);
-unsigned tga_getdotclock(struct tga_devconfig *dc);
-
-struct tga_devconfig tga_console_dc;
+pcitag_t, bus_size_t *pcisize, struct tga_devconfig *dc);
+unsigned int tga_getdotclock(struct tga_devconfig *dc);
 
 int tga_ioctl(void *, void *, u_long, void *, int, struct lwp *);
 paddr_t tga_mmap(void *, void *, off_t, int);
 static void tga_copyrows(void *, int, int, int);
 static void tga_copycols(void *, int, int, int, int);
 static int tga_alloc_screen(void *, const struct wsscreen_descr *,
-  void **, int *, int *, long *);
+void **, int *, int *, long *);
 static void tga_free_screen(void *, void *);
 static int tga_show_screen(void *, void *, int,
-void (*) (void *, int, int), void *);
+void (*) (void *, int, int), void *);
 static int tga_rop(struct rasops_info *, int, int, int, int, int,
-	struct rasops_info *, int, int);
+struct rasops_info *, int, int);
 static int tga_rop_vtov(struct rasops_info *, int, int, int, int,
-	int, struct rasops_info *, int, int);
-static void tga_putchar(void *c, int row, int col,
-u_int uc, long attr);
+int, struct rasops_info *, int, int);
+static void tga_putchar(void *c, int row, int col, u_int uc, long attr);
 static void tga_eraserows(void *, int, int, long);
-static void	tga_erasecols(void *, int, int, int, long);
+static void tga_erasecols(void *, int, int, int, long);
 void tga2_init(struct tga_devconfig *);
 
 static void tga_config_interrupts(device_t);
 
 /* RAMDAC interface functions */
-static int		tga_sched_update(void *, void (*)(void *));
-static void		tga_ramdac_wr(void *, u_int, u_int8_t);
-static u_int8_t	tga_ramdac_rd(void *, u_int);
-static void		tga_bt463_wr(void *, u_int, u_int8_t);
-static u_int8_t	tga_bt463_rd(void *, u_int);
-static void		tga2_ramdac_wr(void *, u_int, u_int8_t);
-static u_int8_t	tga2_ramdac_rd(void *, u_int);
+static int tga_sched_update(void *, void (*)(void *));
+static void tga_ramdac_wr(void *, u_int, uint8_t);
+static uint8_t tga_ramdac_rd(void *, u_int);
+static void tga_bt463_wr(void *, u_int, uint8_t);
+static uint8_t tga_bt463_rd(void *, u_int);
+static void tga2_ramdac_wr(void *, u_int, uint8_t);
+static uint8_t tga2_ramdac_rd(void *, u_int);
 
 /* Interrupt handler */
-static int	tga_intr(void *);
+static int tga_intr(void *);
+
+struct tga_devconfig tga_console_dc;
 
 /* The NULL entries will get filled in by rasops_init().
  * XXX and the non-NULL ones will be overwritten; reset after calling it.
@@ -158,8 +157,10 @@
 static void	tga_unblank(struct tga_devconfig *);
 
 int
-tga_cnmatch(bus_space_tag_t iot, bus_space_tag_t memt, pci_chipset_tag_t pc, pcitag_t tag)
+tga_cnmatch(bus_space_tag_t iot, bus_space_tag_t memt,
+pci_chipset_tag_t pc, pcitag_t tag)
 {
+
 	return tga_matchcommon(memt, pc, tag);
 }
 
@@ -209,7 +210,8 @@
 }
 
 static void
-tga_mapaddrs(bus_space_tag_t memt, pci_chipset_tag_t pc, pcitag_t tag, bus_size_t *pcisize, struct tga_devconfig *dc)
+tga_mapaddrs(bus_space_tag_t memt, pci_chipset_tag_t pc, pcitag_t tag,
+bus_size_t *pcisize, struct tga_devconfig *dc)
 {
 	int flags;
 
@@ -227,15 +229,15 @@
 	if (bus_space_map(memt, dc-dc_pcipaddr, *pcisize,
 	BUS_SPACE_MAP_PREFETCHABLE | BUS_SPACE_MAP_LINEAR, dc-dc_memh))
 		panic(tga_mapaddrs: could not map TGA address space);
-	dc-dc_vaddr = (vaddr_t) bus_space_vaddr(memt, dc-dc_memh);
+	dc-dc_vaddr = (vaddr_t)bus_space_vaddr(memt, dc-dc_memh);
 
 	bus_space_subregion(dc-dc_memt, dc-dc_memh,
-		TGA_MEM_CREGS, TGA_CREGS_SIZE,
-		dc-dc_regs);
+	

CVS commit: src/sys/arch/hp700/hp700

2009-05-16 Thread Matt Fleming
Module Name:src
Committed By:   mjf
Date:   Sat May 16 16:06:06 UTC 2009

Modified Files:
src/sys/arch/hp700/hp700: machdep.c pim.h

Log Message:
Add PA-RISC 2.0 PIM support.

Fix the HPMC exception handler so that, if we're running on a PA-RISC
2.0 machine, we use the 64-bit PIM data structures.

There was also a bug in the HPMC exception handler that stopped output
being written to the console after we'd taken the exception. We need
to make a PDC_IO pdc call to reset I/O.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/hp700/hp700/machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp700/hp700/pim.h

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

Modified files:

Index: src/sys/arch/hp700/hp700/machdep.c
diff -u src/sys/arch/hp700/hp700/machdep.c:1.63 src/sys/arch/hp700/hp700/machdep.c:1.64
--- src/sys/arch/hp700/hp700/machdep.c:1.63	Wed May 13 14:33:42 2009
+++ src/sys/arch/hp700/hp700/machdep.c	Sat May 16 16:06:06 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.63 2009/05/13 14:33:42 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.64 2009/05/16 16:06:06 mjf Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.63 2009/05/13 14:33:42 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.64 2009/05/16 16:06:06 mjf Exp $);
 
 #include opt_cputype.h
 #include opt_ddb.h
@@ -1455,12 +1455,20 @@
  * an LPMC, or a TOC.  The check type is passed in as a trap
  * type, one of T_HPMC, T_LPMC, or T_INTERRUPT (for TOC).
  */
-static char pim_data_buffer[4096];	/* XXX assumed to be big enough */
+static char pim_data_buffer[896] __attribute__((__aligned__(8)));
 static char in_check = 0;
-void
-hppa_machine_check(int check_type)
+
+#define	PIM_WORD(name, word, bits)			\
+do {			\
+	snprintb(bitmask_buffer, sizeof(bitmask_buffer),\
+	bits, word);\
+	printf(%s %s, name, bitmask_buffer);		\
+} while (/* CONSTCOND */ 0)
+
+
+static inline void
+hppa_pim_dump(int check_type)
 {
-	int pdc_pim_type;
 	struct hp700_pim_hpmc *hpmc;
 	struct hp700_pim_lpmc *lpmc;
 	struct hp700_pim_toc *toc;
@@ -1470,37 +1478,20 @@
 	int reg_i, reg_j, reg_k;
 	char bitmask_buffer[64];
 	const char *name;
-	int error;
-#define	PIM_WORD(name, word, bits)			\
-do {			\
-	snprintb(bitmask_buffer, sizeof(bitmask_buffer),\
-	bits, word);\
-	printf(%s %s, name, bitmask_buffer);		\
-} while (/* CONSTCOND */ 0)
 
-	/* Do an fcacheall(). */
-	fcacheall();
-
-	/* Dispatch on the check type. */
 	regs = NULL;
 	checks = NULL;
 	switch (check_type) {
 	case T_HPMC:
-		name = HPMC;
-		pdc_pim_type = PDC_PIM_HPMC;
 		hpmc = (struct hp700_pim_hpmc *) pim_data_buffer;
 		regs = hpmc-pim_hpmc_regs;
 		checks = hpmc-pim_hpmc_checks;
 		break;
 	case T_LPMC:
-		name = LPMC;
-		pdc_pim_type = PDC_PIM_LPMC;
 		lpmc = (struct hp700_pim_lpmc *) pim_data_buffer;
 		checks = lpmc-pim_lpmc_checks;
 		break;
 	case T_INTERRUPT:
-		name = TOC;
-		pdc_pim_type = PDC_PIM_TOC;
 		toc = (struct hp700_pim_toc *) pim_data_buffer;
 		regs = toc-pim_toc_regs;
 		break;
@@ -1508,11 +1499,6 @@
 		panic(unknown machine check type);
 		/* NOTREACHED */
 	}
-	printf(\nmachine check: %s, name);
-	error = pdc_call((iodcio_t)pdc, 0, PDC_PIM, pdc_pim_type,
-		pdc_pim, pim_data_buffer, sizeof(pim_data_buffer));
-	if (error  0)
-		printf( - WARNING: could not transfer PIM info (%d), error);
 
 	/* If we have register arrays, display them. */
 	if (regs != NULL) {
@@ -1538,7 +1524,8 @@
 		}
 
 		/* Print out some interesting registers. */
-		printf(\n\n\tIIA 0x%x:0x%08x 0x%x:0x%08x,
+		printf(\n\n\tIIA head 0x%x:0x%08x\n
+			\tIIA tail 0x%x:0x%08x,
 			regs-pim_regs_cr17, regs-pim_regs_cr18,
 			regs-pim_regs_iisq_tail, regs-pim_regs_iioq_tail);
 		PIM_WORD(\n\tIPSW, regs-pim_regs_cr22, PSW_BITS);
@@ -1569,6 +1556,164 @@
 		printf(\n\tPath Info 0x%08x,
 			checks-pim_check_path_info);
 	}
+}
+
+static inline void
+hppa_pim64_dump(int check_type)
+{
+	struct hp700_pim64_hpmc *hpmc;
+	struct hp700_pim64_lpmc *lpmc;
+	struct hp700_pim64_toc *toc;
+	struct hp700_pim64_regs *regs;
+	struct hp700_pim64_checks *checks;
+	int reg_i, reg_j, reg_k;
+	uint64_t *regarray;
+	char bitmask_buffer[64];
+	const char *name;
+
+	regs = NULL;
+	checks = NULL;
+	switch (check_type) {
+	case T_HPMC:
+		hpmc = (struct hp700_pim64_hpmc *) pim_data_buffer;
+		regs = hpmc-pim_hpmc_regs;
+		checks = hpmc-pim_hpmc_checks;
+		break;
+	case T_LPMC:
+		lpmc = (struct hp700_pim64_lpmc *) pim_data_buffer;
+		checks = lpmc-pim_lpmc_checks;
+		break;
+	case T_INTERRUPT:
+		toc = (struct hp700_pim64_toc *) pim_data_buffer;
+		regs = toc-pim_toc_regs;
+		break;
+	default:
+		panic(unknown machine check type);
+		/* NOTREACHED */
+	}
+
+	/* If we have register arrays, display them. */
+	if (regs != NULL) {
+		for (reg_i = 0; reg_i  3; reg_i++) {
+			if (reg_i == 0) {
+name = General;
+

CVS commit: src/sys/arch/acorn32/podulebus

2009-05-16 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat May 16 16:40:58 UTC 2009

Modified Files:
src/sys/arch/acorn32/podulebus: esc.c if_ie.c sfas.c

Log Message:
KNF, same object code generated


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/acorn32/podulebus/esc.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/acorn32/podulebus/if_ie.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/acorn32/podulebus/sfas.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/acorn32/podulebus/esc.c
diff -u src/sys/arch/acorn32/podulebus/esc.c:1.22 src/sys/arch/acorn32/podulebus/esc.c:1.23
--- src/sys/arch/acorn32/podulebus/esc.c:1.22	Wed Mar 18 17:06:41 2009
+++ src/sys/arch/acorn32/podulebus/esc.c	Sat May 16 16:40:58 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: esc.c,v 1.22 2009/03/18 17:06:41 cegger Exp $	*/
+/*	$NetBSD: esc.c,v 1.23 2009/05/16 16:40:58 cegger Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -86,7 +86,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: esc.c,v 1.22 2009/03/18 17:06:41 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: esc.c,v 1.23 2009/05/16 16:40:58 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -818,7 +818,7 @@
 /* Setup the nexus struct. */
 	nexus-ID	   = ((mode  ESC_SELECT_R) ? 0xC0 : 0x80) | lun;
 	nexus-clen	   = clen;
-	memcpy( nexus-cbuf, cbuf, nexus-clen);
+	memcpy(nexus-cbuf, cbuf, nexus-clen);
 	nexus-cbuf[1] |= lun  5;		/* Fix the lun bits */
 	nexus-cur_link	   = 0;
 	nexus-dma_len	   = 0;
@@ -1202,7 +1202,7 @@
  left)
 dev-sc_bump_va[len-(left--)] = *rp-esc_fifo;
 
-			  memcpy( dev-sc_buf, dev-sc_bump_va, len-left);
+			  memcpy(dev-sc_buf, dev-sc_bump_va, len-left);
 			}
 			  } else {
 			/* Count any unsent bytes and flush them. */
@@ -1317,7 +1317,7 @@
 			dev-sc_dma_len = len;
 
 			if (nexus-state == ESC_NS_DATA_OUT)
-			  memcpy( dev-sc_bump_va, dev-sc_buf, dev-sc_dma_len);
+			  memcpy(dev-sc_bump_va, dev-sc_buf, dev-sc_dma_len);
 		  } else {
 			dev-sc_dma_buf = dev-sc_dma_blk_ptr;
 			dev-sc_dma_len = dev-sc_dma_blk_len;

Index: src/sys/arch/acorn32/podulebus/if_ie.c
diff -u src/sys/arch/acorn32/podulebus/if_ie.c:1.26 src/sys/arch/acorn32/podulebus/if_ie.c:1.27
--- src/sys/arch/acorn32/podulebus/if_ie.c:1.26	Tue May 12 06:54:10 2009
+++ src/sys/arch/acorn32/podulebus/if_ie.c	Sat May 16 16:40:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie.c,v 1.26 2009/05/12 06:54:10 cegger Exp $ */
+/* $NetBSD: if_ie.c,v 1.27 2009/05/16 16:40:58 cegger Exp $ */
 
 /*
  * Copyright (c) 1995 Melvin Tang-Richardson.
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ie.c,v 1.26 2009/05/12 06:54:10 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ie.c,v 1.27 2009/05/16 16:40:58 cegger Exp $);
 
 #define IGNORE_ETHER1_IDROM_CHECKSUM
 
@@ -450,7 +450,7 @@
 
 	/* Fill in my application form to attach to the inet system */
 
-	memcpy( ifp-if_xname, device_xname(sc-sc_dev), IFNAMSIZ);
+	memcpy(ifp-if_xname, device_xname(sc-sc_dev), IFNAMSIZ);
 	ifp-if_softc = sc;
 	ifp-if_start = iestart;
 	ifp-if_ioctl = ieioctl;
@@ -1493,7 +1493,7 @@
 
 		for (m0 = m; m  (len + m-m_len)  IE_TXBUF_SIZE;
 		 m = m-m_next) {
-			memcpy( buffer, mtod(m, void *), m-m_len);
+			memcpy(buffer, mtod(m, void *), m-m_len);
 			buffer += m-m_len;
 			len += m-m_len;
 		}

Index: src/sys/arch/acorn32/podulebus/sfas.c
diff -u src/sys/arch/acorn32/podulebus/sfas.c:1.19 src/sys/arch/acorn32/podulebus/sfas.c:1.20
--- src/sys/arch/acorn32/podulebus/sfas.c:1.19	Wed Mar 18 17:06:41 2009
+++ src/sys/arch/acorn32/podulebus/sfas.c	Sat May 16 16:40:58 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sfas.c,v 1.19 2009/03/18 17:06:41 cegger Exp $	*/
+/*	$NetBSD: sfas.c,v 1.20 2009/05/16 16:40:58 cegger Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -82,7 +82,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sfas.c,v 1.19 2009/03/18 17:06:41 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: sfas.c,v 1.20 2009/05/16 16:40:58 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -739,7 +739,7 @@
 /* Setup the nexus struct. */
 	nexus-ID	   = ((mode  SFAS_SELECT_R) ? 0xC0 : 0x80) | lun;
 	nexus-clen	   = clen;
-	memcpy( nexus-cbuf, cbuf, nexus-clen);
+	memcpy(nexus-cbuf, cbuf, nexus-clen);
 	nexus-cbuf[1] |= lun  5;		/* Fix the lun bits */
 	nexus-cur_link	   = 0;
 	nexus-dma_len	   = 0;
@@ -1123,7 +1123,7 @@
  left)
 dev-sc_bump_va[len-(left--)] = *rp-sfas_fifo;
 
-			  memcpy( dev-sc_buf, dev-sc_bump_va, len-left);
+			  memcpy(dev-sc_buf, dev-sc_bump_va, len-left);
 			}
 			  } else {
 			/* Count any unsent bytes and flush them. */
@@ -1237,7 +1237,7 @@
 			dev-sc_dma_len = len;
 
 			if (nexus-state == SFAS_NS_DATA_OUT)
-			  memcpy( dev-sc_bump_va, dev-sc_buf, dev-sc_dma_len);
+			  memcpy(dev-sc_bump_va, dev-sc_buf, 

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

2009-05-16 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat May 16 16:49:19 UTC 2009

Modified Files:
src/sys/arch/arm/arm: process_machdep.c

Log Message:
KNF, same object code generated.
(checked with evbarm CP3100 kernel)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/arm/process_machdep.c

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

Modified files:

Index: src/sys/arch/arm/arm/process_machdep.c
diff -u src/sys/arch/arm/arm/process_machdep.c:1.20 src/sys/arch/arm/arm/process_machdep.c:1.21
--- src/sys/arch/arm/arm/process_machdep.c:1.20	Wed Mar 18 17:06:42 2009
+++ src/sys/arch/arm/arm/process_machdep.c	Sat May 16 16:49:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: process_machdep.c,v 1.20 2009/03/18 17:06:42 cegger Exp $	*/
+/*	$NetBSD: process_machdep.c,v 1.21 2009/05/16 16:49:19 cegger Exp $	*/
 
 /*
  * Copyright (c) 1993 The Regents of the University of California.
@@ -133,7 +133,7 @@
 
 #include sys/param.h
 
-__KERNEL_RCSID(0, $NetBSD: process_machdep.c,v 1.20 2009/03/18 17:06:42 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: process_machdep.c,v 1.21 2009/05/16 16:49:19 cegger Exp $);
 
 #include sys/proc.h
 #include sys/ptrace.h
@@ -156,7 +156,7 @@
 	struct trapframe *tf = process_frame(l);
 
 	KASSERT(tf != NULL);
-	memcpy( (void *)regs-r, (void *)tf-tf_r0, sizeof(regs-r));
+	memcpy((void *)regs-r, (void *)tf-tf_r0, sizeof(regs-r));
 	regs-r_sp = tf-tf_usr_sp;
 	regs-r_lr = tf-tf_usr_lr;
 	regs-r_pc = tf-tf_pc;
@@ -194,7 +194,7 @@
 	struct trapframe *tf = process_frame(l);
 
 	KASSERT(tf != NULL);
-	memcpy( tf-tf_r0, regs-r, sizeof(regs-r));
+	memcpy(tf-tf_r0, regs-r, sizeof(regs-r));
 	tf-tf_usr_sp = regs-r_sp;
 	tf-tf_usr_lr = regs-r_lr;
 #ifdef __PROG32



CVS commit: src/sys/arch/i386

2009-05-16 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat May 16 16:52:03 UTC 2009

Modified Files:
src/sys/arch/i386/i386: bios32.c
src/sys/arch/i386/pci: glxsb.c

Log Message:
KNF, same object code generated.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/i386/i386/bios32.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/pci/glxsb.c

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

Modified files:

Index: src/sys/arch/i386/i386/bios32.c
diff -u src/sys/arch/i386/i386/bios32.c:1.25 src/sys/arch/i386/i386/bios32.c:1.26
--- src/sys/arch/i386/i386/bios32.c:1.25	Wed Mar 18 17:06:44 2009
+++ src/sys/arch/i386/i386/bios32.c	Sat May 16 16:52:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bios32.c,v 1.25 2009/03/18 17:06:44 cegger Exp $	*/
+/*	$NetBSD: bios32.c,v 1.26 2009/05/16 16:52:03 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -86,7 +86,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bios32.c,v 1.25 2009/03/18 17:06:44 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: bios32.c,v 1.26 2009/05/16 16:52:03 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -327,7 +327,7 @@
 	if (i == indx) {
 		if (va + len  end) {
 			ret = dest;
-			memcpy( ret, va, len);
+			memcpy(ret, va, len);
 			ret[len - 1] = '\0';
 		}
 	}

Index: src/sys/arch/i386/pci/glxsb.c
diff -u src/sys/arch/i386/pci/glxsb.c:1.8 src/sys/arch/i386/pci/glxsb.c:1.9
--- src/sys/arch/i386/pci/glxsb.c:1.8	Wed Mar 18 17:06:44 2009
+++ src/sys/arch/i386/pci/glxsb.c	Sat May 16 16:52:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: glxsb.c,v 1.8 2009/03/18 17:06:44 cegger Exp $	*/
+/*	$NetBSD: glxsb.c,v 1.9 2009/05/16 16:52:03 cegger Exp $	*/
 /* $OpenBSD: glxsb.c,v 1.7 2007/02/12 14:31:45 tom Exp $ */
 
 /*
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: glxsb.c,v 1.8 2009/03/18 17:06:44 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: glxsb.c,v 1.9 2009/05/16 16:52:03 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -331,7 +331,7 @@
 		if (ses == NULL)
 			return (ENOMEM);
 		if (sesn != 0) {
-			memcpy( ses, sc-sc_sessions, sesn * sizeof(*ses));
+			memcpy(ses, sc-sc_sessions, sesn * sizeof(*ses));
 			memset(sc-sc_sessions, 0, sesn * sizeof(*ses));
 			free(sc-sc_sessions, M_DEVBUF);
 		}
@@ -347,7 +347,7 @@
 	ses-ses_klen = cri-cri_klen;
 
 	/* Copy the key (Geode LX wants the primary key only) */
-	memcpy( ses-ses_key, cri-cri_key, sizeof(ses-ses_key));
+	memcpy(ses-ses_key, cri-cri_key, sizeof(ses-ses_key));
 
 	*sidp = GLXSB_SID(0, sesn);
 	return (0);
@@ -492,9 +492,9 @@
 	if (crd-crd_flags  CRD_F_ENCRYPT) {
 		control = SB_CTL_ENC;
 		if (crd-crd_flags  CRD_F_IV_EXPLICIT)
-			memcpy( op_iv, crd-crd_iv, sizeof(op_iv));
+			memcpy(op_iv, crd-crd_iv, sizeof(op_iv));
 		else
-			memcpy( op_iv, ses-ses_iv, sizeof(op_iv));
+			memcpy(op_iv, ses-ses_iv, sizeof(op_iv));
 
 		if ((crd-crd_flags  CRD_F_IV_PRESENT) == 0) {
 			if (crp-crp_flags  CRYPTO_F_IMBUF)
@@ -511,7 +511,7 @@
 	} else {
 		control = SB_CTL_DEC;
 		if (crd-crd_flags  CRD_F_IV_EXPLICIT)
-			memcpy( op_iv, crd-crd_iv, sizeof(op_iv));
+			memcpy(op_iv, crd-crd_iv, sizeof(op_iv));
 		else {
 			if (crp-crp_flags  CRYPTO_F_IMBUF)
 m_copydata((struct mbuf *)crp-crp_buf,
@@ -557,7 +557,7 @@
 			cuio_copyback((struct uio *)crp-crp_buf,
 			crd-crd_skip + offset, len, op_dst);
 		else
-			memcpy( (char *)crp-crp_buf + crd-crd_skip + offset, op_dst,
+			memcpy((char *)crp-crp_buf + crd-crd_skip + offset, op_dst,
 			len);
 
 		offset += len;
@@ -576,11 +576,11 @@
 		 * time.
 		 */
 		if (crd-crd_flags  CRD_F_ENCRYPT) {
-			memcpy( piv, op_dst + len - sizeof(op_iv), sizeof(op_iv));
+			memcpy(piv, op_dst + len - sizeof(op_iv), sizeof(op_iv));
 		} else {
 			/* Decryption, only need this if another iteration */
 			if (tlen  0) {
-memcpy( piv, op_src + len - sizeof(op_iv),
+memcpy(piv, op_src + len - sizeof(op_iv),
 sizeof(op_iv));
 			}
 		}



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

2009-05-16 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat May 16 16:55:24 UTC 2009

Modified Files:
src/sys/arch/sparc/dev: cgfourteen.c zs.c zs_kgdb.c

Log Message:
KNF, same object code generated


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/sparc/dev/cgfourteen.c
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/sparc/dev/zs.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sparc/dev/zs_kgdb.c

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

Modified files:

Index: src/sys/arch/sparc/dev/cgfourteen.c
diff -u src/sys/arch/sparc/dev/cgfourteen.c:1.58 src/sys/arch/sparc/dev/cgfourteen.c:1.59
--- src/sys/arch/sparc/dev/cgfourteen.c:1.58	Thu Apr 16 16:57:21 2009
+++ src/sys/arch/sparc/dev/cgfourteen.c	Sat May 16 16:55:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgfourteen.c,v 1.58 2009/04/16 16:57:21 macallan Exp $ */
+/*	$NetBSD: cgfourteen.c,v 1.59 2009/05/16 16:55:24 cegger Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -271,7 +271,7 @@
 			self-dv_xname, sa-sa_nreg);
 		return;
 	}
-	memcpy( sc-sc_physadr, sa-sa_reg,
+	memcpy(sc-sc_physadr, sa-sa_reg,
 	  sa-sa_nreg * sizeof(struct sbus_reg));
 
 	sc-sc_vramsize = sc-sc_physadr[CG14_PXL_IDX].sbr_size;

Index: src/sys/arch/sparc/dev/zs.c
diff -u src/sys/arch/sparc/dev/zs.c:1.113 src/sys/arch/sparc/dev/zs.c:1.114
--- src/sys/arch/sparc/dev/zs.c:1.113	Wed Mar 18 17:06:46 2009
+++ src/sys/arch/sparc/dev/zs.c	Sat May 16 16:55:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.113 2009/03/18 17:06:46 cegger Exp $	*/
+/*	$NetBSD: zs.c,v 1.114 2009/05/16 16:55:24 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: zs.c,v 1.113 2009/03/18 17:06:46 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: zs.c,v 1.114 2009/05/16 16:55:24 cegger Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -475,8 +475,8 @@
 		cs-cs_reg_csr  = zc-zc_csr;
 		cs-cs_reg_data = zc-zc_data;
 
-		memcpy( cs-cs_creg, zs_init_reg, 16);
-		memcpy( cs-cs_preg, zs_init_reg, 16);
+		memcpy(cs-cs_creg, zs_init_reg, 16);
+		memcpy(cs-cs_preg, zs_init_reg, 16);
 
 		/* XXX: Consult PROM properties for this?! */
 		cs-cs_defspeed = zs_get_speed(cs);

Index: src/sys/arch/sparc/dev/zs_kgdb.c
diff -u src/sys/arch/sparc/dev/zs_kgdb.c:1.20 src/sys/arch/sparc/dev/zs_kgdb.c:1.21
--- src/sys/arch/sparc/dev/zs_kgdb.c:1.20	Wed Mar 18 17:06:46 2009
+++ src/sys/arch/sparc/dev/zs_kgdb.c	Sat May 16 16:55:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs_kgdb.c,v 1.20 2009/03/18 17:06:46 cegger Exp $	*/
+/*	$NetBSD: zs_kgdb.c,v 1.21 2009/05/16 16:55:24 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: zs_kgdb.c,v 1.20 2009/03/18 17:06:46 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: zs_kgdb.c,v 1.21 2009/05/16 16:55:24 cegger Exp $);
 
 #include opt_kgdb.h
 
@@ -111,7 +111,7 @@
 {
 	int s, tconst;
 
-	memcpy( cs-cs_preg, zs_kgdb_regs, 16);
+	memcpy(cs-cs_preg, zs_kgdb_regs, 16);
 
 	if (iena) {
 		cs-cs_preg[1] = ZSWR1_RIE | ZSWR1_SIE;



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

2009-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat May 16 17:16:12 UTC 2009

Modified Files:
src/sys/arch/sparc/include: psl.h

Log Message:
Add memory clobbers to the inline assembler modifying/testing the %psr
register, to avoid the compiler reordering instructions out of critical
sections. Should fix PR port-sparc/41372.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/sparc/include/psl.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/sparc/include/psl.h
diff -u src/sys/arch/sparc/include/psl.h:1.44 src/sys/arch/sparc/include/psl.h:1.45
--- src/sys/arch/sparc/include/psl.h:1.44	Mon Feb 19 02:57:40 2007
+++ src/sys/arch/sparc/include/psl.h	Sat May 16 17:16:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.44 2007/02/19 02:57:40 mrg Exp $ */
+/*	$NetBSD: psl.h,v 1.45 2009/05/16 17:16:12 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -252,7 +252,7 @@
 static __inline void
 setpsr(int newpsr)
 {
-	__asm volatile(wr %0,0,%%psr : : r (newpsr));
+	__asm volatile(wr %0,0,%%psr : : r (newpsr) : memory);
 	__asm volatile(nop; nop; nop);
 }
 
@@ -266,7 +266,7 @@
 	 * which gives us the same value as the old psr but with all
 	 * the old PIL bits turned off.
 	 */
-	__asm volatile(rd %%psr,%0 : =r (psr));
+	__asm volatile(rd %%psr,%0 : =r (psr) : : memory);
 	oldipl = psr  PSR_PIL;
 	__asm volatile(wr %0,%1,%%psr : : r (psr), r (oldipl));
 
@@ -290,7 +290,7 @@
 	psr = ~PSR_PIL; \
 	__asm volatile(wr %0,%1,%%psr : : \
 	r (psr), n ((newipl)  8)); \
-	__asm volatile(nop; nop; nop); \
+	__asm volatile(nop; nop; nop : : : memory); \
 }
 
 _SPLSET(spllowerschedclock, IPL_SCHED)
@@ -324,7 +324,7 @@
 	psr = (psr  ~oldipl) | newipl;
 
 	__asm volatile(wr %0,0,%%psr : : r (psr));
-	__asm volatile(nop; nop; nop);
+	__asm volatile(nop; nop; nop : : : memory);
 
 	return (oldipl);
 }
@@ -345,7 +345,7 @@
 {
 	int psr;
 
-	__asm volatile(rd %%psr,%0 : =r (psr));
+	__asm volatile(rd %%psr,%0 : =r (psr) : : memory);
 	__asm volatile(wr %0,%1,%%psr : : \
 	r (psr  ~PSR_PIL), rn (newipl));
 	__asm volatile(nop; nop; nop);



CVS commit: src/sys/arch/sparc/sparc

2009-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat May 16 17:42:36 UTC 2009

Modified Files:
src/sys/arch/sparc/sparc: msiiep.c

Log Message:
Implement dmamap_unload - I might be missing something, or is it realy
this easy?


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/sparc/sparc/msiiep.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/msiiep.c
diff -u src/sys/arch/sparc/sparc/msiiep.c:1.36 src/sys/arch/sparc/sparc/msiiep.c:1.37
--- src/sys/arch/sparc/sparc/msiiep.c:1.36	Wed Jun  4 12:41:41 2008
+++ src/sys/arch/sparc/sparc/msiiep.c	Sat May 16 17:42:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msiiep.c,v 1.36 2008/06/04 12:41:41 ad Exp $ */
+/*	$NetBSD: msiiep.c,v 1.37 2009/05/16 17:42:35 martin Exp $ */
 
 /*
  * Copyright (c) 2001 Valeriy E. Ushakov
@@ -27,7 +27,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msiiep.c,v 1.36 2008/06/04 12:41:41 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: msiiep.c,v 1.37 2009/05/16 17:42:35 martin Exp $);
 
 #include sys/param.h
 #include sys/malloc.h
@@ -657,10 +657,12 @@
 }
 
 static void
-mspcic_dmamap_unload(bus_dma_tag_t t, bus_dmamap_t dmam)
+mspcic_dmamap_unload(bus_dma_tag_t t, bus_dmamap_t map)
 {
 
-	panic(mspcic_dmamap_unload: not implemented);
+	/* Mark the mappings as invalid. */
+	map-dm_mapsize = 0;
+	map-dm_nsegs = 0;
 }
 
 



CVS commit: src/sys/compat/sunos32

2009-05-16 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sat May 16 17:45:23 UTC 2009

Modified Files:
src/sys/compat/sunos32: sunos32_misc.c

Log Message:
Follow pad to PAD change.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/compat/sunos32/sunos32_misc.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/compat/sunos32/sunos32_misc.c
diff -u src/sys/compat/sunos32/sunos32_misc.c:1.65 src/sys/compat/sunos32/sunos32_misc.c:1.66
--- src/sys/compat/sunos32/sunos32_misc.c:1.65	Sun Jan 11 13:14:14 2009
+++ src/sys/compat/sunos32/sunos32_misc.c	Sat May 16 17:45:23 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos32_misc.c,v 1.65 2009/01/11 13:14:14 nakayama Exp $	*/
+/*	$NetBSD: sunos32_misc.c,v 1.66 2009/05/16 17:45:23 nakayama Exp $	*/
 /* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp	*/
 
 /*
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sunos32_misc.c,v 1.65 2009/01/11 13:14:14 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: sunos32_misc.c,v 1.66 2009/05/16 17:45:23 nakayama Exp $);
 
 #define COMPAT_SUNOS 1
 
@@ -755,7 +755,7 @@
 	SUNOS32TO64_UAP(prot);
 	SCARG(ua, flags) = SCARG(uap, flags)  ~SUNOS32__MAP_NEW;
 	SUNOS32TO64_UAP(fd);
-	SCARG(ua, pad) = 0;
+	SCARG(ua, PAD) = 0;
 	SUNOS32TOX_UAP(pos, off_t);
 
 	error = sys_mmap(l, ua, retval);



CVS commit: src/share/tmac

2009-05-16 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sat May 16 18:12:05 UTC 2009

Modified Files:
src/share/tmac: doc2html

Log Message:
change description for libbluetooth to Bluetooth Library as it is
more than just host lookup these days


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/share/tmac/doc2html

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

Modified files:

Index: src/share/tmac/doc2html
diff -u src/share/tmac/doc2html:1.61 src/share/tmac/doc2html:1.62
--- src/share/tmac/doc2html:1.61	Tue May 12 18:07:54 2009
+++ src/share/tmac/doc2html	Sat May 16 18:12:04 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: doc2html,v 1.61 2009/05/12 18:07:54 plunky Exp $
+.\ $NetBSD: doc2html,v 1.62 2009/05/16 18:12:04 plunky Exp $
 .\
 .\ Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -573,7 +573,7 @@
 .if \\$1libarm32 \ARM32 Architecture Library (libarm32, -larm32)
 .if \\$1libi386 \i386 Architecture Library (libi386, -li386)
 .if \\$1libm68k \m68k Architecture Library (libm68k, -lm68k)
-.if \\$1libbluetooth \Bluetooth Hosts Library (libbluetooth, -lbluetooth)
+.if \\$1libbluetooth \Bluetooth Library (libbluetooth, -lbluetooth)
 .if \\$1libc \Standard C Library (libc, -lc)
 .if \\$1libcdk \Curses Development Kit Library (libcdk, -lcdk)
 .if \\$1libcompat \Compatibility Library (libcompat, -lcompat)



CVS commit: src/gnu/usr.bin/groff/tmac

2009-05-16 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sat May 16 18:13:08 UTC 2009

Modified Files:
src/gnu/usr.bin/groff/tmac: mdoc.local

Log Message:
change description of libbluetooth to Bluetooth Library as it contains
more than just host lookups

also, remove libsdp as that has been deprecated


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/gnu/usr.bin/groff/tmac/mdoc.local

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

Modified files:

Index: src/gnu/usr.bin/groff/tmac/mdoc.local
diff -u src/gnu/usr.bin/groff/tmac/mdoc.local:1.51 src/gnu/usr.bin/groff/tmac/mdoc.local:1.52
--- src/gnu/usr.bin/groff/tmac/mdoc.local:1.51	Thu May  7 00:37:30 2009
+++ src/gnu/usr.bin/groff/tmac/mdoc.local	Sat May 16 18:13:08 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: mdoc.local,v 1.51 2009/05/07 00:37:30 snj Exp $
+.\ $NetBSD: mdoc.local,v 1.52 2009/05/16 18:13:08 plunky Exp $
 .\
 .\ Copyright (c) 2003, 2004 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -71,14 +71,13 @@
 .ds doc-volume-as-iyonixiyonix
 .ds doc-volume-as-landisk   landisk
 .
-.\ Bluetooth libraries
+.\ Local libraries not in groff
 .ds doc-str-Lb-libarchive   Reading and Writing Streaming Archives Library (libarchive, \-larchive)
-.ds doc-str-Lb-libbluetooth Bluetooth Host Lookup Library (libbluetooth, \-lbluetooth)
+.ds doc-str-Lb-libbluetooth Bluetooth Library (libbluetooth, \-lbluetooth)
 .ds doc-str-Lb-libnetpgpNetpgp signing, verification, encryption and decryption (libnetpgp, \-lnetpgp)
 .ds doc-str-Lb-libopenpgpsdkOpenpgp signing, verification, encryption and decryption (libopenpgpsdk, \-lopenpgpsdk)
 .ds doc-str-Lb-libprop  Property Container Object Library (libprop, \-lprop)
 .ds doc-str-Lb-libpuffs puffs Convenience Library (libpuffs, \-lpuffs)
 .ds doc-str-Lb-librefuseFile System in Userspace Convenience Library (librefuse, \-lrefuse)
-.ds doc-str-Lb-libsdp   Bluetooth Service Discovery Protocol library (libsdp, \-libsdp)
 .ds doc-str-Lb-libssp   Buffer Overflow Protection Library (libssp, \-lssp)
 .ds doc-str-Lb-libfetch		File Transfer Library for URLs (libfetch, \-lfetch)



CVS commit: src/sys/dev/sbus

2009-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat May 16 18:24:44 UTC 2009

Modified Files:
src/sys/dev/sbus: dbri.c

Log Message:
we can not free() a dmamap!


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/sbus/dbri.c

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

Modified files:

Index: src/sys/dev/sbus/dbri.c
diff -u src/sys/dev/sbus/dbri.c:1.22 src/sys/dev/sbus/dbri.c:1.23
--- src/sys/dev/sbus/dbri.c:1.22	Tue May 12 13:20:05 2009
+++ src/sys/dev/sbus/dbri.c	Sat May 16 18:24:44 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbri.c,v 1.22 2009/05/12 13:20:05 cegger Exp $	*/
+/*	$NetBSD: dbri.c,v 1.23 2009/05/16 18:24:44 martin Exp $	*/
 
 /*
  * Copyright (C) 1997 Rudolf Koenig (rfkoe...@immd4.informatik.uni-erlangen.de)
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.22 2009/05/12 13:20:05 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.23 2009/05/16 18:24:44 martin Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -2102,7 +2102,19 @@
 static void
 dbri_free(void *v, void *p, struct malloc_type *mt)
 {
-	free(p, mt);
+	struct dbri_softc *sc = v;
+	struct dbri_desc *dd;
+	int i;
+
+	for (i = 0; i  sc-sc_desc_used; i++) {
+		dd = sc-sc_desc[i];
+		if (dd-buf == p)
+			break;
+	}
+	if (i = sc-sc_desc_used)
+		return;
+	bus_dmamap_unload(sc-sc_dmat, dd-dmamap);
+	bus_dmamap_destroy(sc-sc_dmat, dd-dmamap);
 }
 
 static paddr_t



CVS commit: src/sys/arch/sparc64

2009-05-16 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sat May 16 19:15:34 UTC 2009

Modified Files:
src/sys/arch/sparc64/include: cpu.h cpu_counter.h ctlreg.h psl.h
src/sys/arch/sparc64/sparc64: clock.c ipifuncs.c trap.c

Log Message:
- move definition of tick() from ctlreg.h to psl.h and rename to gettick()
  for consistency with other functions for reading/writing ASRs.
- move definition of tl() from trap.c to psl.h as same as above.
- define settick() in psl.h and use it in clock.c.
- cosmetic chages in psl.h.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/sparc64/include/cpu.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc64/include/cpu_counter.h
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/sparc64/include/ctlreg.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/sparc64/include/psl.h
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/sparc64/sparc64/clock.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sparc64/sparc64/ipifuncs.c
cvs rdiff -u -r1.156 -r1.157 src/sys/arch/sparc64/sparc64/trap.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/sparc64/include/cpu.h
diff -u src/sys/arch/sparc64/include/cpu.h:1.84 src/sys/arch/sparc64/include/cpu.h:1.85
--- src/sys/arch/sparc64/include/cpu.h:1.84	Sun Oct  5 01:53:05 2008
+++ src/sys/arch/sparc64/include/cpu.h	Sat May 16 19:15:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.84 2008/10/05 01:53:05 nakayama Exp $ */
+/*	$NetBSD: cpu.h,v 1.85 2009/05/16 19:15:34 nakayama Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -343,6 +343,7 @@
 void	snapshot(struct pcb *);
 struct frame *getfp(void);
 void	switchtoctx(int);
+void	next_tick(long);
 /* trap.c */
 void	kill_user_windows(struct lwp *);
 int	rwindow_save(struct lwp *);

Index: src/sys/arch/sparc64/include/cpu_counter.h
diff -u src/sys/arch/sparc64/include/cpu_counter.h:1.7 src/sys/arch/sparc64/include/cpu_counter.h:1.8
--- src/sys/arch/sparc64/include/cpu_counter.h:1.7	Mon Apr 28 20:23:37 2008
+++ src/sys/arch/sparc64/include/cpu_counter.h	Sat May 16 19:15:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_counter.h,v 1.7 2008/04/28 20:23:37 martin Exp $	*/
+/*	$NetBSD: cpu_counter.h,v 1.8 2009/05/16 19:15:34 nakayama Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -39,7 +39,6 @@
 #ifdef _KERNEL
 
 #include machine/cpu.h
-#include machine/ctlreg.h
 
 #define	cpu_hascounter()	(1)
 
@@ -47,14 +46,14 @@
 cpu_counter(void)
 {
 
-	return (tick());
+	return (gettick());
 }
 
 static __inline uint32_t
 cpu_counter32(void)
 {
 
-	return (tick()  0xUL);
+	return (gettick()  0xUL);
 }
 
 static __inline uint64_t

Index: src/sys/arch/sparc64/include/ctlreg.h
diff -u src/sys/arch/sparc64/include/ctlreg.h:1.44 src/sys/arch/sparc64/include/ctlreg.h:1.45
--- src/sys/arch/sparc64/include/ctlreg.h:1.44	Sat Mar 31 13:04:21 2007
+++ src/sys/arch/sparc64/include/ctlreg.h	Sat May 16 19:15:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctlreg.h,v 1.44 2007/03/31 13:04:21 hannken Exp $ */
+/*	$NetBSD: ctlreg.h,v 1.45 2009/05/16 19:15:34 nakayama Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -1159,24 +1159,6 @@
 #define membar_load() __asm volatile(membar #LoadLoad | #LoadStore : :)
 #define membar_store() __asm volatile(membar #LoadStore | #StoreStore : :)
 
-#ifdef __arch64__
-/* read 64-bit %tick register */
-#define	tick() ({ \
-	register u_long _tick_tmp; \
-	__asm volatile(rdpr %%tick, %0 : =r (_tick_tmp) :); \
-	_tick_tmp; \
-})
-#else
-/* read 64-bit %tick register on 32-bit system */
-#define	tick() ({ \
-	register u_int _tick_hi = 0, _tick_lo = 0; \
-	__asm volatile(rdpr %%tick, %0; srl %0,0,%1; srlx %0,32,%0  \
-		: =r (_tick_hi), =r (_tick_lo) : ); \
-	(((uint64_t)_tick_hi)32)|((uint64_t)_tick_lo); \
-})
-#endif
-
-extern void next_tick(long);
 #endif
 
 #endif /* _SPARC_CTLREG_H_ */

Index: src/sys/arch/sparc64/include/psl.h
diff -u src/sys/arch/sparc64/include/psl.h:1.40 src/sys/arch/sparc64/include/psl.h:1.41
--- src/sys/arch/sparc64/include/psl.h:1.40	Sun Mar  2 15:07:02 2008
+++ src/sys/arch/sparc64/include/psl.h	Sat May 16 19:15:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.40 2008/03/02 15:07:02 nakayama Exp $ */
+/*	$NetBSD: psl.h,v 1.41 2009/05/16 19:15:34 nakayama Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -251,13 +251,44 @@
 /*
  * Inlines for manipulating privileged registers
  */
+static __inline uint64_t
+gettick(void)
+{
+#ifdef __arch64__
+	uint64_t tick;
+
+	__asm volatile(rdpr %%tick, %0 : =r (tick));
+	return tick;
+#else
+	uint32_t tick_hi, tick_lo;
+
+	__asm volatile(rdpr %%tick, %0; srl %0,0,%1; srlx %0,32,%0
+		: =r (tick_hi), =r (tick_lo));
+	return ((uint64_t)tick_hi  32) | tick_lo;
+#endif
+}
+
+static __inline void
+settick(uint64_t newtick)
+{
+#ifdef __arch64__
+	__asm volatile(wrpr %0, 0, %%tick : : r (newtick) : memory);
+#else
+	uint32_t tick_hi = newtick  32, tick_lo = newtick;
+
+	__asm volatile(sllx %1,32,%0; or %0,%2,%0; wrpr 

CVS commit: src/sys/dev/scsipi

2009-05-16 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sat May 16 20:10:52 UTC 2009

Modified Files:
src/sys/dev/scsipi: sd.c

Log Message:
Do not detach a sd(4) instance if it is open, but return EBUSY,
instead.  If the detach is forced, do what sdclose() does on the
last close: flush the cache, delete our reference to the SCSI bus
device, et cetera.


To generate a diff of this commit:
cvs rdiff -u -r1.281 -r1.282 src/sys/dev/scsipi/sd.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/scsipi/sd.c
diff -u src/sys/dev/scsipi/sd.c:1.281 src/sys/dev/scsipi/sd.c:1.282
--- src/sys/dev/scsipi/sd.c:1.281	Tue May 12 14:44:31 2009
+++ src/sys/dev/scsipi/sd.c	Sat May 16 20:10:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.281 2009/05/12 14:44:31 cegger Exp $	*/
+/*	$NetBSD: sd.c,v 1.282 2009/05/16 20:10:52 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sd.c,v 1.281 2009/05/12 14:44:31 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: sd.c,v 1.282 2009/05/16 20:10:52 dyoung Exp $);
 
 #include opt_scsi.h
 #include rnd.h
@@ -103,6 +103,7 @@
 static bool	sd_suspend(device_t PMF_FN_PROTO);
 static bool	sd_shutdown(device_t, int);
 static int	sd_interpret_sense(struct scsipi_xfer *);
+static void	sdlastclose(struct sd_softc *);
 
 static int	sd_mode_sense(struct sd_softc *, u_int8_t, void *, size_t, int,
 		int, int *);
@@ -349,7 +350,20 @@
 sddetach(device_t self, int flags)
 {
 	struct sd_softc *sd = device_private(self);
-	int s, bmaj, cmaj, i, mn;
+	int s, bmaj, cmaj, i, mn, rc;
+
+	rc = 0;
+	mutex_enter(sd-sc_dk.dk_openlock);
+	if (sd-sc_dk.dk_openmask == 0)
+		;	/* nothing to do */
+	else if ((flags  DETACH_FORCE) != 0)
+		rc = EBUSY;
+	else
+		sdlastclose(sd);
+	mutex_exit(sd-sc_dk.dk_openlock);
+
+	if (rc != 0)
+		return rc;
 
 	/* locate the major number */
 	bmaj = bdevsw_lookup_major(sd_bdevsw);
@@ -582,6 +596,42 @@
 }
 
 /*
+ * Caller must hold sd-sc_dk.dk_openlock.
+ */
+static void
+sdlastclose(struct sd_softc *sd)
+{
+	struct scsipi_periph *periph = sd-sc_periph;
+	struct scsipi_adapter *adapt = periph-periph_channel-chan_adapter;
+
+	/*
+	 * If the disk cache needs flushing, and the disk supports
+	 * it, do it now.
+	 */
+	if ((sd-flags  SDF_DIRTY) != 0) {
+		if (sd_flush(sd, 0)) {
+			aprint_error_dev(sd-sc_dev,
+cache synchronization failed\n);
+			sd-flags = ~SDF_FLUSHING;
+		} else
+			sd-flags = ~(SDF_FLUSHING|SDF_DIRTY);
+	}
+
+	scsipi_wait_drain(periph);
+
+	if (periph-periph_flags  PERIPH_REMOVABLE)
+		scsipi_prevent(periph, SPAMR_ALLOW,
+		XS_CTL_IGNORE_ILLEGAL_REQUEST |
+		XS_CTL_IGNORE_NOT_READY |
+		XS_CTL_SILENT);
+	periph-periph_flags = ~PERIPH_OPEN;
+
+	scsipi_wait_drain(periph);
+
+	scsipi_adapter_delref(adapt);
+}
+
+/*
  * close the device.. only called if we are the LAST occurence of an open
  * device.  Convenient now but usually a pain.
  */
@@ -589,8 +639,6 @@
 sdclose(dev_t dev, int flag, int fmt, struct lwp *l)
 {
 	struct sd_softc *sd = device_lookup_private(sd_cd, SDUNIT(dev));
-	struct scsipi_periph *periph = sd-sc_periph;
-	struct scsipi_adapter *adapt = periph-periph_channel-chan_adapter;
 	int part = SDPART(dev);
 
 	mutex_enter(sd-sc_dk.dk_openlock);
@@ -605,33 +653,8 @@
 	sd-sc_dk.dk_openmask =
 	sd-sc_dk.dk_copenmask | sd-sc_dk.dk_bopenmask;
 
-	if (sd-sc_dk.dk_openmask == 0) {
-		/*
-		 * If the disk cache needs flushing, and the disk supports
-		 * it, do it now.
-		 */
-		if ((sd-flags  SDF_DIRTY) != 0) {
-			if (sd_flush(sd, 0)) {
-aprint_error_dev(sd-sc_dev,
-	cache synchronization failed\n);
-sd-flags = ~SDF_FLUSHING;
-			} else
-sd-flags = ~(SDF_FLUSHING|SDF_DIRTY);
-		}
-
-		scsipi_wait_drain(periph);
-
-		if (periph-periph_flags  PERIPH_REMOVABLE)
-			scsipi_prevent(periph, SPAMR_ALLOW,
-			XS_CTL_IGNORE_ILLEGAL_REQUEST |
-			XS_CTL_IGNORE_NOT_READY |
-			XS_CTL_SILENT);
-		periph-periph_flags = ~PERIPH_OPEN;
-
-		scsipi_wait_drain(periph);
-
-		scsipi_adapter_delref(adapt);
-	}
+	if (sd-sc_dk.dk_openmask == 0)
+		sdlastclose(sd);
 
 	mutex_exit(sd-sc_dk.dk_openlock);
 	return (0);



CVS commit: src/lib/libpthread/arch

2009-05-16 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat May 16 22:20:42 UTC 2009

Modified Files:
src/lib/libpthread/arch/alpha: pthread_md.h
src/lib/libpthread/arch/arm: pthread_md.h
src/lib/libpthread/arch/hppa: pthread_md.h
src/lib/libpthread/arch/i386: pthread_md.h
src/lib/libpthread/arch/m68k: pthread_md.h
src/lib/libpthread/arch/mips: pthread_md.h
src/lib/libpthread/arch/powerpc: pthread_md.h
src/lib/libpthread/arch/powerpc64: pthread_md.h
src/lib/libpthread/arch/sh3: pthread_md.h
src/lib/libpthread/arch/sparc: pthread_md.h
src/lib/libpthread/arch/sparc64: pthread_md.h
src/lib/libpthread/arch/vax: pthread_md.h
Added Files:
src/lib/libpthread/arch/hppa: pthread_md.S
Removed Files:
src/lib/libpthread/arch/alpha: _context_u.S genassym.cf
src/lib/libpthread/arch/arm: _context_u.S genassym.cf
src/lib/libpthread/arch/hppa: _context_u.S genassym.cf
src/lib/libpthread/arch/i386: _context_u.S _getsetc.S genassym.cf
pthread_md.c
src/lib/libpthread/arch/m68k: _context_u.S genassym.cf
src/lib/libpthread/arch/mips: SYS.h _context_u.S genassym.cf
src/lib/libpthread/arch/powerpc: _context_u.S genassym.cf
src/lib/libpthread/arch/powerpc64: _context_u.S genassym.cf
src/lib/libpthread/arch/sh3: _context_u.S genassym.cf
src/lib/libpthread/arch/sparc: _context_u.S genassym.cf
src/lib/libpthread/arch/sparc64: _context_u.S genassym.cf
src/lib/libpthread/arch/vax: _context_u.S genassym.cf

Log Message:
Remove unused code that's confusing when using cscope/opengrok.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/lib/libpthread/arch/alpha/_context_u.S
cvs rdiff -u -r1.7 -r0 src/lib/libpthread/arch/alpha/genassym.cf
cvs rdiff -u -r1.5 -r1.6 src/lib/libpthread/arch/alpha/pthread_md.h
cvs rdiff -u -r1.4 -r0 src/lib/libpthread/arch/arm/_context_u.S
cvs rdiff -u -r1.7 -r0 src/lib/libpthread/arch/arm/genassym.cf
cvs rdiff -u -r1.4 -r1.5 src/lib/libpthread/arch/arm/pthread_md.h
cvs rdiff -u -r1.4 -r0 src/lib/libpthread/arch/hppa/_context_u.S
cvs rdiff -u -r1.3 -r0 src/lib/libpthread/arch/hppa/genassym.cf
cvs rdiff -u -r0 -r1.1 src/lib/libpthread/arch/hppa/pthread_md.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libpthread/arch/hppa/pthread_md.h
cvs rdiff -u -r1.9 -r0 src/lib/libpthread/arch/i386/_context_u.S
cvs rdiff -u -r1.8 -r0 src/lib/libpthread/arch/i386/_getsetc.S
cvs rdiff -u -r1.7 -r0 src/lib/libpthread/arch/i386/genassym.cf
cvs rdiff -u -r1.6 -r0 src/lib/libpthread/arch/i386/pthread_md.c
cvs rdiff -u -r1.16 -r1.17 src/lib/libpthread/arch/i386/pthread_md.h
cvs rdiff -u -r1.5 -r0 src/lib/libpthread/arch/m68k/_context_u.S
cvs rdiff -u -r1.7 -r0 src/lib/libpthread/arch/m68k/genassym.cf
cvs rdiff -u -r1.6 -r1.7 src/lib/libpthread/arch/m68k/pthread_md.h
cvs rdiff -u -r1.3 -r0 src/lib/libpthread/arch/mips/SYS.h \
src/lib/libpthread/arch/mips/_context_u.S
cvs rdiff -u -r1.7 -r0 src/lib/libpthread/arch/mips/genassym.cf
cvs rdiff -u -r1.7 -r1.8 src/lib/libpthread/arch/mips/pthread_md.h
cvs rdiff -u -r1.5 -r0 src/lib/libpthread/arch/powerpc/_context_u.S
cvs rdiff -u -r1.7 -r0 src/lib/libpthread/arch/powerpc/genassym.cf
cvs rdiff -u -r1.5 -r1.6 src/lib/libpthread/arch/powerpc/pthread_md.h
cvs rdiff -u -r1.1 -r0 src/lib/libpthread/arch/powerpc64/_context_u.S
cvs rdiff -u -r1.2 -r0 src/lib/libpthread/arch/powerpc64/genassym.cf
cvs rdiff -u -r1.1 -r1.2 src/lib/libpthread/arch/powerpc64/pthread_md.h
cvs rdiff -u -r1.6 -r0 src/lib/libpthread/arch/sh3/_context_u.S
cvs rdiff -u -r1.8 -r0 src/lib/libpthread/arch/sh3/genassym.cf
cvs rdiff -u -r1.6 -r1.7 src/lib/libpthread/arch/sh3/pthread_md.h
cvs rdiff -u -r1.3 -r0 src/lib/libpthread/arch/sparc/_context_u.S
cvs rdiff -u -r1.8 -r0 src/lib/libpthread/arch/sparc/genassym.cf
cvs rdiff -u -r1.6 -r1.7 src/lib/libpthread/arch/sparc/pthread_md.h
cvs rdiff -u -r1.3 -r0 src/lib/libpthread/arch/sparc64/_context_u.S
cvs rdiff -u -r1.8 -r0 src/lib/libpthread/arch/sparc64/genassym.cf
cvs rdiff -u -r1.5 -r1.6 src/lib/libpthread/arch/sparc64/pthread_md.h
cvs rdiff -u -r1.4 -r0 src/lib/libpthread/arch/vax/_context_u.S
cvs rdiff -u -r1.8 -r0 src/lib/libpthread/arch/vax/genassym.cf
cvs rdiff -u -r1.6 -r1.7 src/lib/libpthread/arch/vax/pthread_md.h

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

Modified files:

Index: src/lib/libpthread/arch/alpha/pthread_md.h
diff -u src/lib/libpthread/arch/alpha/pthread_md.h:1.5 src/lib/libpthread/arch/alpha/pthread_md.h:1.6
--- src/lib/libpthread/arch/alpha/pthread_md.h:1.5	Mon Apr 28 20:23:02 2008
+++ src/lib/libpthread/arch/alpha/pthread_md.h	Sat May 16 22:20:40 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_md.h,v 1.5 2008/04/28 20:23:02 martin Exp $	*/
+/*	$NetBSD: pthread_md.h,v 1.6 2009/05/16 22:20:40 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -45,7 +45,6 @@
 

CVS commit: src/lib/libpthread

2009-05-16 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat May 16 22:21:18 UTC 2009

Modified Files:
src/lib/libpthread: Makefile pthread_int.h

Log Message:
Remove unused code that's confusing when using cscope/opengrok.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/lib/libpthread/Makefile
cvs rdiff -u -r1.70 -r1.71 src/lib/libpthread/pthread_int.h

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

Modified files:

Index: src/lib/libpthread/Makefile
diff -u src/lib/libpthread/Makefile:1.55 src/lib/libpthread/Makefile:1.56
--- src/lib/libpthread/Makefile:1.55	Sun Oct 26 00:00:27 2008
+++ src/lib/libpthread/Makefile	Sat May 16 22:21:18 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.55 2008/10/26 00:00:27 mrg Exp $
+#	$NetBSD: Makefile,v 1.56 2009/05/16 22:21:18 ad Exp $
 #
 
 WARNS=	4
@@ -29,19 +29,8 @@
 CPPFLAGS+=	-D__LIBPTHREAD_SOURCE__
 
 # XXX: This crappy poke at libc's internals needs to be fixed.
-# We need to put this *after our own includes, so that our assym.h
-# gets picked, instead of the libc one
 CPPFLAGS+=-I${NETBSDSRCDIR}/sys -I${.CURDIR}/../libc
 
-DPSRCS+=	assym.h
-CLEANFILES+=	assym.h
-
-assym.h: ${ARCHDIR}/genassym.cf pthread.h pthread_int.h pthread_md.h
-	${_MKTARGET_CREATE}
-	${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
-		 ${ARCHDIR}/genassym.cf  assym.h.tmp  \
-	mv -f assym.h.tmp assym.h
-
 LIB=	pthread
 
 #
@@ -64,9 +53,8 @@
 SRCS+=	res_state.c
 SRCS+=	sem.c
 # Architecture-dependent files
-SRCS+=	_context_u.S
-.if exists(${ARCHDIR}/pthread_md.c)
-SRCS+= pthread_md.c
+.if exists(${ARCHDIR}/pthread_md.S)
+SRCS+= pthread_md.S
 .endif
 
 .if defined(PTHREAD__COMPAT)
@@ -99,10 +87,6 @@
 
 COPTS.pthread.c += -Wno-stack-protector
 
-_context_u.po: _context_u.o
-	${_MKTARGET_CREATE}
-	cp _context_u.o _context_u.po
-
 MAN+=	affinity.3 pthread.3 \
 	pthread_attr.3 \
 	pthread_attr_getname_np.3 \
@@ -162,8 +146,6 @@
 MLINKS+=	pthread_testcancel.3 pthread_setcancelstate.3
 MLINKS+=	pthread_testcancel.3 pthread_setcanceltype.3
 
-pthread_switch.S _context_u.S: assym.h
-
 .include bsd.lib.mk
 
 .else

Index: src/lib/libpthread/pthread_int.h
diff -u src/lib/libpthread/pthread_int.h:1.70 src/lib/libpthread/pthread_int.h:1.71
--- src/lib/libpthread/pthread_int.h:1.70	Sat Jun 28 10:29:37 2008
+++ src/lib/libpthread/pthread_int.h	Sat May 16 22:21:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_int.h,v 1.70 2008/06/28 10:29:37 ad Exp $	*/
+/*	$NetBSD: pthread_int.h,v 1.71 2009/05/16 22:21:18 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -231,16 +231,6 @@
 #define	pthread__simple_lock_try(alp)	(*pthread__lock_ops-plo_try)(alp)
 #define	pthread__simple_unlock(alp)	(*pthread__lock_ops-plo_unlock)(alp)
 
-#ifndef _getcontext_u
-int	_getcontext_u(ucontext_t *) PTHREAD_HIDE;
-#endif
-#ifndef _setcontext_u
-int	_setcontext_u(const ucontext_t *) PTHREAD_HIDE;
-#endif
-#ifndef _swapcontext_u
-int	_swapcontext_u(ucontext_t *, const ucontext_t *) PTHREAD_HIDE;
-#endif
-
 void	pthread__testcancel(pthread_t) PTHREAD_HIDE;
 int	pthread__find(pthread_t) PTHREAD_HIDE;
 



CVS commit: src/lib/libpthread/arch/x86_64

2009-05-16 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat May 16 22:23:45 UTC 2009

Modified Files:
src/lib/libpthread/arch/x86_64: pthread_md.h
Removed Files:
src/lib/libpthread/arch/x86_64: _context_u.S genassym.cf

Log Message:
Remove unused code that's confusing when using cscope/opengrok.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r0 src/lib/libpthread/arch/x86_64/_context_u.S
cvs rdiff -u -r1.6 -r0 src/lib/libpthread/arch/x86_64/genassym.cf
cvs rdiff -u -r1.10 -r1.11 src/lib/libpthread/arch/x86_64/pthread_md.h

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

Modified files:

Index: src/lib/libpthread/arch/x86_64/pthread_md.h
diff -u src/lib/libpthread/arch/x86_64/pthread_md.h:1.10 src/lib/libpthread/arch/x86_64/pthread_md.h:1.11
--- src/lib/libpthread/arch/x86_64/pthread_md.h:1.10	Mon Apr 28 20:23:02 2008
+++ src/lib/libpthread/arch/x86_64/pthread_md.h	Sat May 16 22:23:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_md.h,v 1.10 2008/04/28 20:23:02 martin Exp $	*/
+/*	$NetBSD: pthread_md.h,v 1.11 2009/05/16 22:23:45 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -46,7 +46,6 @@
 }
 
 #define pthread__uc_sp(ucp) ((ucp)-uc_mcontext.__gregs[_REG_URSP])
-#define pthread__uc_pc(ucp) ((ucp)-uc_mcontext.__gregs[_REG_RIP])
 
 /*
  * Set initial, sane values for registers whose values aren't just
@@ -64,38 +63,6 @@
 	(ucp)-uc_mcontext.__gregs[_REG_SS] = 0x23,			\
 	(ucp)-uc_mcontext.__gregs[_REG_RFL] = 0x202;
 
-/*
- * Usable stack space below the ucontext_t. 
- * See comment in pthread_switch.S about STACK_SWITCH.
- */
-#define STACKSPACE	64	/* room for 8 long values */
-
-/*
- * Conversions between struct reg and struct mcontext. Used by
- * libpthread_dbg.
- */
-
-#define PTHREAD_UCONTEXT_TO_REG(reg, uc) \
-	memcpy(reg, (uc)-uc_mcontext.__gregs, _NGREG * sizeof (long));
-
-#define PTHREAD_REG_TO_UCONTEXT(uc, reg) do {\
-	memcpy((uc)-uc_mcontext.__gregs, reg, _NGREG * sizeof (long)); \
-	(uc)-uc_flags = ((uc)-uc_flags | _UC_CPU)  ~_UC_USER; 	\
-	} while (/*CONSTCOND*/0)
-
-
-#define PTHREAD_UCONTEXT_TO_FPREG(freg, uc)		   		\
-	(void)memcpy((freg)-fxstate,	\
-(uc)-uc_mcontext.__fpregs, sizeof(struct fpreg))
-
-#define PTHREAD_FPREG_TO_UCONTEXT(uc, freg) do {   	   		\
-	(void)memcpy(			\
-(uc)-uc_mcontext.__fpregs,	\
-	(freg)-fxstate, sizeof(struct fpreg));			\
-	/*LINTED precision loss */	\
-	(uc)-uc_flags = ((uc)-uc_flags | _UC_FPU)  ~_UC_USER;	\
-	} while (/*CONSTCOND*/0)
-
 #define	pthread__smt_pause()	__asm __volatile(rep; nop ::: memory)
 
 /* Don't need additional memory barriers. */



CVS commit: src/sys/arch/x86/x86

2009-05-16 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat May 16 23:48:00 UTC 2009

Modified Files:
src/sys/arch/x86/x86: ioapic.c

Log Message:
Fix suspend/resume problem with some configurations. From droch...@.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/x86/x86/ioapic.c

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

Modified files:

Index: src/sys/arch/x86/x86/ioapic.c
diff -u src/sys/arch/x86/x86/ioapic.c:1.42 src/sys/arch/x86/x86/ioapic.c:1.43
--- src/sys/arch/x86/x86/ioapic.c:1.42	Fri May  1 09:38:24 2009
+++ src/sys/arch/x86/x86/ioapic.c	Sat May 16 23:48:00 2009
@@ -1,4 +1,4 @@
-/* 	$NetBSD: ioapic.c,v 1.42 2009/05/01 09:38:24 cegger Exp $	*/
+/* 	$NetBSD: ioapic.c,v 1.43 2009/05/16 23:48:00 ad Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ioapic.c,v 1.42 2009/05/01 09:38:24 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ioapic.c,v 1.43 2009/05/16 23:48:00 ad Exp $);
 
 #include opt_ddb.h
 
@@ -409,14 +409,15 @@
 	pp = sc-sc_pins[pin];
 	map = pp-ip_map;
 	redlo = map == NULL ? IOAPIC_REDLO_MASK : map-redir;
+	redhi = 0;
 	delmode = (redlo  IOAPIC_REDLO_DEL_MASK)  IOAPIC_REDLO_DEL_SHIFT;
-	redhi = (ci-ci_cpuid  IOAPIC_REDHI_DEST_SHIFT);
 
 	if (delmode == IOAPIC_REDLO_DEL_FIXED ||
 	delmode == IOAPIC_REDLO_DEL_LOPRI) {
 		if (pp-ip_type == IST_NONE) {
 			redlo |= IOAPIC_REDLO_MASK;
 		} else {
+			redhi = (ci-ci_cpuid  IOAPIC_REDHI_DEST_SHIFT);
 			redlo |= (idt_vec  0xff);
 			redlo |= (IOAPIC_REDLO_DEL_FIXEDIOAPIC_REDLO_DEL_SHIFT);
 			redlo = ~IOAPIC_REDLO_DSTMOD;



CVS commit: src/sys/kern

2009-05-16 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat May 16 23:58:09 UTC 2009

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

Log Message:
sys_mq_open: remove broken access flag check.
Noted by Stathis Kamperis.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/kern/sys_mqueue.c

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

Modified files:

Index: src/sys/kern/sys_mqueue.c
diff -u src/sys/kern/sys_mqueue.c:1.16 src/sys/kern/sys_mqueue.c:1.17
--- src/sys/kern/sys_mqueue.c:1.16	Sat Apr 11 23:05:26 2009
+++ src/sys/kern/sys_mqueue.c	Sat May 16 23:58:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_mqueue.c,v 1.16 2009/04/11 23:05:26 christos Exp $	*/
+/*	$NetBSD: sys_mqueue.c,v 1.17 2009/05/16 23:58:09 rmind Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Mindaugas Rasiukevicius rmind at NetBSD org
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sys_mqueue.c,v 1.16 2009/04/11 23:05:26 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: sys_mqueue.c,v 1.17 2009/05/16 23:58:09 rmind Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -344,10 +344,7 @@
 	char *name;
 	int mqd, error, oflag;
 
-	/* Check access mode flags */
 	oflag = SCARG(uap, oflag);
-	if ((oflag  O_ACCMODE) == 0)
-		return EINVAL;
 
 	/* Get the name from the user-space */
 	name = kmem_zalloc(MQ_NAMELEN, KM_SLEEP);



CVS commit: src/sys/dev

2009-05-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun May 17 00:40:44 UTC 2009

Modified Files:
src/sys/dev/ic: hme.c hmevar.h
src/sys/dev/pci: if_hme_pci.c
src/sys/dev/sbus: if_hme_sbus.c

Log Message:
Split device_t/softc.
Tested PCI HME on i386.  Sbus HME is compile test only.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/ic/hme.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/ic/hmevar.h
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/if_hme_pci.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/sbus/if_hme_sbus.c

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

Modified files:

Index: src/sys/dev/ic/hme.c
diff -u src/sys/dev/ic/hme.c:1.78 src/sys/dev/ic/hme.c:1.79
--- src/sys/dev/ic/hme.c:1.78	Tue May 12 14:25:17 2009
+++ src/sys/dev/ic/hme.c	Sun May 17 00:40:43 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hme.c,v 1.78 2009/05/12 14:25:17 cegger Exp $	*/
+/*	$NetBSD: hme.c,v 1.79 2009/05/17 00:40:43 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hme.c,v 1.78 2009/05/12 14:25:17 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: hme.c,v 1.79 2009/05/17 00:40:43 tsutsui Exp $);
 
 /* #define HMEDEBUG */
 
@@ -196,7 +196,7 @@
 	if ((error = bus_dmamem_alloc(dmatag, size,
   2048, 0,
   seg, 1, rseg, BUS_DMA_NOWAIT)) != 0) {
-		aprint_error_dev(sc-sc_dev, DMA buffer alloc error %d\n,
+		aprint_error_dev(sc-sc_dev, DMA buffer alloc error %d\n,
 			error);
 		return;
 	}
@@ -205,7 +205,7 @@
 	if ((error = bus_dmamem_map(dmatag, seg, rseg, size,
 sc-sc_rb.rb_membase,
 BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
-		aprint_error_dev(sc-sc_dev, DMA buffer map error %d\n,
+		aprint_error_dev(sc-sc_dev, DMA buffer map error %d\n,
 			error);
 		bus_dmamap_unload(dmatag, sc-sc_dmamap);
 		bus_dmamem_free(dmatag, seg, rseg);
@@ -214,7 +214,7 @@
 
 	if ((error = bus_dmamap_create(dmatag, size, 1, size, 0,
 BUS_DMA_NOWAIT, sc-sc_dmamap)) != 0) {
-		aprint_error_dev(sc-sc_dev, DMA map create error %d\n,
+		aprint_error_dev(sc-sc_dev, DMA map create error %d\n,
 			error);
 		return;
 	}
@@ -223,18 +223,18 @@
 	if ((error = bus_dmamap_load(dmatag, sc-sc_dmamap,
 	sc-sc_rb.rb_membase, size, NULL,
 	BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
-		aprint_error_dev(sc-sc_dev, DMA buffer map load error %d\n,
+		aprint_error_dev(sc-sc_dev, DMA buffer map load error %d\n,
 			error);
 		bus_dmamem_free(dmatag, seg, rseg);
 		return;
 	}
 	sc-sc_rb.rb_dmabase = sc-sc_dmamap-dm_segs[0].ds_addr;
 
-	printf(%s: Ethernet address %s\n, device_xname(sc-sc_dev),
+	aprint_normal_dev(sc-sc_dev, Ethernet address %s\n,
 	ether_sprintf(sc-sc_enaddr));
 
 	/* Initialize ifnet structure. */
-	strlcpy(ifp-if_xname, device_xname(sc-sc_dev), IFNAMSIZ);
+	strlcpy(ifp-if_xname, device_xname(sc-sc_dev), IFNAMSIZ);
 	ifp-if_softc = sc;
 	ifp-if_start = hme_start;
 	ifp-if_ioctl = hme_ioctl;
@@ -263,9 +263,9 @@
 	 * the RJ45 (internal) PHY first, so that the MII PHY is always
 	 * instance 1.
 	 */
-	mii_attach(sc-sc_dev, mii, 0x,
+	mii_attach(sc-sc_dev, mii, 0x,
 			HME_PHYAD_INTERNAL, MII_OFFSET_ANY, MIIF_FORCEANEG);
-	mii_attach(sc-sc_dev, mii, 0x,
+	mii_attach(sc-sc_dev, mii, 0x,
 			HME_PHYAD_EXTERNAL, MII_OFFSET_ANY, MIIF_FORCEANEG);
 
 	child = LIST_FIRST(mii-mii_phys);
@@ -288,7 +288,8 @@
 			 * connector.
 			 */
 			if (child-mii_phy  1 || child-mii_inst  1) {
-aprint_error_dev(sc-sc_dev, cannot accommodate MII device %s
+aprint_error_dev(sc-sc_dev,
+cannot accommodate MII device %s
 at phy %d, instance %d\n,
    device_xname(child-mii_dev),
    child-mii_phy, child-mii_inst);
@@ -323,7 +324,7 @@
 		panic(hme_config: can't establish shutdownhook);
 
 #if NRND  0
-	rnd_attach_source(sc-rnd_source, device_xname(sc-sc_dev),
+	rnd_attach_source(sc-rnd_source, device_xname(sc-sc_dev),
 			  RND_TYPE_NET, 0);
 #endif
 
@@ -379,7 +380,7 @@
 		DELAY(20);
 	}
 
-	printf(%s: hme_stop: reset failed\n, device_xname(sc-sc_dev));
+	printf(%s: hme_stop: reset failed\n, device_xname(sc-sc_dev));
 }
 
 void
@@ -862,7 +863,7 @@
 	ETHERMTU + sizeof(struct ether_header))) {
 #ifdef HMEDEBUG
 		printf(%s: invalid packet size %d; dropping\n,
-		device_xname(sc-sc_dev), len);
+		device_xname(sc-sc_dev), len);
 #endif
 		ifp-if_ierrors++;
 		return;
@@ -893,7 +894,7 @@
 void
 hme_start(struct ifnet *ifp)
 {
-	struct hme_softc *sc = (struct hme_softc *)ifp-if_softc;
+	struct hme_softc *sc = ifp-if_softc;
 	void *txd = sc-sc_rb.rb_txd;
 	struct mbuf *m;
 	unsigned int txflags;
@@ -1064,7 +1065,7 @@
 
 		if (flags  HME_XD_OFL) {
 			printf(%s: buffer overflow, ri=%d; flags=0x%x\n,
-	device_xname(sc-sc_dev), ri, flags);
+	device_xname(sc-sc_dev), ri, flags);
 		} else
 			hme_read(sc, ri, flags);
 
@@ -1107,7 +1108,7 @@
 		st = 

CVS commit: src/share/man/man4

2009-05-16 Thread Erik E. Fair
Module Name:src
Committed By:   fair
Date:   Sun May 17 00:53:36 UTC 2009

Modified Files:
src/share/man/man4: ahd.4

Log Message:
Eliminate several groff warnings seen during build.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/ahd.4

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

Modified files:

Index: src/share/man/man4/ahd.4
diff -u src/share/man/man4/ahd.4:1.3 src/share/man/man4/ahd.4:1.4
--- src/share/man/man4/ahd.4:1.3	Fri Apr 10 15:05:06 2009
+++ src/share/man/man4/ahd.4	Sun May 17 00:53:36 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: ahd.4,v 1.3 2009/04/10 15:05:06 joerg Exp $
+.\	$NetBSD: ahd.4,v 1.4 2009/05/17 00:53:36 fair Exp $
 .\
 .\ Copyright (c) 1995, 1996, 1997, 1998, 2000
 .\ 	Justin T. Gibbs.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ $FreeBSD: /repoman/r/ncvs/src/share/man/man4/ahd.4,v 1.5 2004/07/04 14:17:41 simon Exp $
 .\
-.Dd July 4, 2004
+.Dd May 16, 2009
 .Dt AHD 4
 .Os
 .Sh NAME
@@ -82,22 +82,22 @@
 .Dv AHD_DEBUG
 is enabled.
 Logically OR the following bits together:
-.Bl -column Value Function -offset indent
-.It Em Value	Function
-.It 0x0001	Show miscellaneous information
-.It 0x0002	Show sense data
-.It 0x0004	Show Serial EEPROM contents
-.It 0x0008	Show bus termination settings
-.It 0x0010	Show host memory usage
-.It 0x0020	Show SCSI protocol messages
-.It 0x0040	Show mode pointer of the chip register window
-.It 0x0080	Show selection timeouts
-.It 0x0100	Show FIFO usage messages
-.It 0x0200	Show Queue Full status
-.It 0x0400	Show SCB queue status
-.It 0x0800	Show inbound packet information
-.It 0x1000	Show S/G list information
-.It 0x2000	Enable extra diagnostic code in the firmware
+.Bl -column -offset indent '0x0001' 'Function'
+.It Em Value Ta Em Function
+.It 0x0001 Ta Show miscellaneous information
+.It 0x0002 Ta Show sense data
+.It 0x0004 Ta Show Serial EEPROM contents
+.It 0x0008 Ta Show bus termination settings
+.It 0x0010 Ta Show host memory usage
+.It 0x0020 Ta Show SCSI protocol messages
+.It 0x0040 Ta Show mode pointer of the chip register window
+.It 0x0080 Ta Show selection timeouts
+.It 0x0100 Ta Show FIFO usage messages
+.It 0x0200 Ta Show Queue Full status
+.It 0x0400 Ta Show SCB queue status
+.It 0x0800 Ta Show inbound packet information
+.It 0x1000 Ta Show S/G list information
+.It 0x2000 Ta Enable extra diagnostic code in the firmware
 .El
 .Pp
 The



CVS commit: src/share/man/man4

2009-05-16 Thread Erik E. Fair
Module Name:src
Committed By:   fair
Date:   Sun May 17 01:23:27 UTC 2009

Modified Files:
src/share/man/man4: crypto.4

Log Message:
Eliminate a groff warning seen during build.
Add some paragraph breaks for clarity/readability.
Sentence periods should be at end of lines.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man4/crypto.4

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

Modified files:

Index: src/share/man/man4/crypto.4
diff -u src/share/man/man4/crypto.4:1.14 src/share/man/man4/crypto.4:1.15
--- src/share/man/man4/crypto.4:1.14	Fri May  2 18:11:05 2008
+++ src/share/man/man4/crypto.4	Sun May 17 01:23:27 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: crypto.4,v 1.14 2008/05/02 18:11:05 martin Exp $
+.\	$NetBSD: crypto.4,v 1.15 2009/05/17 01:23:27 fair Exp $
 .\ 
 .\ Copyright (c) 2008 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -53,7 +53,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\ THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd March 29, 2008
+.Dd May 16, 2009
 .Dt CRYPTO 4
 .Os
 .Sh NAME
@@ -77,12 +77,14 @@
 cryptographic transforms, as implemented by the
 .Xr opencrypto 9
 in-kernel interface.
+.Pp
 The
 .Cm swcrypto
 driver is a software-only implementation of the
 .Xr opencrypto 9
 interface, and must be included to use the interface without hardware
 acceleration.
+.Pp
 The
 .Pa /dev/crypto
 special device provides an
@@ -92,6 +94,7 @@
 then issue
 .Xr ioctl 2
 calls on the descriptor.
+.Pp
 The
 .Nm
 device provides two distinct modes of operation: one mode for
@@ -106,7 +109,8 @@
 .Pp
 .Bl -enum
 .It
-Open a file descriptor for the device.  See
+Open a file descriptor for the device.
+See
 .Xr open 2 .
 .It
 If any symmetric operation will be performed,
@@ -116,7 +120,8 @@
 .Dv CIOCNGSESSION .
 Most applications will require at least one symmetric session.
 Since cipher and MAC keys are tied to sessions, many
-applications will require more.  Asymmetric operations do not use sessions.
+applications will require more.
+Asymmetric operations do not use sessions.
 .It
 Submit requests, synchronously with
 .Dv CIOCCRYPT
@@ -170,6 +175,7 @@
 .Xr opencrypto 9 ,
 as providers of a given algorithm, some or all of the following
 symmetric-key privacy algorithms may be available:
+.Pp
 .Bl -tag -compact -width CRYPTO_RIPEMD160_HMAC -offset indent
 .It CRYPTO_DES_CBC
 .It CRYPTO_3DES_CBC
@@ -182,6 +188,7 @@
 .Ss Integrity-check operations
 Contingent upon hardware support, some or all of the following
 keyed one-way hash algorithms may be available:
+.Pp
 .Bl -tag -compact -width CRYPTO_RIPEMD160_HMAC -offset indent
 .It CRYPTO_RIPEMD160_HMAC
 .It CRYPTO_MD5_KPDK
@@ -192,6 +199,7 @@
 .It CRYPTO_MD5
 .It CRYPTO_SHA1
 .El
+.Pp
 The
 .Em CRYPTO_MD5
 and
@@ -204,11 +212,11 @@
 .\
 .It Dv CRIOGET Fa int *fd
 This operation is deprecated and will be removed after
-.Nx 5.0.
+.Nx 5.0 .
 It clones the fd argument to
 .Xr ioctl 4 ,
-yielding a new file descriptor for the creation of sessions.  Because the
-device now clones on open, this operation is unnecessary.
+yielding a new file descriptor for the creation of sessions.
+Because the device now clones on open, this operation is unnecessary.
 .\
 .It Dv CIOCGSESSION Fa struct session_op *sessp
 .Bd -literal
@@ -233,8 +241,8 @@
 is reserved to indicate that the indicated operation (privacy or integrity)
 is not desired for this session.
 .Pp
-Multiple sessions may be bound to a single file descriptor.  The session
-ID returned in
+Multiple sessions may be bound to a single file descriptor.
+The session ID returned in
 .Fa sessp-\*[Gt]ses
 is supplied as a required field in the symmetric-operation structure
 .Fa crypt_op
@@ -289,10 +297,10 @@
 };
 
 .Ed
-Create one or more sessions.  Takes a counted array of
+Create one or more sessions.
+Takes a counted array of
 .Fa session_n_op
-structures
-in
+structures in
 .Fa sgop .
 For each requested session (array element n), the session number is returned in
 .Fa sgop-\*[Gt]sessions[n].ses
@@ -374,14 +382,16 @@
 field.
 .Pp
 Each operation can accept an opaque value from the user to be passed back
-to the user when the operation completes ((e.g. to track context for the
-request).  The opaque field is
+to the user when the operation completes
+(e.g., to track context for the request).
+The opaque field is
 .Fa cr_mop-\*[Gt]reqs[n].opaque.
 .Pp
 If a problem occurs with starting any of the operations then that
 operation's
 .Fa cr_mop-\*[Gt]reqs[n].status
-field is filled with the error code.  The failure of an operation does not
+field is filled with the error code.
+The failure of an operation does not
 prevent the other operations from being started.
 .Pp
 The
@@ -397,7 +407,8 @@
 and
 .Fa mackey
 fields of the
-operation structure are currently unused.  They are intended for use to
+operation structure are currently unused.
+They are intended for use to
 immediately 

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

2009-05-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun May 17 01:28:27 UTC 2009

Modified Files:
src/sys/arch/sparc64/dev: sbus.c sbusvar.h

Log Message:
Split device_t/softc.  Compile test only, but mostly similar changes
with sparc/dev/sbus.c rev 1.69.

XXX: it looks some functions should be merged between sparc and sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/sparc64/dev/sbus.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sparc64/dev/sbusvar.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/sparc64/dev/sbus.c
diff -u src/sys/arch/sparc64/dev/sbus.c:1.83 src/sys/arch/sparc64/dev/sbus.c:1.84
--- src/sys/arch/sparc64/dev/sbus.c:1.83	Sat Oct 18 03:31:10 2008
+++ src/sys/arch/sparc64/dev/sbus.c	Sun May 17 01:28:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbus.c,v 1.83 2008/10/18 03:31:10 nakayama Exp $ */
+/*	$NetBSD: sbus.c,v 1.84 2009/05/17 01:28:27 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1999-2002 Eduardo Horvath
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sbus.c,v 1.83 2008/10/18 03:31:10 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: sbus.c,v 1.84 2009/05/17 01:28:27 tsutsui Exp $);
 
 #include opt_ddb.h
 
@@ -91,11 +91,11 @@
 
 
 /* autoconfiguration driver */
-int	sbus_match(struct device *, struct cfdata *, void *);
-void	sbus_attach(struct device *, struct device *, void *);
+int	sbus_match(device_t, cfdata_t, void *);
+void	sbus_attach(device_t, device_t, void *);
 
 
-CFATTACH_DECL(sbus, sizeof(struct sbus_softc),
+CFATTACH_DECL_NEW(sbus, sizeof(struct sbus_softc),
 sbus_match, sbus_attach, NULL, NULL);
 
 extern struct cfdriver sbus_cd;
@@ -152,7 +152,7 @@
 }
 
 int
-sbus_match(struct device *parent, struct cfdata *cf, void *aux)
+sbus_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct mainbus_attach_args *ma = aux;
 
@@ -163,7 +163,7 @@
  * Attach an Sbus.
  */
 void
-sbus_attach(struct device *parent, struct device *self, void *aux)
+sbus_attach(device_t parent, device_t self, void *aux)
 {
 	struct sbus_softc *sc = device_private(self);
 	struct mainbus_attach_args *ma = aux;
@@ -175,6 +175,7 @@
 	bus_space_tag_t sbt;
 	struct sbus_attach_args sa;
 
+	sc-sc_dev = self;
 	sc-sc_bustag = ma-ma_bustag;
 	sc-sc_dmatag = ma-ma_dmatag;
 	sc-sc_ign = ma-ma_interrupts[0]  INTMAP_IGN;		
@@ -225,7 +226,7 @@
 	error = prom_getprop(node, ranges, sizeof(struct openprom_range),
 			 sbt-nranges, sbt-ranges);
 	if (error)
-		panic(%s: error getting ranges property, device_xname(sc-sc_dev));
+		panic(%s: error getting ranges property, device_xname(self));
 
 	/* initialize the IOMMU */
 
@@ -248,7 +249,7 @@
 	name = (char *)malloc(32, M_DEVBUF, M_NOWAIT);
 	if (name == 0)
 		panic(couldn't malloc iommu name);
-	snprintf(name, 32, %s dvma, device_xname(sc-sc_dev));
+	snprintf(name, 32, %s dvma, device_xname(self));
 
 	iommu_init(name, sc-sc_is, 0, -1);
 
@@ -294,7 +295,7 @@
 			printf(sbus_attach: %s: incomplete\n, name1);
 			continue;
 		}
-		(void) config_found(sc-sc_dev, (void *)sa, sbus_print);
+		(void) config_found(self, sa, sbus_print);
 		sbus_destroy_attach_args(sa);
 	}
 }
@@ -411,10 +412,10 @@
  * its sbusdev portion.
  */
 void
-sbus_establish(register struct sbusdev *sd, register struct device *dev)
+sbus_establish(struct sbusdev *sd, device_t dev)
 {
 	register struct sbus_softc *sc;
-	register struct device *curdev;
+	register device_t curdev;
 
 	/*
 	 * We have to look for the sbus by name, since it is not necessarily
@@ -423,16 +424,16 @@
 	 * sbus, since we might (in the future) support multiple sbus's.
 	 */
 	for (curdev = device_parent(dev); ; curdev = device_parent(curdev)) {
-		if (!curdev || !device_xname(curdev))
+		if ((curdev == NULL) || (device_xname(curdev) == NULL))
 			panic(sbus_establish: can't find sbus parent for %s,
-			  device_xname(sd-sd_dev)
-	? device_xname(sd-sd_dev)
+			  device_xname(dev)
+	? device_xname(dev)
 	: unknown );
 
 		if (strncmp(device_xname(curdev), sbus, 4) == 0)
 			break;
 	}
-	sc = (struct sbus_softc *) curdev;
+	sc = device_private(curdev);
 
 	sd-sd_dev = dev;
 	sd-sd_bchain = sc-sc_sbdev;
@@ -447,9 +448,9 @@
 {
 	register struct sbusdev *sd;
 	struct sbus_softc *sc = device_lookup_private(sbus_cd, sbus);
-	struct device *dev;
+	device_t dev;
 
-	printf(reset %s:, device_xname(sc-sc_dev));
+	printf(reset %s:, device_xname(sc-sc_dev));
 	for (sd = sc-sc_sbdev; sd != NULL; sd = sd-sd_bchain) {
 		if (sd-sd_reset) {
 			dev = sd-sd_dev;
@@ -674,7 +675,7 @@
 	bus_size_t maxsegsz, bus_size_t boundary, int flags,
 	bus_dmamap_t *dmamp)
 {
-	struct sbus_softc *sc = (struct sbus_softc *)t-_cookie;
+	struct sbus_softc *sc = t-_cookie;
 	int error;
 
 	error = bus_dmamap_create(t-_parent, size, nsegments, maxsegsz,

Index: src/sys/arch/sparc64/dev/sbusvar.h
diff -u src/sys/arch/sparc64/dev/sbusvar.h:1.15 src/sys/arch/sparc64/dev/sbusvar.h:1.16
--- 

CVS commit: src/sys/dev

2009-05-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun May 17 01:33:25 UTC 2009

Modified Files:
src/sys/dev/pci: if_hme_pci.c
src/sys/dev/sbus: if_hme_sbus.c

Log Message:
u_intNN_t - uintNN_t


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pci/if_hme_pci.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/sbus/if_hme_sbus.c

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

Modified files:

Index: src/sys/dev/pci/if_hme_pci.c
diff -u src/sys/dev/pci/if_hme_pci.c:1.29 src/sys/dev/pci/if_hme_pci.c:1.30
--- src/sys/dev/pci/if_hme_pci.c:1.29	Sun May 17 00:40:43 2009
+++ src/sys/dev/pci/if_hme_pci.c	Sun May 17 01:33:25 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hme_pci.c,v 1.29 2009/05/17 00:40:43 tsutsui Exp $	*/
+/*	$NetBSD: if_hme_pci.c,v 1.30 2009/05/17 01:33:25 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2000 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_hme_pci.c,v 1.29 2009/05/17 00:40:43 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_hme_pci.c,v 1.30 2009/05/17 01:33:25 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -94,7 +94,7 @@
 
 #if HME_USE_LOCAL_MAC_ADDRESS
 static inline int
-hmepromvalid(u_int8_t* buf)
+hmepromvalid(uint8_t* buf)
 {
 	return buf[0] == 0x18  buf[1] == 0x00 	/* structure length */
 	buf[2] == 0x00 /* revision */
@@ -133,16 +133,16 @@
 #if HME_USE_LOCAL_MAC_ADDRESS
 	struct pci_attach_args	ebus_pa;
 	pcireg_t		ebus_cl, ebus_id;
-	u_int8_t		*enaddr;
+	uint8_t			*enaddr;
 	bus_space_tag_t		romt;
 	bus_space_handle_t	romh;
 	bus_size_t		romsize;
-	u_int8_t		buf[64];
+	uint8_t			buf[64];
 	int			dataoff, vpdoff;
 	struct pci_vpd		*vpd;
-	static const u_int8_t promhdr[] = { 0x55, 0xaa };
+	static const uint8_t promhdr[] = { 0x55, 0xaa };
 #define PROMHDR_PTR_DATA	0x18
-	static const u_int8_t promdat[] = {
+	static const uint8_t promdat[] = {
 		0x50, 0x43, 0x49, 0x52,		/* PCIR */
 		PCI_VENDOR_SUN  0xff, PCI_VENDOR_SUN  8,
 		PCI_PRODUCT_SUN_HMENETWORK  0xff,

Index: src/sys/dev/sbus/if_hme_sbus.c
diff -u src/sys/dev/sbus/if_hme_sbus.c:1.30 src/sys/dev/sbus/if_hme_sbus.c:1.31
--- src/sys/dev/sbus/if_hme_sbus.c:1.30	Sun May 17 00:40:44 2009
+++ src/sys/dev/sbus/if_hme_sbus.c	Sun May 17 01:33:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hme_sbus.c,v 1.30 2009/05/17 00:40:44 tsutsui Exp $	*/
+/*	$NetBSD: if_hme_sbus.c,v 1.31 2009/05/17 01:33:24 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_hme_sbus.c,v 1.30 2009/05/17 00:40:44 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_hme_sbus.c,v 1.31 2009/05/17 01:33:24 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -87,7 +87,7 @@
 	struct hme_softc *sc = hsc-hsc_hme;
 	struct sbus_softc *sbsc = device_private(parent);
 	struct sbusdev *sd = hsc-hsc_sbus;
-	u_int32_t burst, sbusburst;
+	uint32_t burst, sbusburst;
 	int node;
 
 	sc-sc_dev = self;



CVS commit: src/sys/dev/pci

2009-05-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun May 17 02:08:35 UTC 2009

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

Log Message:
Split device_t/softc.  Tested on D-Link DL-4000.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pci/if_stge.c

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

Modified files:

Index: src/sys/dev/pci/if_stge.c
diff -u src/sys/dev/pci/if_stge.c:1.46 src/sys/dev/pci/if_stge.c:1.47
--- src/sys/dev/pci/if_stge.c:1.46	Wed May  6 09:25:16 2009
+++ src/sys/dev/pci/if_stge.c	Sun May 17 02:08:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_stge.c,v 1.46 2009/05/06 09:25:16 cegger Exp $	*/
+/*	$NetBSD: if_stge.c,v 1.47 2009/05/17 02:08:35 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_stge.c,v 1.46 2009/05/06 09:25:16 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_stge.c,v 1.47 2009/05/17 02:08:35 tsutsui Exp $);
 
 #include bpfilter.h
 
@@ -132,7 +132,7 @@
  * Software state per device.
  */
 struct stge_softc {
-	struct device sc_dev;		/* generic device information */
+	device_t sc_dev;		/* generic device information */
 	bus_space_tag_t sc_st;		/* bus space tag */
 	bus_space_handle_t sc_sh;	/* bus space handle */
 	bus_dma_tag_t sc_dmat;		/* bus DMA tag */
@@ -291,7 +291,7 @@
 
 int	stge_copy_small = 0;
 
-CFATTACH_DECL(stge, sizeof(struct stge_softc),
+CFATTACH_DECL_NEW(stge, sizeof(struct stge_softc),
 stge_match, stge_attach, NULL, NULL);
 
 static uint32_t stge_mii_bitbang_read(device_t);
@@ -400,7 +400,7 @@
 
 	sc-sc_rev = PCI_REVISION(pa-pa_class);
 
-	printf(: %s, rev. %d\n, sp-stge_name, sc-sc_rev);
+	aprint_normal(: %s, rev. %d\n, sp-stge_name, sc-sc_rev);
 
 	/*
 	 * Map the device.
@@ -419,7 +419,7 @@
 		sc-sc_st = iot;
 		sc-sc_sh = ioh;
 	} else {
-		aprint_error_dev(sc-sc_dev, unable to map device registers\n);
+		aprint_error_dev(self, unable to map device registers\n);
 		return;
 	}
 
@@ -433,7 +433,7 @@
 	/* power up chip */
 	if ((error = pci_activate(pa-pa_pc, pa-pa_tag, self, NULL)) 
 	error != EOPNOTSUPP) {
-		aprint_error_dev(sc-sc_dev, cannot activate %d\n,
+		aprint_error_dev(self, cannot activate %d\n,
 		error);
 		return;
 	}
@@ -441,19 +441,19 @@
 	 * Map and establish our interrupt.
 	 */
 	if (pci_intr_map(pa, ih)) {
-		aprint_error_dev(sc-sc_dev, unable to map interrupt\n);
+		aprint_error_dev(self, unable to map interrupt\n);
 		return;
 	}
 	intrstr = pci_intr_string(pc, ih);
 	sc-sc_ih = pci_intr_establish(pc, ih, IPL_NET, stge_intr, sc);
 	if (sc-sc_ih == NULL) {
-		aprint_error_dev(sc-sc_dev, unable to establish interrupt);
+		aprint_error_dev(self, unable to establish interrupt);
 		if (intrstr != NULL)
-			printf( at %s, intrstr);
-		printf(\n);
+			aprint_error( at %s, intrstr);
+		aprint_error(\n);
 		return;
 	}
-	printf(%s: interrupting at %s\n, device_xname(sc-sc_dev), intrstr);
+	aprint_normal_dev(self, interrupting at %s\n, intrstr);
 
 	/*
 	 * Allocate the control data structures, and create and load the
@@ -462,7 +462,8 @@
 	if ((error = bus_dmamem_alloc(sc-sc_dmat,
 	sizeof(struct stge_control_data), PAGE_SIZE, 0, seg, 1, rseg,
 	0)) != 0) {
-		aprint_error_dev(sc-sc_dev, unable to allocate control data, error = %d\n,
+		aprint_error_dev(self,
+		unable to allocate control data, error = %d\n,
 		error);
 		goto fail_0;
 	}
@@ -470,7 +471,8 @@
 	if ((error = bus_dmamem_map(sc-sc_dmat, seg, rseg,
 	sizeof(struct stge_control_data), (void **)sc-sc_control_data,
 	BUS_DMA_COHERENT)) != 0) {
-		aprint_error_dev(sc-sc_dev, unable to map control data, error = %d\n,
+		aprint_error_dev(self,
+		unable to map control data, error = %d\n,
 		error);
 		goto fail_1;
 	}
@@ -478,15 +480,17 @@
 	if ((error = bus_dmamap_create(sc-sc_dmat,
 	sizeof(struct stge_control_data), 1,
 	sizeof(struct stge_control_data), 0, 0, sc-sc_cddmamap)) != 0) {
-		aprint_error_dev(sc-sc_dev, unable to create control data DMA map, 
-		error = %d\n, error);
+		aprint_error_dev(self,
+		unable to create control data DMA map, error = %d\n,
+		error);
 		goto fail_2;
 	}
 
 	if ((error = bus_dmamap_load(sc-sc_dmat, sc-sc_cddmamap,
 	sc-sc_control_data, sizeof(struct stge_control_data), NULL,
 	0)) != 0) {
-		aprint_error_dev(sc-sc_dev, unable to load control data DMA map, error = %d\n,
+		aprint_error_dev(self,
+		unable to load control data DMA map, error = %d\n,
 		error);
 		goto fail_3;
 	}
@@ -501,8 +505,9 @@
 		if ((error = bus_dmamap_create(sc-sc_dmat,
 		ETHER_MAX_LEN_JUMBO, STGE_NTXFRAGS, MCLBYTES, 0, 0,
 		sc-sc_txsoft[i].ds_dmamap)) != 0) {
-			aprint_error_dev(sc-sc_dev, unable to create tx DMA map %d, 
-			error = %d\n, i, error);
+			aprint_error_dev(self,
+			unable to create tx DMA map %d, error = %d\n,
+			i, error);
 			goto fail_4;
 		}
 	}
@@ 

CVS commit: src/sys

2009-05-16 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sun May 17 05:54:42 UTC 2009

Modified Files:
src/sys/kern: sys_generic.c vfs_vnops.c
src/sys/sys: file.h

Log Message:
remove FILE_LOCK and FILE_UNLOCK.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/kern/sys_generic.c
cvs rdiff -u -r1.165 -r1.166 src/sys/kern/vfs_vnops.c
cvs rdiff -u -r1.67 -r1.68 src/sys/sys/file.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/kern/sys_generic.c
diff -u src/sys/kern/sys_generic.c:1.120 src/sys/kern/sys_generic.c:1.121
--- src/sys/kern/sys_generic.c:1.120	Wed Jul  2 16:45:20 2008
+++ src/sys/kern/sys_generic.c	Sun May 17 05:54:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_generic.c,v 1.120 2008/07/02 16:45:20 matt Exp $	*/
+/*	$NetBSD: sys_generic.c,v 1.121 2009/05/17 05:54:42 yamt Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sys_generic.c,v 1.120 2008/07/02 16:45:20 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: sys_generic.c,v 1.121 2009/05/17 05:54:42 yamt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -593,22 +593,22 @@
 	switch (com) {
 
 	case FIONBIO:
-		FILE_LOCK(fp);
+		mutex_enter(fp-f_lock);
 		if (*(int *)data != 0)
 			fp-f_flag |= FNONBLOCK;
 		else
 			fp-f_flag = ~FNONBLOCK;
-		FILE_UNLOCK(fp);
+		mutex_exit(fp-f_lock);
 		error = (*fp-f_ops-fo_ioctl)(fp, FIONBIO, data);
 		break;
 
 	case FIOASYNC:
-		FILE_LOCK(fp);
+		mutex_enter(fp-f_lock);
 		if (*(int *)data != 0)
 			fp-f_flag |= FASYNC;
 		else
 			fp-f_flag = ~FASYNC;
-		FILE_UNLOCK(fp);
+		mutex_exit(fp-f_lock);
 		error = (*fp-f_ops-fo_ioctl)(fp, FIOASYNC, data);
 		break;
 

Index: src/sys/kern/vfs_vnops.c
diff -u src/sys/kern/vfs_vnops.c:1.165 src/sys/kern/vfs_vnops.c:1.166
--- src/sys/kern/vfs_vnops.c:1.165	Sat Apr 11 23:05:26 2009
+++ src/sys/kern/vfs_vnops.c	Sun May 17 05:54:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnops.c,v 1.165 2009/04/11 23:05:26 christos Exp $	*/
+/*	$NetBSD: vfs_vnops.c,v 1.166 2009/05/17 05:54:42 yamt Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_vnops.c,v 1.165 2009/04/11 23:05:26 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_vnops.c,v 1.166 2009/05/17 05:54:42 yamt Exp $);
 
 #include veriexec.h
 
@@ -428,9 +428,9 @@
 	auio.uio_offset = fp-f_offset;
 	error = VOP_READDIR(vp, auio, fp-f_cred, eofflag, cookies,
 		ncookies);
-	FILE_LOCK(fp);
+	mutex_enter(fp-f_lock);
 	fp-f_offset = auio.uio_offset;
-	FILE_UNLOCK(fp);
+	mutex_exit(fp-f_lock);
 	VOP_UNLOCK(vp, 0);
 	if (error)
 		return (error);
@@ -450,10 +450,10 @@
 		struct vnode *tvp = vp;
 		vp = vp-v_mount-mnt_vnodecovered;
 		VREF(vp);
-		FILE_LOCK(fp);
+		mutex_enter(fp-f_lock);
 		fp-f_data = vp;
 		fp-f_offset = 0;
-		FILE_UNLOCK(fp);
+		mutex_exit(fp-f_lock);
 		vrele(tvp);
 		goto unionread;
 	}

Index: src/sys/sys/file.h
diff -u src/sys/sys/file.h:1.67 src/sys/sys/file.h:1.68
--- src/sys/sys/file.h:1.67	Sat Apr  4 10:12:52 2009
+++ src/sys/sys/file.h	Sun May 17 05:54:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.67 2009/04/04 10:12:52 ad Exp $	*/
+/*	$NetBSD: file.h,v 1.68 2009/05/17 05:54:42 yamt Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -126,9 +126,6 @@
 	SLIST_ENTRY(file) f_unplist;	/* deferred close: see uipc_usrreq.c */
 };
 
-#define FILE_LOCK(fp)	mutex_enter((fp)-f_lock)
-#define FILE_UNLOCK(fp)	mutex_exit((fp)-f_lock)
-
 /*
  * Flags for fo_read and fo_write and do_fileread/write/v
  */



CVS commit: src/sys/compat/netbsd32

2009-05-16 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun May 17 05:55:42 UTC 2009

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_sysent.c

Log Message:
regen: pad - PAD


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/compat/netbsd32/netbsd32_syscall.h \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.86 -r1.87 src/sys/compat/netbsd32/netbsd32_syscalls.c \
src/sys/compat/netbsd32/netbsd32_sysent.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/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.87 src/sys/compat/netbsd32/netbsd32_syscall.h:1.88
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.87	Mon Mar 16 20:49:16 2009
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Sun May 17 05:55:42 2009
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.87 2009/03/16 20:49:16 njoly Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.88 2009/05/17 05:55:42 pooka Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.79 2009/03/16 20:48:13 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.80 2009/05/17 05:54:22 pooka Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.87 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.88
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.87	Mon Mar 16 20:49:16 2009
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Sun May 17 05:55:42 2009
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.87 2009/03/16 20:49:16 njoly Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.88 2009/05/17 05:55:42 pooka Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.79 2009/03/16 20:48:13 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.80 2009/05/17 05:54:22 pooka Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -911,7 +911,7 @@
 	syscallarg(int) fd;
 	syscallarg(netbsd32_voidp) buf;
 	syscallarg(netbsd32_size_t) nbyte;
-	syscallarg(int) pad;
+	syscallarg(int) PAD;
 	syscallarg(off_t) offset;
 };
 check_syscall_args(netbsd32_pread)
@@ -920,7 +920,7 @@
 	syscallarg(int) fd;
 	syscallarg(netbsd32_voidp) buf;
 	syscallarg(netbsd32_size_t) nbyte;
-	syscallarg(int) pad;
+	syscallarg(int) PAD;
 	syscallarg(off_t) offset;
 };
 check_syscall_args(netbsd32_pwrite)
@@ -1038,7 +1038,7 @@
 	syscallarg(int) prot;
 	syscallarg(int) flags;
 	syscallarg(int) fd;
-	syscallarg(netbsd32_long) pad;
+	syscallarg(netbsd32_long) PAD;
 	syscallarg(off_t) pos;
 };
 check_syscall_args(netbsd32_mmap)
@@ -1050,7 +1050,7 @@
 
 struct netbsd32_lseek_args {
 	syscallarg(int) fd;
-	syscallarg(int) pad;
+	syscallarg(int) PAD;
 	syscallarg(off_t) offset;
 	syscallarg(int) whence;
 };
@@ -1058,14 +1058,14 @@
 
 struct netbsd32_truncate_args {
 	syscallarg(netbsd32_charp) path;
-	syscallarg(int) pad;
+	syscallarg(int) PAD;
 	syscallarg(off_t) length;
 };
 check_syscall_args(netbsd32_truncate)
 
 struct netbsd32_ftruncate_args {
 	syscallarg(int) fd;
-	syscallarg(int) pad;
+	syscallarg(int) PAD;
 	syscallarg(off_t) length;
 };
 check_syscall_args(netbsd32_ftruncate)
@@ -1460,7 +1460,7 @@
 	syscallarg(int) fd;
 	syscallarg(netbsd32_iovecp_t) iovp;
 	syscallarg(int) iovcnt;
-	syscallarg(int) pad;
+	syscallarg(int) PAD;
 	syscallarg(off_t) offset;
 };
 check_syscall_args(netbsd32_preadv)
@@ -1469,7 +1469,7 @@
 	syscallarg(int) fd;
 	syscallarg(netbsd32_iovecp_t) iovp;
 	syscallarg(int) iovcnt;
-	syscallarg(int) pad;
+	syscallarg(int) PAD;
 	syscallarg(off_t) offset;
 };
 check_syscall_args(netbsd32_pwritev)
@@ -2098,7 +2098,7 @@
 
 struct netbsd32___posix_fadvise50_args {
 	syscallarg(int) fd;
-	syscallarg(int) pad;
+	syscallarg(int) PAD;
 	syscallarg(off_t) offset;
 	syscallarg(off_t) len;
 	syscallarg(int) advice;

Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.86 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.87
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.86	Mon Mar 16 20:49:16 2009
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Sun May 17 05:55:42 2009
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.86 2009/03/16 20:49:16 njoly Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.87 2009/05/17 05:55:42 pooka Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.79 2009/03/16 20:48:13 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.80 2009/05/17 05:54:22 pooka Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_syscalls.c,v 1.86 2009/03/16 20:49:16 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: 

CVS commit: src/sys/compat/netbsd32

2009-05-16 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun May 17 05:57:01 UTC 2009

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c

Log Message:
pad - PAD.  Fixes build problem reported by Paul Goyette in private email.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/compat/netbsd32/netbsd32_netbsd.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/compat/netbsd32/netbsd32_netbsd.c
diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.156 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.157
--- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.156	Mon Mar 16 20:48:13 2009
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c	Sun May 17 05:57:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_netbsd.c,v 1.156 2009/03/16 20:48:13 njoly Exp $	*/
+/*	$NetBSD: netbsd32_netbsd.c,v 1.157 2009/05/17 05:57:01 pooka Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_netbsd.c,v 1.156 2009/03/16 20:48:13 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_netbsd.c,v 1.157 2009/05/17 05:57:01 pooka Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ddb.h
@@ -1302,7 +1302,7 @@
 		syscallarg(int) fd;
 		syscallarg(netbsd32_voidp) buf;
 		syscallarg(netbsd32_size_t) nbyte;
-		syscallarg(int) pad;
+		syscallarg(int) PAD;
 		syscallarg(off_t) offset;
 	} */
 	struct sys_pread_args ua;
@@ -1310,7 +1310,7 @@
 	NETBSD32TO64_UAP(fd);
 	NETBSD32TOP_UAP(buf, void);
 	NETBSD32TOX_UAP(nbyte, size_t);
-	NETBSD32TO64_UAP(pad);
+	NETBSD32TO64_UAP(PAD);
 	NETBSD32TO64_UAP(offset);
 	return sys_pread(l, ua, retval);
 }
@@ -1322,7 +1322,7 @@
 		syscallarg(int) fd;
 		syscallarg(const netbsd32_voidp) buf;
 		syscallarg(netbsd32_size_t) nbyte;
-		syscallarg(int) pad;
+		syscallarg(int) PAD;
 		syscallarg(off_t) offset;
 	} */
 	struct sys_pwrite_args ua;
@@ -1330,7 +1330,7 @@
 	NETBSD32TO64_UAP(fd);
 	NETBSD32TOP_UAP(buf, void);
 	NETBSD32TOX_UAP(nbyte, size_t);
-	NETBSD32TO64_UAP(pad);
+	NETBSD32TO64_UAP(PAD);
 	NETBSD32TO64_UAP(offset);
 	return sys_pwrite(l, ua, retval);
 }
@@ -1488,7 +1488,7 @@
 		syscallarg(int) prot;
 		syscallarg(int) flags;
 		syscallarg(int) fd;
-		syscallarg(netbsd32_long) pad;
+		syscallarg(netbsd32_long) PAD;
 		syscallarg(off_t) pos;
 	} */
 	struct sys_mmap_args ua;
@@ -1499,7 +1499,7 @@
 	NETBSD32TO64_UAP(prot);
 	NETBSD32TO64_UAP(flags);
 	NETBSD32TO64_UAP(fd);
-	NETBSD32TOX_UAP(pad, long);
+	NETBSD32TOX_UAP(PAD, long);
 	NETBSD32TOX_UAP(pos, off_t);
 	error = sys_mmap(l, ua, retval);
 	if ((u_long)*retval  (u_long)UINT_MAX) {
@@ -1536,7 +1536,7 @@
 {
 	/* {
 		syscallarg(int) fd;
-		syscallarg(int) pad;
+		syscallarg(int) PAD;
 		syscallarg(off_t) offset;
 		syscallarg(int) whence;
 	} */
@@ -1548,7 +1548,7 @@
 	int rv;
 
 	NETBSD32TO64_UAP(fd);
-	NETBSD32TO64_UAP(pad);
+	NETBSD32TO64_UAP(PAD);
 	NETBSD32TO64_UAP(offset);
 	NETBSD32TO64_UAP(whence);
 	rv = sys_lseek(l, ua, newpos.retval64);
@@ -1571,13 +1571,13 @@
 {
 	/* {
 		syscallarg(const netbsd32_charp) path;
-		syscallarg(int) pad;
+		syscallarg(int) PAD;
 		syscallarg(off_t) length;
 	} */
 	struct sys_truncate_args ua;
 
 	NETBSD32TOP_UAP(path, const char);
-	NETBSD32TO64_UAP(pad);
+	NETBSD32TO64_UAP(PAD);
 	NETBSD32TO64_UAP(length);
 	return (sys_truncate(l, ua, retval));
 }
@@ -1587,13 +1587,13 @@
 {
 	/* {
 		syscallarg(int) fd;
-		syscallarg(int) pad;
+		syscallarg(int) PAD;
 		syscallarg(off_t) length;
 	} */
 	struct sys_ftruncate_args ua;
 
 	NETBSD32TO64_UAP(fd);
-	NETBSD32TO64_UAP(pad);
+	NETBSD32TO64_UAP(PAD);
 	NETBSD32TO64_UAP(length);
 	return (sys_ftruncate(l, ua, retval));
 }
@@ -2515,7 +2515,7 @@
 {
 	/* {
 		syscallarg(int) fd;
-		syscallarg(int) pad;
+		syscallarg(int) PAD;
 		syscallarg(off_t) offset;
 		syscallarg(off_t) len;
 		syscallarg(int) advice;