CVS commit: src/lib/libutil

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  4 07:07:12 UTC 2010

Modified Files:
src/lib/libutil: util.3

Log Message:
Remove the list of functions in the libutil library.

While such lists are nice, they are doomed to be repeatedly out of date due
maintenance costs related to manual updates. Ideally there should be a
common routine to auto-generate these, but in the meantime, just point to
the directory where libutil is implemented.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libutil/util.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/libutil/util.3
diff -u src/lib/libutil/util.3:1.19 src/lib/libutil/util.3:1.20
--- src/lib/libutil/util.3:1.19	Sat Apr 11 17:26:32 2009
+++ src/lib/libutil/util.3	Tue May  4 07:07:12 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: util.3,v 1.19 2009/04/11 17:26:32 joerg Exp $
+.\" $NetBSD: util.3,v 1.20 2010/05/04 07:07:12 jruoho Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 17, 2008
+.Dd May 4, 2010
 .Dt UTIL 3
 .Os
 .Sh NAME
@@ -46,60 +46,14 @@
 .Nx Ns -specific
 and are not portable.
 Their use should be restricted.
+.Pp
 Declarations for these functions may be obtained from the include file
-.Pa \*[Lt]util.h\*[Gt] .
-.Sh LIST OF FUNCTIONS
-.Bl -column ".Xr sockaddr_snprintf 3" -compact
-.It Sy Name	Description
-.It Xr disklabel_dkcksum 3 Ta compute the checksum for a disklabel
-.It Xr disklabel_scan 3 Ta scan a buffer for a valid disklabel
-.It Xr forkpty 3 Ta tty utility function
-.It Xr getbootfile 3 Ta get the name of the booted kernel file
-.It Xr getlabeloffset 3 Ta get the sector number and offset of the disklabel
-.It Xr getlabelsector 3 Ta get the sector number and offset of the disklabel
-.It Xr getmaxpartitions 3 Ta get the maximum number of partitions allowed per disk
-.It Xr getrawpartition 3 Ta get the system ``raw'' partition
-.It Xr login 3 Ta login utility function
-.It Xr login_cap 3 Ta query login.conf database about a user class
-.It Xr login_close 3 Ta query login.conf database about a user class
-.It Xr login_getcapbool 3 Ta query login.conf database about a user class
-.It Xr login_getcapnum 3 Ta query login.conf database about a user class
-.It Xr login_getcapsize 3 Ta query login.conf database about a user class
-.It Xr login_getcapstr 3 Ta query login.conf database about a user class
-.It Xr login_getcaptime 3 Ta query login.conf database about a user class
-.It Xr login_getclass 3 Ta query login.conf database about a user class
-.It Xr login_tty 3 Ta tty utility function
-.It Xr loginx 3 Ta login utility function
-.It Xr logout 3 Ta login utility function
-.It Xr logoutx 3 Ta login utility function
-.It Xr logwtmp 3 Ta login utility function
-.It Xr logwtmpx 3 Ta login utility function
-.It Xr opendisk 3 Ta open a disk partition
-.It Xr openpty 3 Ta tty utility function
-.It Xr pidfile 3 Ta write a daemon pid file
-.It Xr pidlock 3 Ta locks based on files containing PIDs
-.It Xr pw_abort 3 Ta passwd file update function
-.It Xr pw_copy 3 Ta utility function for interactive passwd file updates
-.It Xr pw_edit 3 Ta utility function for interactive passwd file updates
-.It Xr pw_error 3 Ta utility function for interactive passwd file updates
-.It Xr pw_getconf 3 Ta password encryption configuration access function
-.It Xr pw_getprefix 3 Ta passwd file update function
-.It Xr pw_init 3 Ta utility function for interactive passwd file updates
-.It Xr pw_lock 3 Ta passwd file update function
-.It Xr pw_mkdb 3 Ta passwd file update function
-.It Xr pw_prompt 3 Ta utility function for interactive passwd file updates
-.It Xr pw_scan 3 Ta utility function for interactive passwd file updates
-.It Xr pw_setprefix 3 Ta passwd file update function
-.It Xr secure_path 3 Ta determine if a file appears to be ``secure''
-.It Xr setclasscontext 3 Ta query login.conf database about a user class
-.It Xr setusercontext 3 Ta query login.conf database about a user class
-.It Xr snprintb 3 Ta bitmask output conversion
-.It Xr sockaddr_snprintf 3 Ta socket address formatting function
-.It Xr ttyaction 3 Ta ttyaction utility function
-.It Xr ttylock 3 Ta locks based on files containing PIDs
-.It Xr ttymsg 3 Ta ttymsg utility function
-.It Xr ttyunlock 3 Ta locks based on files containing PIDs
-.El
+.In util.h .
+The
+.Nm
+library and the associated functions are implemented within the
+.Pa /usr/src/lib/libutil
+directory.
 .Sh FILES
 .Bl -tag -width /usr/lib/libutil_p.a -compact
 .It Pa /usr/lib/libutil.a
@@ -110,4 +64,5 @@
 static util library compiled for profiling
 .El
 .Sh SEE ALSO
-.Xr efun 3
+.Xr efun 3 ,
+.Xr intro 3



CVS commit: src/lib/libc/stdio

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  4 07:43:12 UTC 2010

Modified Files:
src/lib/libc/stdio: stdio.3

Log Message:
Remove the list of functions.

This list was updated only two times in nearly two decades.

(If people need to learn the standard I/O functions in C, it would be better
to mention K&R or some other textbook; if people need to know the list of
functions, it would be better to point out the location of the standard.)

In addition, some clean-up and structural editing.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/stdio/stdio.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/stdio/stdio.3
diff -u src/lib/libc/stdio/stdio.3:1.22 src/lib/libc/stdio/stdio.3:1.23
--- src/lib/libc/stdio/stdio.3:1.22	Mon Jul 13 22:31:59 2009
+++ src/lib/libc/stdio/stdio.3	Tue May  4 07:43:12 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: stdio.3,v 1.22 2009/07/13 22:31:59 wiz Exp $
+.\"	$NetBSD: stdio.3,v 1.23 2010/05/04 07:43:12 jruoho Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)stdio.3	8.7 (Berkeley) 4/19/94
 .\"
-.Dd July 13, 2009
+.Dd May 4, 2010
 .Dt STDIO 3
 .Os
 .Sh NAME
@@ -39,9 +39,9 @@
 .Lb libc
 .Sh SYNOPSIS
 .In stdio.h
-.Fd FILE *stdin;
-.Fd FILE *stdout;
-.Fd FILE *stderr;
+.Vt FILE *stdin;
+.Vt FILE *stdout;
+.Vt FILE *stderr;
 .Sh DESCRIPTION
 The standard
 .Tn I/O
@@ -52,8 +52,6 @@
 and the physical
 .Tn I/O
 characteristics are concealed.
-The functions and macros are listed below;
-more information is available from the individual man pages.
 .Pp
 A stream is associated with an external file (which may be a physical
 device) by
@@ -108,21 +106,24 @@
 .Pp
 At program startup, three streams are predefined and need not be
 opened explicitly:
-.Bl -bullet -compact -offset indent
+.Bl -enum -offset indent
 .It
 .Em standard input
-(for reading conventional input),
+for reading conventional input,
 .It
 .Em standard output
-(for writing conventional output), and
+for writing conventional output, and
 .It
 .Em standard error
-(for writing diagnostic output).
+for writing diagnostic output.
 .El
+.Pp
 These streams are abbreviated
-.Em stdin , stdout
+.Em stdin ,
+.Em stdout ,
 and
 .Em stderr .
+.Pp
 Initially, the standard error stream
 is unbuffered; the standard input and output streams are
 fully buffered if and only if the streams do not refer to
@@ -150,33 +151,20 @@
 Alternatively, these defaults may be modified via the
 .Xr setvbuf 3
 function.
-.Pp
-The
-.Nm
-library is a part of the library
-.Pa libc.a
-and routines are automatically loaded as needed by compilers such
-as
-.Xr cc 1 .
-The
-.Tn SYNOPSIS
-sections of the following manual pages indicate which include files
-are to be used, what the compiler declaration for the function
-looks like and which external variables are of interest.
-.Pp
+.Sh IMPLEMENTATION NOTES
 In multi-threaded applications, operations on streams perform implicit
 locking, except for the
-.Fa getc_unlocked ,
-.Fa getchar_unlocked ,
-.Fa putc_unlocked ,
+.Fn getc_unlocked ,
+.Fn getchar_unlocked ,
+.Fn putc_unlocked ,
 and
-.Fa putchar_unlocked
+.Fn putchar_unlocked
 functions.
 Explicit control of stream locking is available through the
-.Fa flockfile ,
-.Fa ftrylockfile ,
+.Fn flockfile ,
+.Fn ftrylockfile ,
 and
-.Fa funlockfile
+.Fn funlockfile
 functions .
 .Pp
 The following are defined as macros; these names may not be re-used
@@ -211,6 +199,7 @@
 .Dv stderr ,
 .Dv stdin ,
 .Dv stdout .
+.Pp
 Function versions of the macro functions
 .Fn feof ,
 .Fn ferror ,
@@ -236,93 +225,6 @@
 .Nm
 library conforms to
 .St -ansiC .
-.Sh LIST OF FUNCTIONS
-.Bl -column "putchar_unlocked" "Description"
-.It Sy Function	Description
-.It clearerr	check and reset stream status
-.It fclose	close a stream
-.It fdopen	stream open functions
-.It feof	check and reset stream status
-.It ferror	check and reset stream status
-.It fflush	flush a stream
-.It fgetc	get next character or word from input stream
-.It fgetln	get a line from a stream
-.It fgetpos	reposition a stream
-.It fgets	get a line from a stream
-.It fgetwc	get next wide character from input stream
-.It fileno	check and reset stream status
-.It flockfile	lock a stream
-.It fopen	stream open functions
-.It fprintf	formatted output conversion
-.It fpurge	flush a stream
-.It fputc	output a character or word to a stream
-.It fputs	output a line to a stream
-.It fputwc	output a wide character to a stream
-.It fread	binary stream input/output
-.It freopen	stream open functions
-.It fropen	open a stream
-.It fscanf	input format conversion
-.It fseek	reposition a stream
-.It fsetpos	reposition a stream
-.It ftell	reposition a stream
-.It ftrylockfile	lock a stream (non-blocking)
-.It funlockfile	unlock a stream
-.It funopen	open a stream
-.It fwide	set/get orientation

CVS commit: src/lib/libutil

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  4 07:58:28 UTC 2010

Modified Files:
src/lib/libutil: getmntopts.3

Log Message:
Rework the example a little.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libutil/getmntopts.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/libutil/getmntopts.3
diff -u src/lib/libutil/getmntopts.3:1.10 src/lib/libutil/getmntopts.3:1.11
--- src/lib/libutil/getmntopts.3:1.10	Tue Jul 14 18:56:14 2009
+++ src/lib/libutil/getmntopts.3	Tue May  4 07:58:28 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getmntopts.3,v 1.10 2009/07/14 18:56:14 joerg Exp $
+.\"	$NetBSD: getmntopts.3,v 1.11 2010/05/04 07:58:28 jruoho Exp $
 .\"
 .\" Copyright (c) 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)getmntopts.3	8.3 (Berkeley) 3/30/95
 .\"
