CVS commit: xsrc/external/mit/xorg-server/dist/glx

2009-07-21 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Wed Jul 22 06:12:10 UTC 2009

Modified Files:
xsrc/external/mit/xorg-server/dist/glx: glxdri.c

Log Message:
apply patch-am from pkgsrc modular-xorg-server:

date: 2009/06/24 17:25:36;  author: drochner;  state: Exp;  lines: +10 -89
zero out a local variable, fixes random behaviour in case a DRI hw module
cannot be loaded and the server falls back to software rendering, from
Rafal Boni per mail to tech-x11


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 xsrc/external/mit/xorg-server/dist/glx/glxdri.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/glx/glxdri.c
diff -u xsrc/external/mit/xorg-server/dist/glx/glxdri.c:1.1.1.2 xsrc/external/mit/xorg-server/dist/glx/glxdri.c:1.2
--- xsrc/external/mit/xorg-server/dist/glx/glxdri.c:1.1.1.2	Thu Jul  9 07:04:34 2009
+++ xsrc/external/mit/xorg-server/dist/glx/glxdri.c	Wed Jul 22 06:12:10 2009
@@ -968,6 +968,8 @@
 const __DRIextension **extensions;
 int i;
 
+memset(&framebuffer, 0, sizeof(framebuffer));
+
 if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
 	!DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
 	!isCapable) {



CVS commit: xsrc/external/mit/xorg-server/dist/exa

2009-07-21 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Wed Jul 22 06:10:52 UTC 2009

Modified Files:
xsrc/external/mit/xorg-server/dist/exa: exa_accel.c

Log Message:
apply the patch from http://bugs.freedesktop.org/attachment.cgi?id=27568.
it fixes various issues picked up by newer pixman.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
xsrc/external/mit/xorg-server/dist/exa/exa_accel.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/exa/exa_accel.c
diff -u xsrc/external/mit/xorg-server/dist/exa/exa_accel.c:1.1.1.3 xsrc/external/mit/xorg-server/dist/exa/exa_accel.c:1.2
--- xsrc/external/mit/xorg-server/dist/exa/exa_accel.c:1.1.1.3	Thu Jul  9 07:04:33 2009
+++ xsrc/external/mit/xorg-server/dist/exa/exa_accel.c	Wed Jul 22 06:10:52 2009
@@ -415,6 +415,7 @@
 
 if (rects) {
 	int i;
+	int ordering;
 
 	for (i = 0; i < nbox; i++) {
 	rects[i].x = pbox[i].x1 + dx + src_off_x;
@@ -423,7 +424,16 @@
 	rects[i].height = pbox[i].y2 - pbox[i].y1;
 	}
 
-	srcregion  = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED);
+	/* This must match the miRegionCopy() logic for reversing rect order */
+	if (nbox == 1 || (dx > 0 && dy > 0) ||
+	(pDstDrawable != pSrcDrawable &&
+	 (pDstDrawable->type != DRAWABLE_WINDOW ||
+	  pSrcDrawable->type != DRAWABLE_WINDOW)))
+	ordering = CT_YXBANDED;
+	else
+	ordering = CT_UNSORTED;
+
+	srcregion  = RECTS_TO_REGION(pScreen, nbox, rects, ordering);
 	xfree(rects);
 
 	if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,



CVS commit: src/sys/ufs/ufs

2009-07-21 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Jul 22 04:49:19 UTC 2009

Modified Files:
src/sys/ufs/ufs: dir.h

Log Message:
typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/ufs/ufs/dir.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/ufs/ufs/dir.h
diff -u src/sys/ufs/ufs/dir.h:1.20 src/sys/ufs/ufs/dir.h:1.21
--- src/sys/ufs/ufs/dir.h:1.20	Sun Dec 11 12:25:28 2005
+++ src/sys/ufs/ufs/dir.h	Wed Jul 22 04:49:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.h,v 1.20 2005/12/11 12:25:28 christos Exp $	*/
+/*	$NetBSD: dir.h,v 1.21 2009/07/22 04:49:19 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -40,7 +40,7 @@
 #define	_UFS_UFS_DIR_H_
 
 /*
- * Theoretically, directories can be more than 2Gb in length, however, in
+ * Theoretically, directories can be more than 2Gb in length; however, in
  * practice this seems unlikely. So, we define the type doff_t as a 32-bit
  * quantity to keep down the cost of doing lookup on a 32-bit machine.
  */



CVS commit: src/sys/rump

2009-07-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Jul 21 23:59:20 UTC 2009

Modified Files:
src/sys/rump/include/rump: rump_syscalls.h
src/sys/rump/librump/rumpkern: rump_syscalls.c

Log Message:
regen: fh syscalls


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.35 -r1.36 src/sys/rump/librump/rumpkern/rump_syscalls.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/rump/include/rump/rump_syscalls.h
diff -u src/sys/rump/include/rump/rump_syscalls.h:1.14 src/sys/rump/include/rump/rump_syscalls.h:1.15
--- src/sys/rump/include/rump/rump_syscalls.h:1.14	Fri May 15 15:52:46 2009
+++ src/sys/rump/include/rump/rump_syscalls.h	Tue Jul 21 23:59:19 2009
@@ -1,10 +1,10 @@
-/* $NetBSD: rump_syscalls.h,v 1.14 2009/05/15 15:52:46 pooka Exp $ */
+/* $NetBSD: rump_syscalls.h,v 1.15 2009/07/21 23:59:19 pooka Exp $ */
 
 /*
  * System call protos in rump namespace.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.227 2009/05/15 15:51:27 pooka Exp
+ * created from	NetBSD: syscalls.master,v 1.228 2009/07/19 02:50:44 rmind Exp
  */
 
 #ifdef _RUMPKERNEL
@@ -110,6 +110,8 @@
 int rump_sys_getdents(int, char *, size_t) __RENAME(rump_sys___getdents30);
 int rump_sys_socket(int, int, int) __RENAME(rump_sys___socket30);
 int rump_sys_getfh(const char *, void *, size_t *) __RENAME(rump_sys___getfh30);
+int rump_sys_fhopen(const void *, size_t, int) __RENAME(rump_sys___fhopen40);
+int rump_sys_fhstatvfs1(const void *, size_t, struct statvfs *, int) __RENAME(rump_sys___fhstatvfs140);
 int rump_sys_mount(const char *, const char *, int, void *, size_t) __RENAME(rump_sys___mount50);
 int rump_sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *) __RENAME(rump_sys___select50);
 int rump_sys_utimes(const char *, const struct timeval *) __RENAME(rump_sys___utimes50);

