CVS commit: src/sys/sys

2009-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 20 05:50:20 UTC 2009

Modified Files:
src/sys/sys: exec_elf.h

Log Message:
Add defns for Elf{32,64}_Syminfo.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/sys/exec_elf.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/sys/exec_elf.h
diff -u src/sys/sys/exec_elf.h:1.99 src/sys/sys/exec_elf.h:1.100
--- src/sys/sys/exec_elf.h:1.99	Sat Dec 19 09:02:46 2009
+++ src/sys/sys/exec_elf.h	Sun Dec 20 05:50:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf.h,v 1.99 2009/12/19 09:02:46 thorpej Exp $	*/
+/*	$NetBSD: exec_elf.h,v 1.100 2009/12/20 05:50:20 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -897,6 +897,39 @@
 #define	ELF64_ST_INFO(bind,type)	ELF_ST_INFO(bind,type)
 #define	ELF64_ST_VISIBILITY(other)	ELF_ST_VISIBILITY(other)
 
+typedef struct {
+	Elf32_Half	si_boundto;	/* direct bindings - symbol bound to */
+	Elf32_Half	si_flags;	/* per symbol flags */
+} Elf32_Syminfo;
+
+typedef struct {
+	Elf64_Half	si_boundto;	/* direct bindings - symbol bound to */
+	Elf64_Half	si_flags;	/* per symbol flags */
+} Elf64_Syminfo;
+
+#define	SYMINFO_FLG_DIRECT	0x0001	/* symbol ref has direct association
+	   to object containing definition */
+#define	SYMINFO_FLG_PASSTHRU	0x0002	/* ignored - see SYMINFO_FLG_FILTER */
+#define	SYMINFO_FLG_COPY	0x0004	/* symbol is a copy-reloc */
+#define	SYMINFO_FLG_LAZYLOAD	0x0008	/* object containing defn should be
+	   lazily-loaded */
+#define	SYMINFO_FLG_DIRECTBIND	0x0010	/* ref should be bound directly to
+	   object containing definition */
+#define	SYMINFO_FLG_NOEXTDIRECT	0x0020	/* don't let an external reference
+	   directly bind to this symbol */
+#define	SYMINFO_FLG_FILTER	0x0002	/* symbol ref is associated to a */
+#define	SYMINFO_FLG_AUXILIARY	0x0040	/*  standard or auxiliary filter */
+
+#define	SYMINFO_BT_SELF		0x	/* symbol bound to self */
+#define	SYMINFO_BT_PARENT	0xfffe	/* symbol bound to parent */
+#define	SYMINFO_BT_NONE		0xfffd	/* no special symbol binding */
+#define	SYMINFO_BT_EXTERN	0xfffc	/* symbol defined as external */
+#define	SYMINFO_BT_LOWRESERVE	0xff00	/* beginning of reserved entries */
+
+#define	SYMINFO_NONE		0	/* Syminfo version */
+#define	SYMINFO_CURRENT		1
+#define	SYMINFO_NUM		2
+
 /*
  * These constants are used for Elf32_Verdef struct's version number.  
  */



CVS commit: src/external/bsd/libelf/dist

2009-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 20 05:52:15 UTC 2009

Modified Files:
src/external/bsd/libelf/dist: libelf.h

Log Message:
Enable __LIBELF_HAVE_ELF_SYMINFO.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libelf/dist/libelf.h

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

Modified files:

Index: src/external/bsd/libelf/dist/libelf.h
diff -u src/external/bsd/libelf/dist/libelf.h:1.3 src/external/bsd/libelf/dist/libelf.h:1.4
--- src/external/bsd/libelf/dist/libelf.h:1.3	Sat Dec 19 07:58:24 2009
+++ src/external/bsd/libelf/dist/libelf.h	Sun Dec 20 05:52:15 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libelf.h,v 1.3 2009/12/19 07:58:24 thorpej Exp $	*/
+/*	$NetBSD: libelf.h,v 1.4 2009/12/20 05:52:15 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -39,7 +39,7 @@
 # define __LIBELF_HAVE_ELF_CAP		1
 # define __LIBELF_HAVE_ELF_MOVE		1
 # define __LIBELF_HAVE_ELF_NOTE		1
-/* # define __LIBELF_HAVE_ELF_SYMINFO	1 */
+# define __LIBELF_HAVE_ELF_SYMINFO	1
 # define __LIBELF_HAVE_ELF_VERS		1
 #endif /* __NetBSD__ */
 



CVS commit: src/external/lib

2009-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 20 05:52:41 UTC 2009

Modified Files:
src/external/lib: Makefile

Log Message:
Build libelf.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/lib/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/lib/Makefile
diff -u src/external/lib/Makefile:1.13 src/external/lib/Makefile:1.14
--- src/external/lib/Makefile:1.13	Mon Nov  2 10:13:19 2009
+++ src/external/lib/Makefile	Sun Dec 20 05:52:41 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2009/11/02 10:13:19 plunky Exp $
+#	$NetBSD: Makefile,v 1.14 2009/12/20 05:52:41 thorpej Exp $
 
 #
 # This Makefile exists to provide a single point to build
@@ -31,6 +31,7 @@
 SUBDIR+= ../bsd/fetch/lib
 SUBDIR+= ../bsd/libarchive/lib
 SUBDIR+= ../bsd/libevent/lib
+SUBDIR+= ../bsd/libelf/lib
 SUBDIR+= ../bsd/am-utils/lib
 SUBDIR+= ../bsd/bind/lib
 SUBDIR+= ../bsd/file/lib



CVS commit: src/distrib/sets/lists

2009-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 20 05:53:35 UTC 2009

Modified Files:
src/distrib/sets/lists/base: shl.elf shl.mi
src/distrib/sets/lists/comp: mi shl.mi

Log Message:
Add libelf files.


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/distrib/sets/lists/base/shl.elf
cvs rdiff -u -r1.507 -r1.508 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.1349 -r1.1350 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.94 -r1.95 src/distrib/sets/lists/comp/shl.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/base/shl.elf
diff -u src/distrib/sets/lists/base/shl.elf:1.193 src/distrib/sets/lists/base/shl.elf:1.194
--- src/distrib/sets/lists/base/shl.elf:1.193	Mon Dec 14 02:01:53 2009
+++ src/distrib/sets/lists/base/shl.elf	Sun Dec 20 05:53:34 2009
@@ -1,4 +1,4 @@
-# $NetBSD: shl.elf,v 1.193 2009/12/14 02:01:53 matt Exp $
+# $NetBSD: shl.elf,v 1.194 2009/12/20 05:53:34 thorpej Exp $
 #
 # Note:	Do not mark old major and major.minor shared libraries as
 #	obsolete; just remove the entry, as third-party applications
@@ -126,6 +126,8 @@
 ./usr/lib/libdns_sd.so.0			base-mdns-shlib		mdns
 ./usr/lib/libedit.sobase-sys-shlib
 ./usr/lib/libedit.so.3base-sys-shlib
+./usr/lib/libelf.sobase-sys-shlib
+./usr/lib/libelf.so.0base-sys-shlib
 ./usr/lib/libevent.sobase-sys-shlib
 ./usr/lib/libevent.so.3base-sys-shlib
 ./usr/lib/libfetch.sobase-sys-shlib

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.507 src/distrib/sets/lists/base/shl.mi:1.508
--- src/distrib/sets/lists/base/shl.mi:1.507	Mon Dec 14 02:01:53 2009
+++ src/distrib/sets/lists/base/shl.mi	Sun Dec 20 05:53:34 2009
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.507 2009/12/14 02:01:53 matt Exp $
+# $NetBSD: shl.mi,v 1.508 2009/12/20 05:53:34 thorpej Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -71,6 +71,7 @@
 ./usr/lib/libdns.so.5.0base-bind-shlib
 ./usr/lib/libdns_sd.so.0.0			base-mdns-shlib		mdns
 ./usr/lib/libedit.so.3.0			base-sys-shlib
+./usr/lib/libelf.so.0.0base-sys-shlib
 ./usr/lib/libevent.so.3.2			base-sys-shlib
 ./usr/lib/libfetch.so.3.0			base-sys-shlib
 ./usr/lib/libform.so.6.0			base-sys-shlib

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1349 src/distrib/sets/lists/comp/mi:1.1350
--- src/distrib/sets/lists/comp/mi:1.1349	Tue Dec 15 03:01:15 2009
+++ src/distrib/sets/lists/comp/mi	Sun Dec 20 05:53:34 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1349 2009/12/15 03:01:15 mrg Exp $
+#	$NetBSD: mi,v 1.1350 2009/12/20 05:53:34 thorpej Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1271,6 +1271,7 @@
 ./usr/include/g++/values.h			comp-obsolete		obsolete
 ./usr/include/g++/vector			comp-cxx-include	cxx
 ./usr/include/g++/vector.h			comp-obsolete		obsolete
+./usr/include/gelf.hcomp-c-include
 ./usr/include/getopt.hcomp-c-include
 ./usr/include/glob.hcomp-c-include
 ./usr/include/grp.hcomp-c-include
@@ -1372,6 +1373,7 @@
 ./usr/include/ldap_features.h			comp-ldap-include	ldap
 ./usr/include/ldap_schema.h			comp-ldap-include	ldap
 ./usr/include/ldap_utf8.h			comp-ldap-include	ldap
+./usr/include/libelf.hcomp-c-include
 ./usr/include/libgen.hcomp-c-include
 ./usr/include/libintl.hcomp-c-include
 ./usr/include/libmilter/mfapi.h			comp-obsolete		obsolete
@@ -2362,6 +2364,9 @@
 ./usr/lib/libedit.acomp-c-lib
 ./usr/lib/libedit_g.a-unknown-		debuglib
 ./usr/lib/libedit_p.acomp-c-proflib		profile
+./usr/lib/libelf.acomp-c-lib
+./usr/lib/libelf_g.a-unknown-		debuglib
+./usr/lib/libelf_p.acomp-c-proflib		profile
 ./usr/lib/libevent.acomp-c-lib
 ./usr/lib/libevent_g.a-unknown-		debuglib
 ./usr/lib/libevent_p.acomp-c-proflib		profile
@@ -3631,6 +3636,7 @@
 ./usr/libdata/lint/llib-ldns.ln			comp-bind-lintlib	lint
 ./usr/libdata/lint/llib-ldns_sd.ln		comp-mdns-lintlib	lint,mdns
 ./usr/libdata/lint/llib-ledit.ln		comp-c-lintlib		lint
+./usr/libdata/lint/llib-lelf.ln			comp-c-lintlib		lint
 ./usr/libdata/lint/llib-levent.ln		comp-c-lintlib		lint
 ./usr/libdata/lint/llib-lfetch.ln		comp-c-lintlib		lint
 ./usr/libdata/lint/llib-lform.ln		comp-c-lintlib		lint
@@ -5369,6 +5375,61 @@
 ./usr/share/man/cat3/el_resize.0		comp-c-catman		.cat
 ./usr/share/man/cat3/el_set.0			comp-c-catman		.cat
 ./usr/share/man/cat3/el_source.0		comp-c-catman		.cat
+./usr/share/man/cat3/elf.0			comp-c-catman		.cat
+./usr/share/man/cat3/elf32_checksum.0		comp-c-catman		.cat
+./usr/share/man/cat3/elf32_fsize.0		comp-c-catman		.cat
+./usr/share/man/cat3/elf32_getehdr.0		comp-c-catman		.cat
+./usr/share/man/cat3/elf32_getphdr.0		comp-c-catman		.cat
+./usr/share/man/cat3/elf32_getshdr.0		comp-c-catman		.cat
+./usr/share/man/cat3/elf32_newehdr.0		comp-c-catman		.cat

CVS commit: src/external/bsd/libelf/dist

2009-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec 19 08:40:58 UTC 2009

Modified Files:
src/external/bsd/libelf/dist: libelf_convert.m4

Log Message:
Fix all sorts of problems with lint and compiler warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/libelf/dist/libelf_convert.m4

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

Modified files:

Index: src/external/bsd/libelf/dist/libelf_convert.m4
diff -u src/external/bsd/libelf/dist/libelf_convert.m4:1.5 src/external/bsd/libelf/dist/libelf_convert.m4:1.6
--- src/external/bsd/libelf/dist/libelf_convert.m4:1.5	Sat Dec 19 07:33:06 2009
+++ src/external/bsd/libelf/dist/libelf_convert.m4	Sat Dec 19 08:40:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libelf_convert.m4,v 1.5 2009/12/19 07:33:06 thorpej Exp $	*/
+/*	$NetBSD: libelf_convert.m4,v 1.6 2009/12/19 08:40:57 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006,2007 Joseph Koshy
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 /* __FBSDID($FreeBSD: src/lib/libelf/libelf_convert.m4,v 1.4.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $); */
-__RCSID($NetBSD: libelf_convert.m4,v 1.5 2009/12/19 07:33:06 thorpej Exp $);
+__RCSID($NetBSD: libelf_convert.m4,v 1.6 2009/12/19 08:40:57 thorpej Exp $);
 
 #include sys/types.h
 
@@ -46,9 +46,9 @@
 
 #define	SWAP_HALF(X) 	do {		\
 		uint16_t _x = (uint16_t) (X);\
-		uint16_t _t = _x  0xFF;\
+		uint32_t _t = _x  0xFF;\
 		_t = 8; _x = 8; _t |= _x  0xFF;			\
-		(X) = _t;		\
+		(X) = (uint16_t)(_t  0x);\
 	} while (/*CONSTCOND*/0)
 #define	SWAP_WORD(X) 	do {		\
 		uint32_t _x = (uint32_t) (X);\
@@ -85,44 +85,53 @@
  * destination pointer is incremented after the write.
  */
 #define	WRITE_BYTE(P,X) do {		\
-		unsigned char *const _p = (unsigned char *) (P);	\
+		unsigned char *const _p = (void *) (P);			\
 		_p[0]		= (unsigned char) (X);			\
-		(P)		= _p + 1;\
+		(P)		= (void *)(_p + 1);			\
 	} while (/*CONSTCOND*/0)
 #define	WRITE_HALF(P,X)	do {		\