-.Dd August 26, 2007
+.Dd May 4, 2010
 .Dt GETMNTOPTS 3
 .Os
 .Sh NAME
@@ -183,7 +183,7 @@
 .Dv MOPT_UPDATE
 entry.
 This can be declared and used as follows:
-.Bd -literal
+.Bd -literal -offset indent
 #include \*[Lt]mntopts.h\*[Gt]
 
 static const struct mntopt mopts[] = {
@@ -193,13 +193,20 @@
 };
 
 \&...
+
 long val;
-mntflags = mntaltflags = 0;
 mntoptparse_t mp;
+mntflags = mntaltflags = 0;
+
 \&...
-if ((mp = getmntopts(options, mopts, \*[Am]mntflags, \*[Am]mntaltflags)) == NULL)
-	err(1, NULL);
+
+mp = getmntopts(options, mopts, \*[Am]mntflags, \*[Am]mntaltflags);
+
+if (mp == NULL)
+	err(EXIT_FAILURE, "getmntopts");
+
 \&...
+
 val = getmntoptnum(mp, "rsize");
 freemntopts(mp);
 .Ed



CVS commit: src/include

2010-05-04 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue May  4 09:07:11 UTC 2010

Modified Files:
src/include: signal.h

Log Message:
handle the difference between C99 and GNUC semantics of inline
functions with external linkage, by using "inline" for STDC and
"extern inline" for GNUC

(as noted by joerg@, using static inline may be clearer)


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/include/signal.h

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

Modified files:

Index: src/include/signal.h
diff -u src/include/signal.h:1.51 src/include/signal.h:1.52
--- src/include/signal.h:1.51	Sun Jan 11 03:04:12 2009
+++ src/include/signal.h	Tue May  4 09:07:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.51 2009/01/11 03:04:12 christos Exp $	*/
+/*	$NetBSD: signal.h,v 1.52 2010/05/04 09:07:11 plunky Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -101,7 +101,11 @@
 #endif
 
 #ifndef _SIGINLINE
+#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
 #define _SIGINLINE extern __inline
+#else
+#define _SIGINLINE __inline
+#endif
 #endif
 
 _SIGINLINE int
@@ -149,7 +153,7 @@
 	__sigfillset(set);
 	return (0);
 }
-#endif /* (__GNUC__ && __STDC__) || _LIBC */
+#endif /* (__GNUC__ && __STDC__) || _SIGINLINE */
 #endif /* !__LIBC12_SOURCE__ */
 
 /*



CVS commit: src/tests/sys/rc

2010-05-04 Thread Julio M. Merino Vidal
Module Name:src
Committed By:   jmmv
Date:   Tue May  4 09:33:57 UTC 2010

Modified Files:
src/tests/sys/rc: t_rc_d_cli.sh

Log Message:
Fix execution of the installed tests by using h_{simple,args} as program
names, without the .sh extension.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/sys/rc/t_rc_d_cli.sh

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

Modified files:

Index: src/tests/sys/rc/t_rc_d_cli.sh
diff -u src/tests/sys/rc/t_rc_d_cli.sh:1.1 src/tests/sys/rc/t_rc_d_cli.sh:1.2
--- src/tests/sys/rc/t_rc_d_cli.sh:1.1	Mon Mar 15 19:03:08 2010
+++ src/tests/sys/rc/t_rc_d_cli.sh	Tue May  4 09:33:57 2010
@@ -1,4 +1,4 @@
-# $NetBSD: t_rc_d_cli.sh,v 1.1 2010/03/15 19:03:08 jmmv Exp $
+# $NetBSD: t_rc_d_cli.sh,v 1.2 2010/05/04 09:33:57 jmmv Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -34,7 +34,7 @@
 }
 no_command_body() {
 	export h_simple=YES
-	rc_helper=$(atf_get_srcdir)/h_simple.sh
+	rc_helper=$(atf_get_srcdir)/h_simple
 
 	atf_check -s eq:1 -o empty -e ignore ${rc_helper}
 }
@@ -46,7 +46,7 @@
 }
 default_start_no_args_body() {
 	export h_simple=YES
-	rc_helper=$(atf_get_srcdir)/h_simple.sh
+	rc_helper=$(atf_get_srcdir)/h_simple
 
 	atf_check -s eq:0 -o ignore -e empty ${rc_helper} start
 	${rc_helper} forcestop
@@ -59,7 +59,7 @@
 }
 default_start_with_args_body() {
 	export h_simple=YES
-	rc_helper=$(atf_get_srcdir)/h_simple.sh
+	rc_helper=$(atf_get_srcdir)/h_simple
 
 	atf_check -s eq:1 -o ignore -e ignore ${rc_helper} start foo
 	if ${rc_helper} status >/dev/null; then
@@ -75,7 +75,7 @@
 }
 default_stop_no_args_body() {
 	export h_simple=YES
-	rc_helper=$(atf_get_srcdir)/h_simple.sh
+	rc_helper=$(atf_get_srcdir)/h_simple
 
 	${rc_helper} start
 	atf_check -s eq:0 -o ignore -e empty ${rc_helper} stop
@@ -88,7 +88,7 @@
 }
 default_stop_with_args_body() {
 	export h_simple=YES
-	rc_helper=$(atf_get_srcdir)/h_simple.sh
+	rc_helper=$(atf_get_srcdir)/h_simple
 
 	${rc_helper} start
 	atf_check -s eq:1 -o ignore -e ignore ${rc_helper} stop foo
@@ -106,7 +106,7 @@
 }
 default_restart_no_args_body() {
 	export h_simple=YES
-	rc_helper=$(atf_get_srcdir)/h_simple.sh
+	rc_helper=$(atf_get_srcdir)/h_simple
 
 	${rc_helper} start
 	atf_check -s eq:0 -o ignore -e empty ${rc_helper} restart
@@ -120,7 +120,7 @@
 }
 default_restart_with_args_body() {
 	export h_simple=YES
-	rc_helper=$(atf_get_srcdir)/h_simple.sh
+	rc_helper=$(atf_get_srcdir)/h_simple
 
 	${rc_helper} start
 	atf_check -s eq:1 -o ignore -e ignore ${rc_helper} restart foo
@@ -131,7 +131,7 @@
 	local command="${1}"; shift
 
 	export h_args=YES
-	rc_helper=$(atf_get_srcdir)/h_args.sh
+	rc_helper=$(atf_get_srcdir)/h_args
 
 	cat >expout 

CVS commit: src/sys/kern

2010-05-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May  4 12:20:50 UTC 2010

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

Log Message:
Don't #error on invalid LABELSECTOR or LABELOFFSET on __RUMPKERNEL build.

As mentioned in src/sys/rump/dev/lib/libdisk/Makefile,
rump(4) builds don't check if each ${MACHINE} actually supports
MBR in MD readdisklabel(9) ops while it pulls MD .

Workarounds so long broken build of ews4800mips.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/kern/subr_disk_mbr.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/subr_disk_mbr.c
diff -u src/sys/kern/subr_disk_mbr.c:1.39 src/sys/kern/subr_disk_mbr.c:1.40
--- src/sys/kern/subr_disk_mbr.c:1.39	Wed Dec 23 09:23:53 2009
+++ src/sys/kern/subr_disk_mbr.c	Tue May  4 12:20:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_disk_mbr.c,v 1.39 2009/12/23 09:23:53 mbalmer Exp $	*/
+/*	$NetBSD: subr_disk_mbr.c,v 1.40 2010/05/04 12:20:50 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_disk_mbr.c,v 1.39 2009/12/23 09:23:53 mbalmer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk_mbr.c,v 1.40 2010/05/04 12:20:50 tsutsui Exp $");
 
 #include 
 #include 
@@ -86,8 +86,10 @@
 #define SCANBLOCKS 3
 #define DISKLABEL_SIZE 404
 #if LABELSECTOR*DEV_BSIZE + LABELOFFSET > SCANBLOCKS*DEV_BSIZE - DISKLABEL_SIZE
+#ifndef _RUMPKERNEL /* XXX: see src/sys/rump/dev/lib/libdisk/Makefile */
 #error Invalid LABELSECTOR or LABELOFFSET
 #endif
+#endif
 
 #define MBR_LABELSECTOR	1
 



CVS commit: src/sys/dev/rasops

2010-05-04 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue May  4 12:36:37 UTC 2010

Modified Files:
src/sys/dev/rasops: rasops2.c