Index: src/sys/rump/librump/rumpkern/rump_syscalls.c
diff -u src/sys/rump/librump/rumpkern/rump_syscalls.c:1.35 src/sys/rump/librump/rumpkern/rump_syscalls.c:1.36
--- src/sys/rump/librump/rumpkern/rump_syscalls.c:1.35	Fri May 15 15:52:46 2009
+++ src/sys/rump/librump/rumpkern/rump_syscalls.c	Tue Jul 21 23:59:20 2009
@@ -1,14 +1,14 @@
-/* $NetBSD: rump_syscalls.c,v 1.35 2009/05/15 15:52:46 pooka Exp $ */
+/* $NetBSD: rump_syscalls.c,v 1.36 2009/07/21 23:59:20 pooka Exp $ */
 
 /*
  * System call vector and marshalling for rump.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.227 2009/05/15 15:51:27 pooka Exp
+ * created from	NetBSD: syscalls.master,v 1.228 2009/07/19 02:50:44 rmind Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.35 2009/05/15 15:52:46 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.36 2009/07/21 23:59:20 pooka Exp $");
 
 #include 
 #include 
@@ -2090,6 +2090,51 @@
 }
 __weak_alias(sys___getfh30,rump_enosys);
 
+int rump_sys___fhopen40(const void *, size_t, int);
+int
+rump_sys___fhopen40(const void * fhp, size_t fh_size, int flags)
+{
+	register_t retval = 0;
+	int error = 0;
+	struct sys___fhopen40_args callarg;
+
+	SPARG(&callarg, fhp) = fhp;
+	SPARG(&callarg, fh_size) = fh_size;
+	SPARG(&callarg, flags) = flags;
+
+	error = rump_sysproxy(SYS___fhopen40, rump_sysproxy_arg,
+	(uint8_t *)&callarg, sizeof(callarg), &retval);
+	if (error) {
+		retval = -1;
+		rumpuser_seterrno(error);
+	}
+	return retval;
+}
+__weak_alias(sys___fhopen40,rump_enosys);
+
+int rump_sys___fhstatvfs140(const void *, size_t, struct statvfs *, int);
+int
+rump_sys___fhstatvfs140(const void * fhp, size_t fh_size, struct statvfs * buf, int flags)
+{
+	register_t retval = 0;
+	int error = 0;
+	struct sys___fhstatvfs140_args callarg;
+
+	SPARG(&callarg, fhp) = fhp;
+	SPARG(&callarg, fh_size) = fh_size;
+	SPARG(&callarg, buf) = buf;
+	SPARG(&callarg, flags) = flags;
+
+	error = rump_sysproxy(SYS___fhstatvfs140, rump_sysproxy_arg,
+	(uint8_t *)&callarg, sizeof(callarg), &retval);
+	if (error) {
+		retval = -1;
+		rumpuser_seterrno(error);
+	}
+	return retval;
+}
+__weak_alias(sys___fhstatvfs140,rump_enosys);
+
 int rump_sys___mount50(const char *, const char *, int, void *, size_t);
 int
 rump_sys___mount50(const char * type, const char * path, int flags, void * data, size_t data_len)
@@ -3257,10 +3302,10 @@
 	(sy_call_t *)sys___socket30 },		/* 394 = __socket30 */
 	{ ns(struct sys___getfh30_args), 0,
 	(sy_call_t *)sys___getfh30 },		/* 395 = __getfh30 */
