CVS commit: src/usr.bin/crunch/crunchgen

2014-01-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jan  4 08:58:51 UTC 2014

Modified Files:
src/usr.bin/crunch/crunchgen: crunchgen.c

Log Message:
Remove .note.netbsd.mcmodel and .note.netbsd.pax from the chrunched binaries.
We don't know wether the former would make sense (as currently used, it never
makes sense for static binaries) and we can not conclude safe PAX flags from
combined binaries.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/crunch/crunchgen/crunchgen.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/crunch/crunchgen/crunchgen.c
diff -u src/usr.bin/crunch/crunchgen/crunchgen.c:1.81 src/usr.bin/crunch/crunchgen/crunchgen.c:1.82
--- src/usr.bin/crunch/crunchgen/crunchgen.c:1.81	Mon Jun 10 18:27:30 2013
+++ src/usr.bin/crunch/crunchgen/crunchgen.c	Sat Jan  4 08:58:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: crunchgen.c,v 1.81 2013/06/10 18:27:30 joerg Exp $	*/
+/*	$NetBSD: crunchgen.c,v 1.82 2014/01/04 08:58:51 martin Exp $	*/
 /*
  * Copyright (c) 1994 University of Maryland
  * All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include sys/cdefs.h
 #if !defined(lint)
-__RCSID($NetBSD: crunchgen.c,v 1.81 2013/06/10 18:27:30 joerg Exp $);
+__RCSID($NetBSD: crunchgen.c,v 1.82 2014/01/04 08:58:51 martin Exp $);
 #endif
 
 #include stdlib.h
@@ -957,7 +957,7 @@ top_makefile_rules(FILE *outmk)
 fprintf(outmk, \t@[ -f ${PROG}.unstripped -a ! ${PROG} -nt ${PROG}.unstripped ] || { \\\n);
 fprintf(outmk, \t\t${_MKSHMSG:Uecho} \  strip \ ${PROG}; \\\n);
 fprintf(outmk, \t\tcp ${PROG} ${PROG}.unstripped  \\\n);
-fprintf(outmk, \t\t${OBJCOPY} -S -R .eh_frame -R .eh_frame_hdr -R .note -R .ident -R .comment -R .copyright ${PROG}  \\\n);
+fprintf(outmk, \t\t${OBJCOPY} -S -R .eh_frame -R .eh_frame_hdr -R .note -R .note.netbsd.mcmodel -R .note.netbsd.pax -R .ident -R .comment -R .copyright ${PROG}  \\\n);
 fprintf(outmk, \t\ttouch ${PROG}.unstripped; \\\n);
 fprintf(outmk, \t}\n);
 fprintf(outmk, objs: $(SUBMAKE_TARGETS)\n);



CVS commit: src/sys/fs/tmpfs

2014-01-04 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Jan  4 12:36:49 UTC 2014

Modified Files:
src/sys/fs/tmpfs: tmpfs_vfsops.c

Log Message:
Fix a race where thread1 runs VOP_REMOVE() and gets preempted in
tmpfs_reclaim() before the call to tmpfs_free_node().  Thread2
runs VFS_FHTOVP() and gets a new vnode attached to the node thread1
is about to destroy.

Change tmpfs_fhtovp() to check the generation number after
tmpfs_vnode_get() succeeded.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/fs/tmpfs/tmpfs_vfsops.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/fs/tmpfs/tmpfs_vfsops.c
diff -u src/sys/fs/tmpfs/tmpfs_vfsops.c:1.55 src/sys/fs/tmpfs/tmpfs_vfsops.c:1.56
--- src/sys/fs/tmpfs/tmpfs_vfsops.c:1.55	Sat Nov 23 16:35:32 2013
+++ src/sys/fs/tmpfs/tmpfs_vfsops.c	Sat Jan  4 12:36:49 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vfsops.c,v 1.55 2013/11/23 16:35:32 rmind Exp $	*/
+/*	$NetBSD: tmpfs_vfsops.c,v 1.56 2014/01/04 12:36:49 hannken Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tmpfs_vfsops.c,v 1.55 2013/11/23 16:35:32 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: tmpfs_vfsops.c,v 1.56 2014/01/04 12:36:49 hannken Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -282,6 +282,7 @@ tmpfs_fhtovp(struct mount *mp, struct fi
 	tmpfs_mount_t *tmp = VFS_TO_TMPFS(mp);
 	tmpfs_node_t *node;
 	tmpfs_fid_t tfh;
+	int error;
 
 	if (fhp-fid_len != sizeof(tmpfs_fid_t)) {
 		return EINVAL;
@@ -290,19 +291,25 @@ tmpfs_fhtovp(struct mount *mp, struct fi
 
 	mutex_enter(tmp-tm_lock);
 	LIST_FOREACH(node, tmp-tm_nodes, tn_entries) {
-		if (node-tn_id != tfh.tf_id) {
-			continue;
-		}
-		if (TMPFS_NODE_GEN(node) != tfh.tf_gen) {
-			continue;
+		if (node-tn_id == tfh.tf_id) {
+			mutex_enter(node-tn_vlock);
+			break;
 		}
-		mutex_enter(node-tn_vlock);
-		break;
 	}
 	mutex_exit(tmp-tm_lock);
 
+	if (node == NULL)
+		return ESTALE;
 	/* Will release the tn_vlock. */
-	return node ? tmpfs_vnode_get(mp, node, vpp) : ESTALE;
+	if ((error = tmpfs_vnode_get(mp, node, vpp)) != 0)
+		return error;
+	if (TMPFS_NODE_GEN(node) != tfh.tf_gen) {
+		vput(*vpp);
+		*vpp = NULL;
+		return ESTALE;
+	}
+
+	return 0;
 }
 
 static int



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

2014-01-04 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan  4 13:23:22 UTC 2014

Modified Files:
src/sys/arch/m68k/fpe: fpu_log.c

Log Message:
FLOGNP1(-0.0) is -0.0, not +0.0.  Found by XM6i.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/m68k/fpe/fpu_log.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/fpe/fpu_log.c
diff -u src/sys/arch/m68k/fpe/fpu_log.c:1.17 src/sys/arch/m68k/fpe/fpu_log.c:1.18
--- src/sys/arch/m68k/fpe/fpu_log.c:1.17	Sat Apr 20 05:27:05 2013
+++ src/sys/arch/m68k/fpe/fpu_log.c	Sat Jan  4 13:23:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_log.c,v 1.17 2013/04/20 05:27:05 isaki Exp $	*/
+/*	$NetBSD: fpu_log.c,v 1.18 2014/01/04 13:23:22 isaki Exp $	*/
 
 /*
  * Copyright (c) 1995  Ken Nakata
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fpu_log.c,v 1.17 2013/04/20 05:27:05 isaki Exp $);
+__KERNEL_RCSID(0, $NetBSD: fpu_log.c,v 1.18 2014/01/04 13:23:22 isaki Exp $);
 
 #include sys/types.h
 #include sys/systm.h
@@ -593,6 +593,10 @@ fpu_lognp1(struct fpemu *fe)
 {
 	struct fpn *fp;
 
+	/* if src is +0/-0, return +0/-0 */
+	if (ISZERO(fe-fe_f2))
+		return fe-fe_f2;
+
 	/* build a 1.0 */
 	fp = fpu_const(fe-fe_f1, FPU_CONST_1);
 	/* fp = 1.0 + f2 */



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

2014-01-04 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Jan  4 13:24:35 UTC 2014

Modified Files:
src/sys/arch/evbsh3/t_sh7706lan: ssumci.c

Log Message:
fix CS bit.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbsh3/t_sh7706lan/ssumci.c

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

Modified files:

Index: src/sys/arch/evbsh3/t_sh7706lan/ssumci.c
diff -u src/sys/arch/evbsh3/t_sh7706lan/ssumci.c:1.2 src/sys/arch/evbsh3/t_sh7706lan/ssumci.c:1.3
--- src/sys/arch/evbsh3/t_sh7706lan/ssumci.c:1.2	Sat Jan 21 19:44:29 2012
+++ src/sys/arch/evbsh3/t_sh7706lan/ssumci.c	Sat Jan  4 13:24:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssumci.c,v 1.2 2012/01/21 19:44:29 nonaka Exp $	*/
+/*	$NetBSD: ssumci.c,v 1.3 2014/01/04 13:24:35 nonaka Exp $	*/
 
 /*-
  * Copyright (C) 2010 NONAKA Kimihiro non...@netbsd.org
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ssumci.c,v 1.2 2012/01/21 19:44:29 nonaka Exp $);
+__KERNEL_RCSID(0, $NetBSD: ssumci.c,v 1.3 2014/01/04 13:24:35 nonaka Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -151,7 +151,7 @@ do {	\
 #define SCPDR_CMD	0x04
 #define	SCPCR_CS_MASK	0x000C
 #define	SCPCR_CS_OUT	0x0004
-#define	SCPDR_CS	0x08
+#define	SCPDR_CS	0x02
 #define	SCPCR_EJECT	0x00C0
 #define	SCPDR_EJECT	0x08
 



CVS commit: src/sys/netinet

2014-01-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Jan  4 14:18:12 UTC 2014

Modified Files:
src/sys/netinet: udp_usrreq.c

Log Message:
IPv6 UDP uses the IPv4 pcb tables, and therefore the stats, so need
to create the percpu UDPv4 counters even in a v6-only system.


To generate a diff of this commit:
cvs rdiff -u -r1.192 -r1.193 src/sys/netinet/udp_usrreq.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/netinet/udp_usrreq.c
diff -u src/sys/netinet/udp_usrreq.c:1.192 src/sys/netinet/udp_usrreq.c:1.193
--- src/sys/netinet/udp_usrreq.c:1.192	Thu Jan  2 18:29:01 2014
+++ src/sys/netinet/udp_usrreq.c	Sat Jan  4 14:18:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp_usrreq.c,v 1.192 2014/01/02 18:29:01 pooka Exp $	*/
+/*	$NetBSD: udp_usrreq.c,v 1.193 2014/01/04 14:18:12 pooka Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: udp_usrreq.c,v 1.192 2014/01/02 18:29:01 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: udp_usrreq.c,v 1.193 2014/01/04 14:18:12 pooka Exp $);
 
 #include opt_inet.h
 #include opt_compat_netbsd.h
@@ -231,6 +231,7 @@ do_udpinit(void)
 {
 
 	in_pcbinit(udbtable, udbhashsize, udbhashsize);
+	udpstat_percpu = percpu_alloc(sizeof(uint64_t) * UDP_NSTATS);
 
 	MOWNER_ATTACH(udp_tx_mowner);
 	MOWNER_ATTACH(udp_rx_mowner);
@@ -252,7 +253,6 @@ udp_init(void)
 {
 
 	sysctl_net_inet_udp_setup(NULL);
-	udpstat_percpu = percpu_alloc(sizeof(uint64_t) * UDP_NSTATS);
 
 	udp_init_common();
 }



CVS commit: src/sbin/newfs_lfs

2014-01-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan  4 15:35:10 UTC 2014

Modified Files:
src/sbin/newfs_lfs: newfs_lfs.8

Log Message:
New sentence, new line. Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sbin/newfs_lfs/newfs_lfs.8

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

Modified files:

Index: src/sbin/newfs_lfs/newfs_lfs.8
diff -u src/sbin/newfs_lfs/newfs_lfs.8:1.22 src/sbin/newfs_lfs/newfs_lfs.8:1.23
--- src/sbin/newfs_lfs/newfs_lfs.8:1.22	Wed Apr  8 13:13:42 2009
+++ src/sbin/newfs_lfs/newfs_lfs.8	Sat Jan  4 15:35:10 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: newfs_lfs.8,v 1.22 2009/04/08 13:13:42 joerg Exp $
+.\	$NetBSD: newfs_lfs.8,v 1.23 2014/01/04 15:35:10 wiz Exp $
 .\
 .\ Copyright (c) 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -96,7 +96,7 @@ Create a log-structured file system (LFS
 This is the default, and this
 option is provided for compatibility only.
 .It Fl M Ar nsegs
-Specify 
+Specify
 .Em lfs_minfreeseg ,
 the number of segments left out of the amount allocated to user data.
 A higher number increases cleaner performance, while a lower number
@@ -123,7 +123,8 @@ but if
 is too close to
 .Em lfs_minfreeseg ,
 the cleaner will run without ceasing when the filesystem becomes close to
-full.  The default is the larger of 15 or the quantity
+full.
+The default is the larger of 15 or the quantity
 .Em lfs_minfreeseg
 / 2 + 1 .
 .It Fl r Ar ident



CVS commit: src/lib/libc/net

2014-01-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan  4 15:37:26 UTC 2014

Modified Files:
src/lib/libc/net: inet6_opt_init.3

Log Message:
Sort sections. Punctuation formatting nits.


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

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

Modified files:

Index: src/lib/libc/net/inet6_opt_init.3
diff -u src/lib/libc/net/inet6_opt_init.3:1.1 src/lib/libc/net/inet6_opt_init.3:1.2
--- src/lib/libc/net/inet6_opt_init.3:1.1	Fri May  5 00:03:21 2006
+++ src/lib/libc/net/inet6_opt_init.3	Sat Jan  4 15:37:26 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: inet6_opt_init.3,v 1.1 2006/05/05 00:03:21 rpaulo Exp $
+.\	$NetBSD: inet6_opt_init.3,v 1.2 2014/01/04 15:37:26 wiz Exp $
 .\	$KAME: inet6_opt_init.3,v 1.7 2004/12/27 05:08:23 itojun Exp $
 .\
 .\ Copyright (C) 2004 WIDE Project.
@@ -237,7 +237,7 @@ The option is returned in the arguments
 .Fa typep , lenp ,
 and
 .Fa databufp .
-.Fa typep, lenp,
+.Fa typep , lenp ,
 and
 .Fa databufp
 point to the 8-bit option type, the 8-bit option length and the option
@@ -299,11 +299,6 @@ by calculating
 which can be used when extracting option content with multiple fields.
 Robust receivers must verify alignment before calling this function.
 .\
-.Sh DIAGNOSTICS
-All the functions return
-\-1
-on an error.
-.\
 .Sh EXAMPLES
 RFC3542 gives comprehensive examples in Section 23.
 .Pp
@@ -311,6 +306,11 @@ KAME also provides examples in the
 .Pa advapitest
 directory of its kit.
 .\
+.Sh DIAGNOSTICS
+All the functions return
+\-1
+on an error.
+.\
 .Sh SEE ALSO
 .Rs
 .%A W. Stevens
@@ -328,10 +328,10 @@ directory of its kit.
 .%N RFC2460
 .%D December 1998
 .Re
-.Sh HISTORY
-The implementation first appeared in KAME advanced networking kit.
 .Sh STANDARDS
 The functions are documented in
 .Dq Advanced Sockets API for IPv6
 .Pq RFC3542 .
 .\
+.Sh HISTORY
+The implementation first appeared in KAME advanced networking kit.



CVS commit: src/lib/libc/net

2014-01-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan  4 15:37:46 UTC 2014

Modified Files:
src/lib/libc/net: inet6_rth_space.3

Log Message:
Sort sections. Remove trailing whitespace.


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

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

Modified files:

Index: src/lib/libc/net/inet6_rth_space.3
diff -u src/lib/libc/net/inet6_rth_space.3:1.1 src/lib/libc/net/inet6_rth_space.3:1.2
--- src/lib/libc/net/inet6_rth_space.3:1.1	Fri May  5 00:03:21 2006
+++ src/lib/libc/net/inet6_rth_space.3	Sat Jan  4 15:37:46 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: inet6_rth_space.3,v 1.1 2006/05/05 00:03:21 rpaulo Exp $
+.\	$NetBSD: inet6_rth_space.3,v 1.2 2014/01/04 15:37:46 wiz Exp $
 .\	$KAME: inet6_rth_space.3,v 1.7 2005/01/05 03:00:44 itojun Exp $
 .\
 .\ Copyright (C) 2004 WIDE Project.
@@ -60,7 +60,7 @@
 The IPv6 Advanced API, RFC 3542, defines the functions that an
 application calls to build and examine IPv6 Routing headers.
 Routing headers are used to perform source routing in IPv6 networks.
-The RFC uses the word 
+The RFC uses the word
 .Dq segments
 to describe addresses and that is the term used here as well.
 All of the functions are defined in the
@@ -81,14 +81,14 @@ The
 .Fn inet6_rth_space
 function returns the number of bytes required to hold a Routing Header
 of the type, specified in the
-.Fa type 
+.Fa type
 argument and containing the number of addresses specified in the
 .Fa segments
 argumment.
-When the type is 
+When the type is
 .Dv IPV6_RTHDR_TYPE_0
 the number of segments must be from 0 through 127.
-Routing headers of type 
+Routing headers of type
 .Dv IPV6_RTHDR_TYPE_2
 contain only one segment, and are only used with Mobile IPv6.
 The return value from this function is the number of bytes required to
@@ -165,20 +165,25 @@ The
 .Fa index
 is the location in the routing header from which the application wants
 to retrieve an address.
-The 
-.Fa index 
+The
+.Fa index
 parameter must have a value between 0 and one less than the number of
 segments present in the routing header.
 The
-.Fn inet6_rth_segments 
+.Fn inet6_rth_segments
 function, described in the last section, should be used to determine
 the total number of segments in the routing header.
 The
 .Fn inet6_rth_getaddr
-function returns a pointer to an IPv6 address on success or 
+function returns a pointer to an IPv6 address on success or
 .Dv NULL
 when an error has occurred.
 .\
+.Sh EXAMPLES
+RFC 3542 gives extensive examples in Section 21, Appendix B.
+.Pp
+KAME also provides examples in the advapitest directory of its kit.
+.\
 .Sh DIAGNOSTICS
 The
 .Fn inet6_rth_space
@@ -197,11 +202,6 @@ and
 .Fn inet6_rth_reverse
 functions return 0 on success, or \-1 upon an error.
 .\
-.Sh EXAMPLES
-RFC 3542 gives extensive examples in Section 21, Appendix B.
-.Pp
-KAME also provides examples in the advapitest directory of its kit.
-.\
 .Sh SEE ALSO
 .Rs
 .%A W. Stevens



CVS commit: src/share/man/man4

2014-01-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan  4 15:40:25 UTC 2014

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

Log Message:
Sort sections.


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

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

Modified files:

Index: src/share/man/man4/ddc.4
diff -u src/share/man/man4/ddc.4:1.3 src/share/man/man4/ddc.4:1.4
--- src/share/man/man4/ddc.4:1.3	Sat Jul 20 21:39:58 2013
+++ src/share/man/man4/ddc.4	Sat Jan  4 15:40:25 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: ddc.4,v 1.3 2013/07/20 21:39:58 wiz Exp $
+.\	$NetBSD: ddc.4,v 1.4 2014/01/04 15:40:25 wiz Exp $
 .\
 .\ Copyright (c) 2006 Itronix Inc.
 .\ All rights reserved.
@@ -42,12 +42,6 @@ The
 .Nm
 driver provides support for accessing the VESA Display Data Channel Version 2
 supported by many video displays.
-.Sh BUGS
-This driver does not provide any mechanism for access from user applications.
-Its only use at this point is to provide a means for framebuffer device
-drivers to query monitor description data (EDID) using a specialized
-in-kernel API.  No support for sending control commands to display devices
-is provided.
 .Sh SEE ALSO
 .Xr iic 4 ,
 .Xr ddc 9 ,
@@ -59,3 +53,9 @@ device appeared in
 .Nx 4.0 .
 .Sh AUTHORS
 .An Garrett D'Amore Aq Mt gdam...@netbsd.org
+.Sh BUGS
+This driver does not provide any mechanism for access from user applications.
+Its only use at this point is to provide a means for framebuffer device
+drivers to query monitor description data (EDID) using a specialized
+in-kernel API.
+No support for sending control commands to display devices is provided.



CVS commit: src/share/man/man9

2014-01-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan  4 15:40:55 UTC 2014

Modified Files:
src/share/man/man9: edid.9

Log Message:
Sort sections.


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

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

Modified files:

Index: src/share/man/man9/edid.9
diff -u src/share/man/man9/edid.9:1.8 src/share/man/man9/edid.9:1.9
--- src/share/man/man9/edid.9:1.8	Thu Jul 25 21:29:00 2013
+++ src/share/man/man9/edid.9	Sat Jan  4 15:40:55 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: edid.9,v 1.8 2013/07/25 21:29:00 wiz Exp $
+.\	$NetBSD: edid.9,v 1.9 2014/01/04 15:40:55 wiz Exp $
 .\
 .\ Copyright 2006 Itronix Inc.
 .\ All rights reserved.
@@ -95,15 +95,6 @@ The
 .Fn edid_parse
 function returns zero if the data was successfully parsed, and
 non-zero otherwise.
-.Sh CODE REFERENCES
-The EDID subsystem is implemented within the file
-.Pa sys/dev/videomode/edid.c .
-.Pp
-The EDID subsystem also makes use of VESA Generalized Timing Formula located
-located in
-.Pa sys/dev/videomode/vesagtf.c
-and the generic videomode database located in
-.Pa sys/dev/videomode/videomode.c .
 .Sh EXAMPLES
 The following code uses these functions
 to retrieve and print information about a monitor:
@@ -121,6 +112,15 @@ to retrieve and print information about 
 		edid_print(info);
 	...
 .Ed
+.Sh CODE REFERENCES
+The EDID subsystem is implemented within the file
+.Pa sys/dev/videomode/edid.c .
+.Pp
+The EDID subsystem also makes use of VESA Generalized Timing Formula located
+located in
+.Pa sys/dev/videomode/vesagtf.c
+and the generic videomode database located in
+.Pa sys/dev/videomode/videomode.c .
 .Sh SEE ALSO
 .Xr ddc 9 ,
 .Xr iic 9



CVS commit: src/share/man/man9

2014-01-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan  4 15:41:59 UTC 2014

Modified Files:
src/share/man/man9: ddc.9

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man9/ddc.9

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

Modified files:

Index: src/share/man/man9/ddc.9
diff -u src/share/man/man9/ddc.9:1.6 src/share/man/man9/ddc.9:1.7
--- src/share/man/man9/ddc.9:1.6	Sun Jul 21 10:14:55 2013
+++ src/share/man/man9/ddc.9	Sat Jan  4 15:41:59 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: ddc.9,v 1.6 2013/07/21 10:14:55 njoly Exp $
+.\	$NetBSD: ddc.9,v 1.7 2014/01/04 15:41:59 wiz Exp $
 .\
 .\ Copyright 2006 Itronix Inc.
 .\ All rights reserved.
@@ -47,9 +47,9 @@
 The
 .Fn ddc_read_edid
 reads a VESA Extended Display Identification Data block (EDID) via
-VESA Display Data Channel (DDCv2).  DDCv2 is a protocol for data exchange
-between display devices (such as monitors and flat panels) and host
-machines using an I2C bus.
+VESA Display Data Channel (DDCv2).
+DDCv2 is a protocol for data exchange between display devices (such
+as monitors and flat panels) and host machines using an I2C bus.
 .Pp
 The
 .Fa tag
@@ -60,9 +60,10 @@ The
 argument is a pointer to a buffer where the EDID data will be stored.
 The
 .Fa len
-argument is the amount of data to read into the buffer.  (The buffer must be
-large enough.)  Typically, this value will be 128, which is the size of a
-normal EDID data block.
+argument is the amount of data to read into the buffer.
+(The buffer must be large enough.)
+Typically, this value will be 128, which is the size of a normal
+EDID data block.
 .Pp
 Normally the EDID data block will be post-processed with the
 .Fn edid_parse



CVS commit: src/usr.bin/ruptime

2014-01-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan  4 15:43:28 UTC 2014

Modified Files:
src/usr.bin/ruptime: ruptime.1

Log Message:
Remove second copy for RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/ruptime/ruptime.1

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/ruptime/ruptime.1
diff -u src/usr.bin/ruptime/ruptime.1:1.11 src/usr.bin/ruptime/ruptime.1:1.12
--- src/usr.bin/ruptime/ruptime.1:1.11	Sat May 13 12:41:54 2006
+++ src/usr.bin/ruptime/ruptime.1	Sat Jan  4 15:43:27 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: ruptime.1,v 1.11 2006/05/13 12:41:54 liamjfoy Exp $
+.\	$NetBSD: ruptime.1,v 1.12 2014/01/04 15:43:27 wiz Exp $
 .\
 .\ Copyright (c) 1983, 1990, 1993, 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -28,7 +28,6 @@
 .\ SUCH DAMAGE.
 .\
 .\ from: @(#)ruptime.1	8.2 (Berkeley) 4/5/94
-.\	$NetBSD: ruptime.1,v 1.11 2006/05/13 12:41:54 liamjfoy Exp $
 .\
 .Dd August 9, 2005
 .Dt RUPTIME 1



CVS commit: src/lib/libc/sys

2014-01-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan  4 15:54:27 UTC 2014

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

Log Message:
Merge EINVAL descriptions.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/lib/libc/sys/sigaction.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/sigaction.2
diff -u src/lib/libc/sys/sigaction.2:1.44 src/lib/libc/sys/sigaction.2:1.45
--- src/lib/libc/sys/sigaction.2:1.44	Sun Oct 14 08:49:28 2012
+++ src/lib/libc/sys/sigaction.2	Sat Jan  4 15:54:27 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: sigaction.2,v 1.44 2012/10/14 08:49:28 dholland Exp $
+.\	$NetBSD: sigaction.2,v 1.45 2014/01/04 15:54:27 wiz Exp $
 .\
 .\ Copyright (c) 1980, 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -318,14 +318,12 @@ points to memory that is not a valid par
 address space.
 .It Bq Er EINVAL
 .Fa sig
-is not a valid signal number.
-.It Bq Er EINVAL
-An attempt is made to ignore or supply a handler for
+is not a valid signal number;
+or an attempt is made to ignore or supply a handler for
 .Dv SIGKILL
 or
-.Dv SIGSTOP .
-.It Bq Er EINVAL
-The
+.Dv SIGSTOP ;
+or the
 .Em sa_flags
 word contains bits other than
 .Dv SA_NOCLDSTOP ,



CVS commit: src/sys/dev/ic

2014-01-04 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Jan  4 16:37:05 UTC 2014

Modified Files:
src/sys/dev/ic: ct65550.c

Log Message:
__unuse the right function
( note to self - don't commit half asleep )


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/ct65550.c

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

Modified files:

Index: src/sys/dev/ic/ct65550.c
diff -u src/sys/dev/ic/ct65550.c:1.9 src/sys/dev/ic/ct65550.c:1.10
--- src/sys/dev/ic/ct65550.c:1.9	Fri Jan  3 15:57:12 2014
+++ src/sys/dev/ic/ct65550.c	Sat Jan  4 16:37:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ct65550.c,v 1.9 2014/01/03 15:57:12 macallan Exp $	*/
+/*	$NetBSD: ct65550.c,v 1.10 2014/01/04 16:37:05 macallan Exp $	*/
 
 /*
  * Copyright (c) 2006 Michael Lorenz
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ct65550.c,v 1.9 2014/01/03 15:57:12 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: ct65550.c,v 1.10 2014/01/04 16:37:05 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -151,7 +151,7 @@ chipsfb_read_vga(struct chipsfb_softc *s
 	return bus_space_read_1(sc-sc_iot, sc-sc_ioregh, reg);
 }
 
-__unused static inline uint8_t
+static inline uint8_t
 chipsfb_read_indexed(struct chipsfb_softc *sc, uint32_t reg, uint8_t index)
 {
 
@@ -159,7 +159,7 @@ chipsfb_read_indexed(struct chipsfb_soft
 	return chipsfb_read_vga(sc, reg | 0x0001);
 }
 
-static inline void
+__unused static inline void
 chipsfb_write_indexed(struct chipsfb_softc *sc, uint32_t reg, uint8_t index,
 uint8_t val)
 {



CVS commit: src/usr.sbin/cpuctl/arch

2014-01-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan  4 18:13:48 UTC 2014

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
- Rename x86_print_cacheinfo() to x86_print_cache_and_tlb_info() because
  this function prints TLB info, too.
- Remove an extra printf when verbose flag is set.
- Print the highest extended info level as the basic info level.
- Sort function.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/cpuctl/arch/i386.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.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.53 src/usr.sbin/cpuctl/arch/i386.c:1.54
--- src/usr.sbin/cpuctl/arch/i386.c:1.53	Mon Dec 23 12:35:33 2013
+++ src/usr.sbin/cpuctl/arch/i386.c	Sat Jan  4 18:13:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.53 2013/12/23 12:35:33 msaitoh Exp $	*/
+/*	$NetBSD: i386.c,v 1.54 2014/01/04 18:13:48 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: i386.c,v 1.53 2013/12/23 12:35:33 msaitoh Exp $);
+__RCSID($NetBSD: i386.c,v 1.54 2014/01/04 18:13:48 msaitoh Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -223,13 +223,13 @@ static void	cpu_probe_base_features(stru
 static void	cpu_probe_features(struct cpu_info *);
 static void	print_bits(const char *, const char *, const char *, uint32_t);
 static void	identifycpu_cpuids(struct cpu_info *);
+static const struct x86_cache_info *cache_info_lookup(
+const struct x86_cache_info *, uint8_t);
 static const char *print_cache_config(struct cpu_info *, int, const char *,
 const char *);
 static const char *print_tlb_config(struct cpu_info *, int, const char *,
 const char *);
-static const struct x86_cache_info *cache_info_lookup(
-const struct x86_cache_info *, uint8_t);
-static void	x86_print_cacheinfo(struct cpu_info *);
+static void	x86_print_cache_and_tlb_info(struct cpu_info *);
 
 /*
  * Note: these are just the ones that may not have a cpuid instruction.
@@ -1432,11 +1432,12 @@ cpu_probe_base_features(struct cpu_info 
 	ci-ci_vendor[2] = descs[2];
 	ci-ci_vendor[1] = descs[3];
 	ci-ci_vendor[3] = 0;
+
+	aprint_verbose(%s: highest basic info %08x\n, cpuname,
+	ci-ci_cpuid_level);
 	if (verbose) {
 		int bf;
 		
-		printf(%s: cpuid basic function max = %08x\n, cpuname,
-		descs[0]);
 		for (bf = 0; bf = ci-ci_cpuid_level; bf++) {
 			x86_cpuid(bf, descs);
 			printf(%s: %08x: %08x %08x %08x %08x\n, cpuname,
@@ -1449,17 +1450,17 @@ cpu_probe_base_features(struct cpu_info 
 	 * - Get cpuid extended function's max level.
 	 */
 	x86_cpuid(0x8000, descs);