Log Message:
fix compile failure.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/rasops/rasops2.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/rasops/rasops2.c
diff -u src/sys/dev/rasops/rasops2.c:1.15 src/sys/dev/rasops/rasops2.c:1.16
--- src/sys/dev/rasops/rasops2.c:1.15	Tue May  4 04:57:34 2010
+++ src/sys/dev/rasops/rasops2.c	Tue May  4 12:36:37 2010
@@ -1,4 +1,4 @@
-/* 	$NetBSD: rasops2.c,v 1.15 2010/05/04 04:57:34 macallan Exp $	*/
+/* 	$NetBSD: rasops2.c,v 1.16 2010/05/04 12:36:37 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.15 2010/05/04 04:57:34 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.16 2010/05/04 12:36:37 nonaka Exp $");
 
 #include "opt_rasops.h"
 
@@ -102,7 +102,7 @@
 rasops2_putchar(void *cookie, int row, int col, u_int uc, long attr)
 {
 	int height, width, fs, rs, fb, bg, fg, lmask, rmask;
-	struct rasops_info *ri;
+	struct rasops_info *ri = (struct rasops_info *)cookie;
 	struct wsdisplay_font *font = PICK_FONT(ri, uc);
 	int32_t *rp;
 	u_char *fr;
@@ -244,7 +244,7 @@
 static void
 rasops2_putchar8(void *cookie, int row, int col, u_int uc, long attr)
 {
-	struct rasops_info *ri;
+	struct rasops_info *ri = (struct rasops_info *)cookie;
 	struct wsdisplay_font *font = PICK_FONT(ri, uc);
 	int height, fs, rs;
 	u_char *fr, *rp;
@@ -311,7 +311,7 @@
 static void
 rasops2_putchar12(void *cookie, int row, int col, u_int uc, long attr)
 {
-	struct rasops_info *ri;
+	struct rasops_info *ri = (struct rasops_info *)cookie;
 	struct wsdisplay_font *font = PICK_FONT(ri, uc);
 	int height, fs, rs;
 	u_char *fr, *rp;
@@ -381,7 +381,7 @@
 static void
 rasops2_putchar16(void *cookie, int row, int col, u_int uc, long attr)
 {
-	struct rasops_info *ri;
+	struct rasops_info *ri = (struct rasops_info *)cookie;
 	struct wsdisplay_font *font = PICK_FONT(ri, uc);
 	int height, fs, rs;
 	u_char *fr, *rp;



CVS commit: src/doc

2010-05-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue May  4 12:45:11 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
sandpoint: support for Marvell-SKnet in netboot


To generate a diff of this commit:
cvs rdiff -u -r1.1389 -r1.1390 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1389 src/doc/CHANGES:1.1390
--- src/doc/CHANGES:1.1389	Mon May  3 16:36:26 2010
+++ src/doc/CHANGES	Tue May  4 12:45:11 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1389 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1390 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -603,3 +603,5 @@
 		to be created before the upload. See the section on security 
 		considerations before enabling. [hubertf 20100429]
 	hpcsh: Add sysinst(8) support. [tsutsui 20100503]
+	sandpoint: Added support for Marvell-SKnet in netboot.
+		[phx 20100503]



CVS commit: src/distrib

2010-05-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May  4 13:33:13 UTC 2010

Modified Files:
src/distrib/ews4800mips/floppies/ramdisk: Makefile
src/distrib/utils/sysinst/arch/ews4800mips: Makefile
Removed Files:
src/distrib/utils/sysinst/arch/ews4800mips: menus.md.fr menus.md.pl
msg.md.de msg.md.es msg.md.fr msg.md.pl

Log Message:
Remove non-English translations from ews4800mips sysinst.
I don't think there are any EWS4800 users outside Japan.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/distrib/ews4800mips/floppies/ramdisk/Makefile
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/sysinst/arch/ews4800mips/Makefile
cvs rdiff -u -r1.1 -r0 src/distrib/utils/sysinst/arch/ews4800mips/menus.md.fr \
src/distrib/utils/sysinst/arch/ews4800mips/menus.md.pl
cvs rdiff -u -r1.2 -r0 src/distrib/utils/sysinst/arch/ews4800mips/msg.md.de \
src/distrib/utils/sysinst/arch/ews4800mips/msg.md.es \
src/distrib/utils/sysinst/arch/ews4800mips/msg.md.fr \
src/distrib/utils/sysinst/arch/ews4800mips/msg.md.pl

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

Modified files:

Index: src/distrib/ews4800mips/floppies/ramdisk/Makefile
diff -u src/distrib/ews4800mips/floppies/ramdisk/Makefile:1.9 src/distrib/ews4800mips/floppies/ramdisk/Makefile:1.10
--- src/distrib/ews4800mips/floppies/ramdisk/Makefile:1.9	Thu Feb 11 09:06:48 2010
+++ src/distrib/ews4800mips/floppies/ramdisk/Makefile	Tue May  4 13:33:13 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.9 2010/02/11 09:06:48 roy Exp $
+#	$NetBSD: Makefile,v 1.10 2010/05/04 13:33:13 tsutsui Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -12,7 +12,7 @@
 
 CRUNCHBIN=	ramdiskbin
 CRUNCHGEN_FLAGS= -d "${DBG}"
-LISTS=		${.CURDIR}/list ${DISTRIBDIR}/common/list.sysinst
+LISTS=		${.CURDIR}/list ${DISTRIBDIR}/common/list.sysinst.en
 MTREECONF=	${DISTRIBDIR}/common/mtree.common
 IMAGEENDIAN=	be
 MAKEDEVTARGETS=	ramdisk

Index: src/distrib/utils/sysinst/arch/ews4800mips/Makefile
diff -u src/distrib/utils/sysinst/arch/ews4800mips/Makefile:1.1 src/distrib/utils/sysinst/arch/ews4800mips/Makefile:1.2
--- src/distrib/utils/sysinst/arch/ews4800mips/Makefile:1.1	Mon Jan  9 10:03:51 2006
+++ src/distrib/utils/sysinst/arch/ews4800mips/Makefile	Tue May  4 13:33:13 2010
@@ -1,6 +1,8 @@
-#	$NetBSD: Makefile,v 1.1 2006/01/09 10:03:51 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.2 2010/05/04 13:33:13 tsutsui Exp $
 #
 # Makefile for ews4800mips
 #
 
+LANGUAGES=	# no translations
+
 .include "../../Makefile.inc"



CVS commit: src/distrib/macppc/cdroms/installcd

2010-05-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May  4 14:09:11 UTC 2010

Modified Files:
src/distrib/macppc/cdroms/installcd: Makefile

Log Message:
Put an INSTALL kernel and ofwboot.xcf into ISO9660 root.
Newer OpenFirmware recognizes not only HFS but also ISO partition.

XXX: should I also update files in src/distrib/cdrom?


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/macppc/cdroms/installcd/Makefile

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

Modified files:

Index: src/distrib/macppc/cdroms/installcd/Makefile
diff -u src/distrib/macppc/cdroms/installcd/Makefile:1.1 src/distrib/macppc/cdroms/installcd/Makefile:1.2
--- src/distrib/macppc/cdroms/installcd/Makefile:1.1	Tue Mar  6 21:57:07 2007
+++ src/distrib/macppc/cdroms/installcd/Makefile	Tue May  4 14:09:11 2010
@@ -1,5 +1,8 @@
-#	$NetBSD: Makefile,v 1.1 2007/03/06 21:57:07 bouyer Exp $
+#	$NetBSD: Makefile,v 1.2 2010/05/04 14:09:11 tsutsui Exp $
 CDBASE=		macppccd		# gives ${CDBASE}.iso
 CDRELEASE=	true			# include $RELEASEDIR/$MACHINE
+CDKERNELS=	netbsd-INSTALL.gz netbsd
+CDINSTKERNEL=	../../floppies/md-kernel
+CDBUILDEXTRA=	${DESTDIR}/usr/mdec/ofwboot.xcf
 
 .include "${.CURDIR}/../../../common/Makefile.bootcd"



CVS commit: src/sys/kern

2010-05-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May  4 14:14:54 UTC 2010

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

Log Message:
Some KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/kern/kern_ksyms.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_ksyms.c
diff -u src/sys/kern/kern_ksyms.c:1.59 src/sys/kern/kern_ksyms.c:1.60
--- src/sys/kern/kern_ksyms.c:1.59	Mon May  3 09:51:36 2010
+++ src/sys/kern/kern_ksyms.c	Tue May  4 14:14:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_ksyms.c,v 1.59 2010/05/03 09:51:36 darran Exp $	*/
+/*	$NetBSD: kern_ksyms.c,v 1.60 2010/05/04 14:14:54 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.59 2010/05/03 09:51:36 darran Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.60 2010/05/04 14:14:54 tsutsui Exp $");
 
 #if defined(_KERNEL) && defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -282,11 +282,11 @@
 
 	/* sanity check for pre-malloc map table used during startup */
 	if ((nmap == ksyms_nmap) && (nsyms >= KSYMS_MAX_ID)) {
-	printf("kern_ksyms: ERROR %d > %d, increase KSYMS_MAX_ID\n",
+		printf("kern_ksyms: ERROR %d > %d, increase KSYMS_MAX_ID\n",
 		nsyms, KSYMS_MAX_ID);
 
-	/* truncate for now */
-	nsyms = KSYMS_MAX_ID-1;
+		/* truncate for now */
+		nsyms = KSYMS_MAX_ID - 1;
 	}
 
 	tab->sd_symstart = symstart;
@@ -349,11 +349,12 @@
 
 #ifdef KDTRACE_HOOKS
 		if (nmap != NULL) {
-			/* Save the size, replace it with the symbol id so
+			/*
+			 * Save the size, replace it with the symbol id so
 			 * the mapping can be done after the cleanup and sort.
 			 */
 			nmap[i] = nsym[n].st_size;
-			nsym[n].st_size = i+1;	/* zero is reserved */
+			nsym[n].st_size = i + 1;	/* zero is reserved */
 		}
 #endif
 
@@ -390,7 +391,7 @@
 	 */
 	if (nmap != NULL) {
 		int new;
-		for (new=0; newe_shoff);
 	if (ehdr->e_shstrndx != 0) {
-		char *shstr = (uint8_t*)start +
-shdr[ehdr->e_shstrndx].sh_offset;
+		char *shstr = (uint8_t *)start +
+		shdr[ehdr->e_shstrndx].sh_offset;
 		for (i = 1; i < ehdr->e_shnum; i++) {
 #ifdef DEBUG
 			printf("ksyms: checking %s\n", &shstr[shdr[i].sh_name]);
 #endif
 			if (shdr[i].sh_type != SHT_PROGBITS)
 continue;
-			if (strncmp(".SUNW_ctf", &shstr[shdr[i].sh_name] ,10) != 0)
+			if (strncmp(".SUNW_ctf", &shstr[shdr[i].sh_name], 10)
+			!= 0)
 continue;
 			ctfstart = (uint8_t *)start + shdr[i].sh_offset;
 			ctfsize = shdr[i].sh_size;
@@ -631,12 +633,12 @@
 
 		/* now iterate through the symbols */
 		maxsym = sym + st->sd_symsize / sizeof(Elf_Sym);
-		for (symindx=0; sym < maxsym; sym++,symindx++) {
+		for (symindx = 0; sym < maxsym; sym++, symindx++) {
 			if (callback(str + sym->st_name, symindx,
-(void *)sym->st_value,
-sym->st_size,
-sym->st_info,
-opaque) != 0) {
+			(void *)sym->st_value,
+			sym->st_size,
+			sym->st_info,
+			opaque) != 0) {
 break;
 			}
 		}
@@ -716,7 +718,7 @@
 	st = kmem_zalloc(sizeof(*st), KM_SLEEP);
 	mutex_enter(&ksyms_lock);
 	addsymtab(name, symstart, symsize, strstart, strsize, st, symstart,
-		NULL, 0, NULL);
+	NULL, 0, NULL);
 	mutex_exit(&ksyms_lock);
 }
 



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

2010-05-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May  4 15:00:39 UTC 2010

Modified Files:
src/sys/arch/mips/conf: stand.ldscript

Log Message:
Merge .rodata.* sections (like .rodata.str1.4) into .rodata section.
Newer binutils creates such sections and old firmware might be confused.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/conf/stand.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/mips/conf/stand.ldscript
diff -u src/sys/arch/mips/conf/stand.ldscript:1.3 src/sys/arch/mips/conf/stand.ldscript:1.4
--- src/sys/arch/mips/conf/stand.ldscript:1.3	Fri Oct  5 05:03:27 2001
+++ src/sys/arch/mips/conf/stand.ldscript	Tue May  4 15:00:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: stand.ldscript,v 1.3 2001/10/05 05:03:27 simonb Exp $ */
+/* $NetBSD: stand.ldscript,v 1.4 2010/05/04 15:00:39 tsutsui Exp $ */
 
 /*  ldscript for NetBSD/mips stand-alone programs */
 OUTPUT_ARCH(mips)
@@ -15,7 +15,7 @@
   } =0
   _etext = .;
   PROVIDE (etext = .);
-  .rodata: { *(.rodata)  }
+  .rodata: { *(.rodata) *(.rodata.*) }
   .data:
   {
 _fdata = . ;



CVS commit: src/sys/arch/ews4800mips/ews4800mips

2010-05-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May  4 15:32:32 UTC 2010

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

Log Message:
Fix dumb build errors. Compile test only.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/ews4800mips/ews4800mips/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/ews4800mips/ews4800mips/machdep.c
diff -u src/sys/arch/ews4800mips/ews4800mips/machdep.c:1.22 src/sys/arch/ews4800mips/ews4800mips/machdep.c:1.23
--- src/sys/arch/ews4800mips/ews4800mips/machdep.c:1.22	Mon Feb  8 19:02:28 2010
+++ src/sys/arch/ews4800mips/ews4800mips/machdep.c	Tue May  4 15:32:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.22 2010/02/08 19:02:28 joerg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.23 2010/05/04 15:32:31 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.22 2010/02/08 19:02:28 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.23 2010/05/04 15:32:31 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -88,7 +88,6 @@
 mach_init(int argc, char *argv[], struct bootinfo *bi)
 {
 	extern char kernel_text[], edata[], end[];
-	struct pcb *pcb0;
 	vaddr_t v;
 	int i;
 
@@ -116,8 +115,8 @@
 	sbd_init();
 
 	__asm volatile("move %0, $29" : "=r"(v));
-	printf("kernel_text=%p edata=%p end=%p sp=%lx\n", kernel_text, edata,
-	end, v);
+	printf("kernel_text=%p edata=%p end=%p sp=%" PRIxVADDR "\n",
+	kernel_text, edata, end, v);
 
 	option(argc, argv, bi);
 



CVS commit: src/sys/dev/ic

2010-05-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May  4 15:38:04 UTC 2010

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

Log Message:
Make local functions static.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/ic/osiop.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/osiop.c
diff -u src/sys/dev/ic/osiop.c:1.37 src/sys/dev/ic/osiop.c:1.38
--- src/sys/dev/ic/osiop.c:1.37	Tue Dec  9 14:11:11 2008
+++ src/sys/dev/ic/osiop.c	Tue May  4 15:38:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: osiop.c,v 1.37 2008/12/09 14:11:11 tsutsui Exp $	*/
+/*	$NetBSD: osiop.c,v 1.38 2010/05/04 15:38:04 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001 Izumi Tsutsui.  All rights reserved.
@@ -95,7 +95,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: osiop.c,v 1.37 2008/12/09 14:11:11 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osiop.c,v 1.38 2010/05/04 15:38:04 tsutsui Exp $");
 
 /* #define OSIOP_DEBUG */
 
@@ -124,23 +124,23 @@
 /* 53C710 script */
 #include 
 
-void osiop_attach(struct osiop_softc *);
-void osiop_minphys(struct buf *);
-void osiop_scsipi_request(struct scsipi_channel *, scsipi_adapter_req_t,
+static void osiop_minphys(struct buf *);
+static void osiop_scsipi_request(struct scsipi_channel *, scsipi_adapter_req_t,
 void *);
-void osiop_poll(struct osiop_softc *, struct osiop_acb *);
-void osiop_sched(struct osiop_softc *);
-void osiop_scsidone(struct osiop_acb *, int);
-void osiop_abort(struct osiop_softc *, const char *);
-void osiop_init(struct osiop_softc *);
-void osiop_reset(struct osiop_softc *);
-void osiop_resetbus(struct osiop_softc *);
-void osiop_start(struct osiop_softc *);
-int osiop_checkintr(struct osiop_softc *, uint8_t, uint8_t, uint8_t, int *);
-void osiop_select(struct osiop_softc *);
-void osiop_update_xfer_mode(struct osiop_softc *, int);
-void scsi_period_to_osiop(struct osiop_softc *, int);
-void osiop_timeout(void *);
+static void osiop_poll(struct osiop_softc *, struct osiop_acb *);
+static void osiop_sched(struct osiop_softc *);
+static void osiop_scsidone(struct osiop_acb *, int);
+static void osiop_abort(struct osiop_softc *, const char *);
+static void osiop_init(struct osiop_softc *);
+static void osiop_reset(struct osiop_softc *);
+static void osiop_resetbus(struct osiop_softc *);
+static void osiop_start(struct osiop_softc *);
+static int osiop_checkintr(struct osiop_softc *, uint8_t, uint8_t, uint8_t,
+int *);
+static void osiop_select(struct osiop_softc *);
+static void osiop_update_xfer_mode(struct osiop_softc *, int);
+static void scsi_period_to_osiop(struct osiop_softc *, int);
+static void osiop_timeout(void *);
 
 int osiop_reset_delay = 250;	/* delay after reset, in milliseconds */
 



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

2010-05-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May  4 16:47:13 UTC 2010

Modified Files:
src/sys/arch/news68k/include: param.h

Log Message:
Switch NetBSD/news68k to using 8KB/page in kernel.
It slightly improves performance on NWS-1750D (MC68030 25MHz):
http://mail-index.NetBSD.org/port-m68k/2009/12/08/msg000204.html

MI m68k/pmap_motorola.c and other sources can handle both 4KB/8KB pages
(amiga and atari have used 8KB pages for many years) and there is
no binary compatibility issue on it.
(kernel modules might be affected but 5.99.29 was just two days ago)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/news68k/include/param.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/news68k/include/param.h
diff -u src/sys/arch/news68k/include/param.h:1.14 src/sys/arch/news68k/include/param.h:1.15
--- src/sys/arch/news68k/include/param.h:1.14	Fri Dec 11 17:53:22 2009
+++ src/sys/arch/news68k/include/param.h	Tue May  4 16:47:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.14 2009/12/11 17:53:22 tsutsui Exp $	*/
+/*	$NetBSD: param.h,v 1.15 2010/05/04 16:47:13 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -86,7 +86,7 @@
 #define	MACHINE		"news68k"
 
 
-#define	PGSHIFT		12		/* LOG2(NBPG) */
+#define	PGSHIFT		13		/* LOG2(NBPG) */
 #define	KERNBASE	0x	/* start of kernel virtual */
 
 #define	UPAGES		2		/* pages of u-area */



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2010-05-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue May  4 17:14:17 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: pmap_tlb.c

Log Message:
Make sure to deactivate ASIDs on pmap destruction even on UP kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/sys/arch/mips/mips/pmap_tlb.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/mips/mips/pmap_tlb.c
diff -u src/sys/arch/mips/mips/pmap_tlb.c:1.1.2.10 src/sys/arch/mips/mips/pmap_tlb.c:1.1.2.11
--- src/sys/arch/mips/mips/pmap_tlb.c:1.1.2.10	Thu Mar 11 08:19:01 2010
+++ src/sys/arch/mips/mips/pmap_tlb.c	Tue May  4 17:14:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.1.2.10 2010/03/11 08:19:01 matt Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.1.2.11 2010/05/04 17:14:17 matt Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.1.2.10 2010/03/11 08:19:01 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.1.2.11 2010/05/04 17:14:17 matt Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -797,14 +797,16 @@
 		TLBINFO_UNLOCK(ti);
 		atomic_and_ulong(&ci->ci_flags, ~CPUF_USERPMAP);
 	}
+#elif defined(DEBUG)
+	tlb_set_asid(0);
 #endif
 }
 
 void
 pmap_tlb_asid_release_all(struct pmap *pm)
 {
-#ifdef MULTIPROCESSOR
 	KASSERT(pm != pmap_kernel());
+#ifdef MULTIPROCESSOR
 	KASSERT(pm->pm_onproc == 0);
 	for (u_int i = 0; pm->pm_active != 0; i++) {
 		KASSERT(i < pmap_ntlbs);
@@ -817,6 +819,18 @@
 			TLBINFO_UNLOCK(ti);
 		}
 	}
+#else
+	/*
+	 * Handle the case of an UP kernel which only has, at most, one ASID.
+	 * If the pmap has an ASID allocated, free it.
+	 */
+	struct pmap_tlb_info * const ti = curcpu()->ci_tlb_info;
+	struct pmap_asid_info * const pai = PMAP_PAI(pm, ti);
+	TLBINFO_LOCK(ti);
+	if (pai->pai_asid) {
+		pmap_pai_reset(ti, pai, pm);
+	}
+	TLBINFO_UNLOCK(ti);
 #endif /* MULTIPROCESSOR */
 }
 



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2010-05-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue May  4 17:14:47 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: pmap_segtab.c

Log Message:
Cleanup segtab allocation.   Add some counters to monitor memory usage.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/sys/arch/mips/mips/pmap_segtab.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/mips/mips/pmap_segtab.c
diff -u src/sys/arch/mips/mips/pmap_segtab.c:1.1.2.6 src/sys/arch/mips/mips/pmap_segtab.c:1.1.2.7
--- src/sys/arch/mips/mips/pmap_segtab.c:1.1.2.6	Thu Feb 25 05:24:24 2010
+++ src/sys/arch/mips/mips/pmap_segtab.c	Tue May  4 17:14:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_segtab.c,v 1.1.2.6 2010/02/25 05:24:24 matt Exp $	*/
+/*	$NetBSD: pmap_segtab.c,v 1.1.2.7 2010/05/04 17:14:47 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.1.2.6 2010/02/25 05:24:24 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.1.2.7 2010/05/04 17:14:47 matt Exp $");
 
 /*
  *	Manages physical address maps.
@@ -137,7 +137,15 @@
 
 CTASSERT(NBPG >= sizeof(struct segtab));
 
-struct segtab	*free_segtab;		/* free list kept locally */
+struct segtab * volatile free_segtab;		/* free list kept locally */
+#ifdef DEBUG
+uint32_t nget_segtab;
+uint32_t nput_segtab;
+uint32_t npage_segtab;
+#define	SEGTAB_ADD(n, v)	(n ## _segtab += (v))
+#else
+#define	SEGTAB_ADD(n, v)	((void) 0)
+#endif
 
 static inline struct vm_page *
 pmap_pte_pagealloc(void)
@@ -183,33 +191,32 @@
 pmap_segtab_alloc(pmap_t pmap)
 {
 	struct segtab *stp;
-
+ again:
 	stp = NULL;
 	while (__predict_true(free_segtab != NULL)) {
 		struct segtab *next_stp;
 		stp = free_segtab;
 		next_stp = (struct segtab *)stp->seg_tab[0];
-		if (stp == atomic_cas_ptr(&free_segtab, stp, next_stp))
+		if (stp == atomic_cas_ptr(&free_segtab, stp, next_stp)) {
+			SEGTAB_ADD(nget, 1);
 			break;
+		}
 	}
 	
 	if (__predict_true(stp != NULL)) {
 		stp->seg_tab[0] = NULL;
 	} else {
-		paddr_t stp_pa;
+		struct vm_page * const stp_pg = pmap_pte_pagealloc();
 
-		for (;;) {
-			struct vm_page * const stp_pg = pmap_pte_pagealloc();
-			if (stp_pg != NULL) {
-stp_pa = VM_PAGE_TO_PHYS(stp_pg);
-break;
-			}
+		if (__predict_false(stp_pg == NULL)) {
 			/*
-			 * XXX What else can we do?  Could we
-			 * XXX deadlock here?
+			 * XXX What else can we do?  Could we deadlock here?
 			 */
 			uvm_wait("pmap_create");
+			goto again;
 		}
+		SEGTAB_ADD(npage, 1);
+		const paddr_t stp_pa = VM_PAGE_TO_PHYS(stp_pg);
 
 #ifdef _LP64
 		KASSERT(mips_options.mips3_xkphys_cached);
@@ -234,6 +241,7 @@
 if (tmp == atomic_cas_ptr(&free_segtab, tmp, stp+1))
 	break;
 			}
+			SEGTAB_ADD(nput, n - 1);
 		}
 	}
 
@@ -302,8 +310,10 @@
 	for (;;) {
 		void *tmp = free_segtab;
 		stp->seg_tab[0] = tmp;
-		if (tmp == atomic_cas_ptr(&free_segtab, tmp, stp))
+		if (tmp == atomic_cas_ptr(&free_segtab, tmp, stp)) {
+			SEGTAB_ADD(nput, 1);
 			break;
+		}
 	}
 }
 



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2010-05-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue May  4 17:15:36 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: pmap.c