-	{ 0, 0, 0,
-	(sy_call_t *)rump_enosys },			/* 396 = unrumped */
-	{ 0, 0, 0,
-	(sy_call_t *)rump_enosys },			/* 397 = unrumped */
+	{ ns(struct sys___fhopen40_args), 0,
+	(sy_call_t *)sys___fhopen40 },		/* 396 = __fhopen40 */
+	{ ns(struct sys___fhstatvfs140_args), 0,
+	(sy_call_t *)sys___fhstatvfs140 },		/* 397 = __fhstatvfs140 */
 	{ 0, 0, 0,
 	(sy

CVS commit: src/sys/kern

2009-07-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Jul 21 23:59:00 UTC 2009

Modified Files:
src/sys/kern: syscalls.master

Log Message:
+fhopen, +fhstatvfs1 RUMP


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/sys/kern/syscalls.master

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/syscalls.master
diff -u src/sys/kern/syscalls.master:1.228 src/sys/kern/syscalls.master:1.229
--- src/sys/kern/syscalls.master:1.228	Sun Jul 19 02:50:44 2009
+++ src/sys/kern/syscalls.master	Tue Jul 21 23:59:00 2009
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.228 2009/07/19 02:50:44 rmind Exp $
+	$NetBSD: syscalls.master,v 1.229 2009/07/21 23:59:00 pooka Exp $
 
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
 
@@ -761,9 +761,9 @@
 394	STD	 RUMP	{ int|sys|30|socket(int domain, int type, int protocol); }
 395	STD 	 RUMP	{ int|sys|30|getfh(const char *fname, void *fhp, \
 			size_t *fh_size); }
-396	STD 		{ int|sys|40|fhopen(const void *fhp, size_t fh_size,\
+396	STD 	 RUMP	{ int|sys|40|fhopen(const void *fhp, size_t fh_size,\
 			int flags); }
-397	STD 		{ int|sys|40|fhstatvfs1(const void *fhp, \
+397	STD 	 RUMP	{ int|sys|40|fhstatvfs1(const void *fhp, \
 			size_t fh_size, struct statvfs *buf, int flags); }
 398	COMPAT_50 MODULAR { int|sys|40|fhstat(const void *fhp, \
 			size_t fh_size, struct stat30 *sb); }



CVS commit: src/tests/lib/libc/string

2009-07-21 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Tue Jul 21 21:45:33 UTC 2009

Modified Files:
src/tests/lib/libc/string: t_popcount.c

Log Message:
flag a 64-bit integer constant as "ULL" -- this is not clean but the
code around it assumes it anyway
fixes build on 32-bit


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/string/t_popcount.c

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

Modified files:

Index: src/tests/lib/libc/string/t_popcount.c
diff -u src/tests/lib/libc/string/t_popcount.c:1.1 src/tests/lib/libc/string/t_popcount.c:1.2
--- src/tests/lib/libc/string/t_popcount.c:1.1	Tue Jul 21 13:18:44 2009
+++ src/tests/lib/libc/string/t_popcount.c	Tue Jul 21 21:45:33 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_popcount.c,v 1.1 2009/07/21 13:18:44 joerg Exp $	*/
+/*	$NetBSD: t_popcount.c,v 1.2 2009/07/21 21:45:33 drochner Exp $	*/
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_popcount.c,v 1.1 2009/07/21 13:18:44 joerg Exp $");
+__RCSID("$NetBSD: t_popcount.c,v 1.2 2009/07/21 21:45:33 drochner Exp $");
 
 #include 
 #include 
@@ -176,7 +176,7 @@
 		}
 	}
 
-	ATF_CHECK_EQ(popcountll(0x), 64);
+	ATF_CHECK_EQ(popcountll(0xULL), 64);
 }
 
 ATF_TP_ADD_TCS(tp)



CVS commit: src/common/lib/libc/string

2009-07-21 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Tue Jul 21 19:56:56 UTC 2009

Modified Files:
src/common/lib/libc/string: popcount32.c popcount64.c

Log Message:
remove stray semicolons, makes lint happy and lets the libc build proceed


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/string/popcount32.c
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/string/popcount64.c

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

Modified files:

Index: src/common/lib/libc/string/popcount32.c
diff -u src/common/lib/libc/string/popcount32.c:1.2 src/common/lib/libc/string/popcount32.c:1.3
--- src/common/lib/libc/string/popcount32.c:1.2	Tue Jul 21 17:37:51 2009
+++ src/common/lib/libc/string/popcount32.c	Tue Jul 21 19:56:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: popcount32.c,v 1.2 2009/07/21 17:37:51 joerg Exp $	*/
+/*	$NetBSD: popcount32.c,v 1.3 2009/07/21 19:56:55 drochner Exp $	*/
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: popcount32.c,v 1.2 2009/07/21 17:37:51 joerg Exp $");
+__RCSID("$NetBSD: popcount32.c,v 1.3 2009/07/21 19:56:55 drochner Exp $");
 
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 #include 
@@ -69,9 +69,9 @@
 }
 
 #if UINT_MAX == 0xU
-__strong_alias(popcount, popcount32);
+__strong_alias(popcount, popcount32)
 #endif
 
 #if ULONG_MAX == 0xU
-__strong_alias(popcountl, popcount32);
+__strong_alias(popcountl, popcount32)
 #endif

Index: src/common/lib/libc/string/popcount64.c
diff -u src/common/lib/libc/string/popcount64.c:1.3 src/common/lib/libc/string/popcount64.c:1.4
--- src/common/lib/libc/string/popcount64.c:1.3	Tue Jul 21 17:14:12 2009
+++ src/common/lib/libc/string/popcount64.c	Tue Jul 21 19:56:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: popcount64.c,v 1.3 2009/07/21 17:14:12 joerg Exp $	*/
+/*	$NetBSD: popcount64.c,v 1.4 2009/07/21 19:56:55 drochner Exp $	*/
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: popcount64.c,v 1.3 2009/07/21 17:14:12 joerg Exp $");
+__RCSID("$NetBSD: popcount64.c,v 1.4 2009/07/21 19:56:55 drochner Exp $");
 
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 #include 
@@ -73,10 +73,10 @@
 #endif
 
 #if ULONG_MAX == 0xULL
-__strong_alias(popcountl, popcount64);
+__strong_alias(popcountl, popcount64)
 #endif
 
 #if ULLONG_MAX == 0xULL
-__strong_alias(popcountll, popcount64);
+__strong_alias(popcountll, popcount64)
 #endif
 



CVS commit: src/sys/dev/dkwedge

2009-07-21 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Jul 21 19:41:00 UTC 2009

Modified Files:
src/sys/dev/dkwedge: dk.c

Log Message:
Extract a lot of code from dkwedge_del(), and move it to dkwedge_detach()
to create a comprehensive detachment hook.  Let that hook run at
shutdown.  Now, 'drvctl -d dk0' actually deletes a wedge if it is
not in-use (otherwise fails w/ EBUSY), and wedges are gracefully
detached from their "parent" at shutdown.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/dkwedge/dk.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/dkwedge/dk.c
diff -u src/sys/dev/dkwedge/dk.c:1.46 src/sys/dev/dkwedge/dk.c:1.47
--- src/sys/dev/dkwedge/dk.c:1.46	Thu Jul  2 00:56:48 2009
+++ src/sys/dev/dkwedge/dk.c	Tue Jul 21 19:41:00 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dk.c,v 1.46 2009/07/02 00:56:48 dyoung Exp $	*/
+/*	$NetBSD: dk.c,v 1.47 2009/07/21 19:41:00 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.46 2009/07/02 00:56:48 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.47 2009/07/21 19:41:00 dyoung Exp $");
 
 #include "opt_dkwedge.h"
 
@@ -95,6 +95,7 @@
 static void	dkrestart(void *);
 
 static int	dklastclose(struct dkwedge_softc *);
+static int	dkwedge_detach(device_t, int);
 
 static dev_type_open(dkopen);
 static dev_type_close(dkclose);
@@ -149,23 +150,10 @@
 		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
-/*
- * dkwedge_detach:
- *
- *	Autoconfiguration detach function for pseudo-device glue.
- */
-static int
-dkwedge_detach(device_t self, int flags)
-{
-
-	pmf_device_deregister(self);
-	/* Always succeeds. */
-	return (0);
-}
-
 CFDRIVER_DECL(dk, DV_DISK, NULL);
-CFATTACH_DECL_NEW(dk, 0,
-	  dkwedge_match, dkwedge_attach, dkwedge_detach, NULL);
+CFATTACH_DECL3_NEW(dk, 0,
+dkwedge_match, dkwedge_attach, dkwedge_detach, NULL, NULL, NULL,
+DVF_DETACH_SHUTDOWN);
 
 /*
  * dkwedge_wait_drain:
@@ -423,36 +411,111 @@
 }
 
 /*
- * dkwedge_del:		[exported function]
+ * dkwedge_find:
  *
- *	Delete a disk wedge based on the provided information.
+ *	Lookup a disk wedge based on the provided information.
  *	NOTE: We look up the wedge based on the wedge devname,
  *	not wname.
+ *
+ *	Return NULL if the wedge is not found, otherwise return
+ *	the wedge's softc.  Assign the wedge's unit number to unitp
+ *	if unitp is not NULL.
  */
-int
-dkwedge_del(struct dkwedge_info *dkw)
+static struct dkwedge_softc *
+dkwedge_find(struct dkwedge_info *dkw, u_int *unitp)
 {
 	struct dkwedge_softc *sc = NULL;
 	u_int unit;
-	int bmaj, cmaj, s;
 
 	/* Find our softc. */
 	dkw->dkw_devname[sizeof(dkw->dkw_devname) - 1] = '\0';
-	rw_enter(&dkwedges_lock, RW_WRITER);
+	rw_enter(&dkwedges_lock, RW_READER);
 	for (unit = 0; unit < ndkwedges; unit++) {
 		if ((sc = dkwedges[unit]) != NULL &&
 		strcmp(device_xname(sc->sc_dev), dkw->dkw_devname) == 0 &&
 		strcmp(sc->sc_parent->dk_name, dkw->dkw_parent) == 0) {
-			/* Mark the wedge as dying. */
-			sc->sc_state = DKW_STATE_DYING;
 			break;
 		}
 	}
 	rw_exit(&dkwedges_lock);
 	if (unit == ndkwedges)
+		return NULL;
+
+	if (unitp != NULL)
+		*unitp = unit;
+
+	return sc;
+}
+
+/*
+ * dkwedge_del:		[exported function]
+ *
+ *	Delete a disk wedge based on the provided information.
+ *	NOTE: We look up the wedge based on the wedge devname,
+ *	not wname.
+ */
+int
+dkwedge_del(struct dkwedge_info *dkw)
+{
+	struct dkwedge_softc *sc = NULL;
+
+	/* Find our softc. */
+	if ((sc = dkwedge_find(dkw, NULL)) == NULL)
 		return (ESRCH);
 
-	KASSERT(sc != NULL);
+	return config_detach(sc->sc_dev, DETACH_FORCE | DETACH_QUIET);
+}
+
+static int
+dkwedge_begindetach(struct dkwedge_softc *sc, int flags)
+{
+	struct disk *dk = &sc->sc_dk;
+	int rc;
+
+	rc = 0;
+	mutex_enter(&dk->dk_openlock);
+	mutex_enter(&sc->sc_parent->dk_rawlock);
+	if (dk->dk_openmask == 0)
+		;	/* nothing to do */
+	else if ((flags & DETACH_FORCE) == 0)
+		rc = EBUSY;
+	else
+		rc = dklastclose(sc);
+	mutex_exit(&sc->sc_parent->dk_rawlock);
+	mutex_exit(&dk->dk_openlock);
+
+	return rc;
+}
+
+/*
+ * dkwedge_detach:
+ *
+ *	Autoconfiguration detach function for pseudo-device glue.
+ */
+static int
+dkwedge_detach(device_t self, int flags)
+{
+	struct dkwedge_softc *sc = NULL;
+	u_int unit;
+	int bmaj, cmaj, rc, s;
+
+	rw_enter(&dkwedges_lock, RW_WRITER);
+	for (unit = 0; unit < ndkwedges; unit++) {
+		if ((sc = dkwedges[unit]) != NULL && sc->sc_dev == self)
+			break;
+	}
+	if (unit == ndkwedges)
+		rc = ENXIO;
+	else if ((rc = dkwedge_begindetach(sc, flags)) == 0) {
+		/* Mark the wedge as dying. */
+		sc->sc_state = DKW_STATE_DYING;
+	}
+	rw_exit(&dkwedges_lock);
+
+	if (rc != 0)
+		return rc;
+
+	pmf_device_deregister(self);
 
 	/* Locate the wedge major numbers. */
 	bmaj = bdevsw_lookup_major(&dk_bdevsw);

CVS commit: src/sys/compat/linux32/common

2009-07-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue Jul 21 18:50:43 UTC 2009

Modified Files:
src/sys/compat/linux32/common: linux32_time.c

Log Message:
Kill unreachable return statement.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/linux32/common/linux32_time.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/linux32/common/linux32_time.c
diff -u src/sys/compat/linux32/common/linux32_time.c:1.28 src/sys/compat/linux32/common/linux32_time.c:1.29
--- src/sys/compat/linux32/common/linux32_time.c:1.28	Fri Jan 16 13:10:47 2009
+++ src/sys/compat/linux32/common/linux32_time.c	Tue Jul 21 18:50:43 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_time.c,v 1.28 2009/01/16 13:10:47 njoly Exp $ */
+/*	$NetBSD: linux32_time.c,v 1.29 2009/07/21 18:50:43 njoly Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_time.c,v 1.28 2009/01/16 13:10:47 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_time.c,v 1.29 2009/07/21 18:50:43 njoly Exp $");
 
 #include 
 #include 
@@ -349,8 +349,6 @@
 	ts.tv_nsec = 10 / tc_getfrequency();
 	native_to_linux32_timespec(

CVS commit: src/sys/compat/linux/common

2009-07-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue Jul 21 18:42:56 UTC 2009

Modified Files:
src/sys/compat/linux/common: linux_time.c

Log Message:
Do reject unknown/invalid linux clockid.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/linux/common/linux_time.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/linux/common/linux_time.c
diff -u src/sys/compat/linux/common/linux_time.c:1.28 src/sys/compat/linux/common/linux_time.c:1.29
--- src/sys/compat/linux/common/linux_time.c:1.28	Sun Jan 11 02:45:48 2009
+++ src/sys/compat/linux/common/linux_time.c	Tue Jul 21 18:42:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_time.c,v 1.28 2009/01/11 02:45:48 christos Exp $ */
+/*	$NetBSD: linux_time.c,v 1.29 2009/07/21 18:42:56 njoly Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.28 2009/01/11 02:45:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.29 2009/07/21 18:42:56 njoly Exp $");
 
 #include 
 #include 
@@ -181,6 +181,7 @@
 	case LINUX_CLOCK_THREAD_CPUTIME_ID:
 	case LINUX_CLOCK_REALTIME_HR:
 	case LINUX_CLOCK_MONOTONIC_HR:
+	default:
 		return EINVAL;
 	}
 



CVS commit: src/common/lib/libc/string

2009-07-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jul 21 17:37:51 UTC 2009

Modified Files:
src/common/lib/libc/string: popcount32.c

Log Message:
Include limits.h.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/string/popcount32.c

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

Modified files:

Index: src/common/lib/libc/string/popcount32.c
diff -u src/common/lib/libc/string/popcount32.c:1.1 src/common/lib/libc/string/popcount32.c:1.2
--- src/common/lib/libc/string/popcount32.c:1.1	Tue Jul 21 14:55:32 2009
+++ src/common/lib/libc/string/popcount32.c	Tue Jul 21 17:37:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: popcount32.c,v 1.1 2009/07/21 14:55:32 joerg Exp $	*/
+/*	$NetBSD: popcount32.c,v 1.2 2009/07/21 17:37:51 joerg Exp $	*/
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,12 +32,14 @@
  */
 
 #include 
-__RCSID("$NetBSD: popcount32.c,v 1.1 2009/07/21 14:55:32 joerg Exp $");
+__RCSID("$NetBSD: popcount32.c,v 1.2 2009/07/21 17:37:51 joerg Exp $");
 
 #if !defined(_KERNEL) && !defined(_STANDALONE)
+#include 
 #include 
 #else
 #include 
+#include 
 #endif
 
 /*
@@ -66,7 +68,7 @@
 	return c;
 }
 
-#if UINT_MAX == 0xUL
+#if UINT_MAX == 0xU
 __strong_alias(popcount, popcount32);
 #endif
 



CVS commit: src/gnu/dist/gettext/gettext-tools/libuniname

2009-07-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jul 21 17:35:17 UTC 2009

Modified Files:
src/gnu/dist/gettext/gettext-tools/libuniname: uniname.c

Log Message:
Don't redefine uint16_t and uint8_t, just use the system includes.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/gnu/dist/gettext/gettext-tools/libuniname/uniname.c

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

Modified files:

Index: src/gnu/dist/gettext/gettext-tools/libuniname/uniname.c
diff -u src/gnu/dist/gettext/gettext-tools/libuniname/uniname.c:1.1.1.1 src/gnu/dist/gettext/gettext-tools/libuniname/uniname.c:1.2
--- src/gnu/dist/gettext/gettext-tools/libuniname/uniname.c:1.1.1.1	Fri Apr 29 15:07:52 2005
+++ src/gnu/dist/gettext/gettext-tools/libuniname/uniname.c	Tue Jul 21 17:35:17 2009
@@ -22,6 +22,7 @@
 /* Specification.  */
 #include "uniname.h"
 
+#include 
 #include 
 #include 
 #include 
@@ -31,8 +32,6 @@
 
 
 /* Table of Unicode character names, derived from UnicodeData.txt.  */
-#define uint16_t unsigned short
-#define uint32_t unsigned int
 #include "uninames.h"
 /* It contains:
   static const char unicode_name_words[26496] = ...;



CVS commit: src/common/lib/libc/string

2009-07-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jul 21 17:14:12 UTC 2009

Modified Files:
src/common/lib/libc/string: popcount64.c

Log Message:
Make the constant u_longlong too, lint is just too stupid...


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/string/popcount64.c

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

Modified files:

Index: src/common/lib/libc/string/popcount64.c
diff -u src/common/lib/libc/string/popcount64.c:1.2 src/common/lib/libc/string/popcount64.c:1.3
--- src/common/lib/libc/string/popcount64.c:1.2	Tue Jul 21 16:10:48 2009
+++ src/common/lib/libc/string/popcount64.c	Tue Jul 21 17:14:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: popcount64.c,v 1.2 2009/07/21 16:10:48 joerg Exp $	*/
+/*	$NetBSD: popcount64.c,v 1.3 2009/07/21 17:14:12 joerg Exp $	*/
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: popcount64.c,v 1.2 2009/07/21 16:10:48 joerg Exp $");
+__RCSID("$NetBSD: popcount64.c,v 1.3 2009/07/21 17:14:12 joerg Exp $");
 
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 #include 
@@ -55,7 +55,7 @@
 popcount64(uint64_t v)
 {
 	return popcount32((uint32_t)(v >> 32)) +
-	popcount32((uint32_t)(v & 0xU));
+	popcount32((uint32_t)(v & 0xULL));
 }
 #else
 unsigned int



CVS commit: src/include

2009-07-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jul 21 16:27:54 UTC 2009

Modified Files:
src/include: strings.h

Log Message:
Some parts of gcc fail with the direct include of sys/inttypes.h, so
fall back to using sys/types.h like stdlib.h does.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/include/strings.h

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

Modified files:

Index: src/include/strings.h
diff -u src/include/strings.h:1.15 src/include/strings.h:1.16
--- src/include/strings.h:1.15	Tue Jul 21 14:55:33 2009
+++ src/include/strings.h	Tue Jul 21 16:27:54 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: strings.h,v 1.15 2009/07/21 14:55:33 joerg Exp $	*/
+/*	$NetBSD: strings.h,v 1.16 2009/07/21 16:27:54 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
 
 #include 
 
-#include 
+#include 
 
 __BEGIN_DECLS
 int	 bcmp(const void *, const void *, size_t);



CVS commit: src/common/lib/libc/string

2009-07-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jul 21 16:10:48 UTC 2009

Modified Files:
src/common/lib/libc/string: popcount64.c

Log Message:
Add explicit casts to make lint happy.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/string/popcount64.c

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

Modified files:

Index: src/common/lib/libc/string/popcount64.c
diff -u src/common/lib/libc/string/popcount64.c:1.1 src/common/lib/libc/string/popcount64.c:1.2
--- src/common/lib/libc/string/popcount64.c:1.1	Tue Jul 21 14:55:32 2009
+++ src/common/lib/libc/string/popcount64.c	Tue Jul 21 16:10:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: popcount64.c,v 1.1 2009/07/21 14:55:32 joerg Exp $	*/
+/*	$NetBSD: popcount64.c,v 1.2 2009/07/21 16:10:48 joerg Exp $	*/
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: popcount64.c,v 1.1 2009/07/21 14:55:32 joerg Exp $");
+__RCSID("$NetBSD: popcount64.c,v 1.2 2009/07/21 16:10:48 joerg Exp $");
 
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 #include 
@@ -54,7 +54,8 @@
 unsigned int
 popcount64(uint64_t v)
 {
-	return popcount32(v >> 32) + popcount32(v & 0xU);
+	return popcount32((uint32_t)(v >> 32)) +
+	popcount32((uint32_t)(v & 0xU));
 }
 #else
 unsigned int



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

2009-07-21 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Jul 21 16:04:16 UTC 2009

Modified Files:
src/sys/arch/evbarm/ifpga: ifpga.c ifpga_clock.c ifpga_pci.c
ifpga_pcivar.h ifpgavar.h pl030_rtc.c

Log Message:
device_t/softc split.  Compiled, but never run.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/ifpga/ifpga.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/ifpga/ifpga_clock.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/ifpga/ifpga_pci.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/ifpga/ifpga_pcivar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/ifpga/ifpgavar.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/ifpga/pl030_rtc.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/evbarm/ifpga/ifpga.c
diff -u src/sys/arch/evbarm/ifpga/ifpga.c:1.22 src/sys/arch/evbarm/ifpga/ifpga.c:1.23
--- src/sys/arch/evbarm/ifpga/ifpga.c:1.22	Sun Apr 27 18:58:46 2008
+++ src/sys/arch/evbarm/ifpga/ifpga.c	Tue Jul 21 16:04:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifpga.c,v 1.22 2008/04/27 18:58:46 matt Exp $ */
+/*	$NetBSD: ifpga.c,v 1.23 2009/07/21 16:04:16 dyoung Exp $ */
 
 /*
  * Copyright (c) 2001 ARM Ltd
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ifpga.c,v 1.22 2008/04/27 18:58:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ifpga.c,v 1.23 2009/07/21 16:04:16 dyoung Exp $");
 
 #include 
 #include 
@@ -66,12 +66,12 @@
 #include "locators.h"
 
 /* Prototypes */
-static int  ifpga_match		(struct device *, struct cfdata *, void *);
-static void ifpga_attach	(struct device *, struct device *, void *);
+static int  ifpga_match		(device_t, cfdata_t, void *);
+static void ifpga_attach	(device_t, device_t, void *);
 static int  ifpga_print		(void *, const char *);
 
 /* Drive and attach structures */
-CFATTACH_DECL(ifpga, sizeof(struct ifpga_softc),
+CFATTACH_DECL_NEW(ifpga, sizeof(struct ifpga_softc),
 ifpga_match, ifpga_attach, NULL, NULL);
 
 int ifpga_found;
@@ -91,6 +91,8 @@
 static struct bus_space ifpga_bs_tag;
 
 struct ifpga_softc *ifpga_sc;
+device_t ifpga_dev;
+
 /*
  * Print the configuration information for children
  */
@@ -109,10 +111,9 @@
 }
 
 static int
-ifpga_search(struct device *parent, struct cfdata *cf,
-	 const int *ldesc, void *aux)
+ifpga_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
-	struct ifpga_softc *sc = (struct ifpga_softc *)parent;
+	struct ifpga_softc *sc = device_private(parent);
 	struct ifpga_attach_args ifa;
 	int tryagain;
 
@@ -133,7 +134,7 @@
 }
 
 static int
-ifpga_match(struct device *parent, struct cfdata *cf, void *aux)
+ifpga_match(device_t parent, cfdata_t cf, void *aux)
 {
 #if 0
 	struct mainbus_attach_args *ma = aux;
@@ -151,9 +152,9 @@
 }
 
 static void
-ifpga_attach(struct device *parent, struct device *self, void *aux)
+ifpga_attach(device_t parent, device_t self, void *aux)
 {
-	struct ifpga_softc *sc = (struct ifpga_softc *)self;
+	struct ifpga_softc *sc = device_private(self);
 	u_int id, sysclk;
 #if defined(PCI_NETBSD_CONFIGURE) && NPCI > 0
 	struct extent *ioext, *memext, *pmemext;
@@ -176,13 +177,14 @@
 
 	sc->sc_iot = &ifpga_bs_tag;
 
+	ifpga_dev = self;
 	ifpga_sc = sc;
 
 	/* Now map in the IFPGA motherboard registers.  */
 	if (bus_space_map(sc->sc_iot, IFPGA_IO_SC_BASE, IFPGA_IO_SC_SIZE, 0,
 	&sc->sc_sc_ioh))
 		panic("%s: Cannot map system controller registers", 
-		self->dv_xname);
+		device_xname(self));
 
 	id = bus_space_read_4(sc->sc_iot, sc->sc_sc_ioh, IFPGA_SC_ID);
 
@@ -221,7 +223,7 @@
 		panic(" Unsupported bus");
 	}
 
-	printf("\n%s: FPGA ", self->dv_xname);
+	printf("\n%s: FPGA ", device_xname(self));
 
 	switch (id & IFPGA_SC_ID_FPGA_MASK)
 	{
@@ -246,20 +248,22 @@
 	if (bus_space_map(sc->sc_iot, IFPGA_IO_IRQ_BASE, IFPGA_IO_IRQ_SIZE, 
 	BUS_SPACE_MAP_LINEAR, &sc->sc_irq_ioh))
 		panic("%s: Cannot map irq controller registers",
-		self->dv_xname);
+		device_xname(self));
 
 	/* We can write to the IRQ/FIQ controller now.  */
 	ifpga_intr_postinit();
 
 	/* Map the core module */
 	if (bus_space_map(sc->sc_iot, IFPGA_IO_CM_BASE, IFPGA_IO_CM_SIZE, 0,
-	&sc->sc_cm_ioh))
-		panic("%s: Cannot map core module registers", self->dv_xname);
+	&sc->sc_cm_ioh)) {
+		panic("%s: Cannot map core module registers",
+		device_xname(self));
+	}
 
 	/* Map the timers */
 	if (bus_space_map(sc->sc_iot, IFPGA_IO_TMR_BASE, IFPGA_IO_TMR_SIZE, 0,
 	&sc->sc_tmr_ioh))