-		uint16_t _t	= (X);	\
-		unsigned char *const _p	= (unsigned char *) (P);	\
-		unsigned const char *const _q = (unsigned char *) _t;	\
-		_p[0]		= _q[0];\
-		_p[1]		= _q[1];\
-		(P) 		= _p + 2;\
+		union {			\
+			uint16_t val;	\
+			uint8_t bytes[2];\
+		} _t;			\
+		unsigned char *const _p	= (void *) (P);			\
+		_t.val = (X);		\
+		_p[0]		= _t.bytes[0];\
+		_p[1]		= _t.bytes[1];\
+		(P) 		= (void *)(_p + 2);			\
 	} while (/*CONSTCOND*/0)
 #define	WRITE_WORD(P,X)	do {		\
-		uint32_t _t	= (X);	\
-		unsigned char *const _p	= (unsigned char *) (P);	\
-		unsigned const char *const _q = (unsigned char *) _t;	\
-		_p[0]		= _q[0];\
-		_p[1]		= _q[1];\
-		_p[2]		= _q[2];\
-		_p[3]		= _q[3];\
-		(P)		= _p + 4;\
+		union {			\
+			uint32_t val;	\
+			uint8_t bytes[4];\
+		} _t;			\
+		unsigned char *const _p	= (void *) (P);			\
+		_t.val = (X);		\
+		_p[0]		= _t.bytes[0];\
+		_p[1]		= _t.bytes[1];\
+		_p[2]		= _t.bytes[2];\
+		_p[3]		= _t.bytes[3];\
+		(P)		= (void *)(_p + 4);			\
 	} while (/*CONSTCOND*/0)
 #define	WRITE_ADDR32(P,X)	WRITE_WORD(P,X)
 #define	WRITE_OFF32(P,X)	WRITE_WORD(P,X)
 #define	WRITE_SWORD(P,X)	WRITE_WORD(P,X)
 #define	WRITE_WORD64(P,X)	do {	\
-		uint64_t _t	= (X);	\
-		unsigned char *const _p	= (unsigned char *) (P);	\
-		unsigned const char *const _q = (unsigned char *) _t;	\
-		_p[0]		= _q[0];\
-		_p[1]		= _q[1];\
-		_p[2]		= _q[2];\
-		_p[3]		= _q[3];\
-		_p[4]		= _q[4];\
-		_p[5]		= _q[5];\
-		_p[6]		= _q[6];\
-		_p[7]		= _q[7];\
-		(P)		= _p + 8;\
+		union {			\
+			uint64_t val;	\
+			uint8_t bytes[8];\
+		} _t;			\
+		unsigned char *const _p	= (void *) (P);			\
+		_t.val = (X);		\
+		_p[0]		= _t.bytes[0];\
+		_p[1]		= _t.bytes[1];\
+		_p[2]		= _t.bytes[2];\
+		_p[3]		= _t.bytes[3];\
+		_p[4]		= _t.bytes[4];\
+		_p[5]		= _t.bytes[5];\
+		_p[6]		= _t.bytes[6];\
+		_p[7]		= _t.bytes[7];\
+		(P)		= (void *)(_p + 8);			\
 	} while (/*CONSTCOND*/0)
 #define	WRITE_ADDR64(P,X)	WRITE_WORD64(P,X)
 #define	WRITE_LWORD(P,X)	WRITE_WORD64(P,X)
@@ -142,15 +151,15 @@
 
 #define	READ_BYTE(P,X)	do {		\
 		const unsigned char *const _p =\
-			(const unsigned char *) (P);			\
+			(const void *) (P);\
 		(X)		= _p[0];\
 		(P)		= (P) + 1;\
 	} while (/*CONSTCOND*/0)
 #define	READ_HALF(P,X)	do {		\
 		uint16_t _t;		\
-		unsigned char *const _q = (unsigned char *) _t;	\
+		unsigned char *const _q = (void *) _t;			\
 		const unsigned char *const _p =\
-			(const unsigned char *) (P);			\
+			(const void *) (P);\
 		_q[0]		= _p[0];\
 		_q[1]		= _p[1];\
 		(P)		= (P) + 2;\
@@ -158,9 +167,9 @@
 	} while (/*CONSTCOND*/0)
 #define	READ_WORD(P,X)	do {		\
 		uint32_t _t;		\
-		unsigned char *const _q = (unsigned char *) _t;	\
+		

CVS commit: src/external/bsd/libelf/dist

2009-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec 19 08:47:46 UTC 2009

Modified Files:
src/external/bsd/libelf/dist: libelf_convert.m4

Log Message:
We don't have an Elf_Note typedef, but Elf32_Nhdr and Elf64_Nhdr are
equivalent; use Elf32_Nhdr instead.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/libelf/dist/libelf_convert.m4

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

Modified files:

Index: src/external/bsd/libelf/dist/libelf_convert.m4
diff -u src/external/bsd/libelf/dist/libelf_convert.m4:1.6 src/external/bsd/libelf/dist/libelf_convert.m4:1.7
--- src/external/bsd/libelf/dist/libelf_convert.m4:1.6	Sat Dec 19 08:40:57 2009
+++ src/external/bsd/libelf/dist/libelf_convert.m4	Sat Dec 19 08:47:46 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libelf_convert.m4,v 1.6 2009/12/19 08:40:57 thorpej Exp $	*/
+/*	$NetBSD: libelf_convert.m4,v 1.7 2009/12/19 08:47:46 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006,2007 Joseph Koshy
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 /* __FBSDID($FreeBSD: src/lib/libelf/libelf_convert.m4,v 1.4.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $); */
-__RCSID($NetBSD: libelf_convert.m4,v 1.6 2009/12/19 08:40:57 thorpej Exp $);
+__RCSID($NetBSD: libelf_convert.m4,v 1.7 2009/12/19 08:47:46 thorpej Exp $);
 
 #include sys/types.h
 
@@ -493,7 +493,7 @@
 }
 
 /*
- * Elf_Note structures comprise a fixed size header followed by variable
+ * Elf note structures comprise a fixed size header followed by variable
  * length strings.  The fixed size header needs to be byte swapped, but
  * not the strings.
  *
@@ -503,7 +503,7 @@
 libelf_cvt_NOTE_tom(char *dst, char *src, size_t count, int byteswap)
 {
 	uint32_t namesz, descsz, type;
-	Elf_Note *en;
+	Elf32_Nhdr *en;		/* Elf32_Nhdr and Elf64_Nhdr are equiv. */
 	size_t sz;
 
 	if (dst == src  !byteswap)
@@ -514,7 +514,7 @@
 		return;
 	}
 