Log Message:
Add code after pmap_remove_all nukes the ASID to reestablish it after the
subsequent pmap_update.


To generate a diff of this commit:
cvs rdiff -u -r1.179.16.23 -r1.179.16.24 src/sys/arch/mips/mips/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/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.179.16.23 src/sys/arch/mips/mips/pmap.c:1.179.16.24
--- src/sys/arch/mips/mips/pmap.c:1.179.16.23	Thu Apr  8 16:05:31 2010
+++ src/sys/arch/mips/mips/pmap.c	Tue May  4 17:15:36 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.179.16.23 2010/04/08 16:05:31 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.179.16.24 2010/05/04 17:15:36 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.179.16.23 2010/04/08 16:05:31 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.179.16.24 2010/05/04 17:15:36 matt Exp $");
 
 /*
  *	Manages physical address maps.
@@ -788,11 +788,12 @@
 	if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
 		printf("pmap_destroy(%p)\n", pmap);
 #endif
-	if (atomic_add_int_nv(&pmap->pm_count, 1) > 0) {
+	if (atomic_dec_uint_nv(&pmap->pm_count) > 0) {
 		PMAP_COUNT(dereference);
 		return;
 	}
 
+	KASSERT(pmap->pm_count == 0);
 	PMAP_COUNT(destroy);
 	kpreempt_disable();
 	pmap_tlb_asid_release_all(pmap);
@@ -814,7 +815,7 @@
 		printf("pmap_reference(%p)\n", pmap);
 #endif
 	if (pmap != NULL) {
-		atomic_add_int(&pmap->pm_count, 1);
+		atomic_inc_uint(&pmap->pm_count);
 	}
 	PMAP_COUNT(reference);
 }
@@ -845,12 +846,10 @@
 {
 	PMAP_COUNT(deactivate);
 
-#ifdef MULTIPROCESSOR
 	kpreempt_disable();
 	curcpu()->ci_pmap_segbase = (void *)(MIPS_KSEG2_START + 0x1eadbeef);
 	pmap_tlb_asid_deactivate(l->l_proc->p_vmspace->vm_map.pmap);
 	kpreempt_enable();
-#endif
 }
 
 void
@@ -858,13 +857,22 @@
 {
 	PMAP_COUNT(update);
 
-#ifdef MULTIPROCESSOR
 	kpreempt_disable();
+#ifdef MULTIPROCESSOR
 	u_int pending = atomic_swap_uint(&pm->pm_shootdown_pending, 0);
 	if (pending && pmap_tlb_shootdown_bystanders(pm))
 		PMAP_COUNT(shootdown_ipis);
-	kpreempt_enable();
 #endif
+	/*
+	 * If pmap_remove_all was called, we deactivated ourselves and nuked
+	 * our ASID.  Now we have to reactivate ourselves.
+	 */
+	if (__predict_false(pm->pm_flags & PMAP_DEFERRED_ACTIVATE)) {
+		pm->pm_flags ^= PMAP_DEFERRED_ACTIVATE;
+		pmap_tlb_asid_acquire(pm, curlwp);
+		pmap_segtab_activate(pm, curlwp);
+	}
+	kpreempt_enable();
 }
 
 /*
@@ -1634,6 +1642,7 @@
 	 */
 	pmap_tlb_asid_deactivate(pmap);
 	pmap_tlb_asid_release_all(pmap);