-		panic("%s: Cannot map timer registers", self->dv_xname);
+		panic("%s: Cannot map timer registers", device_xname(self));
 
 	printf("\n");
 
@@ -275,7 +279,7 @@
 	&pci_sc->sc_conf_ioh)
 	|| bus_space_map(pci_sc->sc_memt, IFPGA_V360_REG_BASE,
 	IFPGA_V360_REG_SIZE, 0, &pci_sc->sc_reg_ioh))
-		panic("%s: Cannot map pci memory", self->dv_xname);
+		panic("%s: Cannot map pci memory", device_xname(self));
 
 	{
 		pcireg_t id_reg, class_reg;
@@ -287

CVS commit: src/sys/arch/pmax/pmax

2009-07-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Jul 21 15:10:39 UTC 2009

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

Log Message:
No need to clear BSS in kernel itself if there is valid bootinfo,
i.e. it's loaded by our native bootloader.


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/sys/arch/pmax/pmax/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/pmax/pmax/machdep.c
diff -u src/sys/arch/pmax/pmax/machdep.c:1.233 src/sys/arch/pmax/pmax/machdep.c:1.234
--- src/sys/arch/pmax/pmax/machdep.c:1.233	Tue Jul 21 14:26:48 2009
+++ src/sys/arch/pmax/pmax/machdep.c	Tue Jul 21 15:10:39 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.233 2009/07/21 14:26:48 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.234 2009/07/21 15:10:39 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -77,7 +77,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.233 2009/07/21 14:26:48 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.234 2009/07/21 15:10:39 tsutsui Exp $");
 
 #include "fs_mfs.h"
 #include "opt_ddb.h"
@@ -230,7 +230,9 @@
 		ssym = (void *)bi_syms->ssym;
 		esym = (void *)bi_syms->esym;
 		kernend = (void *)mips_round_page(esym);
+#if 0	/* our bootloader clears BSS properly */
 		memset(edata, 0, end - edata);
+#endif
 	} else
 #ifdef EXEC_AOUT
 	/* XXX: Backwards compatibility with old bootblocks - this should



CVS commit: src

2009-07-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jul 21 14:55:33 UTC 2009

Modified Files:
src/distrib/sets/lists/comp: mi
src/include: strings.h
src/lib/libc/string: Makefile.inc popcount.3
src/sys/lib/libkern: Makefile.libkern libkern.h
Added Files:
src/common/lib/libc/string: popcount32.c popcount64.c
Removed Files:
src/lib/libc/string: popcount.c popcountl.c popcountll.c

Log Message:
Move popcount et al to src/common and add popcount32/popcount64.
Requested by rm...@. MD should now override popcount32/popcount64 and
provide the aliases as fitting.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/common/lib/libc/string/popcount32.c \
src/common/lib/libc/string/popcount64.c
cvs rdiff -u -r1.1286 -r1.1287 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.14 -r1.15 src/include/strings.h
cvs rdiff -u -r1.73 -r1.74 src/lib/libc/string/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/string/popcount.3
cvs rdiff -u -r1.1 -r0 src/lib/libc/string/popcount.c \
src/lib/libc/string/popcountl.c src/lib/libc/string/popcountll.c
cvs rdiff -u -r1.2 -r1.3 src/sys/lib/libkern/Makefile.libkern
cvs rdiff -u -r1.91 -r1.92 src/sys/lib/libkern/libkern.h

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1286 src/distrib/sets/lists/comp/mi:1.1287
--- src/distrib/sets/lists/comp/mi:1.1286	Tue Jul 21 14:18:50 2009
+++ src/distrib/sets/lists/comp/mi	Tue Jul 21 14:55:32 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1286 2009/07/21 14:18:50 njoly Exp $
+#	$NetBSD: mi,v 1.1287 2009/07/21 14:55:32 joerg Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6946,6 +6946,8 @@
 ./usr/share/man/cat3/popcount.0			comp-c-catman		.cat
 ./usr/share/man/cat3/popcountl.0		comp-c-catman		.cat
 ./usr/share/man/cat3/popcountll.0		comp-c-catman		.cat
+./usr/share/man/cat3/popcount32.0		comp-c-catman		.cat
+./usr/share/man/cat3/popcount64.0		comp-c-catman		.cat
 ./usr/share/man/cat3/popen.0			comp-c-catman		.cat
 ./usr/share/man/cat3/pos_form_cursor.0		comp-c-catman		.cat
 ./usr/share/man/cat3/posix_memalign.0		comp-c-catman		.cat
@@ -12406,6 +12408,8 @@
 ./usr/share/man/html3/popcount.html		comp-c-htmlman		html
 ./usr/share/man/html3/popcountl.html		comp-c-htmlman		html
 ./usr/share/man/html3/popcountll.html		comp-c-htmlman		html
+./usr/share/man/html3/popcount32.html		comp-c-htmlman		html
+./usr/share/man/html3/popcount64.html		comp-c-htmlman		html
 ./usr/share/man/html3/popen.html		comp-c-htmlman		html
 ./usr/share/man/html3/pos_form_cursor.html	comp-c-htmlman		html
 ./usr/share/man/html3/posix_memalign.html	comp-c-htmlman		html
@@ -17860,6 +17864,8 @@
 ./usr/share/man/man3/popcount.3			comp-c-man		.man
 ./usr/share/man/man3/popcountl.3		comp-c-man		.man
 ./usr/share/man/man3/popcountll.3		comp-c-man		.man
+./usr/share/man/man3/popcount32.3		comp-c-man		.man
+./usr/share/man/man3/popcount64.3		comp-c-man		.man
 ./usr/share/man/man3/popen.3			comp-c-man		.man
 ./usr/share/man/man3/pos_form_cursor.3		comp-c-man		.man
 ./usr/share/man/man3/posix_memalign.3		comp-c-man		.man

Index: src/include/strings.h
diff -u src/include/strings.h:1.14 src/include/strings.h:1.15
--- src/include/strings.h:1.14	Tue Jul 21 13:18:43 2009
+++ src/include/strings.h	Tue Jul 21 14:55:33 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: strings.h,v 1.14 2009/07/21 13:18:43 joerg Exp $	*/
+/*	$NetBSD: strings.h,v 1.15 2009/07/21 14:55:33 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -46,6 +46,8 @@
 
 #include 
 
+#include 
+
 __BEGIN_DECLS
 int	 bcmp(const void *, const void *, size_t);
 void	 bcopy(const void *, void *, size_t);
@@ -55,6 +57,8 @@
 unsigned int	popcount(unsigned int) __constfunc;
 unsigned int	popcountl(unsigned long) __constfunc;
 unsigned int	popcountll(unsigned long long) __constfunc;
+unsigned int	popcount32(uint32_t) __constfunc;
+unsigned int	popcount64(uint64_t) __constfunc;
 char	*rindex(const char *, int);
 int	 strcasecmp(const char *, const char *);
 int	 strncasecmp(const char *, const char *, size_t);

Index: src/lib/libc/string/Makefile.inc
diff -u src/lib/libc/string/Makefile.inc:1.73 src/lib/libc/string/Makefile.inc:1.74
--- src/lib/libc/string/Makefile.inc:1.73	Tue Jul 21 13:18:43 2009
+++ src/lib/libc/string/Makefile.inc	Tue Jul 21 14:55:33 2009
@@ -1,10 +1,10 @@
 #	from: @(#)Makefile.inc	8.1 (Berkeley) 6/4/93
-#	$NetBSD: Makefile.inc,v 1.73 2009/07/21 13:18:43 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.74 2009/07/21 14:55:33 joerg Exp $
 
 # string sources
 .PATH: ${ARCHDIR}/string ${.CURDIR}/string
 
-SRCS+=	bm.c popcountl.c stpcpy.c stpncpy.c \
+SRCS+=	bm.c stpcpy.c stpncpy.c \
 	strcasecmp.c strncasecmp.c strcasestr.c strcoll.c strdup.c \
 	strerror.c strlcat.c strlcpy.c strnlen.c \
 	strmode.c strsignal.c strtok.c \
@@ -55,11 +55,11 @@
 .if empty(SRCS:M

CVS commit: src/sys/arch/pmax/pmax

2009-07-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Jul 21 14:26:48 UTC 2009

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

Log Message:
Fix an #ifdef botch in rev 1.214 that causes
[ Kernel symbol table invalid! ] message at boot,
which means no ksyms(4) support even on GENERIC kernel.

Should be pulled up to netbsd-4 and netbsd-5.


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/sys/arch/pmax/pmax/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/pmax/pmax/machdep.c
diff -u src/sys/arch/pmax/pmax/machdep.c:1.232 src/sys/arch/pmax/pmax/machdep.c:1.233
--- src/sys/arch/pmax/pmax/machdep.c:1.232	Wed Mar 18 10:22:33 2009
+++ src/sys/arch/pmax/pmax/machdep.c	Tue Jul 21 14:26:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.232 2009/03/18 10:22:33 cegger Exp $	*/
+/*	$NetBSD: machdep.c,v 1.233 2009/07/21 14:26:48 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -77,7 +77,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.232 2009/03/18 10:22:33 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.233 2009/07/21 14:26:48 tsutsui Exp $");
 
 #include "fs_mfs.h"
 #include "opt_ddb.h"
@@ -231,13 +231,13 @@
 		esym = (void *)bi_syms->esym;
 		kernend = (void *)mips_round_page(esym);
 		memset(edata, 0, end - edata);
-	}
+	} else
+#ifdef EXEC_AOUT
 	/* XXX: Backwards compatibility with old bootblocks - this should
 	 * go soon...
 	 */
