CVS commit: src/sys/dev/putter

2010-08-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Aug 27 07:40:01 UTC 2010

Modified Files:
src/sys/dev/putter: putter.c

Log Message:
waiters gonna wait, so call seldestroy to wake them up when we go south


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/putter/putter.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/putter/putter.c
diff -u src/sys/dev/putter/putter.c:1.28 src/sys/dev/putter/putter.c:1.29
--- src/sys/dev/putter/putter.c:1.28	Sun Apr 11 09:36:47 2010
+++ src/sys/dev/putter/putter.c	Fri Aug 27 07:40:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: putter.c,v 1.28 2010/04/11 09:36:47 pooka Exp $	*/
+/*	$NetBSD: putter.c,v 1.29 2010/08/27 07:40:01 pooka Exp $	*/
 
 /*
  * Copyright (c) 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: putter.c,v 1.28 2010/04/11 09:36:47 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: putter.c,v 1.29 2010/08/27 07:40:01 pooka Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -606,6 +606,7 @@
 	TAILQ_REMOVE(putter_ilist, pi, pi_entries);
 	pi-pi_private = PUTTER_DEAD;
 	mutex_exit(pi_mtx);
+	seldestroy(pi-pi_sel);
 
 	DPRINTF((putter_nukebypmp: nuked %p\n, pi));
 }



CVS commit: src/tests/fs/vfs

2010-08-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Aug 27 08:15:30 UTC 2010

Modified Files:
src/tests/fs/vfs: t_full.c

Log Message:
Skip the full test for puffs now that we can (yes, atf issue #53)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/vfs/t_full.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/fs/vfs/t_full.c
diff -u src/tests/fs/vfs/t_full.c:1.1 src/tests/fs/vfs/t_full.c:1.2
--- src/tests/fs/vfs/t_full.c:1.1	Tue Aug 17 11:46:16 2010
+++ src/tests/fs/vfs/t_full.c	Fri Aug 27 08:15:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_full.c,v 1.1 2010/08/17 11:46:16 pooka Exp $	*/
+/*	$NetBSD: t_full.c,v 1.2 2010/08/27 08:15:30 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -57,10 +57,7 @@
 	int fd, i = 0;
 
 	if (FSTYPE_PUFFS(tc)) {
-		/* XXX: I would *LIKE* to skip this, but atf won't let me */
-		return;
-
-		atf_tc_skip(puffs does not support explicit block allocation);
+		atf_tc_skip(puffs does not support GOP_ALLOC);
 	}
 
 	bonus = 0;



CVS commit: src

2010-08-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Aug 27 08:21:43 UTC 2010

Added Files:
src/lib/librump: rump.3
Removed Files:
src/sys/rump/librump/rumpkern: rump.3

Log Message:
Move the manpage from the kernel sources into lib, 'cause that's
where it's used.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/lib/librump/rump.3
cvs rdiff -u -r1.9 -r0 src/sys/rump/librump/rumpkern/rump.3

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

Added files:

Index: src/lib/librump/rump.3
diff -u /dev/null src/lib/librump/rump.3:1.1
--- /dev/null	Fri Aug 27 08:21:43 2010
+++ src/lib/librump/rump.3	Fri Aug 27 08:21:43 2010
@@ -0,0 +1,191 @@
+.\ $NetBSD: rump.3,v 1.1 2010/08/27 08:21:43 pooka Exp $
+.\
+.\ Copyright (c) 2008-2010 Antti Kantee.  All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\ SUCH DAMAGE.
+.\
+.Dd August 26, 2010
+.Dt RUMP 3
+.Os
+.Sh NAME
+.Nm rump
+.Nd The Rump Anykernel
+.Sh LIBRARY
+rump Library (librump, \-lrump)
+.Sh SYNOPSIS
+.In rump/rump.h
+.In rump/rump_syscalls.h
+.Sh DESCRIPTION
+.Nm
+is part of the realization of a flexible anykernel architecture for
+.Nx .
+An anykernel architecture enables using kernel code in a number of
+different kernel models.
+These models include, but are not limited to, the original monolithic
+kernel, a microkernel server, or an exokernel style application
+library.
+.Nm
+itself makes it possible to run unmodified kernel components in a regular
+userspace process.
+Most of the time unmodified means unmodified source code, but some
+architectures can also execute unmodified kernel module binaries
+in userspace.
+Examples of different use models are running file system drivers
+as userspace servers (see
+.Xr p2k 3 )
+and being able to write standalone applications which understand
+file system images.
+.Pp
+Regardless of the kernel model used, a rump kernel is a fullfledged
+kernel with its own virtual namespaces,
+including a file system hierarchy, CPUs, TCP/UDP
+ports, device driver attachments and file descriptors.
+This means that any modification to the system state on the host
+running the rump kernel will not show up in the rump kernel and
+vice versa.
+A rump kernel may also be significantly more lightweight that the
+host, and might not include include for example file system support
+at all.
+.Pp
+A rump kernel is bootstrapped by calling
+.Fn rump_init .
+Before bootstrapping the kernel, it is possible to control its
+functionality by setting various environment variables:
+.Bl -tag -width RUMP_MEMLIMITXX
+.It Dv RUMP_NCPU
+If set, indicates the number of virtual CPUs configured into a
+rump kernel.
+The default is the number of host CPUs.
+The number of virtual CPUs controls how many threads can enter
+the rump kernel simultaneously.
+.It Dv RUMP_VERBOSE
+If set to non-zero, activates bootverbose.
+.It Dv RUMP_THREADS
+If set to 0, prevents the rump kernel from creating any kernel threads.
+This is possible usually only for file systems, as other subsystems
+depend on threads to work.
+.It Dv RUMP_MEMLIMIT
+If set, indicates how many bytes of memory a rump kernel will
+allocate before attempting to purge caches.
+The default is as much as the host allows.
+.El
+.Pp
+A number of interfaces are available for requesting services from
+a rump kernel.
+The most commonly used ones are the rump system calls.
+They are exactly like regular system calls but with the exception
+that they target the rump kernel of the current process instead of
+the host kernel.
+For example,
+.Fn rump_sys_socket
+takes the same parameters as
+.Fn socket
+and will open a socket in the rump kernel.
+The resulting file descriptor 

CVS commit: src/lib/libc/gen

2010-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 27 08:38:42 UTC 2010

Modified Files:
src/lib/libc/gen: Makefile.inc psignal.3 psignal.c

Log Message:
add psiginfo.


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/lib/libc/gen/Makefile.inc
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/gen/psignal.3
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/gen/psignal.c

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/gen/Makefile.inc
diff -u src/lib/libc/gen/Makefile.inc:1.170 src/lib/libc/gen/Makefile.inc:1.171
--- src/lib/libc/gen/Makefile.inc:1.170	Sat May 22 02:38:15 2010
+++ src/lib/libc/gen/Makefile.inc	Fri Aug 27 04:38:41 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.170 2010/05/22 06:38:15 tnozaki Exp $
+#	$NetBSD: Makefile.inc,v 1.171 2010/08/27 08:38:41 christos Exp $
 #	from: @(#)Makefile.inc	8.6 (Berkeley) 5/4/95
 
 # gen sources
@@ -130,7 +130,7 @@
 MLINKS+=humanize_number.3 dehumanize_number.3
 MLINKS+=makecontext.3 swapcontext.3
 MLINKS+=popen.3 pclose.3
-MLINKS+=psignal.3 sys_siglist.3 psignal.3 sys_signame.3
+MLINKS+=psignal.3 sys_siglist.3 psignal.3 sys_signame.3 psignal.3 psiginfo.3
 MLINKS+=pwcache.3 user_from_uid.3 pwcache.3 group_from_gid.3
 MLINKS+=pwcache.3 uid_from_user.3 pwcache.3 gid_from_group.3
 MLINKS+=pwcache.3 pwcache_userdb.3 pwcache.3 pwcache_groupdb.3