+	pmap->pm_flags |= PMAP_DEFERRED_ACTIVATE;
 	kpreempt_enable();
 }
 /*
@@ -2340,7 +2349,7 @@
 		lock = atomic_cas_ptr(&pg->mdpage.pvh_lock, NULL, new_lock);
 		if (lock == NULL) {
 			lock = new_lock;
-			atomic_add_int(&pli->pli_lock_refs[lockid], 1);
+			atomic_inc_uint(&pli->pli_lock_refs[lockid]);
 		}
 	}
 



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2010-05-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue May  4 17:15:53 UTC 2010

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: pmap.h

Log Message:
Add pm_flags and PMAP_DEFERRED_ACTIVATE


To generate a diff of this commit:
cvs rdiff -u -r1.54.26.12 -r1.54.26.13 src/sys/arch/mips/include/pmap.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/mips/include/pmap.h
diff -u src/sys/arch/mips/include/pmap.h:1.54.26.12 src/sys/arch/mips/include/pmap.h:1.54.26.13
--- src/sys/arch/mips/include/pmap.h:1.54.26.12	Thu Mar 11 08:19:01 2010
+++ src/sys/arch/mips/include/pmap.h	Tue May  4 17:15:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.54.26.12 2010/03/11 08:19:01 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.54.26.13 2010/05/04 17:15:53 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -166,6 +166,8 @@
 #endif
 	struct segtab		*pm_segtab;	/* pointers to pages of PTEs */
 	u_int			pm_count;	/* pmap reference count */
+	u_int			pm_flags;
+#define	PMAP_DEFERRED_ACTIVATE	0x0001
 	struct pmap_statistics	pm_stats;	/* pmap statistics */
 	struct pmap_asid_info	pm_pai[1];
 } *pmap_t;



CVS commit: src/sys/dev/rasops

2010-05-04 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue May  4 19:16:22 UTC 2010

Modified Files:
src/sys/dev/rasops: rasops2.c

Log Message:
remove now redundant ri = ... lines in putchar() methods
Looks like none of my usual test builds used rasops2.c


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/rasops/rasops2.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/rasops/rasops2.c
diff -u src/sys/dev/rasops/rasops2.c:1.16 src/sys/dev/rasops/rasops2.c:1.17
--- src/sys/dev/rasops/rasops2.c:1.16	Tue May  4 12:36:37 2010
+++ src/sys/dev/rasops/rasops2.c	Tue May  4 19:16:22 2010
@@ -1,4 +1,4 @@
-/* 	$NetBSD: rasops2.c,v 1.16 2010/05/04 12:36:37 nonaka Exp $	*/
+/* 	$NetBSD: rasops2.c,v 1.17 2010/05/04 19:16:22 macallan Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.16 2010/05/04 12:36:37 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.17 2010/05/04 19:16:22 macallan Exp $");
 
 #include "opt_rasops.h"
 
@@ -107,8 +107,6 @@
 	int32_t *rp;
 	u_char *fr;
 
-	ri = (struct rasops_info *)cookie;
-
 #ifdef RASOPS_CLIPPING
 	/* Catches 'row < 0' case too */
 	if ((unsigned)row >= (unsigned)ri->ri_rows)
@@ -256,8 +254,6 @@
 		return;
 	}
 
-	ri = (struct rasops_info *)cookie;
-
 #ifdef RASOPS_CLIPPING
 	/* Catches 'row < 0' case too */
 	if ((unsigned)row >= (unsigned)ri->ri_rows) {
@@ -323,8 +319,6 @@
 		return;
 	}
 
-	ri = (struct rasops_info *)cookie;
-
 #ifdef RASOPS_CLIPPING
 	/* Catches 'row < 0' case too */
 	if ((unsigned)row >= (unsigned)ri->ri_rows) {
@@ -393,8 +387,6 @@
 		return;
 	}
 