-#ifdef EXEC_AOUT
 	/* Exec header and symbols? */
-	else if (aout->a_midmag == 0x07018b00 && (i = aout->a_syms) != 0) {
+	if (aout->a_midmag == 0x07018b00 && (i = aout->a_syms) != 0) {
 		ssym = end;
 		i += (*(long *)(end + i + 4) + 3) & ~3;		/* strings */
 		esym = end + i + 4;



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

2009-07-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue Jul 21 14:18:50 UTC 2009

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
+mount_nilfs.debug


To generate a diff of this commit:
cvs rdiff -u -r1.1285 -r1.1286 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1285 src/distrib/sets/lists/comp/mi:1.1286
--- src/distrib/sets/lists/comp/mi:1.1285	Tue Jul 21 13:18:43 2009
+++ src/distrib/sets/lists/comp/mi	Tue Jul 21 14:18:50 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1285 2009/07/21 13:18:43 joerg Exp $
+#	$NetBSD: mi,v 1.1286 2009/07/21 14:18:50 njoly Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2734,6 +2734,7 @@
 ./usr/libdata/debug/sbin/mount_lfs.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/mount_msdos.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/mount_nfs.debug	comp-nfsclient-debug	debug
+./usr/libdata/debug/sbin/mount_nilfs.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/mount_ntfs.debug	comp-ntfs-debug		debug
 ./usr/libdata/debug/sbin/mount_null.debug	comp-miscfs-debug	debug
 ./usr/libdata/debug/sbin/mount_overlay.debug	comp-miscfs-debug	debug



CVS commit: src/lib/libc/string

2009-07-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul 21 13:22:15 UTC 2009

Modified Files:
src/lib/libc/string: ffs.3

Log Message:
Xref popcount(3).


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/string/ffs.3

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

Modified files:

Index: src/lib/libc/string/ffs.3
diff -u src/lib/libc/string/ffs.3:1.10 src/lib/libc/string/ffs.3:1.11
--- src/lib/libc/string/ffs.3:1.10	Thu Aug  7 16:43:47 2003
+++ src/lib/libc/string/ffs.3	Tue Jul 21 13:22:15 2009
@@ -28,9 +28,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)ffs.3	8.2 (Berkeley) 4/19/94
-.\"	$NetBSD: ffs.3,v 1.10 2003/08/07 16:43:47 agc Exp $
+.\"	$NetBSD: ffs.3,v 1.11 2009/07/21 13:22:15 wiz Exp $
 .\"
-.Dd April 19, 1994
+.Dd July 21, 2009
 .Dt FFS 3
 .Os
 .Sh NAME
@@ -52,7 +52,8 @@
 bit.
 A return value of 0 means that the argument was zero.
 .Sh SEE ALSO
-.Xr bitstring 3
+.Xr bitstring 3 ,
+.Xr popcount 3
 .Sh HISTORY
 The
 .Fn ffs



CVS commit: src/lib/libc/string

2009-07-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul 21 13:21:42 UTC 2009

Modified Files:
src/lib/libc/string: popcount.3

Log Message:
Fix typo, add comma in enumeration.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/string/popcount.3

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

Modified files:

Index: src/lib/libc/string/popcount.3
diff -u src/lib/libc/string/popcount.3:1.1 src/lib/libc/string/popcount.3:1.2
--- src/lib/libc/string/popcount.3:1.1	Tue Jul 21 13:18:44 2009
+++ src/lib/libc/string/popcount.3	Tue Jul 21 13:21:41 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: popcount.3,v 1.1 2009/07/21 13:18:44 joerg Exp $
+.\"	$NetBSD: popcount.3,v 1.2 2009/07/21 13:21:41 wiz Exp $
 .\"
 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -44,7 +44,7 @@
 .Ft unsigned int
 .Fn popcountl "unsigned long value"
 .Ft unsigned int
-.Fn popcountl "unsigned long long value"
+.Fn popcountll "unsigned long long value"
 .Sh DESCRIPTION
 The
 .Nm
@@ -55,7 +55,7 @@
 .Sh HISTORY
 The
 .Fn popcount ,
-.Fn popcountl
+.Fn popcountl ,
 and
 .Fn popcountll
 functions appeared in



CVS commit: src

2009-07-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jul 21 13:18:44 UTC 2009

Modified Files:
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist
src/include: strings.h
src/lib/libc/string: Makefile.inc
src/tests/lib/libc: Atffile Makefile
Added Files:
src/lib/libc/string: popcount.3 popcount.c popcountl.c popcountll.c
src/tests/lib/libc/string: Atffile Makefile t_popcount.c

Log Message:
Add popcount(3) and the long and long long version. Name is inspired by
gnulib, the implementation goes back to the AMD Software Optimizer
guide. A number of platforms will want to replace the C version with
assembler code using native instructions.


To generate a diff of this commit:
cvs rdiff -u -r1.1284 -r1.1285 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.44 -r1.45 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.406 -r1.407 src/etc/mtree/NetBSD.dist
cvs rdiff -u -r1.13 -r1.14 src/include/strings.h
cvs rdiff -u -r1.72 -r1.73 src/lib/libc/string/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/string/popcount.3 \
src/lib/libc/string/popcount.c src/lib/libc/string/popcountl.c \
src/lib/libc/string/popcountll.c
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/Atffile \
src/tests/lib/libc/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/string/Atffile \
src/tests/lib/libc/string/Makefile src/tests/lib/libc/string/t_popcount.c

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1284 src/distrib/sets/lists/comp/mi:1.1285
--- src/distrib/sets/lists/comp/mi:1.1284	Mon Jul 20 17:03:36 2009
+++ src/distrib/sets/lists/comp/mi	Tue Jul 21 13:18:43 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1284 2009/07/20 17:03:36 joerg Exp $
+#	$NetBSD: mi,v 1.1285 2009/07/21 13:18:43 joerg Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6942,6 +6942,9 @@
 ./usr/share/man/cat3/pmap_unset.0		comp-c-catman		.cat
 ./usr/share/man/cat3/pmc.0			comp-c-catman		.cat
 ./usr/share/man/cat3/pnoutrefresh.0		comp-c-catman		.cat
+./usr/share/man/cat3/popcount.0			comp-c-catman		.cat
+./usr/share/man/cat3/popcountl.0		comp-c-catman		.cat
+./usr/share/man/cat3/popcountll.0		comp-c-catman		.cat
 ./usr/share/man/cat3/popen.0			comp-c-catman		.cat
 ./usr/share/man/cat3/pos_form_cursor.0		comp-c-catman		.cat
 ./usr/share/man/cat3/posix_memalign.0		comp-c-catman		.cat
@@ -12399,6 +12402,9 @@
 ./usr/share/man/html3/pmap_unset.html		comp-c-htmlman		html
 ./usr/share/man/html3/pmc.html			comp-c-htmlman		html
 ./usr/share/man/html3/pnoutrefresh.html		comp-c-htmlman		html
+./usr/share/man/html3/popcount.html		comp-c-htmlman		html
+./usr/share/man/html3/popcountl.html		comp-c-htmlman		html
+./usr/share/man/html3/popcountll.html		comp-c-htmlman		html
 ./usr/share/man/html3/popen.html		comp-c-htmlman		html
 ./usr/share/man/html3/pos_form_cursor.html	comp-c-htmlman		html
 ./usr/share/man/html3/posix_memalign.html	comp-c-htmlman		html
@@ -17850,6 +17856,9 @@
 ./usr/share/man/man3/pmap_unset.3		comp-c-man		.man
 ./usr/share/man/man3/pmc.3			comp-c-man		.man
 ./usr/share/man/man3/pnoutrefresh.3		comp-c-man		.man
+./usr/share/man/man3/popcount.3			comp-c-man		.man
+./usr/share/man/man3/popcountl.3		comp-c-man		.man
+./usr/share/man/man3/popcountll.3		comp-c-man		.man
 ./usr/share/man/man3/popen.3			comp-c-man		.man
 ./usr/share/man/man3/pos_form_cursor.3		comp-c-man		.man
 ./usr/share/man/man3/posix_memalign.3		comp-c-man		.man

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.44 src/distrib/sets/lists/tests/mi:1.45
--- src/distrib/sets/lists/tests/mi:1.44	Mon Jul 20 17:03:36 2009
+++ src/distrib/sets/lists/tests/mi	Tue Jul 21 13:18:43 2009
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.44 2009/07/20 17:03:36 joerg Exp $
+# $NetBSD: mi,v 1.45 2009/07/21 13:18:43 joerg Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -136,6 +136,8 @@
 ./usr/libdata/debug/usr/tests/lib/libc	tests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libc/stdlibtests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_mi_vector_hash.debug	tests-lib-debug	debug
+./usr/libdata/debug/usr/tests/lib/libc/stringtests-lib-debug	debug
+./usr/libdata/debug/usr/tests/lib/libc/string/t_popcount.debug		tests-lib-debug	debug
 ./usr/libdata/debug/usr/tests/modules	tests-sys-debug
 ./usr/libdata/debug/usr/tests/modules/t_modctl.debug			tests-sys-debug		debug
 ./usr/libdata/debug/usr/tests/net	tests-net-debug
@@ -847,6 +849,9 @@
 ./usr/tests/lib/libc/stdlib			tests-lib-tests
 ./usr/tests/lib/libc/stdlib/Atffile		tests-lib-tests
 ./usr/tests/lib/libc/stdlib/t_mi_vector_hash	tests-lib-tests
+./usr/tests/lib/libc/string			tests-lib-tests
+./usr/tests/lib/libc/string/Atffile		tests-lib-tests
+./usr/tests/lib/libc/strin

CVS commit: src/lib/libc/stdlib

2009-07-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jul 21 12:40:53 UTC 2009

Modified Files:
src/lib/libc/stdlib: mi_vector_hash.3

Log Message:
Add HISTORY.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/stdlib/mi_vector_hash.3

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

Modified files:

Index: src/lib/libc/stdlib/mi_vector_hash.3
diff -u src/lib/libc/stdlib/mi_vector_hash.3:1.1 src/lib/libc/stdlib/mi_vector_hash.3:1.2
--- src/lib/libc/stdlib/mi_vector_hash.3:1.1	Mon Jul 20 17:03:37 2009
+++ src/lib/libc/stdlib/mi_vector_hash.3	Tue Jul 21 12:40:52 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mi_vector_hash.3,v 1.1 2009/07/20 17:03:37 joerg Exp $
+.\"	$NetBSD: mi_vector_hash.3,v 1.2 2009/07/21 12:40:52 joerg Exp $
 .\"
 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -56,5 +56,10 @@
 An optimised code path is used if
 .Fa key
 is aligned on a 32-bit boundary.
+.Sh HISTORY
+The
+.Nm
+function appeared in
+.Nx 6.0 .
 .Sh AUTHORS
 The hash function has been created by Bob Jenkins.



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

2009-07-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jul 21 07:35:55 UTC 2009

Modified Files:
src/sys/arch/arm/footbridge: footbridge.c footbridge_clock.c
footbridge_com.c footbridgevar.h todclock.c
src/sys/arch/arm/footbridge/isa: dsrtc.c sysbeep_isa.c

Log Message:
device_t/softc split
CFATTACH_DECL -> CFATTACH_DECL_NEW
struct device * -> device_t
struct cfdata * -> cfdata_t
Use aprint*


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/footbridge/footbridge.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/footbridge/footbridge_clock.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/footbridge/footbridge_com.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/footbridge/footbridgevar.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/footbridge/todclock.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/footbridge/isa/dsrtc.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/footbridge/isa/sysbeep_isa.c

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

Modified files:

Index: src/sys/arch/arm/footbridge/footbridge.c
diff -u src/sys/arch/arm/footbridge/footbridge.c:1.20 src/sys/arch/arm/footbridge/footbridge.c:1.21
--- src/sys/arch/arm/footbridge/footbridge.c:1.20	Sat Mar 14 15:36:02 2009
+++ src/sys/arch/arm/footbridge/footbridge.c	Tue Jul 21 07:35:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: footbridge.c,v 1.20 2009/03/14 15:36:02 dsl Exp $	*/
+/*	$NetBSD: footbridge.c,v 1.21 2009/07/21 07:35:55 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: footbridge.c,v 1.20 2009/03/14 15:36:02 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: footbridge.c,v 1.21 2009/07/21 07:35:55 skrll Exp $");
 
 #include 
 #include 
@@ -68,15 +68,13 @@
 
 /* Declare prototypes */
 
-static int footbridge_match(struct device *parent, struct cfdata *cf,
-	 void *aux);
-static void footbridge_attach(struct device *parent, struct device *self,
-	 void *aux);
+static int footbridge_match(device_t parent, cfdata_t cf, void *aux);
+static void footbridge_attach(device_t parent, device_t self, void *aux);
 static int footbridge_print(void *aux, const char *pnp);
 static int footbridge_intr(void *arg);
 
 /* Driver and attach structures */
-CFATTACH_DECL(footbridge, sizeof(struct footbridge_softc),
+CFATTACH_DECL_NEW(footbridge, sizeof(struct footbridge_softc),
 footbridge_match, footbridge_attach, NULL, NULL);
 
 /* Various bus space tags */
@@ -109,7 +107,7 @@
 }
 
 /*
- * int footbridgeprint(void *aux, const char *name)
+ * int footbridge_print(void *aux, const char *name)
  *
  * print configuration info for children
  */
@@ -131,7 +129,7 @@
  */ 
  
 static int
-footbridge_match(struct device *parent, struct cfdata *cf, void *aux)
+footbridge_match(device_t parent, cfdata_t cf, void *aux)
 {
 	if (footbridge_found)
 		return(0);
@@ -140,14 +138,14 @@
 
 
 /*
- * void footbridge_attach(struct device *parent, struct device *dev, void *aux)
+ * void footbridge_attach(device_t parent, device_t dev, void *aux)
  *
  */
   
 static void
-footbridge_attach(struct device *parent, struct device *self, void *aux)
+footbridge_attach(device_t parent, device_t self, void *aux)
 {
-	struct footbridge_softc *sc = (struct footbridge_softc *)self;
+	struct footbridge_softc *sc = device_private(self);
 	union footbridge_attach_args fba;
 	int vendor, device, rev;
 
@@ -156,21 +154,22 @@
 
 	clock_sc = sc;
 
+	sc->sc_dev = self;
 	sc->sc_iot = &footbridge_bs_tag;
 
 	/* Map the Footbridge */
 	if (bus_space_map(sc->sc_iot, DC21285_ARMCSR_VBASE,
 	 DC21285_ARMCSR_VSIZE, 0, &sc->sc_ioh))
-		panic("%s: Cannot map registers", self->dv_xname);
+		panic("%s: Cannot map registers", device_xname(self));
 
 	/* Read the ID to make sure it is what we think it is */
 	vendor = bus_space_read_2(sc->sc_iot, sc->sc_ioh, VENDOR_ID);
 	device = bus_space_read_2(sc->sc_iot, sc->sc_ioh, DEVICE_ID);
 	rev = bus_space_read_1(sc->sc_iot, sc->sc_ioh, REVISION);
 	if (vendor != DC21285_VENDOR_ID && device != DC21285_DEVICE_ID)
-		panic("%s: Unrecognised ID", self->dv_xname);
+		panic("%s: Unrecognised ID", device_xname(self));
 
-	printf(": DC21285 rev %d\n", rev);
+	aprint_normal(": DC21285 rev %d\n", rev);
 
 	/* Disable all interrupts from the footbridge */
 	bus_space_write_4(sc->sc_iot, sc->sc_ioh, IRQ_ENABLE_CLEAR, 0x);

Index: src/sys/arch/arm/footbridge/footbridge_clock.c
diff -u src/sys/arch/arm/footbridge/footbridge_clock.c:1.25 src/sys/arch/arm/footbridge/footbridge_clock.c:1.26
--- src/sys/arch/arm/footbridge/footbridge_clock.c:1.25	Sat Sep 20 14:53:37 2008
+++ src/sys/arch/arm/footbridge/footbridge_clock.c	Tue Jul 21 07:35:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: footbridge_clock.c,v 1.25 2008/09/20 14:53:37 chris Exp $	*/
+/*	$NetBSD: footbridge_clock.c,v 1.26 2009/07/21 07:35:55 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997 Mark B

CVS commit: src/sys/arch/powerpc/include/oea

2009-07-21 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Tue Jul 21 07:08:57 UTC 2009

Modified Files:
src/sys/arch/powerpc/include/oea: bat.h

Log Message:
protect C constructs from assembler source inclusion.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/include/oea/bat.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/powerpc/include/oea/bat.h
diff -u src/sys/arch/powerpc/include/oea/bat.h:1.12 src/sys/arch/powerpc/include/oea/bat.h:1.13
--- src/sys/arch/powerpc/include/oea/bat.h:1.12	Mon Apr 28 20:23:32 2008
+++ src/sys/arch/powerpc/include/oea/bat.h	Tue Jul 21 07:08:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bat.h,v 1.12 2008/04/28 20:23:32 martin Exp $	*/
+/*	$NetBSD: bat.h,v 1.13 2009/07/21 07:08:57 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #ifndef	_POWERPC_OEA_BAT_H_
 #define	_POWERPC_OEA_BAT_H_
 
-#ifndef _LOCORE
+#if defined(_KERNEL) && !defined(_LOCORE)
 struct bat {
 	register_t batu;
 	register_t batl;
@@ -196,8 +196,7 @@
 
 #define	BAT_VA2IDX(va)	((va) >> ADDR_SR_SHFT)
 
-#ifdef	_KERNEL
-#ifndef _LOCORE
+#if defined(_KERNEL) && !defined(_LOCORE)
 void oea_batinit(paddr_t, ...);
 void oea_iobat_add(paddr_t, register_t);
 void oea_iobat_remove(paddr_t);
@@ -206,6 +205,5 @@
 extern struct bat battable[];
 #endif /* PPC_OEA */
 #endif
-#endif
 
 #endif	/* _POWERPC_OEA_BAT_H_ */