-	while (count  sizeof(Elf_Note)) {
+	while (count  sizeof(Elf32_Nhdr)) {
 
 		READ_WORD(src, namesz);
 		READ_WORD(src, descsz);
@@ -526,12 +526,12 @@
 			SWAP_WORD(type);
 		}
 
-		en = (Elf_Note *) (uintptr_t) dst;
+		en = (Elf32_Nhdr *) (uintptr_t) dst;
 		en-n_namesz = namesz;
 		en-n_descsz = descsz;
 		en-n_type = type;
 
-		dst += sizeof(Elf_Note);
+		dst += sizeof(Elf32_Nhdr);
 
 		ROUNDUP2(namesz, 4);
 		ROUNDUP2(descsz, 4);
@@ -553,7 +553,7 @@
 libelf_cvt_NOTE_tof(char *dst, char *src, size_t count, int byteswap)
 {
 	uint32_t namesz, descsz, type;
-	Elf_Note *en;
+	Elf32_Nhdr *en;		/* Elf32_Nhdr and Elf64_Nhdr are equiv. */
 	size_t sz;
 
 	if (dst == src  !byteswap)
@@ -564,9 +564,9 @@
 		return;
 	}
 
-	while (count  sizeof(Elf_Note)) {
+	while (count  sizeof(Elf32_Nhdr)) {
 
-		en = (Elf_Note *) (uintptr_t) src;
+		en = (Elf32_Nhdr *) (uintptr_t) src;
 		namesz = en-n_namesz;
 		descsz = en-n_descsz;
 		type = en-n_type;
@@ -582,7 +582,7 @@
 		WRITE_WORD(dst, descsz);
 		WRITE_WORD(dst, type);
 
-		src += sizeof(Elf_Note);
+		src += sizeof(Elf32_Nhdr);
 
 		ROUNDUP2(namesz, 4);
 		ROUNDUP2(descsz, 4);



CVS commit: src/external/bsd/libelf/dist

2009-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec 19 09:00:56 UTC 2009

Modified Files:
src/external/bsd/libelf/dist: libelf_ehdr.c

Log Message:
Add some range checks to quiet warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libelf/dist/libelf_ehdr.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/bsd/libelf/dist/libelf_ehdr.c
diff -u src/external/bsd/libelf/dist/libelf_ehdr.c:1.2 src/external/bsd/libelf/dist/libelf_ehdr.c:1.3
--- src/external/bsd/libelf/dist/libelf_ehdr.c:1.2	Sat Dec 19 05:55:37 2009
+++ src/external/bsd/libelf/dist/libelf_ehdr.c	Sat Dec 19 09:00:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libelf_ehdr.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $	*/
+/*	$NetBSD: libelf_ehdr.c,v 1.3 2009/12/19 09:00:56 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -30,11 +30,12 @@
 
 #include sys/cdefs.h
 /* __FBSDID($FreeBSD: src/lib/libelf/libelf_ehdr.c,v 1.2.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $); */
-__RCSID($NetBSD: libelf_ehdr.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $);
+__RCSID($NetBSD: libelf_ehdr.c,v 1.3 2009/12/19 09:00:56 thorpej Exp $);
 
 #include assert.h
 #include gelf.h
 #include libelf.h
+#include limits.h
 #include stdlib.h
 
 #include _libelf.h
@@ -65,9 +66,14 @@
 	if ((scn = _libelf_allocate_scn(e, (size_t) 0)) == NULL)
 		return (0);
 
+	if (shoff  SSIZE_MAX) {
+		LIBELF_SET_ERROR(HEADER, 0);
+		return (0);
+	}
+
 	xlator = _libelf_get_translator(ELF_T_SHDR, ELF_TOMEMORY, ec);
-	(*xlator)((char *) scn-s_shdr, e-e_rawfile + shoff, (size_t) 1,
-	e-e_byteorder != LIBELF_PRIVATE(byteorder));
+	(*xlator)((void *) scn-s_shdr, e-e_rawfile + (ssize_t)shoff,
+	(size_t) 1, e-e_byteorder != LIBELF_PRIVATE(byteorder));
 
 #define	GET_SHDR_MEMBER(M) ((ec == ELFCLASS32) ? scn-s_shdr.s_shdr32.M : \
 		scn-s_shdr.s_shdr64.M)
@@ -77,7 +83,12 @@
 		return (0);
 	}
 
-	e-e_u.e_elf.e_nscn = GET_SHDR_MEMBER(sh_size);
+	if (GET_SHDR_MEMBER(sh_size)  UINT_MAX) {
+		LIBELF_SET_ERROR(HEADER, 0);
+		return (0);
+	}
+
+	e-e_u.e_elf.e_nscn = (unsigned int)GET_SHDR_MEMBER(sh_size);
 	e-e_u.e_elf.e_nphdr = (phnum != PN_XNUM) ? phnum :
 	GET_SHDR_MEMBER(sh_info);
 	e-e_u.e_elf.e_strndx = (strndx != SHN_XINDEX) ? strndx :



CVS commit: src/external/bsd/libelf/lib

2009-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec 19 09:01:32 UTC 2009

Modified Files:
src/external/bsd/libelf/lib: Makefile

Log Message:
Fix a typo.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libelf/lib/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/bsd/libelf/lib/Makefile
diff -u src/external/bsd/libelf/lib/Makefile:1.1 src/external/bsd/libelf/lib/Makefile:1.2
--- src/external/bsd/libelf/lib/Makefile:1.1	Sat Dec 19 05:52:01 2009
+++ src/external/bsd/libelf/lib/Makefile	Sat Dec 19 09:01:32 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2009/12/19 05:52:01 thorpej Exp $
+#	$NetBSD: Makefile,v 1.2 2009/12/19 09:01:32 thorpej Exp $
 
 .include bsd.init.mk
 
@@ -72,7 +72,7 @@
 		gelf_getehdr.3 gelf_getmove.3 gelf_getphdr.3	\
 		gelf_getrel.3 gelf_getrela.3 gelf_getshdr.3		\
 		gelf_getsym.3 gelf_getsyminfo.3 gelf_getsymshndx.3	\
-		gelf_newehdr.3 gelf_hewphdr.3\
+		gelf_newehdr.3 gelf_newphdr.3\
 		gelf_update_ehdr.3	\
 		gelf_xlatetof.3
 



CVS commit: src/sys/sys

2009-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec 19 09:02:46 UTC 2009

Modified Files:
src/sys/sys: exec_elf.h

Log Message:
Add some definitions, from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/sys/exec_elf.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/sys/exec_elf.h
diff -u src/sys/sys/exec_elf.h:1.98 src/sys/sys/exec_elf.h:1.99
--- src/sys/sys/exec_elf.h:1.98	Tue Nov 24 16:55:11 2009
+++ src/sys/sys/exec_elf.h	Sat Dec 19 09:02:46 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf.h,v 1.98 2009/11/24 16:55:11 pooka Exp $	*/
+/*	$NetBSD: exec_elf.h,v 1.99 2009/12/19 09:02:46 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -73,6 +73,8 @@
 #define	ELF32_FSZ_WORD	4
 typedef	uint16_t	Elf32_Half;
 #define	ELF32_FSZ_HALF	2
+typedef	uint64_t	Elf32_Lword;
+#define	ELF32_FSZ_LWORD	8
 
 typedef	uint64_t	Elf64_Addr;
 #define	ELF64_FSZ_ADDR	8
@@ -92,9 +94,11 @@
 #endif /* ELF64_FSZ_WORD */
 
 typedef	int64_t		Elf64_Sxword;
-#define	ELF64_FSZ_XWORD	8
+#define	ELF64_FSZ_SXWORD 8
 typedef	uint64_t	Elf64_Xword;
 #define	ELF64_FSZ_XWORD	8
+typedef	uint64_t	Elf64_Lword;
+#define	ELF64_FSZ_LWORD	8
 typedef	uint32_t	Elf64_Half;
 #define	ELF64_FSZ_HALF	4
 typedef	uint16_t	Elf64_Quarter;
@@ -190,10 +194,16 @@
 #define ELFOSABI_TRU64		10	/* TRU64 UNIX */
 #define ELFOSABI_MODESTO	11	/* Novell Modesto */
 #define ELFOSABI_OPENBSD	12	/* OpenBSD */
+#define	ELFOSABI_OPENVMS	13	/* OpenVMS */
+#define	ELFOSABI_NSK		14	/* HP Non-Stop Kernel */
+#define	ELFOSABI_AROS		15	/* Amiga Research OS */
 /* Unofficial OSABIs follow */
 #define ELFOSABI_ARM		97	/* ARM */
 #define	ELFOSABI_STANDALONE	255	/* Standalone (embedded) application */
 
+#define	ELFOSABI_NONE		ELFOSABI_SYSV
+#define	ELFOSABI_AIX		ELFOSABI_MONTEREY
+
 /* e_type */
 #define	ET_NONE		0	/* No file type */
 #define	ET_REL		1	/* Relocatable file */
@@ -229,6 +239,7 @@
 #define	EM_PPC		20	/* PowerPC */
 #define	EM_PPC64	21	/* 64-bit PowerPC */
 			/* 22-35 - Reserved */
+#define	EM_S390		22	/* System/390 XXX reserved */
 #define	EM_V800		36	/* NEC V800 */
 #define	EM_FR20		37	/* Fujitsu FR20 */
 #define	EM_RH32		38	/* TRW RH-32 */
@@ -288,7 +299,22 @@
 #define	EM_OPENRISC	92	/* OpenRISC 32-bit embedded processor */
 #define	EM_ARC_A5	93	/* ARC Cores Tangent-A5 */
 #define	EM_XTENSA	94	/* Tensilica Xtensa Architecture */
+#define	EM_VIDEOCORE	95	/* Alphamosaic VideoCore processor */
+#define	EM_TMM_GPP	96	/* Thompson Multimedia General Purpose Processor */
 #define	EM_NS32K	97	/* National Semiconductor 32000 series */
+#define	EM_TPC		98	/* Tenor Network TPC processor */
+#define	EM_SNP1K	99	/* Trebia SNP 1000 processor */
+#define	EM_ST200	100	/* STMicroelectronics ST200 microcontroller */
+#define	EM_IP2K		101	/* Ubicom IP2xxx microcontroller family */
+#define	EM_MAX		102	/* MAX processor */
+#define	EM_CR		103	/* National Semiconductor CompactRISC micorprocessor */
+#define	EM_F2MC16	104	/* Fujitsu F2MC16 */
+#define	EM_MSP430	105	/* Texas Instruments MSP430 */
+#define	EM_BLACKFIN	106	/* Analog Devices Blackfin DSP */
+#define	EM_SE_C33	107	/* Seiko Epson S1C33 family */
+#define	EM_SEP		108	/* Sharp embedded microprocessor */
+#define	EM_ARCA		109	/* Arca RISC microprocessor */
+#define	EM_UNICORE	110	/* UNICORE from PKU-Unity Ltd. and MPRC Peking University */
 
 /* Unofficial machine types follow */
 #define	EM_AVR32	6317	/* used by NetBSD/avr32 */
@@ -345,6 +371,9 @@
 #define	PF_MASKOS	0x0ff0	/* Operating system specific values */
 #define	PF_MASKPROC	0xf000	/* Processor-specific values */
 
+/* Extended program header index. */
+#define	PN_XNUM		0x
+
 /*
  * Section Headers
  */
@@ -387,14 +416,25 @@
 #define	SHT_REL		9		/* Relocation information w/o addend */
 #define	SHT_SHLIB	10		/* Reserved, unspecified semantics */
 #define	SHT_DYNSYM	11		/* Symbol table for dynamic linker */
-#define	SHT_NUM		12
+#define	SHT_INIT_ARRAY	14		/* Initialization function pointers */
+#define	SHT_FINI_ARRAY	15		/* Termination function pointers */
+#define	SHT_PREINIT_ARRAY 16		/* Pre-initialization function ptrs */
+#define	SHT_GROUP	17		/* Section group */
+#define	SHT_SYMTAB_SHNDX 18		/* Section indexes (see SHN_XINDEX) */
+#define	SHT_NUM		19
 
 #define	SHT_LOOS	0x6000	/* Operating system specific range */
-#define SHT_SUNW_VERDEF	0x6ffd	/* Versions defined by file */
-#define SHT_SUNW_VERNEED 0x6ffe	/* Versions needed by file */
-#define SHT_SUNW_VERSYM	0x6fff	/* Symbol versions */
+#define	SHT_SUNW_move	0x6ffa
+#define	SHT_SUNW_syminfo 0x6ffc
+#define SHT_SUNW_verdef	0x6ffd	/* Versions defined by file */
+#define	SHT_GNU_verdef	SHT_SUNW_verdef
+#define SHT_SUNW_verneed 0x6ffe	/* Versions needed by file */
+#define	SHT_GNU_verneed	SHT_SUNW_verneed
+#define SHT_SUNW_versym	0x6fff	/* Symbol versions */
+#define	SHT_GNU_versym	SHT_SUNW_versym
 #define	

CVS commit: src/usr.bin/elf2ecoff

2009-12-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec 19 10:27:13 UTC 2009

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

Log Message:
Use %zu for size_t, not %zd.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/elf2ecoff/elf2ecoff.c

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

Modified files:

Index: src/usr.bin/elf2ecoff/elf2ecoff.c
diff -u src/usr.bin/elf2ecoff/elf2ecoff.c:1.25 src/usr.bin/elf2ecoff/elf2ecoff.c:1.26
--- src/usr.bin/elf2ecoff/elf2ecoff.c:1.25	Mon Dec 14 14:11:32 2009
+++ src/usr.bin/elf2ecoff/elf2ecoff.c	Sat Dec 19 10:27:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2ecoff.c,v 1.25 2009/12/14 14:11:32 uebayasi Exp $	*/
+/*	$NetBSD: elf2ecoff.c,v 1.26 2009/12/19 10:27:13 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1997 Jonathan Stone
@@ -255,7 +255,7 @@
 		ph[i].p_type == PT_MIPS_REGINFO) {
 
 			if (debug) {
-fprintf(stderr,   skipping PH %zd type %d flags 0x%x\n,
+fprintf(stderr,   skipping PH %zu type %d flags 0x%x\n,
 i, ph[i].p_type, ph[i].p_flags);
 			}
 			continue;
@@ -263,7 +263,7 @@
 		/* Section types we can't handle... */
 		else
 			if (ph[i].p_type != PT_LOAD) {
-fprintf(stderr, Program header %zd type %d can't be converted.\n,
+fprintf(stderr, Program header %zu type %d can't be converted.\n,
 i, ph[i].p_type);
 exit(1);
 			}
@@ -278,7 +278,7 @@
 
 			if (debug) {
 fprintf(stderr,
-  combinining PH %zd type %d flags 0x%x with data, ndata = %ld, nbss =%ld\n, i, ph[i].p_type, ph[i].p_flags, ndata.len, nbss.len);
+  combinining PH %zu type %d flags 0x%x with data, ndata = %ld, nbss =%ld\n, i, ph[i].p_type, ph[i].p_flags, ndata.len, nbss.len);
 			}
 			combine(data, ndata, 0);
 			combine(bss, nbss, 1);
@@ -290,7 +290,7 @@
 			if (debug) {
 
 fprintf(stderr,
-  combinining PH %zd type %d flags 0x%x with text, len = %ld\n,
+  combinining PH %zu type %d flags 0x%x with text, len = %ld\n,
 i, ph[i].p_type, ph[i].p_flags, ntxt.len);
 			}
 			combine(text, ntxt, 0);



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

2009-12-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec 19 10:34:18 UTC 2009

Modified Files:
src/sys/arch/sparc/dev: audioamd.c fd.c

Log Message:
Disable fast trap handlers which invoke software interrupts
in sparc/amd7930intr.s and sparc/bsd_fdintr.s until they are
rewritten to adapt new MI softint(9) API.

No particular comments on PR port-sparc/42192, but
this fixes timeout problem on floppy access on my SPARCstation 1+.

XXX: floppy support on sun4m seems to have another problem (data overrun).


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sparc/dev/audioamd.c
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/sparc/dev/fd.c

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

Modified files:

Index: src/sys/arch/sparc/dev/audioamd.c
diff -u src/sys/arch/sparc/dev/audioamd.c:1.24 src/sys/arch/sparc/dev/audioamd.c:1.25
--- src/sys/arch/sparc/dev/audioamd.c:1.24	Thu Sep 17 12:38:11 2009
+++ src/sys/arch/sparc/dev/audioamd.c	Sat Dec 19 10:34:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: audioamd.c,v 1.24 2009/09/17 12:38:11 tsutsui Exp $	*/
+/*	$NetBSD: audioamd.c,v 1.25 2009/12/19 10:34:18 tsutsui Exp $	*/
 /*	NetBSD: am7930_sparc.c,v 1.44 1999/03/14 22:29:00 jonathan Exp 	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: audioamd.c,v 1.24 2009/09/17 12:38:11 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: audioamd.c,v 1.25 2009/12/19 10:34:18 tsutsui Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -308,7 +308,13 @@
 	sc-sc_au.au_bt = sc-sc_bt;
 	sc-sc_au.au_bh = sc-sc_bh;
 	(void)bus_intr_establish2(sc-sc_bt, pri, IPL_HIGH,
-  am7930hwintr, sc, amd7930_trap);
+  am7930hwintr, sc,
+#ifdef notyet /* XXX amd7930intr.s needs to be fixed for MI softint(9) */
+  amd7930_trap
+#else
+  NULL
+#endif
+  );
 
 	sc-sc_sicookie = softint_establish(SOFTINT_SERIAL, am7930swintr, sc);
 	if (sc-sc_sicookie == NULL) {

Index: src/sys/arch/sparc/dev/fd.c
diff -u src/sys/arch/sparc/dev/fd.c:1.146 src/sys/arch/sparc/dev/fd.c:1.147
--- src/sys/arch/sparc/dev/fd.c:1.146	Mon May 25 19:22:53 2009
+++ src/sys/arch/sparc/dev/fd.c	Sat Dec 19 10:34:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.146 2009/05/25 19:22:53 jnemeth Exp $	*/
+/*	$NetBSD: fd.c,v 1.147 2009/12/19 10:34:18 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fd.c,v 1.146 2009/05/25 19:22:53 jnemeth Exp $);
+__KERNEL_RCSID(0, $NetBSD: fd.c,v 1.147 2009/12/19 10:34:18 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_md.h
@@ -639,7 +639,13 @@
 
 	fdciop = fdc-sc_io;
 	if (bus_intr_establish2(fdc-sc_bustag, pri, 0,
-fdc_c_hwintr, fdc, fdchwintr) == NULL) {
+fdc_c_hwintr, fdc,
+#ifdef notyet /* XXX bsd_fdintr.s needs to be fixed for MI softint(9) */
+fdchwintr
+#else
+NULL
+#endif
+) == NULL) {
 		printf(\n%s: cannot register interrupt handler\n,
 			fdc-sc_dev.dv_xname);
 		return (-1);



CVS commit: src/sys/rump/dev/wip/libusb

2009-12-19 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Dec 19 11:29:26 UTC 2009

Modified Files:
src/sys/rump/dev/wip/libusb: locators.h

Log Message:
purge some stuff not used by this component anymore


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/dev/wip/libusb/locators.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/rump/dev/wip/libusb/locators.h
diff -u src/sys/rump/dev/wip/libusb/locators.h:1.1 src/sys/rump/dev/wip/libusb/locators.h:1.2
--- src/sys/rump/dev/wip/libusb/locators.h:1.1	Thu Oct  1 21:46:31 2009
+++ src/sys/rump/dev/wip/libusb/locators.h	Sat Dec 19 11:29:26 2009
@@ -1,12 +1,7 @@
-/*	$NetBSD: locators.h,v 1.1 2009/10/01 21:46:31 pooka Exp $	*/
+/*	$NetBSD: locators.h,v 1.2 2009/12/19 11:29:26 pooka Exp $	*/
 
 /* locators borrowed from config.  redo properly some day */
 
-#define SCSIBUSCF_TARGET 0
-#define SCSIBUSCF_TARGET_DEFAULT -1
-#define SCSIBUSCF_LUN 1
-#define SCSIBUSCF_LUN_DEFAULT -1
-#define SCSIBUSCF_NLOCS 2
 #define USBIFIFCF_PORT 0
 #define USBIFIFCF_PORT_DEFAULT -1
 #define USBIFIFCF_CONFIGURATION 1
@@ -33,6 +28,3 @@
 #define USBDEVIFCF_RELEASE 5
 #define USBDEVIFCF_RELEASE_DEFAULT -1
 #define USBDEVIFCF_NLOCS 6
-#define SCSICF_CHANNEL 0
-#define SCSICF_CHANNEL_DEFAULT -1
-#define SCSICF_NLOCS 1



CVS commit: src/sys/dev/usb

2009-12-19 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Dec 19 11:41:57 UTC 2009

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

Log Message:
Don't impose a compile-time dependency on the kernel containing
ohci/uhci just for the sake of setting a debug variable.


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

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

Modified files:

Index: src/sys/dev/usb/usb.c
diff -u src/sys/dev/usb/usb.c:1.119 src/sys/dev/usb/usb.c:1.120
--- src/sys/dev/usb/usb.c:1.119	Thu Nov 12 20:11:35 2009
+++ src/sys/dev/usb/usb.c	Sat Dec 19 11:41:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb.c,v 1.119 2009/11/12 20:11:35 dyoung Exp $	*/
+/*	$NetBSD: usb.c,v 1.120 2009/12/19 11:41:56 pooka Exp $	*/
 
 /*
  * Copyright (c) 1998, 2002, 2008 The NetBSD Foundation, Inc.
@@ -37,13 +37,10 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usb.c,v 1.119 2009/11/12 20:11:35 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: usb.c,v 1.120 2009/12/19 11:41:56 pooka Exp $);
 
 #include opt_compat_netbsd.h
 
-#include ohci.h
-#include uhci.h
-
 #include sys/param.h
 #include sys/systm.h
 #include sys/kernel.h
@@ -74,12 +71,6 @@
 #define DPRINTF(x)	if (usbdebug) logprintf x
 #define DPRINTFN(n,x)	if (usbdebug(n)) logprintf x
 int	usbdebug = 0;
-#if defined(UHCI_DEBUG)  NUHCI  0
-extern int	uhcidebug;
-#endif
-#if defined(OHCI_DEBUG)  NOHCI  0
-extern int	ohcidebug;
-#endif
 /*
  * 0  - do usual exploration
  * 1  - do not use timeout exploration
@@ -602,12 +593,6 @@
 		if (!(flag  FWRITE))
 			return (EBADF);
 		usbdebug  = ((*(int *)data)  0x00ff);
-#if defined(UHCI_DEBUG)  NUHCI  0
-		uhcidebug = ((*(int *)data)  0xff00)  8;
-#endif
-#if defined(OHCI_DEBUG)  NOHCI  0
-		ohcidebug = ((*(int *)data)  0x00ff)  16;
-#endif
 		break;
 #endif /* USB_DEBUG */
 	case USB_REQUEST:



CVS commit: src/sys/rump/dev/wip/libusb/opt

2009-12-19 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Dec 19 11:48:17 UTC 2009

Modified Files:
src/sys/rump/dev/wip/libusb/opt: opt_usbverbose.h

Log Message:
define USBVERBOSE


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/dev/wip/libusb/opt/opt_usbverbose.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/rump/dev/wip/libusb/opt/opt_usbverbose.h
diff -u src/sys/rump/dev/wip/libusb/opt/opt_usbverbose.h:1.1 src/sys/rump/dev/wip/libusb/opt/opt_usbverbose.h:1.2
--- src/sys/rump/dev/wip/libusb/opt/opt_usbverbose.h:1.1	Thu Oct  1 21:46:31 2009
+++ src/sys/rump/dev/wip/libusb/opt/opt_usbverbose.h	Sat Dec 19 11:48:17 2009
@@ -1 +1,3 @@
-/*	$NetBSD: opt_usbverbose.h,v 1.1 2009/10/01 21:46:31 pooka Exp $	*/
+/*	$NetBSD: opt_usbverbose.h,v 1.2 2009/12/19 11:48:17 pooka Exp $	*/
+
+#define USBVERBOSE



CVS commit: src/sys/rump/dev/wip/libusb/opt

2009-12-19 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Dec 19 11:48:30 UTC 2009

Removed Files:
src/sys/rump/dev/wip/libusb/opt: ohci.h uhci.h

Log Message:
get rid of unnecessary headers


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/sys/rump/dev/wip/libusb/opt/ohci.h \
src/sys/rump/dev/wip/libusb/opt/uhci.h

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



CVS commit: src/sys/rump/dev/wip/libumass

2009-12-19 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Dec 19 11:55:23 UTC 2009

Modified Files:
src/sys/rump/dev/wip/libumass: sd_at_scsibus_at_umass.c

Log Message:
Replace totally handwritten ioconf.c with only a semi handwritten
one, partially now generated with config(1).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/sys/rump/dev/wip/libumass/sd_at_scsibus_at_umass.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/dev/wip/libumass/sd_at_scsibus_at_umass.c
diff -u src/sys/rump/dev/wip/libumass/sd_at_scsibus_at_umass.c:1.4 src/sys/rump/dev/wip/libumass/sd_at_scsibus_at_umass.c:1.5
--- src/sys/rump/dev/wip/libumass/sd_at_scsibus_at_umass.c:1.4	Fri Dec  4 17:37:05 2009
+++ src/sys/rump/dev/wip/libumass/sd_at_scsibus_at_umass.c	Sat Dec 19 11:55:23 2009
@@ -1,126 +1,464 @@
-/*	$NetBSD: sd_at_scsibus_at_umass.c,v 1.4 2009/12/04 17:37:05 pooka Exp $	*/
-
-#include sys/param.h
-#include sys/conf.h
-#include sys/device.h
-#include sys/kmem.h
-#include sys/stat.h
+/*	$NetBSD: sd_at_scsibus_at_umass.c,v 1.5 2009/12/19 11:55:23 pooka Exp $	*/
 
 /*
- * sd @ scsibus @ umass @ usb
+ * MACHINE GENERATED: DO NOT EDIT
  *
- * handwritten device configuration 'nuf said
+ * ioconf.c, from the following config:
+ *
+ * === SNIP ===
+
+include conf/files
+include dev/usb/files.usb
+include dev/scsipi/files.scsipi
+
+device mainbus { }
+attach mainbus at root
+device rumpusbhc: usbus, usbroothub
+attach rumpusbhc at mainbus
+
+mainbus0 at root
+rumpusbhc* at mainbus0
+
+# USB bus support
+usb*at rumpusbhc?
+
+# USB Hubs
+uhub*   at usb?
+uhub*   at uhub? port ?
+
+# USB Mass Storage
+umass*  at uhub? port ? configuration ? interface ?
+scsibus* at scsi?
+sd* at scsibus? target ? lun ?
+
+ * === UNSNIP ===
  */
 
-static const struct cfiattrdata scsicf_iattrdata = {
-	scsi, 1, {
-		{ channel, -1, -1 },
+#include sys/param.h
+#include sys/conf.h
+#include sys/device.h
+#include sys/mount.h
+
+static const struct cfiattrdata gpibdevcf_iattrdata = {
+	gpibdev, 1,
+	{
+		{ address, -1, -1 },
+	}
+};
+static const struct cfiattrdata acpibuscf_iattrdata = {
+	acpibus, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata caccf_iattrdata = {
+	cac, 1,
+	{
+		{ unit, -1, -1 },
+	}
+};
+static const struct cfiattrdata spicf_iattrdata = {
+	spi, 1,
+	{
+		{ slave, NULL, 0 },
+	}
+};
+static const struct cfiattrdata radiodevcf_iattrdata = {
+	radiodev, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata mlxcf_iattrdata = {
+	mlx, 1,
+	{
+		{ unit, -1, -1 },
 	}
 };
 static const struct cfiattrdata scsibuscf_iattrdata = {
-	scsibus, 0, {
-		{ NULL, NULL, 0},
+	scsibus, 2,
+	{
+		{ target, -1, -1 },
+		{ lun, -1, -1 },
 	}
 };
-static const struct cfiattrdata *const scsibuscf_attrs[] = {
-	scsibuscf_iattrdata,
-	NULL,
+static const struct cfiattrdata ucombuscf_iattrdata = {
+	ucombus, 1,
+	{
+		{ portno, -1, -1 },
+	}
 };
-CFDRIVER_DECL(scsibus, DV_DULL, scsibuscf_attrs);
-CFDRIVER_DECL(sd, DV_DISK, NULL);
-
-static const struct cfiattrdata uroothub_iattrdata = {
+static const struct cfiattrdata videobuscf_iattrdata = {
+	videobus, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata isabuscf_iattrdata = {
+	isabus, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata i2cbuscf_iattrdata = {
+	i2cbus, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata ata_hlcf_iattrdata = {
+	ata_hl, 1,
+	{
+		{ drive, -1, -1 },
+	}
+};
+static const struct cfiattrdata depcacf_iattrdata = {
+	depca, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata ppbuscf_iattrdata = {
+	ppbus, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata eisabuscf_iattrdata = {
+	eisabus, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata atapicf_iattrdata = {
+	atapi, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata atapibuscf_iattrdata = {
+	atapibus, 1,
+	{
+		{ drive, -1, -1 },
+	}
+};
+static const struct cfiattrdata usbroothubifcf_iattrdata = {
 	usbroothubif, 0, {
 		{ NULL, NULL, 0 },
 	}
 };
-static const struct cfiattrdata *const usb_attrs[] = {
-	uroothub_iattrdata,
-	NULL,
+static const struct cfiattrdata altmemdevcf_iattrdata = {
+	altmemdev, 0, {
+		{ NULL, NULL, 0 },
+	}
 };
-CFDRIVER_DECL(usb, DV_DULL, usb_attrs);
-
-static const struct cfiattrdata usbdevif_iattrdata = {
-	usbdevif, 0, {
+static const struct cfiattrdata tcbuscf_iattrdata = {
+	tcbus, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata onewirebuscf_iattrdata = {
+	onewirebus, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata gpiocf_iattrdata = {
+	gpio, 2,
+	{
+		{ offset, -1, -1 },
+		{ mask, 0, 0 },
+	}
+};
+static const struct cfiattrdata cbbuscf_iattrdata = {
+	cbbus, 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata gpiobuscf_iattrdata = {
+	

CVS commit: src/sys/arch/m68k/m68k

2009-12-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec 19 12:31:35 UTC 2009

Modified Files:
src/sys/arch/m68k/m68k: vm_machdep.c

Log Message:
Remove extern struct pcb *curpcb declaration. Now it's in m68k/pcb.h.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/m68k/m68k/vm_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/m68k/m68k/vm_machdep.c
diff -u src/sys/arch/m68k/m68k/vm_machdep.c:1.31 src/sys/arch/m68k/m68k/vm_machdep.c:1.32
--- src/sys/arch/m68k/m68k/vm_machdep.c:1.31	Sun Nov 29 04:15:43 2009
+++ src/sys/arch/m68k/m68k/vm_machdep.c	Sat Dec 19 12:31:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.31 2009/11/29 04:15:43 rmind Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.32 2009/12/19 12:31:34 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.31 2009/11/29 04:15:43 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.32 2009/12/19 12:31:34 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -127,7 +127,6 @@
 	struct pcb *pcb1, *pcb2;
 	struct trapframe *tf;
 	struct switchframe *sf;
-	extern struct pcb *curpcb;
 	extern void lwp_trampoline(void);
 
 	pcb1 = lwp_getpcb(l1);



CVS commit: src/sys/arch/m68k

2009-12-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec 19 13:08:26 UTC 2009

Modified Files:
src/sys/arch/m68k/include: m68k.h
src/sys/arch/m68k/m68k: vm_machdep.c

Log Message:
Move declaration of lwp_trampoline() into m68k/m68k.h.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/m68k/include/m68k.h
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/m68k/m68k/vm_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/m68k/include/m68k.h
diff -u src/sys/arch/m68k/include/m68k.h:1.14 src/sys/arch/m68k/include/m68k.h:1.15
--- src/sys/arch/m68k/include/m68k.h:1.14	Sat May 30 17:52:05 2009
+++ src/sys/arch/m68k/include/m68k.h	Sat Dec 19 13:08:26 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k.h,v 1.14 2009/05/30 17:52:05 martin Exp $	*/
+/*	$NetBSD: m68k.h,v 1.15 2009/12/19 13:08:26 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -144,6 +144,7 @@
 int 	getsfc(void);
 
 /* switch_subr.s */
+void	lwp_trampoline(void);
 void	savectx(struct pcb *);
 
 /* w16copy.s */

Index: src/sys/arch/m68k/m68k/vm_machdep.c
diff -u src/sys/arch/m68k/m68k/vm_machdep.c:1.32 src/sys/arch/m68k/m68k/vm_machdep.c:1.33
--- src/sys/arch/m68k/m68k/vm_machdep.c:1.32	Sat Dec 19 12:31:34 2009
+++ src/sys/arch/m68k/m68k/vm_machdep.c	Sat Dec 19 13:08:26 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.32 2009/12/19 12:31:34 tsutsui Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.33 2009/12/19 13:08:26 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.32 2009/12/19 12:31:34 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.33 2009/12/19 13:08:26 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -127,7 +127,6 @@
 	struct pcb *pcb1, *pcb2;
 	struct trapframe *tf;
 	struct switchframe *sf;
-	extern void lwp_trampoline(void);
 
 	pcb1 = lwp_getpcb(l1);
 	pcb2 = lwp_getpcb(l2);



CVS commit: src/dist/pf/share/man/man4

2009-12-19 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Sat Dec 19 14:05:53 UTC 2009

Modified Files:
src/dist/pf/share/man/man4: pf.4

Log Message:
Remove the notice about pfsync not being supported, as we have it now.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/dist/pf/share/man/man4/pf.4

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

Modified files:

Index: src/dist/pf/share/man/man4/pf.4
diff -u src/dist/pf/share/man/man4/pf.4:1.11 src/dist/pf/share/man/man4/pf.4:1.12
--- src/dist/pf/share/man/man4/pf.4:1.11	Mon Sep 14 11:17:49 2009
+++ src/dist/pf/share/man/man4/pf.4	Sat Dec 19 14:05:53 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: pf.4,v 1.11 2009/09/14 11:17:49 wiz Exp $
+.\	$NetBSD: pf.4,v 1.12 2009/12/19 14:05:53 ahoka Exp $
 .\	$OpenBSD: pf.4,v 1.59 2007/05/31 19:19:51 jmc Exp $
 .\
 .\ Copyright (C) 2001, Kjell Wooding.  All rights reserved.
@@ -27,7 +27,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd September 14, 2009
+.Dd December 19, 2009
 .Dt PF 4
 .Os
 .Sh NAME
@@ -1146,8 +1146,6 @@
 .Nx :
 .Bl -bullet -offset indent
 .It
-The pfsync protocol is not supported.
-.It
 The
 .Em group
 keyword is not supported.



CVS commit: src

2009-12-19 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Dec 19 15:03:34 UTC 2009

Modified Files:
src/sbin/cgdconfig: Makefile Makefile.cgdconfig
src/share/examples/rump/img2cgd: Makefile
Added Files:
src/sbin/cgdconfig: cgd_rumpops.c
Removed Files:
src/share/examples/rump/img2cgd: cgd_rumpops.c

Log Message:
Use RUMP_ACTION to avoid having to specify the same information
in the Makefiles of all the consumers.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sbin/cgdconfig/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sbin/cgdconfig/Makefile.cgdconfig
cvs rdiff -u -r0 -r1.1 src/sbin/cgdconfig/cgd_rumpops.c
cvs rdiff -u -r1.1 -r1.2 src/share/examples/rump/img2cgd/Makefile
cvs rdiff -u -r1.1 -r0 src/share/examples/rump/img2cgd/cgd_rumpops.c

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

Modified files:

Index: src/sbin/cgdconfig/Makefile
diff -u src/sbin/cgdconfig/Makefile:1.12 src/sbin/cgdconfig/Makefile:1.13
--- src/sbin/cgdconfig/Makefile:1.12	Tue Sep  8 21:36:35 2009
+++ src/sbin/cgdconfig/Makefile	Sat Dec 19 15:03:34 2009
@@ -1,10 +1,8 @@
-# $NetBSD: Makefile,v 1.12 2009/09/08 21:36:35 pooka Exp $
+# $NetBSD: Makefile,v 1.13 2009/12/19 15:03:34 pooka Exp $
 
 PROG=	cgdconfig
 MAN=	cgdconfig.8
 
-SRCS+=	cgd_kernelops.c
-
 .include ${.CURDIR}/Makefile.cgdconfig
 
 .include bsd.prog.mk

Index: src/sbin/cgdconfig/Makefile.cgdconfig
diff -u src/sbin/cgdconfig/Makefile.cgdconfig:1.1 src/sbin/cgdconfig/Makefile.cgdconfig:1.2
--- src/sbin/cgdconfig/Makefile.cgdconfig:1.1	Tue Sep  8 21:36:35 2009
+++ src/sbin/cgdconfig/Makefile.cgdconfig	Sat Dec 19 15:03:34 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.cgdconfig,v 1.1 2009/09/08 21:36:35 pooka Exp $
+#	$NetBSD: Makefile.cgdconfig,v 1.2 2009/12/19 15:03:34 pooka Exp $
 #
 
 SRCS+=	cgdconfig.c		\
@@ -22,3 +22,11 @@
 .PATH:	${CGDCONFIGDIR}
 
 CPPFLAGS+=	-I${CGDCONFIGDIR}
+
+.ifdef RUMP_ACTION
+LDADD+= -lrumpdev_cgd -lrumpdev_disk -lrumpdev -lrumpcrypto
+LDADD+= -lrumpvfs -lrump -lrumpuser -lpthread
+SRCS+=	cgd_rumpops.c
+.else
+SRCS+=	cgd_kernelops.c
+.endif

Index: src/share/examples/rump/img2cgd/Makefile
diff -u src/share/examples/rump/img2cgd/Makefile:1.1 src/share/examples/rump/img2cgd/Makefile:1.2
--- src/share/examples/rump/img2cgd/Makefile:1.1	Tue Sep  8 21:48:25 2009
+++ src/share/examples/rump/img2cgd/Makefile	Sat Dec 19 15:03:34 2009
@@ -1,16 +1,14 @@
 PROG=	img2cgd
-SRCS=	img2cgd.c cgd_rumpops.c
+SRCS=	img2cgd.c
 NOMAN=
 
 .include bsd.own.mk
 
-.include ${NETBSDSRCDIR}/sbin/cgdconfig/Makefile.cgdconfig
-
-LDADD+=	-lrumpdev_cgd -lrumpdev_disk -lrumpdev -lrumpcrypto
-LDADD+=	-lrumpvfs -lrump -lrumpuser -lpthread
-
+RUMP_ACTION=	#defined
 CPPFLAGS+=	-DCGDCONFIG_AS_LIB
+.include ${NETBSDSRCDIR}/sbin/cgdconfig/Makefile.cgdconfig
 
-DBG=-g -O0
+DBG=	-g -O0
+WARNS=	3
 
 .include bsd.prog.mk

Added files:

Index: src/sbin/cgdconfig/cgd_rumpops.c
diff -u /dev/null src/sbin/cgdconfig/cgd_rumpops.c:1.1
--- /dev/null	Sat Dec 19 15:03:34 2009
+++ src/sbin/cgdconfig/cgd_rumpops.c	Sat Dec 19 15:03:34 2009
@@ -0,0 +1,49 @@
+/*	$NetBSD: cgd_rumpops.c,v 1.1 2009/12/19 15:03:34 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2009 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/cdefs.h
+#ifndef lint
+__RCSID($NetBSD: cgd_rumpops.c,v 1.1 2009/12/19 15:03:34 pooka Exp $);
+#endif /* !lint */
+
+#include sys/types.h
+#include sys/ioctl.h
+
+#include fcntl.h
+#include unistd.h
+
+#include rump/rump_syscalls.h
+
+#include cgd_kernelops.h
+
+const struct cgd_kernelops cgd_kops = {
+	.ko_open = rump_sys_open,
+	.ko_ioctl = rump_sys_ioctl,
+	.ko_pread 

CVS commit: src/sbin/mount_portal

2009-12-19 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Dec 19 16:01:25 UTC 2009

Modified Files:
src/sbin/mount_portal: puffs_portal.c

Log Message:
Use CMSG_SPACE() for buffer when receiving file descriptors.
Doesn't break i386 and might be better for sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/mount_portal/puffs_portal.c

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

Modified files:

Index: src/sbin/mount_portal/puffs_portal.c
diff -u src/sbin/mount_portal/puffs_portal.c:1.2 src/sbin/mount_portal/puffs_portal.c:1.3
--- src/sbin/mount_portal/puffs_portal.c:1.2	Sat Dec  5 20:29:19 2009
+++ src/sbin/mount_portal/puffs_portal.c	Sat Dec 19 16:01:25 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_portal.c,v 1.2 2009/12/05 20:29:19 pooka Exp $	*/
+/*	$NetBSD: puffs_portal.c,v 1.3 2009/12/19 16:01:25 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: puffs_portal.c,v 1.2 2009/12/05 20:29:19 pooka Exp $);
+__RCSID($NetBSD: puffs_portal.c,v 1.3 2009/12/19 16:01:25 pooka Exp $);
 #endif /* !lint */
 
 #include sys/types.h
@@ -118,7 +118,7 @@
 	int error, rv;
 
 	rv = 0;
-	cmp = emalloc(CMSG_LEN(sizeof(int)));
+	cmp = emalloc(CMSG_SPACE(sizeof(int)));
 
 	iov.iov_base = error;
 	iov.iov_len = sizeof(int);
@@ -127,7 +127,7 @@
 	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));
 
 	n = recvmsg(fd, msg, 0);
 	if (n == -1) {



CVS commit: src/crypto/external/bsd/openssh

2009-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 19 18:00:27 UTC 2009

Modified Files:
src/crypto/external/bsd/openssh/bin: Makefile.inc
Added Files:
src/crypto/external/bsd/openssh: Makefile.inc

Log Message:
Put the CPPFLAGS in a separate Makefile.inc so that all the defines are
visible in the LIB build. Fixes problem with X11BASE and readpass.c


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/openssh/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/openssh/bin/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/crypto/external/bsd/openssh/bin/Makefile.inc
diff -u src/crypto/external/bsd/openssh/bin/Makefile.inc:1.1 src/crypto/external/bsd/openssh/bin/Makefile.inc:1.2
--- src/crypto/external/bsd/openssh/bin/Makefile.inc:1.1	Sun Jun  7 18:38:45 2009
+++ src/crypto/external/bsd/openssh/bin/Makefile.inc	Sat Dec 19 13:00:26 2009
@@ -1,35 +1,6 @@
-#	$NetBSD: Makefile.inc,v 1.1 2009/06/07 22:38:45 christos Exp $
-
-WARNS?=	1	# XXX -Wshadow -Wcast-qual
-
-.include bsd.own.mk
-
-USE_FORT?= yes	# network client/server
-
-SSHDIST?= ${NETBSDSRCDIR}/crypto/external/bsd/openssh/dist
-
-CPPFLAGS+=-I${SSHDIST} -DHAVE_LOGIN_CAP -DHAVE_MMAP -DHAVE_OPENPTY
-.PATH: ${SSHDIST}
+#	$NetBSD: Makefile.inc,v 1.2 2009/12/19 18:00:26 christos Exp $
 
 LDADD+=	-lssh -lcrypto -lcrypt -lz
 DPADD+=	${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT} ${LIBZ}
 
-.if (${USE_PAM} != no)
-CPPFLAGS+=-DUSE_PAM
-.else	# USE_PAM == no
-.if (${USE_SKEY} != no)
-CPPFLAGS+=-DSKEY
-.endif
-.endif	# USE_PAM == no
-
-.if (${USE_KERBEROS} != no)
-CPPFLAGS+=-DGSSAPI -I${DESTDIR}/usr/include/gssapi
-CPPFLAGS+=-DKRB5 -I${DESTDIR}/usr/include/krb5 -DHEIMDAL
-.endif
-
-.if ${X11FLAVOUR} == Xorg
-CPPFLAGS+=-DX11BASE=\/usr/X11R7\
-.endif
-
-CPPFLAGS+=-DSUPPORT_UTMP -DSUPPORT_UTMPX
-CPPFLAGS+=-DLIBWRAP
+.include ${.PARSEDIR}/../Makefile.inc

Added files:

Index: src/crypto/external/bsd/openssh/Makefile.inc
diff -u /dev/null src/crypto/external/bsd/openssh/Makefile.inc:1.1
--- /dev/null	Sat Dec 19 13:00:27 2009
+++ src/crypto/external/bsd/openssh/Makefile.inc	Sat Dec 19 13:00:26 2009
@@ -0,0 +1,32 @@
+#	$NetBSD: Makefile.inc,v 1.1 2009/12/19 18:00:26 christos Exp $
+
+WARNS?=	1	# XXX -Wshadow -Wcast-qual
+
+.include bsd.own.mk
+
+USE_FORT?= yes	# network client/server
+
+SSHDIST?= ${NETBSDSRCDIR}/crypto/external/bsd/openssh/dist
+
+CPPFLAGS+=-I${SSHDIST} -DHAVE_LOGIN_CAP -DHAVE_MMAP -DHAVE_OPENPTY
+.PATH: ${SSHDIST}
+
+.if (${USE_PAM} != no)
+CPPFLAGS+=-DUSE_PAM
+.else	# USE_PAM == no
+.if (${USE_SKEY} != no)
+CPPFLAGS+=-DSKEY
+.endif
+.endif	# USE_PAM == no
+
+.if (${USE_KERBEROS} != no)
+CPPFLAGS+=-DGSSAPI -I${DESTDIR}/usr/include/gssapi
+CPPFLAGS+=-DKRB5 -I${DESTDIR}/usr/include/krb5 -DHEIMDAL
+.endif
+
+.if ${X11FLAVOUR} == Xorg
+CPPFLAGS+=-DX11BASE=\/usr/X11R7\
+.endif
+
+CPPFLAGS+=-DSUPPORT_UTMP -DSUPPORT_UTMPX
+CPPFLAGS+=-DLIBWRAP



CVS commit: src/sys/arch/m68k

2009-12-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec 19 18:06:52 UTC 2009

Modified Files:
src/sys/arch/m68k/include: m68k.h
src/sys/arch/m68k/m68k: vm_machdep.c

Log Message:
Move declaration of setfunc_trampoline() into m68k/m68k.h.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/m68k/include/m68k.h
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/m68k/m68k/vm_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/m68k/include/m68k.h
diff -u src/sys/arch/m68k/include/m68k.h:1.15 src/sys/arch/m68k/include/m68k.h:1.16
--- src/sys/arch/m68k/include/m68k.h:1.15	Sat Dec 19 13:08:26 2009
+++ src/sys/arch/m68k/include/m68k.h	Sat Dec 19 18:06:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k.h,v 1.15 2009/12/19 13:08:26 tsutsui Exp $	*/
+/*	$NetBSD: m68k.h,v 1.16 2009/12/19 18:06:51 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -146,6 +146,7 @@
 /* switch_subr.s */
 void	lwp_trampoline(void);
 void	savectx(struct pcb *);
+void	setfunc_trampoline(void);
 
 /* w16copy.s */
 void	w16zero(void *, u_int);

Index: src/sys/arch/m68k/m68k/vm_machdep.c
diff -u src/sys/arch/m68k/m68k/vm_machdep.c:1.33 src/sys/arch/m68k/m68k/vm_machdep.c:1.34
--- src/sys/arch/m68k/m68k/vm_machdep.c:1.33	Sat Dec 19 13:08:26 2009
+++ src/sys/arch/m68k/m68k/vm_machdep.c	Sat Dec 19 18:06:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.33 2009/12/19 13:08:26 tsutsui Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.34 2009/12/19 18:06:52 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.33 2009/12/19 13:08:26 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.34 2009/12/19 18:06:52 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -171,7 +171,6 @@
 	struct pcb *pcb = lwp_getpcb(l);
 	struct trapframe *tf = (struct trapframe *)l-l_md.md_regs;
 	struct switchframe *sf = (struct switchframe *)tf - 1;
-	extern void setfunc_trampoline(void);
 
 	sf-sf_pc = (u_int)setfunc_trampoline;
 	pcb-pcb_regs[6] = (int)func;		/* A2 */



CVS commit: src/sys/kern

2009-12-19 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat Dec 19 18:25:55 UTC 2009

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

Log Message:
sigtimedwait: fix a memory leak (which happens since newlock2 times).
Allocate ksiginfo on stack since it is safe and sigget() assumes that it is
not allocated from pool (pending signals via sigput()/sigget() mill should
be dynamically allocated, however).  Might be useful to revisit later.

Likely the cause of PR/40750 and indirect cause of PR/39283.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/kern/sys_sig.c

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

Modified files:

Index: src/sys/kern/sys_sig.c
diff -u src/sys/kern/sys_sig.c:1.23 src/sys/kern/sys_sig.c:1.24
--- src/sys/kern/sys_sig.c:1.23	Sun Mar 29 17:54:12 2009
+++ src/sys/kern/sys_sig.c	Sat Dec 19 18:25:54 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_sig.c,v 1.23 2009/03/29 17:54:12 christos Exp $	*/
+/*	$NetBSD: sys_sig.c,v 1.24 2009/12/19 18:25:54 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sys_sig.c,v 1.23 2009/03/29 17:54:12 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: sys_sig.c,v 1.24 2009/12/19 18:25:54 rmind Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -636,7 +636,7 @@
 	int error, signum;
 	int timo = 0;
 	struct timespec ts, tsstart, tsnow;
-	ksiginfo_t *ksi;
+	ksiginfo_t ksi;
 
 	memset(tsstart, 0, sizeof tsstart);	 /* XXX gcc */
 
@@ -674,13 +674,6 @@
 	 */
 	sigminusset(sigcantmask, l-l_sigwaitset);
 
-	/*
-	 * Allocate a ksi up front.  We can't sleep with the mutex held.
-	 */
-	ksi = ksiginfo_alloc(p, NULL, PR_WAITOK);
-	if (ksi == NULL)
-		return (ENOMEM);
-
 	mutex_enter(p-p_lock);
 
 	/*
@@ -692,8 +685,8 @@
 		goto out;
 	}
 
-	if ((signum = sigget(p-p_sigpend, ksi, 0, l-l_sigwaitset)) == 0)
-		signum = sigget(l-l_sigpend, ksi, 0, l-l_sigwaitset);
+	if ((signum = sigget(p-p_sigpend, ksi, 0, l-l_sigwaitset)) == 0)
+		signum = sigget(l-l_sigpend, ksi, 0, l-l_sigwaitset);
 
 	if (signum != 0) {
 		/*
@@ -706,7 +699,7 @@
 	/*
 	 * Set up the sigwait list.
 	 */
-	l-l_sigwaited = ksi;
+	l-l_sigwaited = ksi;
 	LIST_INSERT_HEAD(p-p_sigwaiters, l, l_sigwaiter);
 
 	/*
@@ -761,10 +754,8 @@
 	 */
  out:
 	if (error == 0)
-		error = (*put_info)(ksi-ksi_info, SCARG(uap, info),
-		sizeof(ksi-ksi_info));
-
-	ksiginfo_free(ksi);
+		error = (*put_info)(ksi.ksi_info, SCARG(uap, info),
+		sizeof(ksi.ksi_info));
 
 	return error;
 }



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

2009-12-19 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Dec 19 19:09:48 UTC 2009

Modified Files:
src/common/lib/libc/arch/sparc/string: ffs.S
src/common/lib/libc/arch/sparc64/string: ffs.S

Log Message:
Don't export __ffstab, it's used only in this routine.  This gets
rid of one of those evil common symbols in the __ namespace.

reviewed by martin


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/sparc/string/ffs.S
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/sparc64/string/ffs.S

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

Modified files:

Index: src/common/lib/libc/arch/sparc/string/ffs.S
diff -u src/common/lib/libc/arch/sparc/string/ffs.S:1.1 src/common/lib/libc/arch/sparc/string/ffs.S:1.2
--- src/common/lib/libc/arch/sparc/string/ffs.S:1.1	Tue Dec 20 19:28:50 2005
+++ src/common/lib/libc/arch/sparc/string/ffs.S	Sat Dec 19 19:09:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.S,v 1.1 2005/12/20 19:28:50 christos Exp $	*/
+/*	$NetBSD: ffs.S,v 1.2 2009/12/19 19:09:48 pooka Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -40,7 +40,7 @@
 #if 0
 	.asciz @(#)ffs.s	8.1 (Berkeley) 6/4/93
 #else
-	RCSID($NetBSD: ffs.S,v 1.1 2005/12/20 19:28:50 christos Exp $)
+	RCSID($NetBSD: ffs.S,v 1.2 2009/12/19 19:09:48 pooka Exp $)
 #endif
 #endif  /* LIBC_SCCS and not lint */
 
@@ -60,9 +60,9 @@
  */
 ENTRY(ffs)
 #ifdef PIC
-	PICCY_SET(_C_LABEL(__ffstab), %o2, %o3)
+	PICCY_SET(ffstab, %o2, %o3)
 #else
-	set	_C_LABEL(__ffstab), %o2
+	set	ffstab, %o2
 #endif
 	andcc	%o0, 0xff, %o1	! get low byte
 	be,a	1f		! try again if 0
@@ -94,7 +94,7 @@
 	retl
 	 add	%o0, 24, %o0
 
-RODATA(__ffstab)
+ffstab:
 	.byte	-24,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 00-0f */
 	.byte	5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1	/* 10-1f */
 	.byte	6,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1	/* 20-2f */

Index: src/common/lib/libc/arch/sparc64/string/ffs.S
diff -u src/common/lib/libc/arch/sparc64/string/ffs.S:1.1 src/common/lib/libc/arch/sparc64/string/ffs.S:1.2
--- src/common/lib/libc/arch/sparc64/string/ffs.S:1.1	Tue Dec 20 19:28:50 2005
+++ src/common/lib/libc/arch/sparc64/string/ffs.S	Sat Dec 19 19:09:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.S,v 1.1 2005/12/20 19:28:50 christos Exp $	*/
+/*	$NetBSD: ffs.S,v 1.2 2009/12/19 19:09:48 pooka Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -40,7 +40,7 @@
 #if 0
 	.asciz @(#)ffs.s	8.1 (Berkeley) 6/4/93
 #else
-	RCSID($NetBSD: ffs.S,v 1.1 2005/12/20 19:28:50 christos Exp $)
+	RCSID($NetBSD: ffs.S,v 1.2 2009/12/19 19:09:48 pooka Exp $)
 #endif
 #endif  /* LIBC_SCCS and not lint */
 
@@ -82,9 +82,9 @@
  */
 ENTRY(ffs)
 #ifdef PIC
-	PICCY_SET(_C_LABEL(__ffstab), %o2, %o3)
+	PICCY_SET(ffstab, %o2, %o3)
 #else
-	set	_C_LABEL(__ffstab), %o2
+	set	ffstab, %o2
 #endif
 	andcc	%o0, 0xff, %o1	! get low byte
 	be,a	1f		! try again if 0
@@ -116,7 +116,7 @@
 	retl
 	 add	%o0, 24, %o0
 
-RODATA(__ffstab)
+ffstab:
 	.byte	-24,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 00-0f */
 	.byte	5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1	/* 10-1f */
 	.byte	6,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1	/* 20-2f */



CVS commit: src/games/tetris

2009-12-19 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Sat Dec 19 19:27:53 UTC 2009

Modified Files:
src/games/tetris: screen.c

Log Message:
Hide the cursor during the game.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/games/tetris/screen.c

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

Modified files:

Index: src/games/tetris/screen.c
diff -u src/games/tetris/screen.c:1.24 src/games/tetris/screen.c:1.25
--- src/games/tetris/screen.c:1.24	Wed Aug 12 08:51:21 2009
+++ src/games/tetris/screen.c	Sat Dec 19 19:27:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: screen.c,v 1.24 2009/08/12 08:51:21 dholland Exp $	*/
+/*	$NetBSD: screen.c,v 1.25 2009/12/19 19:27:53 ahoka Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -84,7 +84,9 @@
 	*LLstr,			/* last line, first column */
 	*pcstr,			/* pad character */
 	*TEstr,			/* end cursor motion mode */
-	*TIstr;			/* begin cursor motion mode */
+	*TIstr,			/* begin cursor motion mode */
+	*VIstr,			/* make cursor invisible */
+	*VEstr;			/* make cursor appear normal */
 char
 	*SEstr,			/* end standout mode */
 	*SOstr;			/* begin standout mode */
@@ -111,6 +113,8 @@
 	{so, SOstr},
 	{te, TEstr},
 	{ti, TIstr},
+	{vi, VIstr},
+	{ve, VEstr},
 	{up, UP},		/* cursor up */
 	{ {0}, NULL}
 };
@@ -299,6 +303,8 @@
 	 */
 	if (TIstr)
 		putstr(TIstr);	/* termcap(5) says this is not padded */
+	if (VIstr)
+		putstr(VIstr);	/* termcap(5) says this is not padded */
 	if (tstp != SIG_IGN)
 		(void) signal(SIGTSTP, scr_stop);
 	if (ttou != SIG_IGN)
@@ -329,6 +335,8 @@
 	/* exit screen mode */
 	if (TEstr)
 		putstr(TEstr);	/* termcap(5) says this is not padded */
+	if (VEstr)
+		putstr(VEstr);	/* termcap(5) says this is not padded */
 	(void) fflush(stdout);
 	(void) tcsetattr(0, TCSADRAIN, oldtt);
 	isset = 0;



CVS commit: src/sys/kern

2009-12-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec 19 20:28:27 UTC 2009

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

Log Message:
Use the kernel space version of the vfs name, not the original userspace
pointer. Avoids crashes on archs with completely separate userspace VA.


To generate a diff of this commit:
cvs rdiff -u -r1.399 -r1.400 src/sys/kern/vfs_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/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.399 src/sys/kern/vfs_syscalls.c:1.400
--- src/sys/kern/vfs_syscalls.c:1.399	Sun Aug  9 22:49:00 2009
+++ src/sys/kern/vfs_syscalls.c	Sat Dec 19 20:28:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.399 2009/08/09 22:49:00 haad Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.400 2009/12/19 20:28:27 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.399 2009/08/09 22:49:00 haad Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.400 2009/12/19 20:28:27 martin Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_fileassoc.h
@@ -279,7 +279,7 @@
 
 	/* If we can autoload a vfs module, try again */
 	mutex_enter(module_lock);
-	(void)module_autoload(fstype, MODULE_CLASS_VFS);
+	(void)module_autoload(fstypename, MODULE_CLASS_VFS);
 	mutex_exit(module_lock);
 
 	if ((*vfsops = vfs_getopsbyname(fstypename)) != NULL)



CVS commit: src/lib/libc/sys

2009-12-19 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Dec 19 23:00:10 UTC 2009

Modified Files:
src/lib/libc/sys: socketpair.2

Log Message:
Remove note about portability, since PF_UNSPEC will cause socketpair()
to EAFNOSUPPORT on NetBSD(!).  Additionally, at least slowaris and
linux talk only about PF_LOCAL.  Finally, since I'm reading a NetBSD
man page, I foremost care about the code working on NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/sys/socketpair.2

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/sys/socketpair.2
diff -u src/lib/libc/sys/socketpair.2:1.19 src/lib/libc/sys/socketpair.2:1.20
--- src/lib/libc/sys/socketpair.2:1.19	Thu May 13 10:20:58 2004
+++ src/lib/libc/sys/socketpair.2	Sat Dec 19 23:00:10 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: socketpair.2,v 1.19 2004/05/13 10:20:58 wiz Exp $
+.\	$NetBSD: socketpair.2,v 1.20 2009/12/19 23:00:10 pooka Exp $
 .\
 .\ Copyright (c) 1983, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ @(#)socketpair.2	8.1 (Berkeley) 6/4/93
 .\
-.Dd August 18, 2002
+.Dd December 20, 2009
 .Dt SOCKETPAIR 2
 .Os
 .Sh NAME
@@ -89,12 +89,5 @@
 .Bx 4.2 .
 .Sh BUGS
 This call is currently implemented only for the
-.Tn LOCAL
+.Dv PF_LOCAL
 domain.
-Many operating systems only accept a
-.Ar protocol
-of
-.Ev PF_UNSPEC ,
-so that should be used instead of
-.Ev PF_LOCAL
-for maximal portability.



CVS commit: src/usr.sbin/eeprom

2009-12-19 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sat Dec 19 23:10:57 UTC 2009

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

Log Message:
Add xref to ofctl(8).


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/eeprom/eeprom.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/eeprom/eeprom.8
diff -u src/usr.sbin/eeprom/eeprom.8:1.15 src/usr.sbin/eeprom/eeprom.8:1.16
--- src/usr.sbin/eeprom/eeprom.8:1.15	Thu Sep 25 22:44:51 2008
+++ src/usr.sbin/eeprom/eeprom.8	Sat Dec 19 23:10:57 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: eeprom.8,v 1.15 2008/09/25 22:44:51 reed Exp $
+.\	$NetBSD: eeprom.8,v 1.16 2009/12/19 23:10:57 nakayama Exp $
 .\
 .\ Copyright (c) 1996 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -339,6 +339,8 @@
 .It /dev/nvram
 The nvram device on PReP systems.
 .El
+.Sh SEE ALSO
+.Xr ofctl 8
 .Sh BUGS
 The fields and their values are not necessarily well defined on
 systems with an openprom.



CVS commit: src/lib/libc/sys

2009-12-19 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Dec 20 02:16:40 UTC 2009

Modified Files:
src/lib/libc/sys: socketpair.2

Log Message:
Sort ERRORS.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/sys/socketpair.2

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/sys/socketpair.2
diff -u src/lib/libc/sys/socketpair.2:1.20 src/lib/libc/sys/socketpair.2:1.21
--- src/lib/libc/sys/socketpair.2:1.20	Sat Dec 19 23:00:10 2009
+++ src/lib/libc/sys/socketpair.2	Sun Dec 20 02:16:40 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: socketpair.2,v 1.20 2009/12/19 23:00:10 pooka Exp $
+.\	$NetBSD: socketpair.2,v 1.21 2009/12/20 02:16:40 wiz Exp $
 .\
 .\ Copyright (c) 1983, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -62,21 +62,21 @@
 .Sh ERRORS
 The call succeeds unless:
 .Bl -tag -width Er
-.It Bq Er EMFILE
-Too many descriptors are in use by this process.
-.It Bq Er ENFILE
-The system file table is full.
 .It Bq Er EAFNOSUPPORT
 The specified address family is not supported on this machine.
-.It Bq Er EPROTONOSUPPORT
-The specified protocol is not supported on this machine.
-.It Bq Er EOPNOTSUPP
-The specified protocol does not support creation of socket pairs.
 .It Bq Er EFAULT
 The address
 .Fa sv
 does not specify a valid part of the
 process address space.
+.It Bq Er EMFILE
+Too many descriptors are in use by this process.
+.It Bq Er ENFILE
+The system file table is full.
+.It Bq Er EOPNOTSUPP
+The specified protocol does not support creation of socket pairs.
+.It Bq Er EPROTONOSUPPORT
+The specified protocol is not supported on this machine.
 .El
 .Sh SEE ALSO
 .Xr pipe 2 ,



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

2009-12-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Dec 20 03:38:59 UTC 2009

Modified Files:
src/sys/arch/sparc/sparc: cpuvar.h

Log Message:
add per-cpu event counters for lev10 and lev14 interrupts.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/sparc/sparc/cpuvar.h

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

Modified files:

Index: src/sys/arch/sparc/sparc/cpuvar.h
diff -u src/sys/arch/sparc/sparc/cpuvar.h:1.79 src/sys/arch/sparc/sparc/cpuvar.h:1.80
--- src/sys/arch/sparc/sparc/cpuvar.h:1.79	Sun May 31 20:09:44 2009
+++ src/sys/arch/sparc/sparc/cpuvar.h	Sun Dec 20 03:38:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuvar.h,v 1.79 2009/05/31 20:09:44 mrg Exp $ */
+/*	$NetBSD: cpuvar.h,v 1.80 2009/12/20 03:38:59 mrg Exp $ */
 
 /*
  *  Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -331,6 +331,10 @@
 	 * in this region that aren't part of the cpu_info to uvm.
 	 */
 	vaddr_t	ci_free_sva1, ci_free_eva1, ci_free_sva2, ci_free_eva2;
+
+	char ci_cpuname[8];	/* cpu/0, etc. */
+	struct evcnt ci_lev10;
+	struct evcnt ci_lev14;
 };
 
 /*



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

2009-12-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Dec 20 03:40:03 UTC 2009

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

Log Message:
add per-cpu event counters for lev10 and lev14 interrupts.
add some disabled MP code to poke other cpus on level 14 interrupts.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sparc/sparc/timer_sun4m.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/timer_sun4m.c
diff -u src/sys/arch/sparc/sparc/timer_sun4m.c:1.17 src/sys/arch/sparc/sparc/timer_sun4m.c:1.18
--- src/sys/arch/sparc/sparc/timer_sun4m.c:1.17	Tue Mar 10 23:58:20 2009
+++ src/sys/arch/sparc/sparc/timer_sun4m.c	Sun Dec 20 03:40:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: timer_sun4m.c,v 1.17 2009/03/10 23:58:20 martin Exp $	*/
+/*	$NetBSD: timer_sun4m.c,v 1.18 2009/12/20 03:40:03 mrg Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: timer_sun4m.c,v 1.17 2009/03/10 23:58:20 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: timer_sun4m.c,v 1.18 2009/12/20 03:40:03 mrg Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -110,6 +110,7 @@
 	 * panic
 	 * so for now just bail when cold
 	 */
+	cpuinfo.ci_lev10.ev_count++;
 	if (cold)
 		return 0;
 	/* read the limit register to clear the interrupt */
@@ -128,6 +129,14 @@
 	struct clockframe *frame = cap;
 	u_long newint;
 
+	cpuinfo.ci_lev14.ev_count++;
+
+#if defined(MULTIPROCESSOR)  0
+	if (!(curcpu()-master)) {
+		raise_ipi(cpuinfo, 10);
+	}
+#endif
+
 	/* read the limit register to clear the interrupt */
 	*((volatile int *)counterreg4m-t_limit);
 
@@ -221,6 +230,13 @@
 		cpi-counterreg_4m = (struct counter_4m *)bh;
 	}
 
+	/* Install timer/statclock event counters, per cpu */
+	for (CPU_INFO_FOREACH(n, cpi)) {
+		snprintf(cpi-ci_cpuname, sizeof(cpi-ci_cpuname), cpu/%d, n);
+		evcnt_attach_dynamic(cpi-ci_lev10, EVCNT_TYPE_INTR, NULL, cpi-ci_cpuname, lev10);
+		evcnt_attach_dynamic(cpi-ci_lev14, EVCNT_TYPE_INTR, NULL, cpi-ci_cpuname, lev14);
+	}
+
 	/* Put processor counter in timer mode */
 	timerreg4m-t_cfg = 0;
 



CVS commit: src/sys/arch/mips/mips

2009-12-19 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Dec 20 03:40:27 UTC 2009

Modified Files:
src/sys/arch/mips/mips: locore.S

Log Message:
Slightly improve the comment.


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/sys/arch/mips/mips/locore.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/mips/mips/locore.S
diff -u src/sys/arch/mips/mips/locore.S:1.171 src/sys/arch/mips/mips/locore.S:1.172
--- src/sys/arch/mips/mips/locore.S:1.171	Mon Dec 14 00:46:06 2009
+++ src/sys/arch/mips/mips/locore.S	Sun Dec 20 03:40:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.171 2009/12/14 00:46:06 matt Exp $	*/
+/*	$NetBSD: locore.S,v 1.172 2009/12/20 03:40:27 rmind Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -171,7 +171,7 @@
  */
 	beq	a0, zero, 1f
 	nop
-	PTR_L	a2, L_PCB(a0)			# a2 = l-l_addr
+	PTR_L	a2, L_PCB(a0)			# a2 = pcb of old lwp
 	mfc0	t0, MIPS_COP_0_STATUS
 	REG_PROLOGUE
 	REG_S	s0, PCB_CONTEXT+SF_REG_S0(a2)



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

2009-12-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Dec 20 03:41:49 UTC 2009

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

Log Message:
- add a diagnostic to ensure that cpus[0] == cpu0's cpu_info-ci_self
- if a cpu doesn't have any mappings allocated, don't copy them.  this
  occurs if a cpu isn't attached (such as a MP kernel with only cpu0
  listed in the config file..)


To generate a diff of this commit:
cvs rdiff -u -r1.337 -r1.338 src/sys/arch/sparc/sparc/pmap.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/pmap.c
diff -u src/sys/arch/sparc/sparc/pmap.c:1.337 src/sys/arch/sparc/sparc/pmap.c:1.338
--- src/sys/arch/sparc/sparc/pmap.c:1.337	Sat Nov  7 07:27:46 2009
+++ src/sys/arch/sparc/sparc/pmap.c	Sun Dec 20 03:41:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.337 2009/11/07 07:27:46 cegger Exp $ */
+/*	$NetBSD: pmap.c,v 1.338 2009/12/20 03:41:49 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -56,7 +56,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.337 2009/11/07 07:27:46 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.338 2009/12/20 03:41:49 mrg Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -3907,6 +3907,14 @@
 #endif
 
 	pmap_update(pmap_kernel());
+
+#ifdef DIAGNOSTIC
+	if (curcpu()-ci_self != cpus[0]) {
+		prom_printf(curcpu()-ci_self %p != cpus[0] %p\n, curcpu()-ci_self, cpus[0]);
+		panic(cpuinfo inconsistent);
+	}
+#endif
+
 	prom_printf(pmap_bootstrap4m done\n);
 }
 
@@ -4181,6 +4189,10 @@
 			n = 0;
 #endif
 			{
+/* Did this cpu attach? */
+if (pmap_kernel()-pm_reg_ptps[n] == 0)
+	continue;
+
 if (pm-pm_reg_ptps[n][vr] != SRMMU_TEINVALID)
 	printf(pmap_chk: spurious PTP in user 
 		region %d on CPU %d\n, vr, n);
@@ -4294,6 +4306,10 @@
 		{
 			int *upt, *kpt;
 
+			/* Did this cpu attach? */
+			if (pmap_kernel()-pm_reg_ptps[n] == 0)
+continue;
+
 			upt = pool_get(L1_pool, flags);
 			pm-pm_reg_ptps[n] = upt;
 			pm-pm_reg_ptps_pa[n] = VA2PA((char *)upt);
@@ -4344,7 +4360,13 @@
 		n = 0;
 #endif
 		{
-			int *pt = pm-pm_reg_ptps[n];
+			int *pt;
+
+			/* Did this cpu attach? */
+			if (pmap_kernel()-pm_reg_ptps[n] == 0)
+continue;
+
+			pt = pm-pm_reg_ptps[n];
 			pm-pm_reg_ptps[n] = NULL;
 			pm-pm_reg_ptps_pa[n] = 0;
 			pool_put(L1_pool, pt);



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

2009-12-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Dec 20 03:42:29 UTC 2009

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

Log Message:
minor KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/arch/sparc/sparc/cpu.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.219 src/sys/arch/sparc/sparc/cpu.c:1.220
--- src/sys/arch/sparc/sparc/cpu.c:1.219	Sat Nov 21 04:16:51 2009
+++ src/sys/arch/sparc/sparc/cpu.c	Sun Dec 20 03:42:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.219 2009/11/21 04:16:51 rmind Exp $ */
+/*	$NetBSD: cpu.c,v 1.220 2009/12/20 03:42:29 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.219 2009/11/21 04:16:51 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.220 2009/12/20 03:42:29 mrg Exp $);
 
 #include opt_multiprocessor.h
 #include opt_lockdebug.h
@@ -1590,7 +1590,7 @@
 			sc-flags |= CPUFLG_CACHEPAGETABLES;
 	} else {
 #ifdef MULTIPROCESSOR
-		if ((sparc_ncpus  1)  (sc-cacheinfo.ec_totalsize == 0))
+		if (sparc_ncpus  1  sc-cacheinfo.ec_totalsize == 0)
 			sc-cache_flush = srmmu_cache_flush;
 #endif
 	}



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

2009-12-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Dec 20 03:48:30 UTC 2009

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

Log Message:
fix the previous to compile !MULTIPROCESSOR.


To generate a diff of this commit:
cvs rdiff -u -r1.338 -r1.339 src/sys/arch/sparc/sparc/pmap.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/pmap.c
diff -u src/sys/arch/sparc/sparc/pmap.c:1.338 src/sys/arch/sparc/sparc/pmap.c:1.339
--- src/sys/arch/sparc/sparc/pmap.c:1.338	Sun Dec 20 03:41:49 2009
+++ src/sys/arch/sparc/sparc/pmap.c	Sun Dec 20 03:48:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.338 2009/12/20 03:41:49 mrg Exp $ */
+/*	$NetBSD: pmap.c,v 1.339 2009/12/20 03:48:30 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -56,7 +56,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.338 2009/12/20 03:41:49 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.339 2009/12/20 03:48:30 mrg Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -4306,9 +4306,11 @@
 		{
 			int *upt, *kpt;
 
+#if defined(MULTIPROCESSOR)
 			/* Did this cpu attach? */
 			if (pmap_kernel()-pm_reg_ptps[n] == 0)
 continue;
+#endif
 
 			upt = pool_get(L1_pool, flags);
 			pm-pm_reg_ptps[n] = upt;
@@ -4362,9 +4364,11 @@
 		{
 			int *pt;
 
+#if defined(MULTIPROCESSOR)
 			/* Did this cpu attach? */
 			if (pmap_kernel()-pm_reg_ptps[n] == 0)
 continue;
+#endif
 
 			pt = pm-pm_reg_ptps[n];
 			pm-pm_reg_ptps[n] = NULL;



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

2009-12-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Dec 20 03:50:57 UTC 2009

Modified Files:
src/sys/arch/sparc/sparc: cpuvar.h

Log Message:
make CPU_INFO_FOREACH() set the iterator count to '0' in the !MP case.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/sparc/sparc/cpuvar.h

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

Modified files:

Index: src/sys/arch/sparc/sparc/cpuvar.h
diff -u src/sys/arch/sparc/sparc/cpuvar.h:1.80 src/sys/arch/sparc/sparc/cpuvar.h:1.81
--- src/sys/arch/sparc/sparc/cpuvar.h:1.80	Sun Dec 20 03:38:59 2009
+++ src/sys/arch/sparc/sparc/cpuvar.h	Sun Dec 20 03:50:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuvar.h,v 1.80 2009/12/20 03:38:59 mrg Exp $ */
+/*	$NetBSD: cpuvar.h,v 1.81 2009/12/20 03:50:56 mrg Exp $ */
 
 /*
  *  Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -425,7 +425,7 @@
 #if defined(MULTIPROCESSOR) || defined(MODULAR) || defined(_MODULE)
 #define	CPU_INFO_FOREACH(cii, cp)	cii = 0; (cp = cpus[cii])  cp-eintstack  cii  sparc_ncpus; cii++
 #else
-#define CPU_INFO_FOREACH(cii, cp)	(void)cii, cp = curcpu(); cp != NULL; cp = NULL
+#define CPU_INFO_FOREACH(cii, cp)	cii = 0, cp = curcpu(); cp != NULL; cp = NULL
 #endif
 
 /*



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

2009-12-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Dec 20 03:53:46 UTC 2009

Modified Files:
src/sys/arch/sparc/sparc: locore.s

Log Message:
- remove unused ft_want_ast()
- give nmi_sun* ENTRY() points so they show up in symbols properly
- add some disabled code to use this cpu's idlelwp area when hatching
  a cpu, but right now it makes this worse not better...


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.250 src/sys/arch/sparc/sparc/locore.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/sparc/sparc/locore.s
diff -u src/sys/arch/sparc/sparc/locore.s:1.249 src/sys/arch/sparc/sparc/locore.s:1.250
--- src/sys/arch/sparc/sparc/locore.s:1.249	Thu Dec 10 05:10:03 2009
+++ src/sys/arch/sparc/sparc/locore.s	Sun Dec 20 03:53:46 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.249 2009/12/10 05:10:03 rmind Exp $	*/
+/*	$NetBSD: locore.s,v 1.250 2009/12/20 03:53:46 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996 Paul Kranenburg
@@ -2988,17 +2988,6 @@
 	b	ft_rett
 	 mov	SRMMU_CXR, %l7			! reload ctx register
 
-_ENTRY(_C_LABEL(ft_want_ast))
-	mov	1, %l4! ack xcall in all cases
-	st	%l4, [%l6 + CPUINFO_XMSG_CMPLT]	! completed = 1
-
-	btst	PSR_PS, %l0		! if from user mode
-	be,a	slowtrap		!  call trap(T_AST)
-	 mov	T_AST, %l3
-
-	mov	%l0, %psr		! else return from trap
-	 nop! AST will be noticed on out way out
-	RETT
 #endif /* MULTIPROCESSOR */
 
 #ifdef notyet
@@ -3041,7 +3030,7 @@
  */
 
 #if defined(SUN4)
-nmi_sun4:
+_ENTRY(_C_LABEL(nmi_sun4))
 	INTR_SETUP(-CCFSZ-80)
 	INCR(_C_LABEL(uvmexp)+V_INTR)	! cnt.v_intr++; (clobbers %o0,%o1)
 	/*
@@ -3067,7 +3056,7 @@
 #endif
 
 #if defined(SUN4C)
-nmi_sun4c:
+_ENTRY(_C_LABEL(nmi_sun4c))
 	INTR_SETUP(-CCFSZ-80)
 	INCR(_C_LABEL(uvmexp)+V_INTR)	! cnt.v_intr++; (clobbers %o0,%o1)
 	/*
@@ -3101,7 +3090,7 @@
 #endif /* SUN4M */
 #endif /* SUN4C */
 
-nmi_common:
+_ENTRY(_C_LABEL(nmi_common))
 	! and call C code
 	call	_C_LABEL(memerr4_4c)	! memerr(0, ser, sva, aer, ava)
 	 clr	%o0
@@ -3122,7 +3111,7 @@
 	 wr	%l4, 0, %y		! restore y
 
 #if defined(SUN4M)
-nmi_sun4m:
+_ENTRY(_C_LABEL(nmi_sun4m))
 	INTR_SETUP(-CCFSZ-80)
 	INCR(_C_LABEL(uvmexp)+V_INTR)	! cnt.v_intr++; (clobbers %o0,%o1)
 
@@ -4616,12 +4605,25 @@
 	wr	%g6, 0, %tbr
 	nop; nop; nop			! paranoia
 
-	/* Set up a stack. We use the bottom half of the interrupt stack */
+#if 1
 	set	USRSTACK - CCFSZ, %fp	! as if called from user code
+
+	/* Set up a stack. We use the bottom half of the interrupt stack */
 	sethi	%hi(_EINTSTACKP), %o0
 	ld	[%o0 + %lo(_EINTSTACKP)], %o0
 	set	(INT_STACK_SIZE/2) + CCFSZ + 80, %sp
 	sub	%o0, %sp, %sp
+#else
+	/*
+	 * Use this CPUs idlelwp's stack
+	 */
+	sethi	%hi(cpcb), %o0
+	ld	[%o0 + %lo(cpcb)], %o0
+	set	USPACE - 80 - CCFSZ, %sp
+	add	%o0, %sp, %sp
+
+	add	80, %sp, %fp
+#endif
 
 	/* Enable traps */
 	rd	%psr, %l0



CVS commit: src/sys/arch/evbmips/rmixl

2009-12-19 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Dec 20 04:11:37 UTC 2009

Modified Files:
src/sys/arch/evbmips/rmixl: autoconf.c machdep.c

Log Message:
Fix few problems in evbmips/rmixl:
- mach_init: use mips_init_lwp0_uarea(), do not hardcode it.  Do not call
  ksyms_init(), it's called in MI.  Also, avoid struct user in few places.
- findroot: use deviter interface.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbmips/rmixl/autoconf.c \
src/sys/arch/evbmips/rmixl/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/evbmips/rmixl/autoconf.c
diff -u src/sys/arch/evbmips/rmixl/autoconf.c:1.2 src/sys/arch/evbmips/rmixl/autoconf.c:1.3
--- src/sys/arch/evbmips/rmixl/autoconf.c:1.2	Mon Dec 14 00:46:02 2009
+++ src/sys/arch/evbmips/rmixl/autoconf.c	Sun Dec 20 04:11:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.2 2009/12/14 00:46:02 matt Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.3 2009/12/20 04:11:37 rmind Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.2 2009/12/14 00:46:02 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.3 2009/12/20 04:11:37 rmind Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -83,31 +83,31 @@
 static void
 findroot(void)
 {
-	struct device *dv;
+	device_t dv;
+	deviter_t di;
 
 	if (booted_device)
 		return;
 
-	if ((booted_device == NULL)  netboot == 0)
-		for (dv = TAILQ_FIRST(alldevs); dv != NULL;
-		 dv = TAILQ_NEXT(dv, dv_list))
+	if ((booted_device == NULL)  netboot == 0) {
+		for (dv = deviter_first(di, DEVITER_F_ROOT_FIRST); dv != NULL;
+		dv = deviter_next(di)) {
 			if (device_class(dv) == DV_DISK 
 			device_is_a(dv, wd))
-booted_device = dv;
-
+booted_device = dv;
+		}
+		deviter_release(di);
+	}
 	/*
 	 * XXX Match up MBR boot specification with BSD disklabel for root?
 	 */
 	booted_partition = 0;
-
-	return;
 }
 
 void
-device_register(dev, aux)
-	struct device *dev;
-	void *aux;
+device_register(struct device *dev, void *aux)
 {
+
 	if ((booted_device == NULL)  (netboot == 1))
 		if (device_class(dev) == DV_IFNET)
 			booted_device = dev;
Index: src/sys/arch/evbmips/rmixl/machdep.c
diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.2 src/sys/arch/evbmips/rmixl/machdep.c:1.3
--- src/sys/arch/evbmips/rmixl/machdep.c:1.2	Mon Dec 14 00:46:03 2009
+++ src/sys/arch/evbmips/rmixl/machdep.c	Sun Dec 20 04:11:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.2 2009/12/14 00:46:03 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.3 2009/12/20 04:11:37 rmind Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.2 2009/12/14 00:46:03 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.3 2009/12/20 04:11:37 rmind Exp $);
 
 #include opt_ddb.h
 #include opt_com.h
@@ -124,7 +124,6 @@
 #include sys/kernel.h
 #include sys/buf.h
 #include sys/reboot.h
-#include sys/user.h
 #include sys/mount.h
 #include sys/kcore.h
 #include sys/boot_flag.h
@@ -268,7 +267,7 @@
 mach_init(int argc, int32_t *argv, void *envp, int64_t infop)
 {
 	struct rmixl_config *rcp = rmixl_configuration;
-	void *kernend, *v;
+	void *kernend;
 	u_long memsize;
 	u_int vm_cluster_cnt;
 	uint32_t r;
@@ -402,27 +401,9 @@
 	pmap_bootstrap();
 
 	/*
-	 * Allocate space for proc0's USPACE.
+	 * Allocate uarea page for lwp0 and set it.
 	 */
-	v = (void *)uvm_pageboot_alloc(USPACE); 
-	lwp0.l_addr = proc0paddr = (struct user *)v;
-	lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1;
-#ifdef _LP64
-lwp0.l_md.md_regs-f_regs[_R_SR] = MIPS_SR_KX;
-#endif
-proc0paddr-u_pcb.pcb_context.val[_L_SR] =
-#ifdef _LP64
-MIPS_SR_KX |
-#endif  
-MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
-
-
-	/*
-	 * Initialize debuggers, and break into them, if appropriate.
-	 */
-#if NKSYMS || defined(DDB) || defined(LKM)
-	ksyms_init(0, 0, 0);
-#endif
+	mips_init_lwp0_uarea();
 
 #if defined(DDB)
 	if (boothowto  RB_KDB)
@@ -844,14 +825,12 @@
 int	waittime = -1;
 
 void
-cpu_reboot(howto, bootstr)
-	int howto;
-	char *bootstr;
+cpu_reboot(int howto, char *bootstr)
 {
 
 	/* Take a snapshot before clobbering any registers. */
 	if (curproc)
-		savectx((struct user *)curpcb);
+		savectx(curpcb);
 
 	if (cold) {
 		howto |= RB_HALT;



CVS commit: src/sys/kern

2009-12-19 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Dec 20 04:49:09 UTC 2009

Modified Files:
src/sys/kern: kern_sig.c sys_sig.c

Log Message:
signal(9) code: add some comments, improve/fix wrong ones.  While here, kill
trailing whitespaces, wrap long lines, etc.  No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.300 -r1.301 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.24 -r1.25 src/sys/kern/sys_sig.c

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

Modified files:

Index: src/sys/kern/kern_sig.c
diff -u src/sys/kern/kern_sig.c:1.300 src/sys/kern/kern_sig.c:1.301
--- src/sys/kern/kern_sig.c:1.300	Sat Nov 14 19:06:54 2009
+++ src/sys/kern/kern_sig.c	Sun Dec 20 04:49:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.300 2009/11/14 19:06:54 rmind Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.301 2009/12/20 04:49:09 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_sig.c,v 1.300 2009/11/14 19:06:54 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_sig.c,v 1.301 2009/12/20 04:49:09 rmind Exp $);
 
 #include opt_ptrace.h
 #include opt_compat_sunos.h
@@ -125,8 +125,8 @@
 (int (*)(struct lwp *, const char *))enosys;
 
 static struct pool_allocator sigactspool_allocator = {
-.pa_alloc = sigacts_poolpage_alloc,
-	.pa_free = sigacts_poolpage_free,
+	.pa_alloc = sigacts_poolpage_alloc,
+	.pa_free = sigacts_poolpage_free
 };
 
 #ifdef DEBUG
@@ -135,9 +135,9 @@
 int	kern_logsigexit = 0;
 #endif
 
-static	const char logcoredump[] =
+static const char logcoredump[] =
 pid %d (%s), uid %d: exited on signal %d (core dumped)\n;
-static	const char lognocoredump[] =
+static const char lognocoredump[] =
 pid %d (%s), uid %d: exited on signal %d (core not dumped, err = %d)\n;
 
 static kauth_listener_t signal_listener;
@@ -166,7 +166,7 @@
 /*
  * signal_init:
  *
- * 	Initialize global signal-related data structures.
+ *	Initialize global signal-related data structures.
  */
 void
 signal_init(void)
@@ -196,14 +196,14 @@
 /*
  * sigacts_poolpage_alloc:
  *
- *	 Allocate a page for the sigacts memory pool.
+ *	Allocate a page for the sigacts memory pool.
  */
 static void *
 sigacts_poolpage_alloc(struct pool *pp, int flags)
 {
 
 	return (void *)uvm_km_alloc(kernel_map,
-	(PAGE_SIZE)*2, (PAGE_SIZE)*2,
+	PAGE_SIZE * 2, PAGE_SIZE * 2,
 	((flags  PR_WAITOK) ? 0 : UVM_KMF_NOWAIT | UVM_KMF_TRYLOCK)
 	| UVM_KMF_WIRED);
 }
@@ -211,21 +211,21 @@
 /*
  * sigacts_poolpage_free:
  *
- *	 Free a page on behalf of the sigacts memory pool.
+ *	Free a page on behalf of the sigacts memory pool.
  */
 static void
 sigacts_poolpage_free(struct pool *pp, void *v)
 {
 
-uvm_km_free(kernel_map, (vaddr_t)v, (PAGE_SIZE)*2, UVM_KMF_WIRED);
+	uvm_km_free(kernel_map, (vaddr_t)v, PAGE_SIZE * 2, UVM_KMF_WIRED);
 }
 
 /*
  * sigactsinit:
- * 
- *	 Create an initial sigctx structure, using the same signal state as
- *	 p.  If 'share' is set, share the sigctx_proc part, otherwise just
- *	 copy it from parent.
+ *
+ *	Create an initial sigacts structure, using the same signal state
+ *	as of specified process.  If 'share' is set, share the sigacts by
+ *	holding a reference, otherwise just copy it from parent.
  */
 struct sigacts *
 sigactsinit(struct proc *pp, int share)
@@ -253,9 +253,8 @@
 
 /*
  * sigactsunshare:
- * 
- *	Make this process not share its sigctx, maintaining all
- *	signal state.
+ *
+ *	Make this process not share its sigacts, maintaining all signal state.
  */
 void
 sigactsunshare(struct proc *p)
@@ -276,7 +275,7 @@
 /*
  * sigactsfree;
  *
- *	Release a sigctx structure.
+ *	Release a sigacts structure.
  */
 void
 sigactsfree(struct sigacts *ps)
@@ -450,7 +449,7 @@
 	if (ok != NULL) {
 		if ((ok-ksi_flags  (KSI_QUEUED | KSI_FROMPOOL)) ==
 		KSI_FROMPOOL)
-			return ok;
+			return ok;
 		if (KSI_EMPTY_P(ok))
 			return ok;
 	}
@@ -519,7 +518,7 @@
 int
 sigget(sigpend_t *sp, ksiginfo_t *out, int signo, const sigset_t *mask)
 {
-ksiginfo_t *ksi;
+	ksiginfo_t *ksi;
 	sigset_t tset;
 
 	/* If there's no pending set, the signal is from the debugger. */
@@ -533,8 +532,8 @@
 			__sigandset(sp-sp_set, tset);
 		} else
 			tset = sp-sp_set;
-		
-		/* If there are no signals pending, that's it. */
+
+		/* If there are no signals pending - return. */
 		if ((signo = firstsig(tset)) == 0)
 			goto out;
 	} else {
@@ -545,34 +544,32 @@
 
 	/* Find siginfo and copy it out. */
 	CIRCLEQ_FOREACH(ksi, sp-sp_info, ksi_list) {
-		if (ksi-ksi_signo == signo) {
-			CIRCLEQ_REMOVE(sp-sp_info, ksi, ksi_list);
-			KASSERT((ksi-ksi_flags  KSI_FROMPOOL) != 0);
-			KASSERT((ksi-ksi_flags  KSI_QUEUED) != 0);
-			ksi-ksi_flags = ~KSI_QUEUED;
-			if (out != NULL) {
-memcpy(out, ksi, sizeof(*out));
-out-ksi_flags = ~(KSI_FROMPOOL | KSI_QUEUED);
-			}
-			ksiginfo_free(ksi);
-