-	ri = (struct rasops_info *)cookie;
-
 #ifdef RASOPS_CLIPPING
 	/* Catches 'row < 0' case too */
 	if ((unsigned)row >= (unsigned)ri->ri_rows) {



CVS commit: src/sys/kern

2010-05-04 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue May  4 19:23:56 UTC 2010

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

Log Message:
switch to nanotime() for 100ns resolution


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/kern/kern_uuid.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_uuid.c
diff -u src/sys/kern/kern_uuid.c:1.16 src/sys/kern/kern_uuid.c:1.17
--- src/sys/kern/kern_uuid.c:1.16	Tue Nov 18 14:01:03 2008
+++ src/sys/kern/kern_uuid.c	Tue May  4 19:23:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_uuid.c,v 1.16 2008/11/18 14:01:03 joerg Exp $	*/
+/*	$NetBSD: kern_uuid.c,v 1.17 2010/05/04 19:23:56 kardel Exp $	*/
 
 /*
  * Copyright (c) 2002 Marcel Moolenaar
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_uuid.c,v 1.16 2008/11/18 14:01:03 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_uuid.c,v 1.17 2010/05/04 19:23:56 kardel Exp $");
 
 #include 
 #include 
@@ -136,19 +136,15 @@
  * the Unix time since 00:00:00.00, January 1, 1970 to the date of the
  * Gregorian reform to the Christian calendar.
  */
-/*
- * At present, NetBSD has no timespec source, only timeval sources.  So,
- * we use timeval.
- */
 static uint64_t
 uuid_time(void)
 {
-	struct timeval tv;
+	struct timespec tsp;
 	uint64_t xtime = 0x01B21DD213814000LL;
 
-	microtime(&tv);
-	xtime += (uint64_t)tv.tv_sec * 1000LL;
-	xtime += (uint64_t)(10 * tv.tv_usec);
+	nanotime(&tsp);
+	xtime += (uint64_t)tsp.tv_sec * 1000LL;
+	xtime += (uint64_t)(tsp.tv_nsec / 100);
 	return (xtime & ((1LL << 60) - 1LL));
 }
 



CVS commit: src/sys/dev/videomode

2010-05-04 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue May  4 21:17:10 UTC 2010

Modified Files:
src/sys/dev/videomode: files.videomode videomode.h
Added Files:
src/sys/dev/videomode: pickmode.c

Log Message:
add a bunch of small utility functions to pick video modes based on things
like dot clock, resolution etc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/videomode/files.videomode
cvs rdiff -u -r0 -r1.1 src/sys/dev/videomode/pickmode.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/videomode/videomode.h

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

Modified files:

Index: src/sys/dev/videomode/files.videomode
diff -u src/sys/dev/videomode/files.videomode:1.3 src/sys/dev/videomode/files.videomode:1.4
--- src/sys/dev/videomode/files.videomode:1.3	Thu May 11 01:49:53 2006
+++ src/sys/dev/videomode/files.videomode	Tue May  4 21:17:10 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.videomode,v 1.3 2006/05/11 01:49:53 gdamore Exp $
+#	$NetBSD: files.videomode,v 1.4 2010/05/04 21:17:10 macallan Exp $
 
 define	videomode
 define	edid
@@ -7,5 +7,7 @@
 file	dev/videomode/videomode.c	videomode | edid
 
 file	dev/videomode/edid.c		edid
+file	dev/videomode/pickmode.c	videomode
+defflag	opt_videomode.h PICKMODE_DEBUG
 
 file	dev/videomode/vesagtf.c		vesagtf | edid

Index: src/sys/dev/videomode/videomode.h
diff -u src/sys/dev/videomode/videomode.h:1.1 src/sys/dev/videomode/videomode.h:1.2
--- src/sys/dev/videomode/videomode.h:1.1	Sat Mar  4 02:34:27 2006
+++ src/sys/dev/videomode/videomode.h	Tue May  4 21:17:10 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: videomode.h,v 1.1 2006/03/04 02:34:27 gdamore Exp $	*/
+/*	$NetBSD: videomode.h,v 1.2 2010/05/04 21:17:10 macallan Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Bang Jun-Young
@@ -66,4 +66,7 @@
 extern const struct videomode videomode_list[];
 extern const int videomode_count;
 
+const struct videomode *pick_mode_by_dotclock(int, int, int);
+const struct videomode *pick_mode_by_ref(int, int, int);
+
 #endif /* _DEV_VIDEOMODE_H */

Added files:

Index: src/sys/dev/videomode/pickmode.c
diff -u /dev/null src/sys/dev/videomode/pickmode.c:1.1
--- /dev/null	Tue May  4 21:17:10 2010
+++ src/sys/dev/videomode/pickmode.c	Tue May  4 21:17:10 2010
@@ -0,0 +1,101 @@
+/* $NetBSD: pickmode.c,v 1.1 2010/05/04 21:17:10 macallan Exp $ */
+
+/*-
+ * Copyright (c) 2006 The NetBSD Foundation
+ * All rights reserved.
+ *
+ * this code was contributed to The NetBSD Foundation by Michael Lorenz
+ *
+ * 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 ``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 NETBSD FOUNDATION 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 
+__KERNEL_RCSID(0, "$NetBSD: pickmode.c,v 1.1 2010/05/04 21:17:10 macallan Exp $");
+
+#include 
+#include 
+#include "opt_videomode.h"
+
+#ifdef PICKMODE_DEBUG
+#define DPRINTF printf
+#else
+#define DPRINTF while (0) printf
+#endif
+
+const struct videomode *
+pick_mode_by_dotclock(int width, int height, int dotclock)
+{
+	const struct videomode *this, *best = NULL;
+	int i;
+
+	DPRINTF("%s: looking for %d x %d at up to %d kHz\n", __func__, width,
+	height, dotclock);
+	for (i = 0; i < videomode_count; i++) {
+
+		this = &videomode_list[i];
+		if ((this->hdisplay != width) || (this->vdisplay != height) ||
+		(this->dot_clock > dotclock))
+			continue;
+		if (best != NULL) {
+
+			if (this->dot_clock > best->dot_clock)
+best = this;
+		} else
+			best = this;
+	}
+	if (best!= NULL)
+		DPRINTF("found %s\n", best->name);
+
+	return best;
+}
+
+const struct videomode *
+pick_mode_by_ref(int width, int height, int refresh)
+{
+	const struct videomode *this, *best = NULL;
+	int mref, closest = 1000, i, diff;
+
+	DPRINTF("%s: looking for %d x %d at up to %d Hz\n", __func__, width,
+	height, refresh);
+	for (i = 0; i < videomode_count;

CVS commit: src/sys/arch

2010-05-04 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Tue May  4 23:27:14 UTC 2010

Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/i386/i386: machdep.c trap.c
src/sys/arch/i386/include: pte.h
src/sys/arch/x86/include: specialreg.h
src/sys/arch/x86/x86: pmap.c
src/sys/arch/xen/x86: cpu.c

Log Message:
Enable the NX bit feature for Xen i386pae and amd64 kernels.

Tested with Xen 3.1 and Xen 3.3, dom0 and domU, by bouyer@ and j...@.

Ok bou...@.


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.686 -r1.687 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.256 -r1.257 src/sys/arch/i386/i386/trap.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/include/pte.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/xen/x86/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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.144 src/sys/arch/amd64/amd64/machdep.c:1.145
--- src/sys/arch/amd64/amd64/machdep.c:1.144	Sun Apr 18 23:47:50 2010
+++ src/sys/arch/amd64/amd64/machdep.c	Tue May  4 23:27:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.144 2010/04/18 23:47:50 jym Exp $	*/
+/*	$NetBSD: machdep.c,v 1.145 2010/05/04 23:27:13 jym Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -107,7 +107,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.144 2010/04/18 23:47:50 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.145 2010/05/04 23:27:13 jym Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -1253,7 +1253,6 @@
 #endif /* XEN */
 
 	cpu_feature[0] &= ~CPUID_FEAT_BLACKLIST;
-	cpu_feature[2] &= ~CPUID_EXT_FEAT_BLACKLIST;
 
 	cpu_init_msrs(&cpu_info_primary, true);
 

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.686 src/sys/arch/i386/i386/machdep.c:1.687
--- src/sys/arch/i386/i386/machdep.c:1.686	Fri Apr 23 16:07:33 2010
+++ src/sys/arch/i386/i386/machdep.c	Tue May  4 23:27:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.686 2010/04/23 16:07:33 joerg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.687 2010/05/04 23:27:13 jym Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.686 2010/04/23 16:07:33 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.687 2010/05/04 23:27:13 jym Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -1299,7 +1299,6 @@
 	pcb = lwp_getpcb(&lwp0);
 
 	cpu_feature[0] &= ~CPUID_FEAT_BLACKLIST;
-	cpu_feature[2] &= ~CPUID_EXT_FEAT_BLACKLIST;
 
 	cpu_init_msrs(&cpu_info_primary, true);
 

Index: src/sys/arch/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.256 src/sys/arch/i386/i386/trap.c:1.257
--- src/sys/arch/i386/i386/trap.c:1.256	Fri Apr 23 19:18:09 2010
+++ src/sys/arch/i386/i386/trap.c	Tue May  4 23:27:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.256 2010/04/23 19:18:09 rmind Exp $	*/
+/*	$NetBSD: trap.c,v 1.257 2010/05/04 23:27:13 jym Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.256 2010/04/23 19:18:09 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.257 2010/05/04 23:27:13 jym Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -671,6 +671,8 @@
 			map = &vm->vm_map;
 		if (frame->tf_err & PGEX_W)
 			ftype = VM_PROT_WRITE;
+		else if (frame->tf_err & PGEX_X)
+			ftype = VM_PROT_EXECUTE;
 		else
 			ftype = VM_PROT_READ;
 

Index: src/sys/arch/i386/include/pte.h
diff -u src/sys/arch/i386/include/pte.h:1.22 src/sys/arch/i386/include/pte.h:1.23
--- src/sys/arch/i386/include/pte.h:1.22	Tue Apr  6 20:43:57 2010
+++ src/sys/arch/i386/include/pte.h	Tue May  4 23:27:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.22 2010/04/06 20:43:57 jld Exp $	*/
+/*	$NetBSD: pte.h,v 1.23 2010/05/04 23:27:14 jym Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -274,5 +274,6 @@
 #define PGEX_P		0x01	/* protection violation (vs. no mapping) */
 #define PGEX_W		0x02	/* exception during a write cycle */
 #define PGEX_U		0x04	/* exception while in user mode (upl) */
+#define PGEX_X		0x10	/* exception during instruction fetch */
 
 #endif /* _I386_PTE_H_ */

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.40 src/sys/arch/x86/include/specialreg.h:1.41
--- src/sys/arch/x86/include/specialreg.h:1.40	Sun Apr 18 23:47:51 2010
+++ src/sys/arch/x86/include/specialreg.h	Tue May  4 23:27:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.40 2010/04/18 23:47:51 jym Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.41 2010/05/04 23:27:14 jym Exp $	*/
 
 /*-
  * Copyright (c) 

CVS commit: src/doc

2010-05-04 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Tue May  4 23:31:54 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
xen: Enable no-execute bit feature for i386pae and amd64 kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.1390 -r1.1391 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1390 src/doc/CHANGES:1.1391
--- src/doc/CHANGES:1.1390	Tue May  4 12:45:11 2010
+++ src/doc/CHANGES	Tue May  4 23:31:54 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1390 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1391 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -605,3 +605,5 @@
 	hpcsh: Add sysinst(8) support. [tsutsui 20100503]
 	sandpoint: Added support for Marvell-SKnet in netboot.
 		[phx 20100503]
+	xen: Enable no-execute bit feature for i386pae and amd64 kernels.
+		[jym 20100505]



CVS commit: src/sys/kern

2010-05-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  5 02:20:42 UTC 2010

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

Log Message:
give the name of the dup initialization.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/kern/kern_malloc.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_malloc.c
diff -u src/sys/kern/kern_malloc.c:1.130 src/sys/kern/kern_malloc.c:1.131
--- src/sys/kern/kern_malloc.c:1.130	Mon Apr  5 04:03:42 2010
+++ src/sys/kern/kern_malloc.c	Tue May  4 22:20:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_malloc.c,v 1.130 2010/04/05 08:03:42 he Exp $	*/
+/*	$NetBSD: kern_malloc.c,v 1.131 2010/05/05 02:20:42 christos Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.130 2010/04/05 08:03:42 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.131 2010/05/05 02:20:42 christos Exp $");
 
 #include 
 #include 
@@ -812,7 +812,8 @@
 		struct malloc_type *ksp;
 		for (ksp = kmemstatistics; ksp != NULL; ksp = ksp->ks_next) {
 			if (ksp == type)
-panic("malloc_type_attach: already on list");
+panic("%s: `%s' already on list", __func__,
+type->ks_shortdesc);
 		}
 	}
 #endif



CVS commit: src/lib/libc/stdio

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May  5 04:13:16 UTC 2010

Modified Files:
src/lib/libc/stdio: stdio.3

Log Message:
Upon lukem@'s request, put the list of functions back.

XXX: Someone needs to go through all standard I/O functions in the libc,
 update the list, and keep it updated. While at it, please convert the
 list to use .Xr so that we can have links in HTML pages.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/stdio/stdio.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/stdio/stdio.3
diff -u src/lib/libc/stdio/stdio.3:1.23 src/lib/libc/stdio/stdio.3:1.24
--- src/lib/libc/stdio/stdio.3:1.23	Tue May  4 07:43:12 2010
+++ src/lib/libc/stdio/stdio.3	Wed May  5 04:13:16 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: stdio.3,v 1.23 2010/05/04 07:43:12 jruoho Exp $
+.\"	$NetBSD: stdio.3,v 1.24 2010/05/05 04:13:16 jruoho Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)stdio.3	8.7 (Berkeley) 4/19/94
 .\"
-.Dd May 4, 2010
+.Dd May 5, 2010
 .Dt STDIO 3
 .Os
 .Sh NAME
@@ -225,6 +225,93 @@
 .Nm
 library conforms to
 .St -ansiC .
+.Sh LIST OF FUNCTIONS
+.Bl -column "putchar_unlocked" "Description"
+.It Sy Function	Description
+.It clearerr	check and reset stream status
+.It fclose	close a stream
+.It fdopen	stream open functions
+.It feof	check and reset stream status
+.It ferror	check and reset stream status
+.It fflush	flush a stream
+.It fgetc	get next character or word from input stream
+.It fgetln	get a line from a stream
+.It fgetpos	reposition a stream
+.It fgets	get a line from a stream
+.It fgetwc	get next wide character from input stream
+.It fileno	check and reset stream status
+.It flockfile	lock a stream
+.It fopen	stream open functions
+.It fprintf	formatted output conversion
+.It fpurge	flush a stream
+.It fputc	output a character or word to a stream
+.It fputs	output a line to a stream
+.It fputwc	output a wide character to a stream
+.It fread	binary stream input/output
+.It freopen	stream open functions
+.It fropen	open a stream
+.It fscanf	input format conversion
+.It fseek	reposition a stream
+.It fsetpos	reposition a stream
+.It ftell	reposition a stream
+.It ftrylockfile	lock a stream (non-blocking)
+.It funlockfile	unlock a stream
+.It funopen	open a stream
+.It fwide	set/get orientation of a stream
+.It fwopen	open a stream
+.It fwrite	binary stream input/output
+.It getc	get next character or word from input stream
+.It getc_unlocked	get next character or word from input stream
+.It Ta (no implicit locking)
+.It getchar	get next character or word from input stream
+.It getchar_unlocked	get next character or word from input stream
+.It Ta (no implicit locking)
+.It getdelim	get a delimited record from a stream
+.It getline	get a line from a stream
+.It gets	get a line from a stream
+.It getw	get next character or word from input stream
+.It getwc	get next wide character from input stream
+.It getwchar	get next wide character from input stream
+.It mkstemp	create unique temporary file
+.It mktemp	create unique temporary file
+.It perror	system error messages
+.It printf	formatted output conversion
+.It putc	output a character or word to a stream
+.It putc_unlocked	output a character or word to a stream
+.It Ta (no implicit locking)
+.It putchar	output a character or word to a stream
+.It putchar_unlocked	output a character or word to a stream
+.It Ta (no implicit locking)
+.It puts	output a line to a stream
+.It putw	output a character or word to a stream
+.It putwc	output a wide character to a stream
+.It putwchar	output a wide character to a stream
+.It remove	remove directory entry
+.It rewind	reposition a stream
+.It scanf	input format conversion
+.It setbuf	stream buffering operations
+.It setbuffer	stream buffering operations
+.It setlinebuf	stream buffering operations
+.It setvbuf	stream buffering operations
+.It snprintf	formatted output conversion
+.It sprintf	formatted output conversion
+.It sscanf	input format conversion
+.It strerror	system error messages
+.It sys_errlist	system error messages
+.It sys_nerr	system error messages
+.It tempnam	temporary file routines
+.It tmpfile	temporary file routines
+.It tmpnam	temporary file routines
+.It ungetc	un-get character from input stream
+.It ungetwc	un-get wide character from input stream
+.It vfprintf	formatted output conversion
+.It vfscanf	input format conversion
+.It vprintf	formatted output conversion
+.It vscanf	input format conversion
+.It vsnprintf	formatted output conversion
+.It vsprintf	formatted output conversion
+.It vsscanf	input format conversion
+.El
 .Sh BUGS
 The standard buffered functions do not interact well with certain other
 library and system functions, especially



CVS commit: src/share/man/man1

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May  5 05:36:21 UTC 2010

Modified Files:
src/share/man/man1: intro.1

Log Message:
Wrap the USD reference around .Rs/.Re.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man1/intro.1

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/man1/intro.1
diff -u src/share/man/man1/intro.1:1.10 src/share/man/man1/intro.1:1.11
--- src/share/man/man1/intro.1:1.10	Wed Nov 10 16:35:57 2004
+++ src/share/man/man1/intro.1	Wed May  5 05:36:21 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: intro.1,v 1.10 2004/11/10 16:35:57 wiz Exp $
+.\"	$NetBSD: intro.1,v 1.11 2010/05/05 05:36:21 jruoho Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)intro.1	8.2 (Berkeley) 12/30/93
 .\"
-.Dd April 21, 1998
+.Dd May 5, 2010
 .Dt INTRO 1
 .Os
 .Sh NAME
@@ -65,11 +65,15 @@
 .Xr intro 7 ,
 .Xr intro 8 ,
 .Xr intro 9
-.Pp
-Tutorials in the
-.%T "UNIX User's Manual Supplementary Documents" .
+.Rs
+.%A The Regents of the University of California
+.%I University of California, Berkeley
+.%T "UNIX User's Manual Supplementary Documents"
+.%D June, 1993
+.%U http://www.netbsd.org/docs/bsd/lite2/usd.html
+.Re
 .Sh HISTORY
 An
-.Nm intro
+.Xr intro 1
 manual appeared in
 .At v6 .



CVS commit: src/share/man/man9/man9.i386

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May  5 05:43:19 UTC 2010

Modified Files:
src/share/man/man9/man9.i386: return_address.9

Log Message:
.Nm -> .Fn, and wrap the kernel config option so that it will fit into 80
columns.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/man9.i386/return_address.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/man9.i386/return_address.9
diff -u src/share/man/man9/man9.i386/return_address.9:1.2 src/share/man/man9/man9.i386/return_address.9:1.3
--- src/share/man/man9/man9.i386/return_address.9:1.2	Tue Nov  3 11:04:32 2009
+++ src/share/man/man9/man9.i386/return_address.9	Wed May  5 05:43:19 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: return_address.9,v 1.2 2009/11/03 11:04:32 wiz Exp $
+.\"	$NetBSD: return_address.9,v 1.3 2010/05/05 05:43:19 jruoho Exp $
 .\"
 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 2, 2009
+.Dd May 5, 2010
 .Dt RETURN_ADDRESS 9 i386
 .Os
 .Sh NAME
@@ -39,7 +39,7 @@
 .Fn return_address "unsigned int level"
 .Sh DESCRIPTION
 The
-.Nm
+.Fn return_address
 function evaluates to the first return address on the call stack
 if
 .Fa level
@@ -52,27 +52,29 @@
 the call stack.
 .Pp
 A special fault handler stops
-.Nm
+.Fn return_address
 from crashing the kernel by examining a non-existent or corrupt stack
 frame.
 .Pp
 Kernel compilation options affect both the ability of
-.Nm
+.Fn return_address
 to locate return addresses on the stack, and the programmer's
 ability to interpret the addresses.
 The compiler may optimize away the stack frame pointers that
-.Nm
+.Fn return_address
 depends on.
+.Pp
 To use
-.Nm
+.Fn return_address
 effecively, try a kernel configuration option such as
 .Bd -literal
-makeoptions DEBUG="-g -fno-omit-frame-pointer -fno-optimize-sibling-calls -O0"
+makeoptions DEBUG="-g -fno-omit-frame-pointer \\
+		   -fno-optimize-sibling-calls -O0"
 .Ed
 .Sh RETURN VALUES
-.Nm
-returns the
-requested return address, or
+The
+.Fn return_address
+returns the requested return address, or
 .Dv NULL
 if it cannot dissect the call stack.
 .Sh CODE REFERENCES
@@ -81,7 +83,8 @@
 .Sh REFERENCES
 .Xr config 5
 .Sh HISTORY
-.Nm
+The
+.Fn return_address
 first appeared in
 .Nx 6.0 .
 .Sh AUTHORS



CVS commit: src/share/man/man9/man9.i386

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May  5 05:49:38 UTC 2010

Modified Files:
src/share/man/man9/man9.i386: bioscall.9

Log Message:
Markup: .Fn instead of .Nm, .Tn, offset indent, newline for a new sentence.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/share/man/man9/man9.i386/bioscall.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/man9.i386/bioscall.9
diff -u src/share/man/man9/man9.i386/bioscall.9:1.8 src/share/man/man9/man9.i386/bioscall.9:1.9
--- src/share/man/man9/man9.i386/bioscall.9:1.8	Wed Apr 30 13:10:59 2008
+++ src/share/man/man9/man9.i386/bioscall.9	Wed May  5 05:49:38 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bioscall.9,v 1.8 2008/04/30 13:10:59 martin Exp $
+.\"	$NetBSD: bioscall.9,v 1.9 2010/05/05 05:49:38 jruoho Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 1, 1998
+.Dd May 5, 2010
 .Dt BIOSCALL 9 i386
 .Os
 .Sh NAME
@@ -39,9 +39,10 @@
 .Fn bioscall "int function" "struct bioscallregs *regs"
 .Sh DESCRIPTION
 The
-.Nm
-function switches the processor into real mode, calls the BIOS interrupt
-numbered
+.Fn bioscall
+function switches the processor into real mode, calls the
+.Tn BIOS
+interrupt numbered
 .Fa function ,
 and returns to protected mode.
 .Pp
@@ -50,10 +51,13 @@
 .Pp
 The register values specified by
 .Fa *regs
-(with one exception) are installed before the BIOS interrupt is called.
-The processor flags are handled specially.  Only the following flags are
-passed to the
-BIOS from the registers in
+(with one exception) are installed before the
+.Tn BIOS
+interrupt is called.
+The processor flags are handled specially.
+Only the following flags are passed to the
+.Tn BIOS
+from the registers in
 .Fa regs
 (the remainder come from the processor's flags register at the time
 of the call):
@@ -71,23 +75,32 @@
 access to 32-, 16- or 8-bit wide sections of the registers.
 Definitions are provided which simplify access to the union members.
 .Sh RETURN VALUES
-.Nm
-fills in
+The
+.Fn bioscall
+function fills in
 .Fa *regs
-with the processor registers as returned from the BIOS call.
+with the processor registers as returned from the
+.Tn BIOS
+call.
 .Sh EXAMPLES
 The Advanced Power Management driver calls
-.Nm
-by setting up a register structure with the APM installation check and
-device types in registers
+.Fn bioscall
+by setting up a register structure with the
+.Tn APM
+installation check and device types in registers
 .Fa ax
 and
 .Fa bx ,
-then calls the BIOS to fetch the details for calling the APM support
-through a protected-mode interface.  The BIOS returns these details in
-the registers:
+then calls the
+.Tn BIOS
+to fetch the details for calling the
+.Tn APM
+support through a protected-mode interface.
+The
+.Tn BIOS
+returns these details in the registers:
 .Pp
-.Bd -literal
+.Bd -literal -offset indent
 #include \*[Lt]i386/bioscall.h\*[Gt]
 #include \*[Lt]i386/apmvar.h\*[Gt]
 struct bioscallregs regs;
@@ -104,11 +117,14 @@
 .Sh REFERENCES
 .Xr apm 4
 .Sh HISTORY
-.Nm
-first appeared in
+The
+.Fn bioscall
+function first appeared in
 .Nx 1.3 .
 .Sh BUGS
-Not all BIOS functions are safe to call through the trampoline, as they
+Not all
+.Tn BIOS
+functions are safe to call through the trampoline, as they
 may depend on system state which has been disturbed or used for other
 purposes once the
 .Nx



CVS commit: src/lib/libc/iconv

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May  5 06:04:20 UTC 2010

Modified Files:
src/lib/libc/iconv: iconv.3

Log Message:
Properly enumerate the two special cases. Also some markup improvements.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/iconv/iconv.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/iconv/iconv.3
diff -u src/lib/libc/iconv/iconv.3:1.12 src/lib/libc/iconv/iconv.3:1.13
--- src/lib/libc/iconv/iconv.3:1.12	Mon Aug  2 13:38:21 2004
+++ src/lib/libc/iconv/iconv.3	Wed May  5 06:04:19 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: iconv.3,v 1.12 2004/08/02 13:38:21 tshiozak Exp $
+.\" $NetBSD: iconv.3,v 1.13 2010/05/05 06:04:19 jruoho Exp $
 .\"
 .\" Copyright (c)2003 Citrus Project,
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd August 1, 2004
+.Dd May 5, 2010
 .Dt ICONV 3
 .Os
 .\" --
@@ -80,14 +80,14 @@
 and
 .Fa dstleft
 are updated as follows:
-.Bl -tag -width 01234567
-.It *src
+.Bl -tag -width 01234567 -offset indent
+.It Fa *src
 Pointer to the byte just after the last character fetched.
-.It *srcleft
+.It Fa *srcleft
 Number of remaining bytes in the source buffer.
-.It *dst
+.It Fa *dst
 Pointer to the byte just after the last character stored.
-.It *dstleft
+.It Fa *dstleft
 Number of remainder bytes in the destination buffer.
 .El
 .Pp
@@ -118,15 +118,13 @@
 returns the number of such
 .Dq invalid conversions .
 .Pp
-There are two special cases of
-.Fn iconv :
-.Bl -tag -width 0123
-.It "src == NULL || *src == NULL"
-.\"
 If the source and/or destination codesets are stateful,
 .Fn iconv
 places these into their initial state.
-.Pp
+There are two special cases of
+.Fn iconv :
+.Bl -enum -offset indent
+.It
 If both
 .Fa dst
 and
@@ -142,7 +140,7 @@
 as above.
 .Fn iconv
 will fail if the buffer is too small to store the shift sequence.
-.Pp
+.It
 On the other hand,
 .Fa dst
 or
@@ -159,7 +157,9 @@
 it returns a conversion descriptor.
 Otherwise,
 .Fn iconv_open
-returns (iconv_t)\-1 and sets errno to indicate the error.
+returns (iconv_t)\-1 and sets
+.Va errno
+to indicate the error.
 .Pp
 Upon successful completion of
 .Fn iconv_close ,



CVS commit: src/lib/libutil

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May  5 06:11:14 UTC 2010

Modified Files:
src/lib/libutil: util.3

Log Message:
Upon lukem@'s request, put the list of functions back.

XXX: Someone, please keep this up-to-date.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libutil/util.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/libutil/util.3
diff -u src/lib/libutil/util.3:1.20 src/lib/libutil/util.3:1.21
--- src/lib/libutil/util.3:1.20	Tue May  4 07:07:12 2010
+++ src/lib/libutil/util.3	Wed May  5 06:11:14 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: util.3,v 1.20 2010/05/04 07:07:12 jruoho Exp $
+.\" $NetBSD: util.3,v 1.21 2010/05/05 06:11:14 jruoho Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 4, 2010
+.Dd May 5, 2010
 .Dt UTIL 3
 .Os
 .Sh NAME
@@ -54,6 +54,58 @@
 library and the associated functions are implemented within the
 .Pa /usr/src/lib/libutil
 directory.
+.Sh LIST OF FUNCTIONS
+.Bl -column ".Xr sockaddr_snprintf 3" -compact
+.It Sy Name	Description
+.It Xr disklabel_dkcksum 3 Ta compute the checksum for a disklabel
+.It Xr disklabel_scan 3 Ta scan a buffer for a valid disklabel
+.It Xr forkpty 3 Ta tty utility function
+.It Xr getbootfile 3 Ta get the name of the booted kernel file
+.It Xr getlabeloffset 3 Ta get the sector number and offset of the disklabel
+.It Xr getlabelsector 3 Ta get the sector number and offset of the disklabel
+.It Xr getmaxpartitions 3 Ta get the maximum number of partitions allowed per disk
+.It Xr getrawpartition 3 Ta get the system ``raw'' partition
+.It Xr login 3 Ta login utility function
+.It Xr login_cap 3 Ta query login.conf database about a user class
+.It Xr login_close 3 Ta query login.conf database about a user class
+.It Xr login_getcapbool 3 Ta query login.conf database about a user class
+.It Xr login_getcapnum 3 Ta query login.conf database about a user class
+.It Xr login_getcapsize 3 Ta query login.conf database about a user class
+.It Xr login_getcapstr 3 Ta query login.conf database about a user class
+.It Xr login_getcaptime 3 Ta query login.conf database about a user class
+.It Xr login_getclass 3 Ta query login.conf database about a user class
+.It Xr login_tty 3 Ta tty utility function
+.It Xr loginx 3 Ta login utility function
+.It Xr logout 3 Ta login utility function
+.It Xr logoutx 3 Ta login utility function
+.It Xr logwtmp 3 Ta login utility function
+.It Xr logwtmpx 3 Ta login utility function
+.It Xr opendisk 3 Ta open a disk partition
+.It Xr openpty 3 Ta tty utility function
+.It Xr pidfile 3 Ta write a daemon pid file
+.It Xr pidlock 3 Ta locks based on files containing PIDs
+.It Xr pw_abort 3 Ta passwd file update function
+.It Xr pw_copy 3 Ta utility function for interactive passwd file updates
+.It Xr pw_edit 3 Ta utility function for interactive passwd file updates
+.It Xr pw_error 3 Ta utility function for interactive passwd file updates
+.It Xr pw_getconf 3 Ta password encryption configuration access function
+.It Xr pw_getprefix 3 Ta passwd file update function
+.It Xr pw_init 3 Ta utility function for interactive passwd file updates
+.It Xr pw_lock 3 Ta passwd file update function
+.It Xr pw_mkdb 3 Ta passwd file update function
+.It Xr pw_prompt 3 Ta utility function for interactive passwd file updates
+.It Xr pw_scan 3 Ta utility function for interactive passwd file updates
+.It Xr pw_setprefix 3 Ta passwd file update function
+.It Xr secure_path 3 Ta determine if a file appears to be ``secure''
+.It Xr setclasscontext 3 Ta query login.conf database about a user class
+.It Xr setusercontext 3 Ta query login.conf database about a user class
+.It Xr snprintb 3 Ta bitmask output conversion
+.It Xr sockaddr_snprintf 3 Ta socket address formatting function
+.It Xr ttyaction 3 Ta ttyaction utility function
+.It Xr ttylock 3 Ta locks based on files containing PIDs
+.It Xr ttymsg 3 Ta ttymsg utility function
+.It Xr ttyunlock 3 Ta locks based on files containing PIDs
+.El
 .Sh FILES
 .Bl -tag -width /usr/lib/libutil_p.a -compact
 .It Pa /usr/lib/libutil.a



CVS commit: src/share/man/man9

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May  5 06:19:15 UTC 2010

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

Log Message:
Clarify a sentence by removing a comma.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man9/byteorder.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/byteorder.9
diff -u src/share/man/man9/byteorder.9:1.5 src/share/man/man9/byteorder.9:1.6
--- src/share/man/man9/byteorder.9:1.5	Tue May  4 05:49:12 2010
+++ src/share/man/man9/byteorder.9	Wed May  5 06:19:15 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: byteorder.9,v 1.5 2010/05/04 05:49:12 jruoho Exp $
+.\"	$NetBSD: byteorder.9,v 1.6 2010/05/05 06:19:15 jruoho Exp $
 .\"
 .\" Copyright (c) 2002 Mike Barcroft 
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD: src/share/man/man9/byteorder.9,v 1.6 2003/05/21 17:32:55 ru Exp $
 .\"
-.Dd May 4, 2010
+.Dd May 5, 2010
 .Dt BYTEORDER 9
 .Os
 .Sh NAME
@@ -190,7 +190,7 @@
 .Fx 5.0 .
 The functions were originally introduced to handle
 .Tn PCI
-bus master devices, which assumed little endian byte order in
+bus master devices which assumed little endian byte order in
 .Tn DMA
 transfers, even on big endian systems.
 .Pp



CVS commit: src/share/man/man3

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May  5 06:24:43 UTC 2010

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

Log Message:
Add a note that rb(3) is preferred for new code.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man3/tree.3

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

Modified files:

Index: src/share/man/man3/tree.3
diff -u src/share/man/man3/tree.3:1.5 src/share/man/man3/tree.3:1.6
--- src/share/man/man3/tree.3:1.5	Sat Feb 14 22:07:04 2009
+++ src/share/man/man3/tree.3	Wed May  5 06:24:43 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tree.3,v 1.5 2009/02/14 22:07:04 dholland Exp $
+.\"	$NetBSD: tree.3,v 1.6 2010/05/05 06:24:43 jruoho Exp $
 .\"	$OpenBSD: tree.3,v 1.9 2003/05/20 09:13:38 jmc Exp $
 .\"/*
 .\" * Copyright 2002 Niels Provos 
@@ -29,7 +29,7 @@
 .\" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\" */
-.Dd February 14, 2009
+.Dd May 5, 2010
 .Dt TREE 3
 .Os
 .Sh NAME
@@ -131,6 +131,12 @@
 .Ft "struct TYPE *"
 .Fn RB_REMOVE "NAME" "RB_HEAD *head" "struct TYPE *elm"
 .Sh DESCRIPTION
+.Bf -symbolic
+This is a legacy interface; for new code,
+.Xr rb 3
+is preferred.
+.Ef
+.Pp
 These macros define data structures for different types of trees:
 splay trees and red-black trees.
 .Pp



CVS commit: src/lib/libc/db/man

2010-05-04 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May  5 06:55:57 UTC 2010

Modified Files:
src/lib/libc/db/man: dbm_clearerr.3

Log Message:
Note the POSIX compliance (already since SUSv2, '97).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/db/man/dbm_clearerr.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/db/man/dbm_clearerr.3
diff -u src/lib/libc/db/man/dbm_clearerr.3:1.4 src/lib/libc/db/man/dbm_clearerr.3:1.5
--- src/lib/libc/db/man/dbm_clearerr.3:1.4	Wed Apr 30 13:10:50 2008
+++ src/lib/libc/db/man/dbm_clearerr.3	Wed May  5 06:55:57 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dbm_clearerr.3,v 1.4 2008/04/30 13:10:50 martin Exp $
+.\"	$NetBSD: dbm_clearerr.3,v 1.5 2010/05/05 06:55:57 jruoho Exp $
 .\"
 .\" Copyright (c) 2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 30, 2004
+.Dd May 5, 2010
 .Dt DBM_CLEARERR 3
 .Os
 .Sh NAME
@@ -298,7 +298,9 @@
 and
 .Fn dbm_store
 functions conform to
-.St -xpg4.2 .
+.St -xpg4.2
+and
+.St -susv2 .
 The
 .Fn dbm_dirfno
 function is an extension.