-	if (descs[0] =  0x8000)
+	if (descs[0] =  0x8000) {
 		ci-ci_cpuid_extlevel = descs[0];
-	else {
+		aprint_verbose(%s: highest extended info %08x\n, cpuname,
+		ci-ci_cpuid_extlevel);
+	} else {
 		/* Set lower value than 0x8000 */
 		ci-ci_cpuid_extlevel = 0;
 	}
 	if (verbose) {
 		unsigned int ef;
 
-		printf(%s: cpuid extended function max = %08x\n, cpuname,
-		descs[0]);
 		for (ef = 0x8000; ef = ci-ci_cpuid_extlevel; ef++) {
 			x86_cpuid(ef, descs);
 			printf(%s: %08x: %08x %08x %08x %08x\n, cpuname,
@@ -1594,7 +1595,6 @@ identifycpu_cpuids(struct cpu_info *ci)
 	u_int core_max = 1;	/* core per package */
 	u_int smt_bits, core_bits;
 	uint32_t descs[4];
-	uint32_t highest_basic_info;
 
 	aprint_verbose(%s: Initial APIC ID %u\n, cpuname, ci-ci_initapicid);
 	ci-ci_packageid = ci-ci_initapicid;
@@ -1612,9 +1612,7 @@ identifycpu_cpuids(struct cpu_info *ci)
 		x86_cpuid(1, descs);
 		lp_max = (descs[1]  16)  0xff;
 	}
-	x86_cpuid(0, descs);
-	highest_basic_info = descs[0];
-	if (highest_basic_info = 4) {
+	if (ci-ci_cpuid_level = 4) {
 		x86_cpuid2(4, 0, descs);
 		core_max = (descs[0]  26) + 1;
 	}
@@ -1824,7 +1822,7 @@ identifycpu(int fd, const char *cpuname)
 			x86_xgetbv());
 	}
 
-	x86_print_cacheinfo(ci);
+	x86_print_cache_and_tlb_info(ci);
 
 	if (ci-ci_cpuid_level = 3  (ci-ci_feat_val[0]  CPUID_PN)) {
 		aprint_verbose(%s: serial number %04X-%04X-%04X-%04X-%04X-%04X\n,
@@ -1881,14 +1879,9 @@ identifycpu(int fd, const char *cpuname)
 		}
 	} else if (cpu_vendor == CPUVENDOR_INTEL) {
 		uint32_t data[4];
-		uint32_t highest_basic_info;
-		uint32_t bi_index;
+		int32_t bi_index;
 
-		x86_cpuid(0x, data);
-		highest_basic_info = data[0];
-		aprint_verbose(%s: highest basic info %08x\n, cpuname,
-		highest_basic_info);
-		for (bi_index = 1; bi_index = highest_basic_info; bi_index++) {
+		for (bi_index = 1; bi_index = ci-ci_cpuid_level; bi_index++) {
 			x86_cpuid(bi_index, data);
 			switch (bi_index) {
 			case 6:
@@ -1952,6 +1945,19 @@ identifycpu(int fd, const char *cpuname)
 		   ucvers.intel1.ucodeversion, ucvers.intel1.platformid);
 }
 
+static const struct x86_cache_info *

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

2014-01-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan  4 19:08:43 UTC 2014

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

Log Message:
Remove duplicated entry. Modify comments a bit.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/x86/include/specialreg.h

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

Modified files:

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.75 src/sys/arch/x86/include/specialreg.h:1.76
--- src/sys/arch/x86/include/specialreg.h:1.75	Wed Dec 25 13:14:36 2013
+++ src/sys/arch/x86/include/specialreg.h	Sat Jan  4 19:08:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.75 2013/12/25 13:14:36 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.76 2014/01/04 19:08:43 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -228,29 +228,6 @@
 		? 0 : (CPUID_TO_EXTMODEL(cpuid)  4)))
 
 /*
- * CPUID Processor extended state Enumeration Fn000d
- *
- * %ecx == 0: supported features info:
- *	%edx:%eax bits valid for XCR0
- *	%ebx Save area size for features enabled in XCR0
- *	%ecx Maximim save area size for all cpu features
- *
- * %ecx == 1:
- *	%eax: Bit 0 = xsaveopt instruction avalaible (sandy bridge onwards)
- *
- * %ecx = 2: Save area details for XCR0 bit n
- *	%eax: size of save area for this feature
- *	%ebx: offset of save area for this feature
- *	%ecx, %edx: reserved
- *	All of %eax, %ebx, %ecx and %edx are zero for unsupported features.
- */
-
-#define	CPUID_PES1_XSAVEOPT	0x0001	/* xsaveopt instruction */
-
-#define CPUID_PES1_FLAGS	\20 \
-	\1 XSAVEOPT
-
-/*
  * Intel Deterministic Cache Parameter Leaf
  * Fn_0004
  */
@@ -340,32 +317,22 @@
 	\35 AVX512CD\36 SHA
 
 /*
- * CPUID Processor extended state Enumeration Fn000d %eax
- *
- * Extended Control Register XCR0
- */
-#define	XCR0_X87	0x0001	/* x87 FPU/MMX state */
-#define	XCR0_SSE	0x0002	/* SSE state */
-#define	XCR0_AVX	0x0004	/* AVX state (ymmn registers) */
-
-#define XCR0_FLAGS1	\20 \
-	\1 x87	\2 SSE	\3 AVX	\4 B03
-
-/*
  * CPUID Processor extended state Enumeration Fn000d
  *
  * %ecx == 0: supported features info:
- *	%edx:%eax bits valid for XCR0
+ *	%eax: Valid bits of lower 32bits of XCR0
  *	%ebx Save area size for features enabled in XCR0
  *	%ecx Maximim save area size for all cpu features
+ *	%edx: Valid bits of upper 32bits of XCR0
  *
- * %ecx == 1: Bit 0 = xsaveopt instruction avalaible (sandy bridge onwards)
+ * %ecx == 1:
+ *	%eax: Bit 0 = xsaveopt instruction avalaible (sandy bridge onwards)
  *
  * %ecx = 2: Save area details for XCR0 bit n
  *	%eax: size of save area for this feature
  *	%ebx: offset of save area for this feature
  *	%ecx, %edx: reserved
- *	All of %eax, %ebx, %ecx and %edx zero for unsupported features.
+ *	All of %eax, %ebx, %ecx and %edx are zero for unsupported features.
  */
 
 #define	CPUID_PES1_XSAVEOPT	0x0001	/* xsaveopt instruction */



CVS commit: src/external/gpl3/binutils/dist/ld/scripttempl

2014-01-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  4 20:17:42 UTC 2014

Modified Files:
src/external/gpl3/binutils/dist/ld/scripttempl: elf.sc

Log Message:
gcc-4.8 has begun putting code in .text.unlikely etc. This breaks our
assumption that .text code comes first in kernels about bootblock so
that the first symbol defined becomes the start address. This change
puts .text before other .text like sections.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/dist/ld/scripttempl/elf.sc

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

Modified files:

Index: src/external/gpl3/binutils/dist/ld/scripttempl/elf.sc
diff -u src/external/gpl3/binutils/dist/ld/scripttempl/elf.sc:1.4 src/external/gpl3/binutils/dist/ld/scripttempl/elf.sc:1.5
--- src/external/gpl3/binutils/dist/ld/scripttempl/elf.sc:1.4	Sun Sep 29 10:03:31 2013
+++ src/external/gpl3/binutils/dist/ld/scripttempl/elf.sc	Sat Jan  4 15:17:42 2014
@@ -473,11 +473,12 @@ cat EOF
   .text ${RELOCATING-0} :
   {
 ${RELOCATING+${TEXT_START_SYMBOLS}}
+*(.text)
 ${RELOCATING+*(.text.unlikely .text.*_unlikely)}
 ${RELOCATING+*(.text.exit .text.exit.*)}
 ${RELOCATING+*(.text.startup .text.startup.*)}
 ${RELOCATING+*(.text.hot .text.hot.*)}
-*(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
+*(.stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
 /* .gnu.warning sections are handled specially by elf32.em.  */
 *(.gnu.warning)
 ${RELOCATING+${OTHER_TEXT_SECTIONS}}



CVS commit: src/sys/arch/sun68k/stand

2014-01-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  4 20:19:33 UTC 2014

Modified Files:
src/sys/arch/sun68k/stand: Makefile.inc
Removed Files:
src/sys/arch/sun68k/stand: boot.ldscript

Log Message:
undo the ld script hack now that the default scripts have been modified to
do this.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/sun68k/stand/Makefile.inc
cvs rdiff -u -r1.1 -r0 src/sys/arch/sun68k/stand/boot.ldscript

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/sun68k/stand/Makefile.inc
diff -u src/sys/arch/sun68k/stand/Makefile.inc:1.22 src/sys/arch/sun68k/stand/Makefile.inc:1.23
--- src/sys/arch/sun68k/stand/Makefile.inc:1.22	Fri Jan  3 16:21:17 2014
+++ src/sys/arch/sun68k/stand/Makefile.inc	Sat Jan  4 15:19:33 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.22 2014/01/03 21:21:17 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.23 2014/01/04 20:19:33 christos Exp $
 
 # Must have S=/usr/src/sys (or equivalent)
 # But note: this is w.r.t. a subdirectory
@@ -39,8 +39,7 @@ ${SA_PROG}.bin : ${SA_PROG}
 	${OBJCOPY} --output-target=binary ${SA_PROG} $@
 
 ${SA_PROG} : ${OBJS} ${DPADD} ${SRTLIB}
-	${LD} -N -Ttext ${RELOC} -e start ${SA_LDFLAGS} \
-	-T${.CURDIR}/../boot.ldscript -o $@ \
+	${LD} -N -Ttext ${RELOC} -e start ${SA_LDFLAGS} -o $@ \
 	${SRTOBJ} ${OBJS} ${LDADD} ${SRTLIB}
 	@${SIZE} $@
 



CVS commit: src/sys/arch/i386/stand/boot

2014-01-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  4 20:18:50 UTC 2014

Modified Files:
src/sys/arch/i386/stand/boot: Makefile.boot
Removed Files:
src/sys/arch/i386/stand/boot: boot.ldscript

Log Message:
undo the linker script hack now that the linker scripts do this.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/i386/stand/boot/Makefile.boot
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/boot/boot.ldscript

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

Modified files:

Index: src/sys/arch/i386/stand/boot/Makefile.boot
diff -u src/sys/arch/i386/stand/boot/Makefile.boot:1.62 src/sys/arch/i386/stand/boot/Makefile.boot:1.63
--- src/sys/arch/i386/stand/boot/Makefile.boot:1.62	Wed Jan  1 17:07:54 2014
+++ src/sys/arch/i386/stand/boot/Makefile.boot	Sat Jan  4 15:18:50 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.boot,v 1.62 2014/01/01 22:07:54 christos Exp $
+# $NetBSD: Makefile.boot,v 1.63 2014/01/04 20:18:50 christos Exp $
 
 S=	${.CURDIR}/../../../../..
 
@@ -33,7 +33,7 @@ BINMODE=444
 
 .PATH:	${.CURDIR}/.. ${.CURDIR}/../../lib
 
-LDFLAGS+= -nostdlib -Wl,-N -Wl,-e,boot_start -T${.CURDIR}/../boot.ldscript
+LDFLAGS+= -nostdlib -Wl,-N -Wl,-e,boot_start
 CPPFLAGS+= -I ${.CURDIR}/..  -I ${.CURDIR}/../../lib -I ${S}/lib/libsa
 CPPFLAGS+= -I ${.OBJDIR}
 # Make sure we override any optimization options specified by the user



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

2014-01-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan  4 21:09:39 UTC 2014

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

Log Message:
Add Energy Performance Bias bit.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/x86/include/specialreg.h

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

Modified files:

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.76 src/sys/arch/x86/include/specialreg.h:1.77
--- src/sys/arch/x86/include/specialreg.h:1.76	Sat Jan  4 19:08:43 2014
+++ src/sys/arch/x86/include/specialreg.h	Sat Jan  4 21:09:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.76 2014/01/04 19:08:43 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.77 2014/01/04 21:09:39 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -276,8 +276,9 @@
  * Power Management, Fn_0006 - %ecx.
  */
 #define CPUID_DSPM_HWF	0x0001	/* MSR_APERF/MSR_MPERF available */
+#define CPUID_DSPM_EPB	0x0008	/* Energy Performance Bias */
 
-#define CPUID_DSPM_FLAGS1	\20 \1 HWF
+#define CPUID_DSPM_FLAGS1	\20 \1 HWF \4 EPB
 
 /*
  * Intel Structured Extended Feature leaf



CVS commit: [LLVM] src/external/bsd/libc++/dist/libcxx

2014-01-04 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Jan  4 21:41:01 UTC 2014

Removed Files:
src/external/bsd/libc++/dist/libcxx/include [LLVM]: dynarray optional
src/external/bsd/libc++/dist/libcxx/test/containers [LLVM]:
DefaultOnly.h min_allocator.h test_allocator.h
src/external/bsd/libc++/dist/libcxx/test/containers/sequences/list 
[LLVM]:
db_iterators_1.pass.cpp
src/external/bsd/libc++/dist/libcxx/test/containers/sequences/vector 
[LLVM]:
db_iterators_1.pass.cpp
src/external/bsd/libc++/dist/libcxx/test/re [LLVM]: test_allocator.h
src/external/bsd/libc++/dist/libcxx/test/strings/basic.string [LLVM]:
min_allocator.h test_allocator.h
src/external/bsd/libc++/dist/libcxx/test/utilities/allocator.adaptor 
[LLVM]:
allocators.h

src/external/bsd/libc++/dist/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func
 [LLVM]:
test_allocator.h

src/external/bsd/libc++/dist/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared
 [LLVM]:
test_allocator.h
src/external/bsd/libc++/dist/libcxx/test/utilities/tuple/tuple.tuple 
[LLVM]:
DefaultOnly.h allocators.h

Log Message:
Clean removed files.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/libc++/dist/libcxx/include/dynarray \
src/external/bsd/libc++/dist/libcxx/include/optional
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/libc++/dist/libcxx/test/containers/DefaultOnly.h \
src/external/bsd/libc++/dist/libcxx/test/containers/min_allocator.h \
src/external/bsd/libc++/dist/libcxx/test/containers/test_allocator.h
cvs rdiff -u -r1.1.1.2 -r0 \

src/external/bsd/libc++/dist/libcxx/test/containers/sequences/list/db_iterators_1.pass.cpp
cvs rdiff -u -r1.1.1.2 -r0 \

src/external/bsd/libc++/dist/libcxx/test/containers/sequences/vector/db_iterators_1.pass.cpp
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/libc++/dist/libcxx/test/re/test_allocator.h
cvs rdiff -u -r1.1.1.1 -r0 \

src/external/bsd/libc++/dist/libcxx/test/strings/basic.string/min_allocator.h \

src/external/bsd/libc++/dist/libcxx/test/strings/basic.string/test_allocator.h
cvs rdiff -u -r1.1.1.1 -r0 \

src/external/bsd/libc++/dist/libcxx/test/utilities/allocator.adaptor/allocators.h
cvs rdiff -u -r1.1.1.1 -r0 \

src/external/bsd/libc++/dist/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/test_allocator.h
cvs rdiff -u -r1.1.1.1 -r0 \

src/external/bsd/libc++/dist/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/test_allocator.h
cvs rdiff -u -r1.1.1.1 -r0 \

src/external/bsd/libc++/dist/libcxx/test/utilities/tuple/tuple.tuple/DefaultOnly.h
 \

src/external/bsd/libc++/dist/libcxx/test/utilities/tuple/tuple.tuple/allocators.h

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



CVS commit: src/sys/opencrypto

2014-01-04 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jan  4 21:42:42 UTC 2014

Modified Files:
src/sys/opencrypto: cryptodev.c

Log Message:
When crypto(4) is built-in, crypto_modcmd() doesn't need to handle all
the auto-config stuff.

While here, ensure that we depend on opencrypto.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/opencrypto/cryptodev.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/opencrypto/cryptodev.c
diff -u src/sys/opencrypto/cryptodev.c:1.70 src/sys/opencrypto/cryptodev.c:1.71
--- src/sys/opencrypto/cryptodev.c:1.70	Wed Jan  1 16:06:01 2014
+++ src/sys/opencrypto/cryptodev.c	Sat Jan  4 21:42:42 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cryptodev.c,v 1.70 2014/01/01 16:06:01 pgoyette Exp $ */
+/*	$NetBSD: cryptodev.c,v 1.71 2014/01/04 21:42:42 pgoyette Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $	*/
 /*	$OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $	*/
 
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cryptodev.c,v 1.70 2014/01/01 16:06:01 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: cryptodev.c,v 1.71 2014/01/04 21:42:42 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -2124,13 +2124,14 @@ crypto_match(device_t parent, cfdata_t d
 	return 1;
 }
 
-MODULE(MODULE_CLASS_DRIVER, crypto, NULL);
+MODULE(MODULE_CLASS_DRIVER, crypto, opencrypto);
 
 CFDRIVER_DECL(crypto, DV_DULL, NULL);
 
 CFATTACH_DECL2_NEW(crypto, 0, crypto_match, crypto_attach, crypto_detach,
 NULL, NULL, NULL);
 
+#ifdef _MODULE
 static int cryptoloc[] = { -1, -1 };
 
 static struct cfdata crypto_cfdata[] = {
@@ -2145,15 +2146,20 @@ static struct cfdata crypto_cfdata[] = {
 	},
 	{ NULL, NULL, 0, 0, NULL, 0, NULL }
 };
+#endif
 
 static int
 crypto_modcmd(modcmd_t cmd, void *arg)
 {
+	int error = 0;
+#ifdef _MODULE
 	devmajor_t cmajor = NODEVMAJOR, bmajor = NODEVMAJOR;
-	int error;
+#endif
 
 	switch (cmd) {
 	case MODULE_CMD_INIT:
+#ifdef _MODULE
+
 		error = config_cfdriver_attach(crypto_cd);
 		if (error) {
 			return error;
@@ -2194,9 +2200,11 @@ crypto_modcmd(modcmd_t cmd, void *arg)
 		}
 
 		(void)config_attach_pseudo(crypto_cfdata);
+#endif
 
-		return 0;
+		return error;
 	case MODULE_CMD_FINI:
+#ifdef _MODULE
 		error = config_cfdata_detach(crypto_cfdata);
 		if (error) {
 			return error;
@@ -2205,8 +2213,9 @@ crypto_modcmd(modcmd_t cmd, void *arg)
 		config_cfattach_detach(crypto_cd.cd_name, crypto_ca);
 		config_cfdriver_detach(crypto_cd);
 		devsw_detach(NULL, crypto_cdevsw);
+#endif
 
-		return 0;
+		return error;
 	default:
 		return ENOTTY;
 	}



CVS commit: src/sys/kern

2014-01-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan  5 00:53:53 UTC 2014

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

Log Message:
avoid use-after-free in *coredump().
fixes kernel crashes during coredump on sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/kern/core_elf32.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/core_elf32.c
diff -u src/sys/kern/core_elf32.c:1.42 src/sys/kern/core_elf32.c:1.43
--- src/sys/kern/core_elf32.c:1.42	Sat Jan  4 00:10:03 2014
+++ src/sys/kern/core_elf32.c	Sun Jan  5 00:53:53 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: core_elf32.c,v 1.42 2014/01/04 00:10:03 dsl Exp $	*/
+/*	$NetBSD: core_elf32.c,v 1.43 2014/01/05 00:53:53 mrg Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(1, $NetBSD: core_elf32.c,v 1.42 2014/01/04 00:10:03 dsl Exp $);
+__KERNEL_RCSID(1, $NetBSD: core_elf32.c,v 1.43 2014/01/05 00:53:53 mrg Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_coredump.h
@@ -116,6 +116,7 @@ ELFNAMEEND(coredump)(struct lwp *l, stru
 
 	struct note_state ns;
 	struct note_buf *nb;
+	struct note_buf *nb_next;
 
 	psections = NULL;
 
@@ -256,8 +257,10 @@ ELFNAMEEND(coredump)(struct lwp *l, stru
   out:
 	if (psections)
 		kmem_free(psections, psectionssize);
-	for (; (nb = ns.ns_first) != NULL; ns.ns_first = nb-nb_next)
+	for (; (nb = ns.ns_first) != NULL; ns.ns_first = nb_next) {
+		nb_next = nb-nb_next;
 		kmem_free(nb, sizeof *nb);
+	}
 	return (error);
 }
 



CVS commit: src/sys/arch/next68k/next68k

2014-01-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan  5 06:30:48 UTC 2014

Modified Files:
src/sys/arch/next68k/next68k: pmap_bootstrap.c

Log Message:
Move physmem calculations before nptpage initialization.

Should fix next68k specific part of PR port-m68k/45915
(panic: pmap_enter_ptpage: can't get KPT page), and
this is the last possible m68k MD part of this PR.

Note this change is not tested on the actual machine (yet),
but as noted in comment next68k/pmap_bootstrap.c is based on
the mvme68k one which has been fixed by the similar diff.

Should be pulled up to all netbsd-6 branches.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/next68k/next68k/pmap_bootstrap.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/next68k/next68k/pmap_bootstrap.c
diff -u src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.42 src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.43
--- src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.42	Fri Feb 10 06:28:39 2012
+++ src/sys/arch/next68k/next68k/pmap_bootstrap.c	Sun Jan  5 06:30:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.42 2012/02/10 06:28:39 mhitch Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.43 2014/01/05 06:30:48 tsutsui Exp $	*/
 
 /*
  * This file was taken from mvme68k/mvme68k/pmap_bootstrap.c
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.42 2012/02/10 06:28:39 mhitch Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.43 2014/01/05 06:30:48 tsutsui Exp $);
 
 #include opt_m68k_arch.h
 
@@ -111,6 +111,42 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 #endif
 
 	/*
+	 * Initialize the mem_clusters[] array for the crash dump
+	 * code.  While we're at it, compute the total amount of
+	 * physical memory in the system.
+	 */
+	for (i = 0; i  VM_PHYSSEG_MAX; i++) {
+		if (RELOC(phys_seg_list[i].ps_start, paddr_t) ==
+		RELOC(phys_seg_list[i].ps_end, paddr_t)) {
+			/*
+			 * No more memory.
+			 */
+			break;
+		}
+
+		/*
+		 * Make sure these are properly rounded.
+		 */
+		RELOC(phys_seg_list[i].ps_start, paddr_t) =
+		m68k_round_page(RELOC(phys_seg_list[i].ps_start,
+	  paddr_t));
+		RELOC(phys_seg_list[i].ps_end, paddr_t) =
+		m68k_trunc_page(RELOC(phys_seg_list[i].ps_end,
+	  paddr_t));
+
+		size = RELOC(phys_seg_list[i].ps_end, paddr_t) -
+		RELOC(phys_seg_list[i].ps_start, paddr_t);
+
+		RELOC(mem_clusters[i].start, u_quad_t) =
+		RELOC(phys_seg_list[i].ps_start, paddr_t);
+		RELOC(mem_clusters[i].size, u_quad_t) = size;
+
+		RELOC(physmem, int) += size  PGSHIFT;
+
+		RELOC(mem_cluster_cnt, int) += 1;
+	}
+
+	/*
 	 * Calculate important physical addresses:
 	 *
 	 *	lwp0upa		lwp0 u-area		UPAGES pages
@@ -484,42 +520,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 	RELOC(lwp0uarea, vaddr_t) = lwp0upa - firstpa;
 
 	/*
-	 * Initialize the mem_clusters[] array for the crash dump
-	 * code.  While we're at it, compute the total amount of
-	 * physical memory in the system.
-	 */
-	for (i = 0; i  VM_PHYSSEG_MAX; i++) {
-		if (RELOC(phys_seg_list[i].ps_start, paddr_t) ==
-		RELOC(phys_seg_list[i].ps_end, paddr_t)) {
-			/*
-			 * No more memory.
-			 */
-			break;
-		}
-
-		/*
-		 * Make sure these are properly rounded.
-		 */
-		RELOC(phys_seg_list[i].ps_start, paddr_t) =
-		m68k_round_page(RELOC(phys_seg_list[i].ps_start,
-	  paddr_t));
-		RELOC(phys_seg_list[i].ps_end, paddr_t) =
-		m68k_trunc_page(RELOC(phys_seg_list[i].ps_end,
-	  paddr_t));
-
-		size = RELOC(phys_seg_list[i].ps_end, paddr_t) -
-		RELOC(phys_seg_list[i].ps_start, paddr_t);
-
-		RELOC(mem_clusters[i].start, u_quad_t) =
-		RELOC(phys_seg_list[i].ps_start, paddr_t);
-		RELOC(mem_clusters[i].size, u_quad_t) = size;
-
-		RELOC(physmem, int) += size  PGSHIFT;
-
-		RELOC(mem_cluster_cnt, int) += 1;
-	}
-
-	/*
 	 * Scoot the start of available on-board RAM forward to
 	 * account for:
 	 *



CVS commit: src/sys/arch/luna68k/stand/boot

2014-01-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan  5 06:56:22 UTC 2014

Modified Files:
src/sys/arch/luna68k/stand/boot: init_main.c version

Log Message:
Detect boot device on PROM load command and set proper default boot device.

Also remove now unnecessary the old netboot check.

Note all addresses of boot device info set by monitor are checked by
memory dump on several LUNA ROM versions, and these addres might be
different on earlier monitor ROM versions.

Bump version to denote the visible change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/stand/boot/init_main.c \
src/sys/arch/luna68k/stand/boot/version

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/luna68k/stand/boot/init_main.c
diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.7 src/sys/arch/luna68k/stand/boot/init_main.c:1.8
--- src/sys/arch/luna68k/stand/boot/init_main.c:1.7	Fri Jan  3 06:37:13 2014
+++ src/sys/arch/luna68k/stand/boot/init_main.c	Sun Jan  5 06:56:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.7 2014/01/03 06:37:13 tsutsui Exp $	*/
+/*	$NetBSD: init_main.c,v 1.8 2014/01/05 06:56:22 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -114,14 +114,71 @@ int boot_timeout = BOOT_TIMEOUT;
 
 static const char prompt[] = boot ;
 
+/*
+ * PROM monitor's boot device info
+ */
+
+/* LUNA-I monitor's bootinfo structure */
+/* This bootinfo data address is investigated on ROM Ver4.22 and Ver4.25 */
+#define	LUNA1_BOOTINFOADDR	0x08c0
+struct luna1_bootinfo {
+	uint8_t	bi_xxx1[3];	/* 0x08c0: ??? */
+	uint8_t	bi_device;	/* 0x08c3: boot device */
+#define	LUNA1_BTDEV_DK	0		/* Hard-Disk */
+#define	LUNA1_BTDEV_FB	1		/* Floppy-Disk */
+#define	LUNA1_BTDEV_SD	2		/* Streamer-Tape */
+#define	LUNA1_BTDEV_P0	3		/* RS232c */
+#define	LUNA1_BTDEV_ET	4		/* Ether-net */
+#define	LUNA1_NBTDEV	5
+
+	struct {
+		uint8_t	bd_xxx1;	/*  0: ??? */
+		uint8_t	bd_boot;	/*  1: 1 == booted */
+		char	bd_name[2];	/*  2: device name (dk, fb, sd ... ) */
+		uint8_t	bd_unit;	/*  4: unit number (not ID) */
+		uint8_t	bd_xxx2;	/*  5: ??? */
+		uint8_t	bd_xxx3;	/*  6: ??? */
+		uint8_t	bd_part;	/*  7: dk partition / st record # */
+		uint8_t	bd_xxx4[4];	/*  8: ??? */
+		uint8_t	bd_xxx5[4];	/* 12: ??? */
+	} bi_devinfo[LUNA1_NBTDEV];
+} __packed;
+
+/* LUNA-II monitor's bootinfo structure */
+/* This bootinfo data address is investigated on ROM Version 1.11 */
+#define	LUNA2_BOOTINFOADDR	0x1d80
+struct luna2_bootinfo {
+	uint8_t	bi_xxx1[13];	/* 0x1d80: ??? */
+	uint8_t	bi_device;	/* 0x1d8d: boot device */
+#define	LUNA2_BTDEV_DK	0		/* Hard-Disk */
+#define	LUNA2_BTDEV_FT	1		/* Floppy-Disk */
+#define	LUNA2_BTDEV_SD	2		/* Streamer-Tape */
+#define	LUNA2_BTDEV_P0	3		/* RS232c */
+#define	LUNA2_NBTDEV	4
+
+	struct {
+		uint8_t	bd_xxx1;	/*  0: ??? */
+		uint8_t	bd_boot;	/*  1: 1 == booted */
+		char	bd_name[4];	/*  2: device name (dk, ft, sd ... ) */
+		uint8_t	bd_xxx2;	/*  6: ??? */
+		uint8_t	bd_ctlr;	/*  7: SCSI controller number */
+		uint8_t	bd_unit;	/*  8: SCSI ID number */
+		uint8_t	bd_xxx3;	/*  9: device number index? */
+		uint8_t	bd_xxx4;	/* 10: ??? */
+		uint8_t	bd_part;	/* 11: dk partition / st record # */
+		uint8_t	bd_xxx5[4];	/* 12: ??? */
+		uint8_t	bd_xxx6[4];	/* 16: ??? */
+	} bi_devinfo[LUNA2_NBTDEV];
+} __packed;
+
+/* #define BTINFO_DEBUG */
+
 void
 main(void)
 {
 	int i, status = 0;
 	const char *machstr;
-	const char *cp;
-	char bootarg[64];
-	bool netboot = false;
+	const char *bootdev;
 	int unit, part;
 
 	/*
@@ -132,25 +189,11 @@ main(void)
 		machstr  = LUNA-I;
 		cpuspeed = MHZ_25;
 		hz = 60;
-		memcpy(bootarg, (char *)*RVPtr-vec53, sizeof(bootarg));
-
-		/* check netboot */
-		for (i = 0, cp = bootarg; i  sizeof(bootarg); i++, cp++) {
-			if (*cp == '\0')
-break;
-			if (*cp == 'E'  memcmp(ENADDR=, cp, 7) == 0) {
-netboot = true;
-break;
-			}
-		}
 	} else {
 		machtype = LUNA_II;
 		machstr  = LUNA-II;
 		cpuspeed = MHZ_25 * 2;	/* XXX */
 		hz = 100;
-		memcpy(bootarg, (char *)*RVPtr-vec02, sizeof(bootarg));
-
-		/* LUNA-II's boot monitor doesn't support netboot */
 	}
 
 	nplane   = get_plane_numbers();
@@ -185,10 +228,78 @@ main(void)
 	configure();
 	printf(\n);
 
-	unit = 0;	/* XXX should parse monitor's Boot-file constant */
+	/* use sd(0,0) for the default boot device */
+	bootdev = sd;
+	unit = 0;
 	part = 0;
+
+	if (machtype == LUNA_I) {
+		const struct luna1_bootinfo *bi1 = (void *)LUNA1_BOOTINFOADDR;
+		int dev = bi1-bi_device;
+
+		switch (dev) {
+		case LUNA1_BTDEV_DK:
+			/* XXX: should check hp_dinfo in ioconf.c */
+			/* note: bd_unit is not SCSI ID */
+			unit = bi1-bi_devinfo[dev].bd_unit;
+			break;
+		case LUNA1_BTDEV_ET:
+			bootdev = le;
+			unit = 0;
+			break;
+		default:
+			/* not supported */
+			break;
+		}
+#ifdef BTINFO_DEBUG
+		printf(bi1-bi_device = 0x%02x\n, bi1-bi_device);
+