Index: src/lib/libc/gen/psignal.3
diff -u src/lib/libc/gen/psignal.3:1.16 src/lib/libc/gen/psignal.3:1.17
--- src/lib/libc/gen/psignal.3:1.16	Wed Apr 14 03:20:27 2010
+++ src/lib/libc/gen/psignal.3	Fri Aug 27 04:38:41 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: psignal.3,v 1.16 2010/04/14 07:20:27 njoly Exp $
+.\	$NetBSD: psignal.3,v 1.17 2010/08/27 08:38:41 christos Exp $
 .\
 .\ Copyright (c) 1983, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,11 +29,12 @@
 .\
 .\ @(#)psignal.3	8.2 (Berkeley) 2/27/95
 .\
-.Dd February 27, 1995
+.Dd August 27, 2010
 .Dt PSIGNAL 3
 .Os
 .Sh NAME
 .Nm psignal ,
+.Nm psiginfo ,
 .Nm sys_siglist ,
 .Nm sys_signame
 .Nd system signal messages
@@ -42,7 +43,8 @@
 .Sh SYNOPSIS
 .In signal.h
 .Ft void
-.Fn psignal unsigned sig const char *s
+.Fn psignal int sig const char *s
+.Fn psiginfo const siginfo_t *si const char *s
 .Vt extern const char * const sys_siglist[];
 .Vt extern const char * const sys_signame[];
 .Sh DESCRIPTION
@@ -66,6 +68,14 @@
 .Dq Unknown signal
 is produced.
 .Pp
+The
+.Fn psiginfo
+function produces the same output as the
+.Fn psignal
+function, only it uses the signal number information from the
+.Fa si
+argument.
+.Pp
 The message strings can be accessed directly using the external array
 .Va sys_siglist ,
 indexed by recognized signal numbers.
@@ -89,3 +99,7 @@
 .Fn psignal
 function appeared in
 .Bx 4.2 .
+The
+.Fn psiginfo
+function appeared in
+.Nx 6.0 .

Index: src/lib/libc/gen/psignal.c
diff -u src/lib/libc/gen/psignal.c:1.21 src/lib/libc/gen/psignal.c:1.22
--- src/lib/libc/gen/psignal.c:1.21	Mon Nov 28 22:11:59 2005
+++ src/lib/libc/gen/psignal.c	Fri Aug 27 04:38:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: psignal.c,v 1.21 2005/11/29 03:11:59 christos Exp $	*/
+/*	$NetBSD: psignal.c,v 1.22 2010/08/27 08:38:41 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)psignal.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: psignal.c,v 1.21 2005/11/29 03:11:59 christos Exp $);
+__RCSID($NetBSD: psignal.c,v 1.22 2010/08/27 08:38:41 christos Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -55,13 +55,11 @@
 #endif
 
 void
-psignal(sig, s)
-	unsigned int sig;
-	const char *s;
+psignal(int sig, const char *s)
 {
 	struct iovec *v;
 	struct iovec iov[4];
-	static char buf[NL_TEXTMAX];
+	char buf[NL_TEXTMAX];
 
 	v = iov;
 	if (s  *s) {
@@ -79,3 +77,9 @@
 	v-iov_len = 1;
 	(void)writev(STDERR_FILENO, iov, (v - iov) + 1);
 }
+
+void
+psiginfo(const siginfo_t *si, const char *s)
+{
+	psignal(si-si_signo, s);
+}



CVS commit: src/include

2010-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 27 08:40:38 UTC 2010

Modified Files:
src/include: signal.h unistd.h

Log Message:
The signal number argument in psignal is int not unsigned int.
Add psiginfo.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/include/signal.h
cvs rdiff -u -r1.123 -r1.124 src/include/unistd.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/signal.h
diff -u src/include/signal.h:1.53 src/include/signal.h:1.54
--- src/include/signal.h:1.53	Fri Jul 30 20:04:42 2010
+++ src/include/signal.h	Fri Aug 27 04:40:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.53 2010/07/31 00:04:42 joerg Exp $	*/
+/*	$NetBSD: signal.h,v 1.54 2010/08/27 08:40:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -180,6 +180,7 @@
 defined(_NETBSD_SOURCE)
 int	sigwait	(const sigset_t * __restrict, int * __restrict);
 int	sigwaitinfo(const sigset_t * __restrict, siginfo_t * __restrict);
+void	psiginfo(const siginfo_t *, const char *);
 
 #ifndef __LIBC12_SOURCE__
 struct timespec;
@@ -197,7 +198,7 @@
 #ifndef __PSIGNAL_DECLARED
 #define __PSIGNAL_DECLARED
 /* also in unistd.h */
-void	psignal(unsigned int, const char *);
+void	psignal(int, const char *);
 #endif /* __PSIGNAL_DECLARED */
 int	sigblock(int);
 int	sigsetmask(int);

Index: src/include/unistd.h
diff -u src/include/unistd.h:1.123 src/include/unistd.h:1.124
--- src/include/unistd.h:1.123	Sat Apr 17 13:51:47 2010
+++ src/include/unistd.h	Fri Aug 27 04:40:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.123 2010/04/17 17:51:47 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.124 2010/08/27 08:40:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -310,7 +310,7 @@
 #ifndef __PSIGNAL_DECLARED
 #define __PSIGNAL_DECLARED
 /* also in signal.h */
-void	psignal(unsigned int, const char *);
+void	psignal(int, const char *);
 #endif /* __PSIGNAL_DECLARED */
 int	 rcmd(char **, int, const char *, const char *, const char *, int *);
 int	 reboot(int, char *);



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

2010-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 27 08:42:23 UTC 2010

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

Log Message:
add psiginfo


To generate a diff of this commit:
cvs rdiff -u -r1.1502 -r1.1503 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.1502 src/distrib/sets/lists/comp/mi:1.1503
--- src/distrib/sets/lists/comp/mi:1.1502	Tue Aug 24 11:03:18 2010
+++ src/distrib/sets/lists/comp/mi	Fri Aug 27 04:42:23 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1502 2010/08/24 15:03:18 pooka Exp $
+#	$NetBSD: mi,v 1.1503 2010/08/27 08:42:23 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -7595,6 +7595,7 @@
 ./usr/share/man/cat3/pset_bind.0		comp-c-catman		.cat
 ./usr/share/man/cat3/pset_create.0		comp-c-catman		.cat
 ./usr/share/man/cat3/pset_destroy.0		comp-c-catman		.cat
+./usr/share/man/cat3/psiginfo.0			comp-c-catman		.cat
 ./usr/share/man/cat3/psignal.0			comp-c-catman		.cat
 ./usr/share/man/cat3/pthread.0			comp-c-catman		.cat
 ./usr/share/man/cat3/pthread_atfork.0		comp-c-catman		.cat
@@ -9596,6 +9597,7 @@
 ./usr/share/man/cat9/propdb_create.0		comp-obsolete		obsolete
 ./usr/share/man/cat9/propdb_destroy.0		comp-obsolete		obsolete
 ./usr/share/man/cat9/properties.0		comp-obsolete		obsolete
+./usr/share/man/cat9/psiginfo.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/psignal.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/putiobuf.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/putter.0			comp-sys-catman		.cat
@@ -13488,6 +13490,7 @@
 ./usr/share/man/html3/pset_bind.html		comp-c-htmlman		html
 ./usr/share/man/html3/pset_create.html		comp-c-htmlman		html
 ./usr/share/man/html3/pset_destroy.html		comp-c-htmlman		html
+./usr/share/man/html3/psiginfo.html		comp-c-htmlman		html
 ./usr/share/man/html3/psignal.html		comp-c-htmlman		html
 ./usr/share/man/html3/pthread.html		comp-c-htmlman		html
 ./usr/share/man/html3/pthread_atfork.html	comp-c-htmlman		html



CVS commit: src/share/man/man3

2010-08-27 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Aug 27 09:13:38 UTC 2010

Modified Files:
src/share/man/man3: bits.3

Log Message:
Replace the example with something more generic and perceptual.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/share/man/man3/bits.3

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/man3/bits.3
diff -u src/share/man/man3/bits.3:1.8 src/share/man/man3/bits.3:1.9
--- src/share/man/man3/bits.3:1.8	Thu Aug 26 16:42:28 2010
+++ src/share/man/man3/bits.3	Fri Aug 27 09:13:38 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: bits.3,v 1.8 2010/08/26 16:42:28 dyoung Exp $
+.\	$NetBSD: bits.3,v 1.9 2010/08/27 09:13:38 jruoho Exp $
 .\
 .\ Copyright (c) 2006, 2010 David Young.  All rights reserved.
 .\
@@ -25,7 +25,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd August 26, 2010
+.Dd August 27, 2010
 .Dt BITS 3
 .Os
 .Sh NAME
@@ -110,37 +110,17 @@
 .Fn __SHIFTOUT m m .
 .El
 .Sh EXAMPLES
-.Bd -literal
-/*
- * Register definitions taken from the RFMD RF3000 manual.
- */
-#define	RF3000_GAINCTL			0x11
-#define RF3000_GAINCTL_TXVGC_MASK	__BITS(7, 2)
-#define	RF3000_GAINCTL_SCRAMBLER	__BIT(1)
-
-/*
- * Shift the transmit power into the transmit-power field of the
- * gain-control register and write it to the baseband processor.
- */
-atw_rf3000_write(sc, RF3000_GAINCTL,
-__SHIFTIN(txpower, RF3000_GAINCTL_TXVGC_MASK));
-
-/*
- * Register definitions taken from the ADMtek ADM8211 manual.
- */
-#define	ATW_RXSTAT_OWN		__BIT(31)
-
-/* ... */
+The following example demonstrates basic usage of the
+.Nm bits
+macros:
+.Bd -literal -offset indent
+uint32_t bits, mask, val;
 
-#define	ATW_RXSTAT_DA1		__BIT(17)
-#define	ATW_RXSTAT_DA0  __BIT(16)
-#define	ATW_RXSTAT_RXDR_MASK__BITS(15,12)
-#define	ATW_RXSTAT_FL_MASK	__BITS(11,0)
+bits = __BITS(2, 3);			/* 1100 */
+mask = __BIT(2) | __BIT(3);		/* 1100 */
 
-/*
- * Extract the frame length from the Rx descriptor's status field.
- */
-len = __SHIFTOUT(rxstat, ATW_RXSTAT_FL_MASK);
+val = __SHIFTIN(0x03, mask);		/* 1100 */
+val = __SHIFTOUT(0xf, mask);		/* 0011 */
 .Ed
 .Sh HISTORY
 The



CVS commit: [uebayasi-xip] src/sys/arch/xen/conf

2010-08-27 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Aug 27 09:41:16 UTC 2010

Modified Files:
src/sys/arch/xen/conf [uebayasi-xip]: files.xen

Log Message:
Glue xmd(4).


To generate a diff of this commit:
cvs rdiff -u -r1.106.2.1 -r1.106.2.2 src/sys/arch/xen/conf/files.xen

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

Modified files:

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.106.2.1 src/sys/arch/xen/conf/files.xen:1.106.2.2
--- src/sys/arch/xen/conf/files.xen:1.106.2.1	Tue Aug 17 06:45:35 2010
+++ src/sys/arch/xen/conf/files.xen	Fri Aug 27 09:41:16 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.106.2.1 2010/08/17 06:45:35 uebayasi Exp $
+#	$NetBSD: files.xen,v 1.106.2.2 2010/08/27 09:41:16 uebayasi Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -286,6 +286,8 @@
 attach ipmi at ipmibus
 file	arch/x86/x86/ipmi.c		ipmi needs-flag
 
+file	arch/x86/x86/xmd_machdep.c	xmd
+
 # CPUS
 
 device cpu



CVS commit: [uebayasi-xip] src/sys/arch/amd64/conf

2010-08-27 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Aug 27 09:41:52 UTC 2010

Modified Files:
src/sys/arch/amd64/conf [uebayasi-xip]: majors.amd64
Added Files:
src/sys/arch/amd64/conf [uebayasi-xip]: XIP

Log Message:
xmd(4) / XIP config for amd64.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/amd64/conf/XIP
cvs rdiff -u -r1.21 -r1.21.6.1 src/sys/arch/amd64/conf/majors.amd64

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/conf/majors.amd64
diff -u src/sys/arch/amd64/conf/majors.amd64:1.21 src/sys/arch/amd64/conf/majors.amd64:1.21.6.1
--- src/sys/arch/amd64/conf/majors.amd64:1.21	Wed Nov 12 12:35:56 2008
+++ src/sys/arch/amd64/conf/majors.amd64	Fri Aug 27 09:41:52 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.amd64,v 1.21 2008/11/12 12:35:56 ad Exp $
+#	$NetBSD: majors.amd64,v 1.21.6.1 2010/08/27 09:41:52 uebayasi Exp $
 #
 # Device majors for amd64
 #
@@ -89,6 +89,7 @@
 device-major	dpt		char 96			dpt
 device-major	twe		char 97			twe
 device-major	nsmb		char 98			nsmb		
+device-major	xmd		char 99  block 21	xmd
 
 #
 # Device majors for Xen. These are assigned here so that:

Added files:

Index: src/sys/arch/amd64/conf/XIP
diff -u /dev/null src/sys/arch/amd64/conf/XIP:1.1.2.1
--- /dev/null	Fri Aug 27 09:41:52 2010
+++ src/sys/arch/amd64/conf/XIP	Fri Aug 27 09:41:51 2010
@@ -0,0 +1,8 @@
+#	$NetBSD: XIP,v 1.1.2.1 2010/08/27 09:41:51 uebayasi Exp $
+
+include arch/amd64/conf/GENERIC
+
+options 	XIP
+
+pseudo-device	xmd		1	# XIP memory disk device (ramdisk)
+options 	XMD_ROOT_SIZE=10240	# 5MB



CVS commit: src/tests/modules

2010-08-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Aug 27 09:56:40 UTC 2010

Modified Files:
src/tests/modules: Makefile
Added Files:
src/tests/modules: t_builtin.c

Log Message:
tests for builtin modules


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/modules/t_builtin.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/modules/Makefile
diff -u src/tests/modules/Makefile:1.7 src/tests/modules/Makefile:1.8
--- src/tests/modules/Makefile:1.7	Sat Aug 21 13:57:41 2010
+++ src/tests/modules/Makefile	Fri Aug 27 09:56:40 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2010/08/21 13:57:41 pgoyette Exp $
+# $NetBSD: Makefile,v 1.8 2010/08/27 09:56:40 pooka Exp $
 
 .include bsd.own.mk
 
@@ -10,7 +10,9 @@
 # will confuse atf-run.  Therefore we must install, at the very least, the
 # Atffile into it.
 TESTS_C=	t_modctl
+TESTS_C+=	t_builtin
 LDADD=		-lprop
+LDADD+=		-lrumpfs_kernfs -lrumpvfs -lrump -lrumpuser -lpthread
 
 TESTS_SH=	t_modload
 

Added files:

Index: src/tests/modules/t_builtin.c
diff -u /dev/null src/tests/modules/t_builtin.c:1.1
--- /dev/null	Fri Aug 27 09:56:40 2010
+++ src/tests/modules/t_builtin.c	Fri Aug 27 09:56:40 2010
@@ -0,0 +1,192 @@
+/*	$NetBSD: t_builtin.c,v 1.1 2010/08/27 09:56:40 pooka Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/types.h
+#include sys/module.h
+#include sys/mount.h
+
+#include atf-c.h
+#include fcntl.h
+#include stdbool.h
+
+#include miscfs/kernfs/kernfs.h
+
+#include rump/rump.h
+#include rump/rump_syscalls.h
+
+#include ../h_macros.h
+
+#define MYMP /mnt
+#define HZFILE MYMP /hz
+
+static bool
+check_kernfs(void)
+{
+	char buf[16];
+	bool rv = true;
+	int fd;
+
+	fd = rump_sys_open(HZFILE, O_RDONLY);
+	if (fd == -1)
+		return false;
+	if (rump_sys_read(fd, buf, sizeof(buf))  1)
+		rv = false;
+	RL(rump_sys_close(fd));
+
+	return rv;
+}
+
+ATF_TC(disable);
+ATF_TC_HEAD(disable, tc)
+{
+
+	atf_tc_set_md_var(tc, descr, Tests that builtin modules can 
+	be disabled);
+}
+
+ATF_TC_BODY(disable, tc)
+{
+
+	rump_init();
+	RL(rump_sys_mkdir(MYMP, 0777));
+	RL(rump_sys_mount(MOUNT_KERNFS, MYMP, 0, NULL, 0));
+	ATF_REQUIRE(check_kernfs());
+	RL(rump_sys_unmount(MYMP, 0));
+	RL(rump_sys_modctl(MODCTL_UNLOAD, kernfs));
+}
+
+ATF_TC(noauto);
+ATF_TC_HEAD(noauto, tc)
+{
+	atf_tc_set_md_var(tc, descr, Tests that disabled builtin modules 
+	will not autoload);
+}
+
+ATF_TC_BODY(noauto, tc)
+{
+
+	rump_init();
+	RL(rump_sys_mkdir(MYMP, 0777));
+
+	RL(rump_sys_modctl(MODCTL_UNLOAD, kernfs));
+
+	ATF_REQUIRE_ERRNO(ENODEV,
+	rump_sys_mount(MOUNT_KERNFS, MYMP, 0, NULL, 0) == -1);
+}
+
+ATF_TC(forcereload);
+ATF_TC_HEAD(forcereload, tc)
+{
+	atf_tc_set_md_var(tc, descr, Tests that disabled builtin modules 
+	can be force-reloaded);
+}
+
+ATF_TC_BODY(forcereload, tc)
+{
+	struct modctl_load mod;
+
+	rump_init();
+	RL(rump_sys_mkdir(MYMP, 0777));
+
+	RL(rump_sys_modctl(MODCTL_UNLOAD, kernfs));
+	ATF_REQUIRE_ERRNO(ENODEV,
+	rump_sys_mount(MOUNT_KERNFS, MYMP, 0, NULL, 0) == -1);
+
+	memset(mod, 0, sizeof(mod));
+	mod.ml_filename = kernfs;
+	mod.ml_flags = MODCTL_LOAD_FORCE;
+
+	RL(rump_sys_modctl(MODCTL_LOAD, mod));
+
+	RL(rump_sys_mount(MOUNT_KERNFS, MYMP, 0, NULL, 0));
+	ATF_REQUIRE(check_kernfs());
+	RL(rump_sys_unmount(MYMP, 0));
+}
+
+ATF_TC(disabledstat);
+ATF_TC_HEAD(disabledstat, tc)
+{
+	atf_tc_set_md_var(tc, descr, Tests that disabled builtin modules 
+	show up in modstat with refcount -1);
+}
+

CVS commit: src

2010-08-27 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Fri Aug 27 09:58:17 UTC 2010

Modified Files:
src/lib/libperfuse: ops.c perfuse.c perfuse_if.h perfuse_priv.h
src/usr.sbin/perfused: msg.c perfused.8 perfused.c perfused.h

Log Message:
- if perfused is not already started (cannot connect to /dev/fuse),
FUSE filesystems will attempt to start it on their own, and will
communicate using a socketpair

- do not advertise NULL file handle as being valid when sending themback to the 
FUSE filesystem.

- unmount if we cannot talk to the FUSE process anymore

- set calling process gid properly

- debug message cleanup


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libperfuse/ops.c \
src/lib/libperfuse/perfuse_if.h src/lib/libperfuse/perfuse_priv.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libperfuse/perfuse.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/perfused/msg.c \
src/usr.sbin/perfused/perfused.h
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/perfused/perfused.8 \
src/usr.sbin/perfused/perfused.c

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

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.2 src/lib/libperfuse/ops.c:1.3
--- src/lib/libperfuse/ops.c:1.2	Thu Aug 26 13:29:01 2010
+++ src/lib/libperfuse/ops.c	Fri Aug 27 09:58:17 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.2 2010/08/26 13:29:01 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.3 2010/08/27 09:58:17 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -667,7 +667,7 @@
 	svfsb-f_fsidx.__fsid_val[1] = 0;
 	svfsb-f_fsid = ps-ps_fsid;
 	svfsb-f_namemax = MAXPATHLEN;	/* XXX */
-	svfsb-f_owner = ps-ps_uid;
+	svfsb-f_owner = ps-ps_owner_uid;
 
 	(void)strlcpy(svfsb-f_mntonname, ps-ps_target, _VFS_NAMELEN);
 
@@ -1206,7 +1206,8 @@
 	if (PERFUSE_NODE_DATA(opc)-pnd_flags  PND_OPEN) {
 		fh = perfuse_get_fh(opc);
 		fsi-fh = fh;
-		fsi-valid |= FUSE_FATTR_FH;
+		if (fh != FUSE_UNKNOWN_FH)
+			fsi-valid |= FUSE_FATTR_FH;
 	}
 
 	if (vap-va_size != (u_quad_t)PUFFS_VNOVAL) {
Index: src/lib/libperfuse/perfuse_if.h
diff -u src/lib/libperfuse/perfuse_if.h:1.2 src/lib/libperfuse/perfuse_if.h:1.3
--- src/lib/libperfuse/perfuse_if.h:1.2	Thu Aug 26 13:29:01 2010
+++ src/lib/libperfuse/perfuse_if.h	Fri Aug 27 09:58:17 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse_if.h,v 1.2 2010/08/26 13:29:01 manu Exp $ */
+/*  $NetBSD: perfuse_if.h,v 1.3 2010/08/27 09:58:17 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -29,6 +29,7 @@
 #define _REFUSE_PERFUSE_H
 
 #define _PATH_FUSE /dev/fuse
+#define _PATH_PERFUSED /usr/sbin/perfused
 #define FUSE_COMMFD_ENV _FUSE_COMMFD 
 #define PERFUSE_MOUNT_MAGIC noFuseRq
 #define PERFUSE_UNKNOWN_INO 0x
@@ -201,5 +202,6 @@
 const char *perfuse_opname(int);
 void perfuse_fs_init(struct puffs_usermount *);
 int perfuse_mainloop(struct puffs_usermount *);
+int perfuse_unmount(struct puffs_usermount *);
 
 #endif /* _REFUSE_PERFUSE_H */
Index: src/lib/libperfuse/perfuse_priv.h
diff -u src/lib/libperfuse/perfuse_priv.h:1.2 src/lib/libperfuse/perfuse_priv.h:1.3
--- src/lib/libperfuse/perfuse_priv.h:1.2	Thu Aug 26 13:29:01 2010
+++ src/lib/libperfuse/perfuse_priv.h	Fri Aug 27 09:58:17 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse_priv.h,v 1.2 2010/08/26 13:29:01 manu Exp $ */
+/*  $NetBSD: perfuse_priv.h,v 1.3 2010/08/27 09:58:17 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -41,9 +41,7 @@
 	void *ps_private;	/* Private field for libperfuse user */
 	struct puffs_usermount *ps_pu;
 	struct puffs_node *ps_root;
-	uid_t ps_uid;
-	gid_t ps_gid;
-	pid_t ps_pid;
+	uid_t ps_owner_uid;
 	int ps_flags;
 #define PS_NO_ACCESS	0x0001	/* access is unimplemented; */
 #define PS_NO_FSYNC	0x0002	/* fsync is unimplemented */

Index: src/lib/libperfuse/perfuse.c
diff -u src/lib/libperfuse/perfuse.c:1.1 src/lib/libperfuse/perfuse.c:1.2
--- src/lib/libperfuse/perfuse.c:1.1	Wed Aug 25 07:16:00 2010
+++ src/lib/libperfuse/perfuse.c	Fri Aug 27 09:58:17 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse.c,v 1.1 2010/08/25 07:16:00 manu Exp $ */
+/*  $NetBSD: perfuse.c,v 1.2 2010/08/27 09:58:17 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -101,16 +101,21 @@
 	int flags;
 	mode_t mode;
 {
-	int s;
+	int sv[2];
 	struct sockaddr_un sun;
 	struct sockaddr *sa;
+	char progname[] = _PATH_PERFUSED;
+	char minus_i[] = -i;
+	char fdstr[16];
+	char *const argv[] = { progname, minus_i, fdstr, NULL};
+	char *const envp[] = { NULL };
 
 	if (strcmp(path, _PATH_FUSE) != 0)
 		return open(path, flags, mode);
 
-	if ((s = socket(PF_LOCAL, SOCK_STREAM, 0)) == -1) {
+	if ((sv[0] = socket(PF_LOCAL, SOCK_STREAM, 0)) == -1) {
 #ifdef PERFUSE_DEBUG
-		printf(%s:%d socket failed: %s, 
+		printf(%s:%d socket failed: %s\n, 
 		   __func__, __LINE__, strerror(errno));
 #endif
 		return -1;
@@ -121,16 +126,49 @@
 	

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

2010-08-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Aug 27 10:01:04 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi module.mi

Log Message:
The incredible travels of Seth List.


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/lists/tests/module.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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.139 src/distrib/sets/lists/tests/mi:1.140
--- src/distrib/sets/lists/tests/mi:1.139	Wed Aug 25 16:46:48 2010
+++ src/distrib/sets/lists/tests/mi	Fri Aug 27 10:01:04 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.139 2010/08/25 16:46:48 jmmv Exp $
+# $NetBSD: mi,v 1.140 2010/08/27 10:01:04 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -341,6 +341,7 @@
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_sotests-libexec-debug
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlinfo.debug		tests-libexec-debug	debug,atf
 ./usr/libdata/debug/usr/tests/modules	tests-sys-debug
+./usr/libdata/debug/usr/tests/modules/t_builtin.debug			tests-sys-debug		debug,atf
 ./usr/libdata/debug/usr/tests/modules/t_modctl.debug			tests-sys-debug		debug,atf
 ./usr/libdata/debug/usr/tests/net	tests-net-debug
 ./usr/libdata/debug/usr/tests/net/bpf	tests-net-debug

Index: src/distrib/sets/lists/tests/module.mi
diff -u src/distrib/sets/lists/tests/module.mi:1.4 src/distrib/sets/lists/tests/module.mi:1.5
--- src/distrib/sets/lists/tests/module.mi:1.4	Sat Aug 21 13:21:48 2010
+++ src/distrib/sets/lists/tests/module.mi	Fri Aug 27 10:01:04 2010
@@ -1,4 +1,4 @@
-# $NetBSD: module.mi,v 1.4 2010/08/21 13:21:48 pgoyette Exp $
+# $NetBSD: module.mi,v 1.5 2010/08/27 10:01:04 pooka Exp $
 #
 # These are only made for ports doing modules.
 #
@@ -7,5 +7,6 @@
 ./usr/tests/modules/k_helper/k_helper.kmod	tests-sys-tests		atf
 ./usr/tests/modules/k_helper2			tests-sys-tests		atf
 ./usr/tests/modules/k_helper2/k_helper2.kmod	tests-sys-tests		atf
+./usr/tests/modules/t_builtin			tests-sys-tests		atf
 ./usr/tests/modules/t_modctl			tests-sys-tests		atf
 ./usr/tests/modules/t_modload			tests-sys-tests		atf



CVS commit: src/tests/syscall

2010-08-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Aug 27 10:03:14 UTC 2010

Modified Files:
src/tests/syscall: t_cmsg.c

Log Message:
Set the cmsg_len and msg_controllen in cmsg_sendfd testcase to match
the usage in the cmsg_sendfd_bounds case.  This test now passes on an
amd64 machine.

Change suggested by and OK'd by pooka@


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/syscall/t_cmsg.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/syscall/t_cmsg.c
diff -u src/tests/syscall/t_cmsg.c:1.13 src/tests/syscall/t_cmsg.c:1.14
--- src/tests/syscall/t_cmsg.c:1.13	Fri Dec 18 21:24:13 2009
+++ src/tests/syscall/t_cmsg.c	Fri Aug 27 10:03:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_cmsg.c,v 1.13 2009/12/18 21:24:13 pooka Exp $	*/
+/*	$NetBSD: t_cmsg.c,v 1.14 2010/08/27 10:03:14 pgoyette Exp $	*/
 
 #include sys/types.h
 #include sys/mount.h
@@ -135,14 +135,14 @@
 
 	cmp-cmsg_level = SOL_SOCKET;
 	cmp-cmsg_type = SCM_RIGHTS;
-	cmp-cmsg_len = CMSG_SPACE(sizeof(int));
+	cmp-cmsg_len = CMSG_LEN(sizeof(int));
 
 	msg.msg_iov = iov;
 	msg.msg_iovlen = 1;
 	msg.msg_name = NULL;
 	msg.msg_namelen = 0;
 	msg.msg_control = cmp;
-	msg.msg_controllen = CMSG_LEN(sizeof(int));
+	msg.msg_controllen = CMSG_SPACE(sizeof(int));
 	*(int *)CMSG_DATA(cmp) = fd[0];
 
 	/* pass the fd */



CVS commit: src/etc/etc.sgimips

2010-08-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Aug 27 11:02:56 UTC 2010

Modified Files:
src/etc/etc.sgimips: Makefile.inc

Log Message:
Fix yet another botch on mips64 merge.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/etc/etc.sgimips/Makefile.inc

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

Modified files:

Index: src/etc/etc.sgimips/Makefile.inc
diff -u src/etc/etc.sgimips/Makefile.inc:1.19 src/etc/etc.sgimips/Makefile.inc:1.20
--- src/etc/etc.sgimips/Makefile.inc:1.19	Mon Dec 14 01:12:05 2009
+++ src/etc/etc.sgimips/Makefile.inc	Fri Aug 27 11:02:55 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.19 2009/12/14 01:12:05 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.20 2010/08/27 11:02:55 tsutsui Exp $
 #
 #	etc.sgimips/Makefile.inc -- sgimips-specific etc Makefile targets
 #
@@ -14,7 +14,7 @@
 
 KERNEL_SETS=		GENERIC${SFX}_IP2x GENERIC${SFX}_IP3x
 .if ${MACHINE_ARCH} == mipseb
-KERNEL_SETS=		GENERIC32_IP12
+KERNEL_SETS+=		GENERIC32_IP12
 KERNEL_SUFFIXES=	ecoff
 .endif
 



CVS commit: src/tests/fs/puffs

2010-08-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Aug 27 12:42:21 UTC 2010

Modified Files:
src/tests/fs/puffs: t_fuzz.c

Log Message:
poll the putter fd instead of doing a blocking read.  Long story
short:  we don't have to wait for the fs syncer to run for the
close to succeed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/puffs/t_fuzz.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/fs/puffs/t_fuzz.c
diff -u src/tests/fs/puffs/t_fuzz.c:1.3 src/tests/fs/puffs/t_fuzz.c:1.4
--- src/tests/fs/puffs/t_fuzz.c:1.3	Mon Aug 16 10:46:20 2010
+++ src/tests/fs/puffs/t_fuzz.c	Fri Aug 27 12:42:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_fuzz.c,v 1.3 2010/08/16 10:46:20 pooka Exp $	*/
+/*	$NetBSD: t_fuzz.c,v 1.4 2010/08/27 12:42:21 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -38,6 +38,7 @@
 
 #include sys/types.h
 #include sys/mount.h
+#include sys/poll.h
 
 #include assert.h
 #include atf-c.h
@@ -167,6 +168,7 @@
 {
 	char buf[PUFFS_MSG_MAXSIZE];
 	struct puffs_req *preq = (void *)buf;
+	struct pollfd pfd;
 	ssize_t n;
 
 	pthread_mutex_lock(damtx);
@@ -176,6 +178,13 @@
 
 		while (dafd != -1) {
 			pthread_mutex_unlock(damtx);
+			pfd.fd = dafd;
+			pfd.events = POLLIN;
+			pfd.revents = 0;
+			if (rump_sys_poll(pfd, 1, 10) == 0) {
+pthread_mutex_lock(damtx);
+continue;
+			}
 			n = rump_sys_read(dafd, buf, sizeof(buf));
 			if (n = 0) {
 pthread_mutex_lock(damtx);
@@ -204,11 +213,12 @@
 	srandom(seed);
 	printf(test seeded RNG with %lu\n, seed);
 
+	rump_init();
+
 	pthread_mutex_init(damtx, NULL);
 	pthread_cond_init(dacv, NULL);
 	pthread_create(pt, NULL, respondthread, NULL);
 
-	rump_init();
 	ATF_REQUIRE(rump_sys_mkdir(/mnt, 0777) == 0);
 
 	for (i = 0; i  ITERATIONS; i++) {



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

2010-08-27 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Fri Aug 27 16:29:13 UTC 2010

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

Log Message:
Add unformatted version of psiginfo(3).


To generate a diff of this commit:
cvs rdiff -u -r1.1504 -r1.1505 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.1504 src/distrib/sets/lists/comp/mi:1.1505
--- src/distrib/sets/lists/comp/mi:1.1504	Fri Aug 27 15:40:46 2010
+++ src/distrib/sets/lists/comp/mi	Fri Aug 27 16:29:13 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1504 2010/08/27 15:40:46 tron Exp $
+#	$NetBSD: mi,v 1.1505 2010/08/27 16:29:13 tron Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -19377,6 +19377,7 @@
 ./usr/share/man/man3/pset_bind.3		comp-c-man		.man
 ./usr/share/man/man3/pset_create.3		comp-c-man		.man
 ./usr/share/man/man3/pset_destroy.3		comp-c-man		.man
+./usr/share/man/man3/psiginfo.3			comp-c-man		.man
 ./usr/share/man/man3/psignal.3			comp-c-man		.man
 ./usr/share/man/man3/pthread.3			comp-c-man		.man
 ./usr/share/man/man3/pthread_atfork.3		comp-c-man		.man



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

2010-08-27 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Fri Aug 27 15:40:46 UTC 2010

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

Log Message:
The psiginfo manual page is in section 3, not 9.


To generate a diff of this commit:
cvs rdiff -u -r1.1503 -r1.1504 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.1503 src/distrib/sets/lists/comp/mi:1.1504
--- src/distrib/sets/lists/comp/mi:1.1503	Fri Aug 27 08:42:23 2010
+++ src/distrib/sets/lists/comp/mi	Fri Aug 27 15:40:46 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1503 2010/08/27 08:42:23 christos Exp $
+#	$NetBSD: mi,v 1.1504 2010/08/27 15:40:46 tron Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -9597,7 +9597,6 @@
 ./usr/share/man/cat9/propdb_create.0		comp-obsolete		obsolete
 ./usr/share/man/cat9/propdb_destroy.0		comp-obsolete		obsolete
 ./usr/share/man/cat9/properties.0		comp-obsolete		obsolete
-./usr/share/man/cat9/psiginfo.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/psignal.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/putiobuf.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/putter.0			comp-sys-catman		.cat



CVS commit: src/usr.bin

2010-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 27 16:38:27 UTC 2010

Modified Files:
src/usr.bin: Makefile

Log Message:
switch back to the old awk till I fixed the problem.


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/usr.bin/Makefile

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

Modified files:

Index: src/usr.bin/Makefile
diff -u src/usr.bin/Makefile:1.190 src/usr.bin/Makefile:1.191
--- src/usr.bin/Makefile:1.190	Thu Aug 26 10:57:47 2010
+++ src/usr.bin/Makefile	Fri Aug 27 12:38:27 2010
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.190 2010/08/26 14:57:47 christos Exp $
+#	$NetBSD: Makefile,v 1.191 2010/08/27 16:38:27 christos Exp $
 #	from: @(#)Makefile	8.3 (Berkeley) 1/7/94
 
 .include bsd.own.mk
 
-SUBDIR= apply apropos asa at audio \
+SUBDIR= apply apropos asa at audio awk \
 	banner basename biff bthset btkey btpin \
 	bzip2 bzip2recover cal calendar cap_mkdb cdplay \
 	checknr chflags chpass cksum cmp col colcrt colrm \



CVS commit: src/external

2010-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 27 16:39:12 UTC 2010

Modified Files:
src/external: Makefile

Log Message:
unhook new awk till I figure out what's wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/Makefile

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

Modified files:

Index: src/external/Makefile
diff -u src/external/Makefile:1.9 src/external/Makefile:1.10
--- src/external/Makefile:1.9	Thu Aug 26 10:57:15 2010
+++ src/external/Makefile	Fri Aug 27 12:39:11 2010
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.9 2010/08/26 14:57:15 christos Exp $
+#	$NetBSD: Makefile,v 1.10 2010/08/27 16:39:11 christos Exp $
 
 SUBDIR+= lib .WAIT
 
-SUBDIR+= apache2 bsd intel-fw-eula intel-fw-public gpl2 gpl3 historical
+SUBDIR+= apache2 bsd intel-fw-eula intel-fw-public gpl2 gpl3
 SUBDIR+= ibm-public intel-public cddl
 
 .include bsd.subdir.mk



CVS commit: src/external/historical/nawk/dist

2010-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 27 16:49:48 UTC 2010

Modified Files:
src/external/historical/nawk/dist: proctab.c

Log Message:
fix botched merge.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/historical/nawk/dist/proctab.c

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

Modified files:

Index: src/external/historical/nawk/dist/proctab.c
diff -u src/external/historical/nawk/dist/proctab.c:1.2 src/external/historical/nawk/dist/proctab.c:1.3
--- src/external/historical/nawk/dist/proctab.c:1.2	Thu Aug 26 10:55:20 2010
+++ src/external/historical/nawk/dist/proctab.c	Fri Aug 27 12:49:47 2010
@@ -186,10 +186,10 @@
 	nullproc,	/* STRING */
 	nullproc,	/* REGEXPR */
 	awkgetline,	/* GETLINE */
-	substr,	/* SUBSTR */
-	split,	/* SPLIT */
 	gensub,	/* GENSUB */
 	jump,	/* RETURN */
+	split,	/* SPLIT */
+	substr,	/* SUBSTR */
 	whilestat,	/* WHILE */
 	cat,	/* CAT */
 	boolop,	/* NOT */



CVS commit: src/usr.bin

2010-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 27 16:50:10 UTC 2010

Modified Files:
src/usr.bin: Makefile

Log Message:
unhook awk again


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/usr.bin/Makefile

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

Modified files:

Index: src/usr.bin/Makefile
diff -u src/usr.bin/Makefile:1.191 src/usr.bin/Makefile:1.192
--- src/usr.bin/Makefile:1.191	Fri Aug 27 12:38:27 2010
+++ src/usr.bin/Makefile	Fri Aug 27 12:50:10 2010
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.191 2010/08/27 16:38:27 christos Exp $
+#	$NetBSD: Makefile,v 1.192 2010/08/27 16:50:10 christos Exp $
 #	from: @(#)Makefile	8.3 (Berkeley) 1/7/94
 
 .include bsd.own.mk
 
-SUBDIR= apply apropos asa at audio awk \
+SUBDIR= apply apropos asa at audio \
 	banner basename biff bthset btkey btpin \
 	bzip2 bzip2recover cal calendar cap_mkdb cdplay \
 	checknr chflags chpass cksum cmp col colcrt colrm \



CVS commit: src/external

2010-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 27 16:50:30 UTC 2010

Modified Files:
src/external: Makefile

Log Message:
hook awk again.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/Makefile

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

Modified files:

Index: src/external/Makefile
diff -u src/external/Makefile:1.10 src/external/Makefile:1.11
--- src/external/Makefile:1.10	Fri Aug 27 12:39:11 2010
+++ src/external/Makefile	Fri Aug 27 12:50:30 2010
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.10 2010/08/27 16:39:11 christos Exp $
+#	$NetBSD: Makefile,v 1.11 2010/08/27 16:50:30 christos Exp $
 
 SUBDIR+= lib .WAIT
 
-SUBDIR+= apache2 bsd intel-fw-eula intel-fw-public gpl2 gpl3
+SUBDIR+= apache2 bsd intel-fw-eula intel-fw-public gpl2 gpl3 historical
 SUBDIR+= ibm-public intel-public cddl
 
 .include bsd.subdir.mk



CVS commit: src/share/man/man4

2010-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Aug 27 18:05:16 UTC 2010

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

Log Message:
Grammar fix.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/share/man/man4/acpicpu.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/acpicpu.4
diff -u src/share/man/man4/acpicpu.4:1.16 src/share/man/man4/acpicpu.4:1.17
--- src/share/man/man4/acpicpu.4:1.16	Fri Aug 27 03:05:26 2010
+++ src/share/man/man4/acpicpu.4	Fri Aug 27 18:05:16 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpicpu.4,v 1.16 2010/08/27 03:05:26 jruoho Exp $
+.\ $NetBSD: acpicpu.4,v 1.17 2010/08/27 18:05:16 wiz Exp $
 .\
 .\ Coyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -294,7 +294,7 @@
 .Nm
 and
 .Xr ichlpcib 4
-provides support for P-states,
+provide support for P-states,
 either one but not both may be used.
 .Sh SEE ALSO
 .Xr acpi 4 ,



CVS commit: src/usr.sbin/perfused

2010-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Aug 27 18:12:51 UTC 2010

Modified Files:
src/usr.sbin/perfused: perfused.8

Log Message:
Various fixes and improvements.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/perfused/perfused.8

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

Modified files:

Index: src/usr.sbin/perfused/perfused.8
diff -u src/usr.sbin/perfused/perfused.8:1.3 src/usr.sbin/perfused/perfused.8:1.4
--- src/usr.sbin/perfused/perfused.8:1.3	Fri Aug 27 09:58:17 2010
+++ src/usr.sbin/perfused/perfused.8	Fri Aug 27 18:12:51 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: perfused.8,v 1.3 2010/08/27 09:58:17 manu Exp $
+.\ $NetBSD: perfused.8,v 1.4 2010/08/27 18:12:51 wiz Exp $
 .\
 .\ Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
 .\
@@ -28,105 +28,106 @@
 .Dt PERFUSED 8
 .Sh NAME
 .Nm perfused
-.Nd PUFFS Enabled Relay to FUSE Daemon
+.Nd PUFFS Enabled Relay to FUSE Daemon
 .Sh SYNOPSIS
 .Nm
-.Op Fl f
+.Op Fl fs
 .Op Fl d Ar types
-.Op Fl s
 .Op Fl i fd
 .Sh DESCRIPTION
 .Nm
-is a userland daemon mplementing the FUSE kernel level API. It creates a
+is a userland daemon implementing the FUSE kernel level API.
+It creates a
 .Pa /dev/fuse
-socket for FUSE filesystem daemons to conenct to.
+socket for FUSE file system daemons to connect to.
 .Nm
-takes care of mouting the filesystem using 
+takes care of mounting the file system using
 .Xr puffs 3 .
 .Pp
-When the kernel sends a 
+When the kernel sends a
 .Xr puffs 3
-operation for the mounted filesystem, 
+operation for the mounted file system,
 .Nm
-will translate it into a FUSE request, and will send it to the filesystem
+will translate it into a FUSE request, and will send it to the file system
 daemon through
 .Pa /dev/fuse .
-The FUSE reply will be converted back into a 
+The FUSE reply will be converted back into a
 .Xr puffs 3
 reply and will be relayed to the kernel.
 .Pp
-FUSE filesystems daemons must be modified so that they request
+FUSE file system daemons must be modified so that they request
 .Nm
-for performing the 
+to perform the
 .Xr mount 2
-system call instead of doing it on their own. This is done by 
-replacing in the sources
+system call instead of doing it on their own.
+This is done by replacing
 .Xr mount 2
 and the
-.Xr open 2 
-call for
+.Xr open 2
+calls for
 .Pa /dev/fuse
-by
+with
 .Fn perfuse_mount
-and 
-.Fn perfuse_open .
+and
+.Fn perfuse_open ,
+respectively, in their sources.
 .Xr libperfuse 3
 must be used at link time.
-Most FUSE filesystem daemons use
+Most FUSE file system daemons use
 .Nm libfuse
-and will work unmodified, provided 
-the modification is done in 
+and will work unmodified, provided the modification is done in
 .Nm libfuse
 itself .
 .Pp
-The following options are availlable:
-.Bl -tag -width indent
-.It Fl f
-Do not fork and stay in the foreground.
+The following options are available:
+.Bl -tag -width XdXtypesXX
 .It Fl d Ar types
-Print additionnal debug information. 
+Print additional debug information.
 .Ar types
-is a comma-separated list of informaton type to print: 
+is a comma-separated list of information types to print:
 .Bl -tag -width indent
 .It Ar puffs
-Display PUFFS requests and replies
+Display PUFFS requests and replies.
 .It Ar fuse
-Display FUSE requests and replies
+Display FUSE requests and replies.
 .It Ar dump
-Dump content of FUSE frames
+Dump content of FUSE frames.
 .It Ar fh
-Display filehandles activity
+Display file handle activity.
 .It Ar reclaim
-Display reclaim activity
+Display reclaim activity.
 .It Ar readdir
-Display readdir activity
+Display readdir activity.
 .It Ar requeue
-Display requeue activity
+Display requeue activity.
 .It Ar sync
-Display dirty flags and sync operations
+Display dirty flags and sync operations.
 .El
-.It Fl s
-Enable debug output only when receiving SIGINFO.
+.It Fl f
+Do not fork, but stay in the foreground.
 .It Fl i Ar fd
 Do not open
 .Pa /dev/fuse
-but use the socket available from file descriptor
+but use the socket available from the file descriptor
 .Ar fd .
-This is used when 
-.Nm 
-is started from 
+This is used when
+.Nm
+is started from
 .Xr libperfuse 3 .
+.It Fl s
+Enable debug output only when receiving
+.Li SIGINFO .
 .El
 .Sh ERRORS
 The program logs to the syslog daemon as facility
 .Dq daemon .
 For detailed debugging use the
-.Fl d 
+.Fl d
 (debug) option.
 .Sh SEE ALSO
-.Xr puffs 4 ,
 .Xr mount 2 ,
-.Xr perfuse_mount 3 
+.Xr perfuse_mount 3 ,
+.Xr puffs 4
 .Sh AUTHORS
 The program was written by
 .An Emmanuel Dreyfus



CVS commit: src/lib/librump

2010-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Aug 27 18:31:18 UTC 2010

Modified Files:
src/lib/librump: rump.3

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/librump/rump.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/librump/rump.3
diff -u src/lib/librump/rump.3:1.1 src/lib/librump/rump.3:1.2
--- src/lib/librump/rump.3:1.1	Fri Aug 27 08:21:43 2010
+++ src/lib/librump/rump.3	Fri Aug 27 18:31:18 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: rump.3,v 1.1 2010/08/27 08:21:43 pooka Exp $
+.\ $NetBSD: rump.3,v 1.2 2010/08/27 18:31:18 wiz Exp $
 .\
 .\ Copyright (c) 2008-2010 Antti Kantee.  All rights reserved.
 .\
@@ -62,7 +62,7 @@
 This means that any modification to the system state on the host
 running the rump kernel will not show up in the rump kernel and
 vice versa.
-A rump kernel may also be significantly more lightweight that the
+A rump kernel may also be significantly more lightweight than the
 host, and might not include include for example file system support
 at all.
 .Pp



CVS commit: src/lib/libperfuse

2010-08-27 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Sat Aug 28 03:46:21 UTC 2010

Modified Files:
src/lib/libperfuse: ops.c perfuse.c

Log Message:
- set user/group ownership after object creation.

- enforce permissios checks. This needs to be  reviewed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libperfuse/ops.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libperfuse/perfuse.c

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

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.3 src/lib/libperfuse/ops.c:1.4
--- src/lib/libperfuse/ops.c:1.3	Fri Aug 27 09:58:17 2010
+++ src/lib/libperfuse/ops.c	Sat Aug 28 03:46:21 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.3 2010/08/27 09:58:17 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.4 2010/08/28 03:46:21 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -41,6 +41,7 @@
 #include perfuse_priv.h
 #include fuse.h
 
+static int no_access(puffs_cookie_t, const struct puffs_cred *, mode_t);
 static void fuse_attr_to_vap(struct perfuse_state *,
 struct vattr *, struct fuse_attr *);
 static int node_lookup_dir_nodot(struct puffs_usermount *,
@@ -48,7 +49,8 @@
 static int node_lookup_common(struct puffs_usermount *, puffs_cookie_t, 
 const char*, struct puffs_node **);
 static int node_mk_common(struct puffs_usermount *, puffs_cookie_t,
-struct puffs_newinfo *, perfuse_msg_t *);
+struct puffs_newinfo *, const struct puffs_cn *pcn,
+const struct vattr *, perfuse_msg_t *);
 static const char *basename_r(const char *);
 static ssize_t fuse_to_dirent(struct puffs_usermount *, puffs_cookie_t,
 struct fuse_dirent *, size_t);
@@ -90,6 +92,23 @@
 #define VTTOIF(indx) (vttoif_tab[(int)(indx)])
 
 
+static int
+no_access(opc, pcr, mode)
+	puffs_cookie_t opc;
+	const struct puffs_cred *pcr;
+	mode_t mode;
+{
+	struct puffs_node *pn;
+	struct vattr *va;
+
+	pn = (struct puffs_node *)opc;
+	va = puffs_pn_getvap(pn);
+
+	return puffs_access(va-va_type, va-va_mode, 
+			va-va_uid, va-va_gid,
+			mode, pcr);
+}
+
 static void
 fuse_attr_to_vap(ps, vap, fa)
 	struct perfuse_state *ps;
@@ -222,15 +241,18 @@
  * perfuse_node_symlink
  */
 static int
-node_mk_common(pu, opc, pni, pm)
+node_mk_common(pu, opc, pni, pcn, vap, pm)
 	struct puffs_usermount *pu;
 	puffs_cookie_t opc;
 	struct puffs_newinfo *pni;
+	const struct puffs_cn *pcn;
+	const struct vattr *vap;
 	perfuse_msg_t *pm;
 {
 	struct perfuse_state *ps;
 	struct puffs_node *pn;
 	struct fuse_entry_out *feo;
+	struct fuse_setattr_in *fsi;
 	int error;
 
 	ps =  puffs_getspecific(pu);
@@ -247,6 +269,25 @@
 
 	fuse_attr_to_vap(ps, pn-pn_va, feo-attr);
 	puffs_newinfo_setcookie(pni, pn);
+	ps-ps_destroy_msg(pm);
+ 
+	/* 
+	 * Set owner and group
+	 */
+	(void)puffs_cred_getuid(pcn-pcn_cred, pn-pn_va.va_uid);
+	(void)puffs_cred_getgid(pcn-pcn_cred, pn-pn_va.va_gid);
+
+	pm = ps-ps_new_msg(pu, (puffs_cookie_t)pn, 
+			FUSE_SETATTR, sizeof(*fsi), NULL);
+	fsi = GET_INPAYLOAD(ps, pm, fuse_setattr_in);
+	fsi-uid = pn-pn_va.va_uid;
+	fsi-gid = pn-pn_va.va_gid;
+	fsi-valid = FUSE_FATTR_UID|FUSE_FATTR_GID;
+
+	/*
+	 * A fuse_attr_out is returned, but we ignore it.
+	 */
+	error = XCHG_MSG(ps, pu, pm, sizeof(struct fuse_attr_out));
 
 out:
 	ps-ps_destroy_msg(pm);
@@ -807,6 +848,12 @@
 	int error;
 	
 	/*
+	 * Create an object require -WX permission in the parent directory
+	 */
+	if (no_access(opc, pcn-pcn_cred, PUFFS_VWRITE|PUFFS_VEXEC))
+		return EACCES;
+
+	/*
 	 * If create is unimplemented: Check that it does not
 	 * already exists, and if not, do mknod and open
 	 */
@@ -888,6 +935,28 @@
 	const char* path;
 	size_t len;
 	
+	/*
+	 * Only superuser can mknod objects other than 
+	 * directories, files, socks, fifo and links.
+	 *
+	 * Create an object require -WX permission in the parent directory
+	 */
+	switch (vap-va_type) {
+	case VDIR:	/* FALLTHROUGH */
+	case VREG:	/* FALLTHROUGH */
+	case VFIFO:	/* FALLTHROUGH */
+	case VSOCK:	/* FALLTHROUGH */
+	case VLNK:
+		if (no_access(opc, pcn-pcn_cred, PUFFS_VWRITE|PUFFS_VEXEC))
+			return EACCES;
+		break;
+	default:	/* VNON, VBLK, VCHR, VBAD */
+		if (!puffs_cred_isjuggernaut(pcn-pcn_cred))
+			return EACCES;
+		break;
+	}
+
+
 	ps = puffs_getspecific(pu);
 	path = basename_r((char *)PCNPATH(pcn));
 	len = sizeof(*fmi) + strlen(path) + 1; 
@@ -899,7 +968,7 @@
 	fmi-umask = 0; 	/* Seems unused bu libfuse */
 	(void)strlcpy((char *)(void *)(fmi + 1), path, len - sizeof(*fmi));
 
-	return node_mk_common(pu, opc, pni, pm);
+	return node_mk_common(pu, opc, pni, pcn, vap, pm);
 }
 
 
@@ -912,6 +981,7 @@
 {
 	struct perfuse_state *ps;
 	perfuse_msg_t *pm;
+	mode_t pmode;
 	int op;
 	struct fuse_open_in *foi;
 	struct fuse_open_out *foo;
@@ -921,10 +991,28 @@
 	ps = puffs_getspecific(pu);
 
 	pn = (struct puffs_node *)opc;
-	if (puffs_pn_getvap(pn)-va_type == VDIR)
+	if (puffs_pn_getvap(pn)-va_type == VDIR) {
 		

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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:00:35 UTC 2010

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

Log Message:
Remove white-space and null-line.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/omap/omap2_gpmc.c

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

Modified files:

Index: src/sys/arch/arm/omap/omap2_gpmc.c
diff -u src/sys/arch/arm/omap/omap2_gpmc.c:1.6 src/sys/arch/arm/omap/omap2_gpmc.c:1.7
--- src/sys/arch/arm/omap/omap2_gpmc.c:1.6	Wed Jul  7 21:10:39 2010
+++ src/sys/arch/arm/omap/omap2_gpmc.c	Sat Aug 28 04:00:35 2010
@@ -1,7 +1,7 @@
-/*	$Id: omap2_gpmc.c,v 1.6 2010/07/07 21:10:39 ahoka Exp $	*/
+/*	$Id: omap2_gpmc.c,v 1.7 2010/08/28 04:00:35 kiyohara Exp $	*/
 
 /* adapted from: */
-/*	$NetBSD: omap2_gpmc.c,v 1.6 2010/07/07 21:10:39 ahoka Exp $ */
+/*	$NetBSD: omap2_gpmc.c,v 1.7 2010/08/28 04:00:35 kiyohara Exp $ */
 
 
 /*
@@ -102,7 +102,7 @@
 
 #include opt_omap.h
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: omap2_gpmc.c,v 1.6 2010/07/07 21:10:39 ahoka Exp $);
+__KERNEL_RCSID(0, $NetBSD: omap2_gpmc.c,v 1.7 2010/08/28 04:00:35 kiyohara Exp $);
 
 #include locators.h
 
@@ -200,7 +200,7 @@
 	rev = bus_space_read_4(sc-sc_iot, ioh, GPMC_REVISION);
 
 	aprint_normal(, rev %d.%d\n,
-		GPMC_REVISION_REV_MAJ(rev), 
+		GPMC_REVISION_REV_MAJ(rev),
 		GPMC_REVISION_REV_MIN(rev));
 
 	sc-sc_ioh = ioh;
@@ -222,7 +222,6 @@
 	gpmc_csconfig_t *cs;
 	uint32_t r;
 	int i;
-	
 
 	cs = sc-sc_csconfig[0];
 	for (i=0; i  GPMC_NCS; i++) {



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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:03:51 UTC 2010

Modified Files:
src/sys/arch/arm/omap: omap2_gpmcreg.h

Log Message:
+ Add some GPMC_CONFIG7 macros and replace magic-number to it.
+ Indent.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/omap/omap2_gpmcreg.h

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

Modified files:

Index: src/sys/arch/arm/omap/omap2_gpmcreg.h
diff -u src/sys/arch/arm/omap/omap2_gpmcreg.h:1.3 src/sys/arch/arm/omap/omap2_gpmcreg.h:1.4
--- src/sys/arch/arm/omap/omap2_gpmcreg.h:1.3	Sat Jul 10 11:50:49 2010
+++ src/sys/arch/arm/omap/omap2_gpmcreg.h	Sat Aug 28 04:03:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_gpmcreg.h,v 1.3 2010/07/10 11:50:49 ahoka Exp $	*/
+/*	$NetBSD: omap2_gpmcreg.h,v 1.4 2010/08/28 04:03:51 kiyohara Exp $	*/
 /*
  * Copyright (c) 2007 Microsoft
  * All rights reserved.
@@ -198,6 +198,12 @@
 #define GPMC_CONFIG7_BASEADDRESS	__BITS(5,0)
 #define GPMC_CONFIG7_CSVALID		__BIT(6)
 #define GPMC_CONFIG7_MASKADDRESS	__BITS(11,8)
+#define GPMC_CONFIG7(m, b)		(((m)  8) | (((b)  24)  0x3f))
+#define GPMC_CONFIG7_MASK_256M		0x0
+#define GPMC_CONFIG7_MASK_128M		0x8
+#define GPMC_CONFIG7_MASK_64M		0xc
+#define GPMC_CONFIG7_MASK_32M		0xe
+#define GPMC_CONFIG7_MASK_16M		0xf
 
 static __inline ulong
 omap_gpmc_config7_addr(uint32_t r)
@@ -213,16 +219,16 @@
 		uint  mask;
 		ulong size;
 	} gpmc_config7_size_tab[5] = {
-		{ 0x0, (256  20) },		/* 256 MB */
-		{ 0x8, (128  20) },		/* 128 MB */
-		{ 0xc, ( 64  20) },		/*  64 MB */
-		{ 0xe, ( 32  20) },		/*  32 MB */
-		{ 0xf, ( 16  20) },		/*  16 MB */
+		{ GPMC_CONFIG7_MASK_256M, (256  20) },
+		{ GPMC_CONFIG7_MASK_128M, (128  20) },
+		{ GPMC_CONFIG7_MASK_64M,  ( 64  20) },
+		{ GPMC_CONFIG7_MASK_32M,  ( 32  20) },
+		{ GPMC_CONFIG7_MASK_16M,  ( 16  20) },
 	};
 	mask = ((r)  GPMC_CONFIG7_MASKADDRESS)  8;
 	for (i=0; i  5; i++) {
 		if (gpmc_config7_size_tab[i].mask == mask)
-		return gpmc_config7_size_tab[i].size;
+			return gpmc_config7_size_tab[i].size;
 	}
 	return 0;
 }



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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:12:40 UTC 2010

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_start.S

Log Message:
Disable L2 Cache when boot time.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/gumstix/gumstix_start.S

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/gumstix/gumstix_start.S
diff -u src/sys/arch/evbarm/gumstix/gumstix_start.S:1.7 src/sys/arch/evbarm/gumstix/gumstix_start.S:1.8
--- src/sys/arch/evbarm/gumstix/gumstix_start.S:1.7	Sat Jul 10 08:17:48 2010
+++ src/sys/arch/evbarm/gumstix/gumstix_start.S	Sat Aug 28 04:12:40 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_start.S,v 1.7 2010/07/10 08:17:48 kiyohara Exp $ */
+/*	$NetBSD: gumstix_start.S,v 1.8 2010/08/28 04:12:40 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -195,6 +195,11 @@
 	orr	r0, r0, #CPU_CONTROL_SYST_ENABLE
 #endif
 #if defined(CPU_CORTEXA8)
+	/* Disable L2 cache beforehand. */
+	mrc	p15, 0, r1, c1, c0, 1
+	bic	r1, r1, #0x2		/* clear L2EN */
+	mcr	p15, 0, r1, c1, c0, 1
+
 	orr	r0, r0, #CPU_CONTROL_AFLT_ENABLE | CPU_CONTROL_DC_ENABLE
 	orr	r0, r0, #CPU_CONTROL_BPRD_ENABLE | CPU_CONTROL_IC_ENABLE
 #endif



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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:30:25 UTC 2010

Modified Files:
src/sys/arch/evbarm/gumstix: if_smsh_gxio.c

Log Message:
+ Struct smsh_gxio is obsolated, and struct lan9118_softc is used.
  We do not have private data at all.
+ Fix typo.  sms_gxio_attach - smsh_gxio_attach


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/gumstix/if_smsh_gxio.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/gumstix/if_smsh_gxio.c
diff -u src/sys/arch/evbarm/gumstix/if_smsh_gxio.c:1.2 src/sys/arch/evbarm/gumstix/if_smsh_gxio.c:1.3
--- src/sys/arch/evbarm/gumstix/if_smsh_gxio.c:1.2	Sun Nov 29 10:08:15 2009
+++ src/sys/arch/evbarm/gumstix/if_smsh_gxio.c	Sat Aug 28 04:30:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsh_gxio.c,v 1.2 2009/11/29 10:08:15 kiyohara Exp $	*/
+/*	$NetBSD: if_smsh_gxio.c,v 1.3 2010/08/28 04:30:24 kiyohara Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_smsh_gxio.c,v 1.2 2009/11/29 10:08:15 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_smsh_gxio.c,v 1.3 2010/08/28 04:30:24 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -51,21 +51,9 @@
 static int smsh_gxio_match(device_t, struct cfdata *, void *);
 static void smsh_gxio_attach(device_t, device_t, void *);
 
-static int ether_serial_digit = 1;  
+static int ether_serial_digit = 1;
 
-struct smsh_gxio_softc {
-	struct lan9118_softc sc_smsh;
-	void *sc_ih;
-
-	/*
-	 * Board independent DMA stuffs, if uses master DMA.
-	 * We use PXA2x0's DMA.
-	 */
-	struct dmac_xfer *sc_txfer;
-	struct dmac_xfer *sc_rxfer;
-};
-
-CFATTACH_DECL_NEW(smsh_gxio, sizeof(struct smsh_gxio_softc),
+CFATTACH_DECL_NEW(smsh_gxio, sizeof(struct lan9118_softc),
 smsh_gxio_match, smsh_gxio_attach, NULL, NULL);
 
 
@@ -104,9 +92,9 @@
 static void
 smsh_gxio_attach(device_t parent, device_t self, void *aux)
 {
-	struct smsh_gxio_softc *gsc = device_private(self);
-	struct lan9118_softc *sc = gsc-sc_smsh;
+	struct lan9118_softc *sc = device_private(self);
 	struct gxio_attach_args *gxa = aux;
+	void *ih;
 
 	KASSERT(system_serial_high != 0 || system_serial_low != 0);
 
@@ -115,7 +103,7 @@
 	/* Map i/o space. */
 	if (bus_space_map(gxa-gxa_iot, gxa-gxa_addr, LAN9118_IOSIZE, 0,
 	sc-sc_ioh))
-		panic(sms_gxio_attach: can't map i/o space);
+		panic(smsh_gxio_attach: can't map i/o space);
 	sc-sc_iot = gxa-gxa_iot;
 
 	sc-sc_enaddr[0] = ((system_serial_high  8)  0xfe) | 0x02;
@@ -132,9 +120,9 @@
 	}
 
 	/* Establish the interrupt handler. */
-	gsc-sc_ih = gxio_intr_establish(gxa-gxa_sc,
+	ih = gxio_intr_establish(gxa-gxa_sc,
 	gxa-gxa_gpirq, IST_EDGE_FALLING, IPL_NET, lan9118_intr, sc);
-	if (gsc-sc_ih == NULL) {
+	if (ih == NULL) {
 		aprint_error_dev(self,
 		couldn't establish interrupt handler\n);
 		bus_space_unmap(sc-sc_iot, sc-sc_ioh, LAN9118_IOSIZE);



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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:33:00 UTC 2010

Modified Files:
src/sys/arch/evbarm/gumstix: if_sm_gxio.c

Log Message:
Remove a white space.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/gumstix/if_sm_gxio.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/gumstix/if_sm_gxio.c
diff -u src/sys/arch/evbarm/gumstix/if_sm_gxio.c:1.8 src/sys/arch/evbarm/gumstix/if_sm_gxio.c:1.9
--- src/sys/arch/evbarm/gumstix/if_sm_gxio.c:1.8	Mon Mar 15 13:11:23 2010
+++ src/sys/arch/evbarm/gumstix/if_sm_gxio.c	Sat Aug 28 04:33:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sm_gxio.c,v 1.8 2010/03/15 13:11:23 kiyohara Exp $ */
+/*	$NetBSD: if_sm_gxio.c,v 1.9 2010/08/28 04:33:00 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_sm_gxio.c,v 1.8 2010/03/15 13:11:23 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_sm_gxio.c,v 1.9 2010/08/28 04:33:00 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -100,7 +100,7 @@
 
 struct sm_gxio_softc {
 	struct	smc91cxx_softc sc_smc;
-	void	*sc_ih;	
+	void	*sc_ih;
 };
 
 CFATTACH_DECL(sm_gxio, sizeof(struct sm_gxio_softc),



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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:39:42 UTC 2010

Modified Files:
src/sys/arch/evbarm/gumstix: gxio.c

Log Message:
+ Add configuration function for NIC of Chestnut43/Tobi/Tobi-Duo.
  tested Chestnut43 only.
+ Remove parenthesis for return.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/gumstix/gxio.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/gumstix/gxio.c
diff -u src/sys/arch/evbarm/gumstix/gxio.c:1.15 src/sys/arch/evbarm/gumstix/gxio.c:1.16
--- src/sys/arch/evbarm/gumstix/gxio.c:1.15	Sat Jul 10 08:17:48 2010
+++ src/sys/arch/evbarm/gumstix/gxio.c	Sat Aug 28 04:39:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.15 2010/07/10 08:17:48 kiyohara Exp $ */
+/*	$NetBSD: gxio.c,v 1.16 2010/08/28 04:39:42 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gxio.c,v 1.15 2010/07/10 08:17:48 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: gxio.c,v 1.16 2010/08/28 04:39:42 kiyohara Exp $);
 
 #include opt_cputypes.h
 #include opt_gumstix.h
@@ -46,7 +46,9 @@
 
 #include machine/bootconfig.h
 
+#include arm/omap/omap2_gpmcreg.h
 #include arm/omap/omap2_reg.h
+#include arm/omap/omap2_intr.h
 #include arm/omap/omap_var.h
 #if defined(CPU_XSCALE_PXA270) || defined(CPU_XSCALE_PXA250)
 #include arm/xscale/pxa2x0cpu.h
@@ -54,11 +56,11 @@
 #include arm/xscale/pxa2x0reg.h
 #include arm/xscale/pxa2x0var.h
 #include arm/xscale/pxa2x0_gpio.h
+#include evbarm/gumstix/gumstixreg.h
 #include evbarm/gumstix/gumstixvar.h
 
-#if !defined(OVERO)	/* X */
+#include ioconf.h
 #include locators.h
-#endif
 
 
 struct gxioconf {
@@ -66,17 +68,20 @@
 	void (*config)(void);
 };
 
-#if !defined(OVERO)	/* X */
+#if defined(GUMSTIX)
 static int gxiomatch(device_t, cfdata_t, void *);
 static void gxioattach(device_t, device_t, void *);
 static int gxiosearch(device_t, cfdata_t, const int *, void *);
 static int gxioprint(void *, const char *);
+
+CFATTACH_DECL_NEW(gxio, sizeof(struct gxio_softc),
+gxiomatch, gxioattach, NULL, NULL);
 #endif
 
 void gxio_config_pin(void);
 void gxio_config_expansion(char *);
 static void gxio_config_gpio(const struct gxioconf *, char *);
-#if defined(CPU_XSCALE_PXA270) || defined(CPU_XSCALE_PXA250)
+#if defined(GUMSTIX)
 static void basix_config(void);
 static void cfstix_config(void);
 static void etherstix_config(void);
@@ -89,15 +94,14 @@
 static void netmmc_config(void);
 static void wifistix_config(void);
 static void wifistix_cf_config(void);
+#elif defined(OVERO)
+static void eth0_config(void);
+static void eth1_config(void);
+static void chestnut_config(void);
+static void tobi_config(void);
+static void tobiduo_config(void);
 #endif
 
-#if !defined(OVERO)	/* X */
-CFATTACH_DECL_NEW(
-gxio, sizeof(struct gxio_softc), gxiomatch, gxioattach, NULL, NULL);
-#endif
-
-char busheader[MAX_BOOT_STRING];
-
 #if defined(CPU_XSCALE_PXA250)
 static struct pxa2x0_gpioconf pxa255dep_gpioconf[] = {
 	/* Bluetooth module configuration */
@@ -161,7 +165,7 @@
 #endif
 
 static const struct gxioconf busheader_conf[] = {
-#if defined(CPU_XSCALE_PXA270) || defined(CPU_XSCALE_PXA250)
+#if defined(GUMSTIX)
 	{ basix,		basix_config },
 	{ cfstix,		cfstix_config },
 	{ etherstix,		etherstix_config },
@@ -176,6 +180,10 @@
 	{ netpro-vx,		netwifimicrosd_config },
 	{ wifistix-cf,	wifistix_cf_config },
 	{ wifistix,		wifistix_config },
+#elif defined(OVERO)
+	{ chestnut43,		chestnut_config },
+	{ tobi,		tobi_config },
+	{ tobi-duo,		tobiduo_config },
 #endif
 	{ NULL }
 };
@@ -184,11 +192,12 @@
 struct gxpcic_slot_irqs gxpcic_slot_irqs[2] = { { 0, -1, -1 }, { 0, -1, -1 } };
 
 
-#if !defined(OVERO)	/* X */
+#if defined(GUMSTIX)
 /* ARGSUSED */
 static int
 gxiomatch(device_t parent, cfdata_t match, void *aux)
 {
+
 	struct pxaip_attach_args *pxa = aux;
 	bus_space_tag_t iot = pxa2x0_bs_tag;
 	bus_space_handle_t ioh;
@@ -199,11 +208,11 @@
 
 	if (bus_space_map(iot,
 	PXA2X0_MEMCTL_BASE, PXA2X0_MEMCTL_SIZE, 0, ioh))
-		return (0);
+		return 0;
 	bus_space_unmap(iot, ioh, PXA2X0_MEMCTL_SIZE);
 
 	/* nothing */
-	return (1);
+	return 1;
 }
 
 /* ARGSUSED */
@@ -223,7 +232,7 @@
 		return;
 
 	/*
-	 *  Attach each gumstix expansion of busheader side devices
+	 *  Attach each gumstix(busheader)/overo expansion board devices.
 	 */
 	config_search_ia(gxiosearch, self, gxio, NULL);
 }
@@ -243,7 +252,7 @@
 	if (config_match(parent, cf, gxa))
 		config_attach(parent, cf, gxa, gxioprint);
 
-	return (0);
+	return 0;
 }
 
 /* ARGSUSED */
@@ -256,7 +265,7 @@
 		printf( addr 0x%lx, gxa-gxa_addr);
 	if (gxa-gxa_gpirq  0)
 		printf( gpirq %d, gxa-gxa_gpirq);
-	return (UNCONF);
+	return UNCONF;
 }
 #endif
 
@@ -322,7 +331,7 @@
 {
 
 	if (expansion == NULL) {
-		

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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:46:24 UTC 2010

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_machdep.c gumstixreg.h

Log Message:
+ Add parsing keyword 'expansion=' in args from U-boot.  And keep backword
  compatibility 'busheader=', in case Gumstix.
+ Add GPMC device map to gumstix_devmap[].


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/gumstix/gumstixreg.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/evbarm/gumstix/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.29 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.30
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.29	Sun Aug  8 09:00:15 2010
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sat Aug 28 04:46:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.29 2010/08/08 09:00:15 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.30 2010/08/28 04:46:24 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -139,6 +139,7 @@
 
 #include opt_evbarm_boardtype.h
 #include opt_cputypes.h
+#include opt_omap.h
 #include opt_gumstix.h
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -168,6 +169,7 @@
 #include machine/frame.h
 
 #include arm/arm32/machdep.h
+#include arm/omap/omap2_gpmcreg.h
 #include arm/omap/omap2_reg.h
 #include arm/omap/omap_var.h
 #include arm/omap/omap_com.h
@@ -460,6 +462,13 @@
 		VM_PROT_READ | VM_PROT_WRITE,
 		PTE_NOCACHE
 	},
+	{
+		OVERO_GPMC_VBASE,
+		_A(GPMC_BASE),
+		_S(GPMC_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
 #endif
 	{ 0, 0, 0, 0, 0 }
 };
@@ -1035,6 +1044,10 @@
 #ifdef GUMSTIX_NETBSD_ARGS_BUSHEADER
 static const char busheader_name[] = busheader=;
 #endif
+#if defined(GUMSTIX_NETBSD_ARGS_BUSHEADER) || \
+defined(GUMSTIX_NETBSD_ARGS_EXPANSION)
+static const char expansion_name[] = expansion=;
+#endif
 #ifdef GUMSTIX_NETBSD_ARGS_CONSOLE
 static const char console_name[] = console=;
 #endif
@@ -1048,12 +1061,21 @@
 	for (i = 1, j = 0; i  argc; i++) {
 #ifdef GUMSTIX_NETBSD_ARGS_BUSHEADER
 		if (!strncmp(argv[i], busheader_name, strlen(busheader_name))) {
-			/* configure for GPIOs of busheader side */
+			/* Configure for GPIOs of busheader side */
 			gxio_config_expansion(argv[i] + strlen(busheader_name));
 			gxio_configured = 1;
 			continue;
 		}
 #endif
+#if defined(GUMSTIX_NETBSD_ARGS_BUSHEADER) || \
+defined(GUMSTIX_NETBSD_ARGS_EXPANSION)
+		if (!strncmp(argv[i], expansion_name, strlen(expansion_name))) {
+			/* Configure expansion */
+			gxio_config_expansion(argv[i] + strlen(expansion_name));
+			gxio_configured = 1;
+			continue;
+		}
+#endif
 #ifdef GUMSTIX_NETBSD_ARGS_CONSOLE
 		if (!strncmp(argv[i], console_name, strlen(console_name))) {
 			strncpy(console, argv[i] + strlen(console_name),
@@ -1081,25 +1103,36 @@
 static void
 process_kernel_args_liner(char *args)
 {
+	int i = 0;
 	char *p = NULL;
 
 	boothowto = 0;
 
 	strncpy(bootargs, args, sizeof(bootargs));
+#if defined(GUMSTIX_NETBSD_ARGS_BUSHEADER) || \
+defined(GUMSTIX_NETBSD_ARGS_EXPANSION)
+	{
+		char *q;
+
+		if ((p = strstr(bootargs, expansion_name)))
+			q = p + strlen(expansion_name);
 #ifdef GUMSTIX_NETBSD_ARGS_BUSHEADER
-	p = strstr(bootargs, busheader_name);
-	if (p) {
-		int i = 0;
-		char expansion[256], c;
+		else if (p = strstr(bootargs, busheader_name))
+			q = p + strlen(busheader_name);
+#endif
+		if (p) {
+			char expansion[256], c;
 
-		do {
-			c = *(p + strlen(busheader_name) + i);
-			if (c == ' ')
-c = '\0';
-			expansion[i++] = c;
-		} while (c != '\0'  i  sizeof(expansion));
-		gxio_config_expansion(expansion);
-		strcpy(p, p + i);
+			i = 0;
+			do {
+c = *(q + i);
+if (c == ' ')
+	c = '\0';
+expansion[i++] = c;
+			} while (c != '\0'  i  sizeof(expansion));
+			gxio_config_expansion(expansion);
+			strcpy(p, q + i);
+		}
 	}
 #endif
 	if (p == NULL)
@@ -1107,9 +1140,9 @@
 #ifdef GUMSTIX_NETBSD_ARGS_CONSOLE
 	p = strstr(bootargs, console_name);
 	if (p != NULL) {
-		int i = 0;
 		char c;
 
+		i = 0;
 		do {
 			c = *(p + strlen(console_name) + i);
 			if (c == ' ')
@@ -1117,7 +1150,7 @@
 			console[i++] = c;
 		} while (c != '\0'  i  sizeof(console));
 		consinit();
-		strcpy(p, p + i);
+		strcpy(p, p + strlen(console_name) + i);
 	}
 #endif
 	boot_args = bootargs;

Index: src/sys/arch/evbarm/gumstix/gumstixreg.h
diff -u src/sys/arch/evbarm/gumstix/gumstixreg.h:1.5 src/sys/arch/evbarm/gumstix/gumstixreg.h:1.6
--- src/sys/arch/evbarm/gumstix/gumstixreg.h:1.5	Sat Jul 10 08:17:48 2010
+++ src/sys/arch/evbarm/gumstix/gumstixreg.h	Sat Aug 28 04:46:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstixreg.h,v 1.5 2010/07/10 08:17:48 kiyohara Exp $  */
+/*	$NetBSD: gumstixreg.h,v 1.6 2010/08/28 04:46:24 kiyohara Exp $  */
 /*
  * 

CVS commit: src/sys/arch/evbarm

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:54:46 UTC 2010

Modified Files:
src/sys/arch/evbarm/conf: OVERO files.overo
Added Files:
src/sys/arch/evbarm/gumstix: if_smsh_gpmc.c

Log Message:
Support s...@gpmc.
  tested Chestnut43 only.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/OVERO
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/files.overo
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/gumstix/if_smsh_gpmc.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/conf/OVERO
diff -u src/sys/arch/evbarm/conf/OVERO:1.3 src/sys/arch/evbarm/conf/OVERO:1.4
--- src/sys/arch/evbarm/conf/OVERO:1.3	Tue Jul 20 12:13:18 2010
+++ src/sys/arch/evbarm/conf/OVERO	Sat Aug 28 04:54:46 2010
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: OVERO,v 1.3 2010/07/20 12:13:18 kiyohara Exp $
+#	$NetBSD: OVERO,v 1.4 2010/08/28 04:54:46 kiyohara Exp $
 #
 #	OVERO -- Gumstix. Inc. Overo platforms kernel
 #
@@ -23,6 +23,9 @@
 
 # Gumstix options
 options 	OVERO
+# Can specify 'expansion=' in args from u-boot.
+options 	GUMSTIX_NETBSD_ARGS_EXPANSION
+options 	GXIO_DEFAULT_EXPANSION=\Chestnut43\
 
 # Standard system options
 
@@ -134,8 +137,8 @@
 options 	KTRACE		# system call tracing, a la ktrace(1)
 options 	IRQSTATS	# manage IRQ statistics
 #options 	KMEMSTATS	# kernel memory statistics
+#options 	MIIVERBOSE	# verbose PHY autoconfig messages
 #options 	USBVERBOSE	# verbose USB device autoconfig messages
-options 	MIIVERBOSE	# Verbose MII autoconfuration messages
 #options 	DDB_KEYCODE=0x40
 #options 	USERCONF	# userconf(4) support
 #options	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
@@ -179,14 +182,14 @@
 
 # Interrupt Controller
 omapicu0	at obio0 addr 0x4820 size 0x1000 intrbase 0
-#omapgpio0	at obio1 addr 0x4831 size 0x0400 intrbase 96  intr 29
-#omapgpio1	at obio2 addr 0x4905 size 0x0400 intrbase 128 intr 30
-#omapgpio2	at obio2 addr 0x49052000 size 0x0400 intrbase 160 intr 31
-#omapgpio3	at obio2 addr 0x49054000 size 0x0400 intrbase 192 intr 32
-#omapgpio4	at obio2 addr 0x49056000 size 0x0400 intrbase 224 intr 33
-#omapgpio5	at obio2 addr 0x49058000 size 0x0400 intrbase 256 intr 34
+omapgpio0	at obio1 addr 0x4831 size 0x0400 intrbase 96  intr 29
+omapgpio1	at obio2 addr 0x4905 size 0x0400 intrbase 128 intr 30
+omapgpio2	at obio2 addr 0x49052000 size 0x0400 intrbase 160 intr 31
+omapgpio3	at obio2 addr 0x49054000 size 0x0400 intrbase 192 intr 32
+omapgpio4	at obio2 addr 0x49056000 size 0x0400 intrbase 224 intr 33
+omapgpio5	at obio2 addr 0x49058000 size 0x0400 intrbase 256 intr 34
 
-#gpio*		at omapgpio?
+gpio*		at omapgpio?
 
 # On-board 16550 UARTs
 com0		at obio2 addr 0x4902 intr 74 mult 4	# UART3 (console)
@@ -220,6 +223,15 @@
 options		HWCLOCK_MACHINE=arch/arm/omap/hwclock_omap1.h
 options		OMAP_CK_REF_SPEED=1200
 
+# overo expantion boards
+
+# SMSC LAN9221
+smsh0	at gpmc? addr 0x0100 intr 272	# Tobi, Chestnut43
+smsh1	at gpmc? addr 0x0200 intr 161	# Tobi-Duo
+
+# MII/PHY support
+ukphy*	at mii? phy ?# smsh(4) internal PHY
+
 # Pseudo-Devices
 
 # disk/mass storage pseudo-devices

Index: src/sys/arch/evbarm/conf/files.overo
diff -u src/sys/arch/evbarm/conf/files.overo:1.2 src/sys/arch/evbarm/conf/files.overo:1.3
--- src/sys/arch/evbarm/conf/files.overo:1.2	Sat Jul 10 08:31:34 2010
+++ src/sys/arch/evbarm/conf/files.overo	Sat Aug 28 04:54:46 2010
@@ -1,10 +1,11 @@
-#	$NetBSD: files.overo,v 1.2 2010/07/10 08:31:34 kiyohara Exp $
+#	$NetBSD: files.overo,v 1.3 2010/08/28 04:54:46 kiyohara Exp $
 #
 # Gumstix. Inc. Overo boards configuration info
 #
 
 file	arch/evbarm/gumstix/gumstix_machdep.c
 defflag opt_gumstix.hOVERO 
+		GUMSTIX_NETBSD_ARGS_EXPANSION
 
 defparam opt_gxio.hGXIO_DEFAULT_EXPANSION
 file	arch/evbarm/gumstix/gxio.c
@@ -15,3 +16,7 @@
 # NS16550 compatible serial ports
 attach com at obio with obiouart
 file	arch/arm/omap/obio_com.c		obiouart
+
+# SMSC LAN9118
+attach	smsh at gpmc with smsh_gpmc
+file	arch/evbarm/gumstix/if_smsh_gpmc.c	smsh_gpmc

Added files:

Index: src/sys/arch/evbarm/gumstix/if_smsh_gpmc.c
diff -u /dev/null src/sys/arch/evbarm/gumstix/if_smsh_gpmc.c:1.1
--- /dev/null	Sat Aug 28 04:54:46 2010
+++ src/sys/arch/evbarm/gumstix/if_smsh_gpmc.c	Sat Aug 28 04:54:46 2010
@@ -0,0 +1,119 @@
+/*	$NetBSD: if_smsh_gpmc.c,v 1.1 2010/08/28 04:54:46 kiyohara Exp $	*/
+/*
+ * Copyright (c) 2010 KIYOHARA Takashi
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *

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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:58:49 UTC 2010

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

Log Message:
Change size number to hexadecimal.


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

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

Modified files:

Index: src/sys/arch/evbarm/conf/OVERO
diff -u src/sys/arch/evbarm/conf/OVERO:1.4 src/sys/arch/evbarm/conf/OVERO:1.5
--- src/sys/arch/evbarm/conf/OVERO:1.4	Sat Aug 28 04:54:46 2010
+++ src/sys/arch/evbarm/conf/OVERO	Sat Aug 28 04:58:49 2010
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: OVERO,v 1.4 2010/08/28 04:54:46 kiyohara Exp $
+#	$NetBSD: OVERO,v 1.5 2010/08/28 04:58:49 kiyohara Exp $
 #
 #	OVERO -- Gumstix. Inc. Overo platforms kernel
 #
@@ -204,9 +204,9 @@
 options OMAP_MPU_TIMER_CLOCK_FREQ=1200
 
 # Watchdog timers
-#omapwdt32k*	at obio2 addr 0x4903 size 2048	# WDT3
-#omapwdt32k*	at obio1 addr 0x4830c000 size 2048	# WDT1
-omapwdt32k*	at obio1 addr 0x48314000 size 2048	# WDT2
+#omapwdt32k*	at obio2 addr 0x4903 size 0x0800	# WDT3
+#omapwdt32k*	at obio1 addr 0x4830c000 size 0x0800	# WDT1
+omapwdt32k*	at obio1 addr 0x48314000 size 0x0800	# WDT2
 
 # On-board USB
 #ehci*		at obio0 addr 0x48064800 size 0x0400 intr 77



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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:59:23 UTC 2010

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

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/evbarm/conf/GUMSTIX

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

Modified files:

Index: src/sys/arch/evbarm/conf/GUMSTIX
diff -u src/sys/arch/evbarm/conf/GUMSTIX:1.51 src/sys/arch/evbarm/conf/GUMSTIX:1.52
--- src/sys/arch/evbarm/conf/GUMSTIX:1.51	Sat Jul 10 08:17:48 2010
+++ src/sys/arch/evbarm/conf/GUMSTIX	Sat Aug 28 04:59:22 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: GUMSTIX,v 1.51 2010/07/10 08:17:48 kiyohara Exp $
+#	$NetBSD: GUMSTIX,v 1.52 2010/08/28 04:59:22 kiyohara Exp $
 #
 #	GUMSTIX -- Gumstix. Inc. gumstix platforms kernel
 #
@@ -24,7 +24,7 @@
 
 # Gumstix options
 options 	GUMSTIX
-# if not specfied 'busheader=' in args from u-boot, use GXIO_DEFAULT_EXPANSION.
+# if not specified 'busheader=' in args from u-boot, use GXIO_DEFAULT_EXPANSION.
 options 	GUMSTIX_NETBSD_ARGS_BUSHEADER
 options 	GUMSTIX_NETBSD_ARGS_CONSOLE	# dynamically configure console
 		# 'console=lcd' or ffuart,stuart