CVS import: othersrc/external/bsd/ibbs

2015-11-22 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Nov 23 05:56:01 UTC 2015

Update of /cvsroot/othersrc/external/bsd/ibbs
In directory ivanova.netbsd.org:/tmp/cvs-serv12751

Log Message:
Import an integer-based version of the Blum Blum Shub random number
generator into othersrc.

IBBS - Integer Blum Blum Shub Random Number Generator
=

This is a small Blum Blum Shub implementation which uses a Mersenne
Twister to take 4 bytes of entropy (retrieved from the microseconds
part of gettimeofday(2)), and generates 2 prime numbers and a seed from
this.  Each prime number and seed is 16 bits.  A deterministic prime
check is used to ensure we are dealing with safe/unsafe prime numbers.

Since 16 bits are used for the two primes, care is taken to avoid
cycles in the BBS output. If a cycle is detected, the generator is
re-seeded, and output starts again.

The RNG seems to be quite efficient, generating numbers at 10 MBps
on a NetBSD VM running in Fusion hosted on Mac OS X.


Blum Blum Shub
==

More information can be found in:

https://en.wikipedia.org/wiki/Blum_Blum_Shub

In short, it's a simple, but slow (in theory), random number generator.


Time to generate random data


% time ./ibbs -n 10 -o 1.out
99.453u 1.379s 1:41.53 99.3%0+0k 0+128io 0pf+0w
%

% bc
scale = 5
10 / 101
9900990.09900

Looks like almost 10MB/s.  Tests run on a NetBSD-7.99.21 VM running
under Fusion hosted on an early 2015 Mac Book Pro.


How random is it?
=

For the dieharder tests, a file with 10^9 random bytes was generated
and handed to dieharder.

2 WEAK tests using dieharder-2 - these seem to vary in successive runs
of tests.  1 FAILED test using dieharder-2.  Every test seems to fail
this test, though, so something is weird with it.

For dieharder-3, it's much easier to egrep output:

% grep PASSED dist/dieharder.out | wc -l
 109
% egrep '(FAILED|WEAK)' dist/dieharder.out
 marsaglia_tsang_gcd|   0|  1000| 100|0.00374452|   WEAK
sts_runs|   2|10| 100|0.99938591|   WEAK
  sts_serial|  12|10| 100|0.99799268|   WEAK
  rgb_lagged_sum|  29|   100| 100|0.00041886|   WEAK
  rgb_lagged_sum|  31|   100| 100|0.0006|  
FAILED
%

If you're worried about a random number generator failing these tests,
please note the p-value, and read the dieharder man page, specifically
the section on p-values.


Provenance
==
The Mersenne Twister code comes from (the BSD-licensed):


http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html

and is used with thanks.

Inspiration for the BBS code came from Pate Williams, who wrote some
code based on multiple-precision numbers. However, ibbs has no
common code with that.


Reproducible Results


The API has been structured so that it's possible to have multiple
ibbs generators in action at any one time. It's also possible to
seed the ibbs generator so that it produces reproducible results
(assuming the same seed is used, of course). Standard operation
will be to have differing results on each run if ibbs_srandom()
is not used.

I'd be really interested to hear other people's opinions on this code; I have
no idea how predictable this random number generator is - the focus was on
producing something which could be used earlier in the boot sequence, or on
smaller, embedded CPUs.

Status:

Vendor Tag: CROOKS
Release Tags:   ibbs-base

N othersrc/external/bsd/ibbs/Makefile
N othersrc/external/bsd/ibbs/bin/Makefile
N othersrc/external/bsd/ibbs/dist/Makefile
N othersrc/external/bsd/ibbs/dist/dieharder.out
N othersrc/external/bsd/ibbs/dist/README
N othersrc/external/bsd/ibbs/dist/libibbs.3
N othersrc/external/bsd/ibbs/dist/ibbs.1
N othersrc/external/bsd/ibbs/dist/ibbs.c
N othersrc/external/bsd/ibbs/dist/ibbs.h
N othersrc/external/bsd/ibbs/dist/mersenne.h
N othersrc/external/bsd/ibbs/dist/main.c
N othersrc/external/bsd/ibbs/dist/mt19937ar.c
N othersrc/external/bsd/ibbs/dist/provenance
N othersrc/external/bsd/ibbs/lib/shlib_version
N othersrc/external/bsd/ibbs/lib/Makefile

No conflicts created by this import



CVS commit: src/sys/dev/filemon

2015-11-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Nov 23 00:47:43 UTC 2015

Modified Files:
src/sys/dev/filemon: filemon_wrapper.c

Log Message:
Retrieve the pathname of the exec'd file before we call sys_execve().

We cannot rely on using copyinstr() to retrieve the pathname from
user mode after a successful exec, since the user mode address space
is no longer valid (and may not even be accessible).  This worked in
earlier code but was broken by rev 1.7.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/filemon/filemon_wrapper.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/filemon/filemon_wrapper.c
diff -u src/sys/dev/filemon/filemon_wrapper.c:1.9 src/sys/dev/filemon/filemon_wrapper.c:1.10
--- src/sys/dev/filemon/filemon_wrapper.c:1.9	Sun Nov 22 01:20:52 2015
+++ src/sys/dev/filemon/filemon_wrapper.c	Mon Nov 23 00:47:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: filemon_wrapper.c,v 1.9 2015/11/22 01:20:52 pgoyette Exp $	*/
+/*	$NetBSD: filemon_wrapper.c,v 1.10 2015/11/23 00:47:43 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2010, Juniper Networks, Inc.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: filemon_wrapper.c,v 1.9 2015/11/22 01:20:52 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filemon_wrapper.c,v 1.10 2015/11/23 00:47:43 pgoyette Exp $");
 
 #include 
 #include 
@@ -71,10 +71,12 @@ filemon_wrapper_execve(struct lwp * l, s
 register_t * retval)
 {
 	char fname[MAXPATHLEN];
-	int error;
+	int error, cerror;
 	size_t done;
 	struct filemon *filemon;
-	
+
+	cerror = copyinstr(SCARG(uap, path), fname, sizeof(fname), &done);
+
 	if ((error = sys_execve(l, uap, retval)) != EJUSTRETURN)
 		return error;
 
@@ -82,8 +84,7 @@ filemon_wrapper_execve(struct lwp * l, s
 	if (filemon == NULL)
 		return EJUSTRETURN;
 
-	error = copyinstr(SCARG(uap, path), fname, sizeof(fname), &done);
-	if (error)
+	if (cerror)
 		goto out;
 
 	filemon_printf(filemon, "E %d %s\n", curproc->p_pid, fname);



CVS commit: src/external/gpl3/gcc.old/dist/gcc/config/i386

2015-11-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 22 20:47:42 UTC 2015

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/i386: cpuid.h

Log Message:
Fix logic bug where __cpuid gets called when __get_cpuid_max() returns 0.
This happens when __level == 0, from libgcc/config/i386/cpuinfo.c#285.
This breaks early i486 CPUs which don't have cpuid


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h

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

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h:1.3 src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h:1.4
--- src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h:1.3	Tue Sep 22 23:39:14 2015
+++ src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h	Sun Nov 22 15:47:42 2015
@@ -259,8 +259,9 @@ __get_cpuid (unsigned int __level,
 	 unsigned int *__ecx, unsigned int *__edx)
 {
   unsigned int __ext = __level & 0x8000;
+  unsigned int __maxlevel = __get_cpuid_max (__ext, 0);
 
-  if (__get_cpuid_max (__ext, 0) < __level)
+  if (__maxlevel == 0 || __maxlevel < __level)
 return 0;
 
   __cpuid (__level, *__eax, *__ebx, *__ecx, *__edx);



CVS commit: src/external/gpl3/gcc/dist/gcc/config/i386

2015-11-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 22 20:47:05 UTC 2015

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/i386: cpuid.h

Log Message:
Fix logic bug where __cpuid gets called when __get_cpuid_max() returns 0.
This happens when __level == 0, from libgcc/config/i386/cpuinfo.c#285.
This breaks early i486 CPUs which don't have cpuid
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h:1.1.1.2 src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h:1.2
--- src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h:1.1.1.2	Sat Mar  1 03:43:18 2014
+++ src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h	Sun Nov 22 15:47:05 2015
@@ -259,8 +259,9 @@ __get_cpuid (unsigned int __level,
 	 unsigned int *__ecx, unsigned int *__edx)
 {
   unsigned int __ext = __level & 0x8000;
+  unsigned int __maxlevel = __get_cpuid_max (__ext, 0);
 
-  if (__get_cpuid_max (__ext, 0) < __level)
+  if (__maxlevel == 0 || __maxlevel < __level)
 return 0;
 
   __cpuid (__level, *__eax, *__ebx, *__ecx, *__edx);



CVS commit: src/sbin/cgdconfig

2015-11-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 22 20:24:19 UTC 2015

Modified Files:
src/sbin/cgdconfig: cgdconfig.c cgdconfig.h params.c

Log Message:
Don't chdir to the config directory; just form the parameters file with a
path if needed.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sbin/cgdconfig/cgdconfig.c
cvs rdiff -u -r1.1 -r1.2 src/sbin/cgdconfig/cgdconfig.h
cvs rdiff -u -r1.26 -r1.27 src/sbin/cgdconfig/params.c

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

Modified files:

Index: src/sbin/cgdconfig/cgdconfig.c
diff -u src/sbin/cgdconfig/cgdconfig.c:1.39 src/sbin/cgdconfig/cgdconfig.c:1.40
--- src/sbin/cgdconfig/cgdconfig.c:1.39	Sun Dec 14 18:27:14 2014
+++ src/sbin/cgdconfig/cgdconfig.c	Sun Nov 22 15:24:19 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: cgdconfig.c,v 1.39 2014/12/14 23:27:14 christos Exp $ */
+/* $NetBSD: cgdconfig.c,v 1.40 2015/11/22 20:24:19 christos Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 2002, 2003\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: cgdconfig.c,v 1.39 2014/12/14 23:27:14 christos Exp $");
+__RCSID("$NetBSD: cgdconfig.c,v 1.40 2015/11/22 20:24:19 christos Exp $");
 #endif
 
 #include 
@@ -68,7 +68,6 @@ __RCSID("$NetBSD: cgdconfig.c,v 1.39 201
 #include "cgdconfig.h"
 #include "prog_ops.h"
 
-#define CGDCONFIG_DIR		"/etc/cgd"
 #define CGDCONFIG_CFILE		CGDCONFIG_DIR "/cgd.conf"
 
 enum action {
@@ -524,22 +523,11 @@ configure(int argc, char **argv, struct 
 	}
 
 	if (argc == 2) {
-		char *pfile, *base;
+		char pfile[MAXPATHLEN];
 
 		/* make string writable for basename */
-		base = strdup(dev);
-		if (base == NULL)
-			return -1;
-
-		if (asprintf(&pfile, "%s/%s",
-		CGDCONFIG_DIR, basename(base)) == -1) {
-			free(base);
-			return -1;
-		}
-
-		p = params_cget(pfile);
-		free(pfile);
-		free(base);
+		strlcpy(pfile, dev, sizeof(pfile));
+		p = params_cget(basename(pfile));
 	} else if (argc == 3) {
 		p = params_cget(argv[2]);
 	} else {
@@ -1124,10 +1112,6 @@ do_all(const char *cfile, int argc, char
 		return -1;
 	}
 
-	ret = chdir(CGDCONFIG_DIR);
-	if (ret == -1)
-		warn("could not chdir to %s", CGDCONFIG_DIR);
-
 	ret = 0;
 	lineno = 0;
 	for (;;) {

Index: src/sbin/cgdconfig/cgdconfig.h
diff -u src/sbin/cgdconfig/cgdconfig.h:1.1 src/sbin/cgdconfig/cgdconfig.h:1.2
--- src/sbin/cgdconfig/cgdconfig.h:1.1	Tue Sep  8 18:16:56 2009
+++ src/sbin/cgdconfig/cgdconfig.h	Sun Nov 22 15:24:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgdconfig.h,v 1.1 2009/09/08 22:16:56 pooka Exp $	*/
+/*	$NetBSD: cgdconfig.h,v 1.2 2015/11/22 20:24:19 christos Exp $	*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -31,4 +31,6 @@
 
 int	cgdconfig(int, char **);
 
+#define CGDCONFIG_DIR		"/etc/cgd"
+
 #endif /* _SBIN_CGDCONFIG_H_ */

Index: src/sbin/cgdconfig/params.c
diff -u src/sbin/cgdconfig/params.c:1.26 src/sbin/cgdconfig/params.c:1.27
--- src/sbin/cgdconfig/params.c:1.26	Tue Jun 16 19:18:54 2015
+++ src/sbin/cgdconfig/params.c	Sun Nov 22 15:24:19 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: params.c,v 1.26 2015/06/16 23:18:54 christos Exp $ */
+/* $NetBSD: params.c,v 1.27 2015/11/22 20:24:19 christos Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -31,10 +31,12 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: params.c,v 1.26 2015/06/16 23:18:54 christos Exp $");
+__RCSID("$NetBSD: params.c,v 1.27 2015/11/22 20:24:19 christos Exp $");
 #endif
 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -46,6 +48,7 @@ __RCSID("$NetBSD: params.c,v 1.26 2015/0
 #include "params.h"
 #include "pkcs5_pbkdf2.h"
 #include "utils.h"
+#include "cgdconfig.h"
 #include "extern.h"
 
 static void	params_init(struct params *);
@@ -618,6 +621,14 @@ params_cget(const char *fn)
 {
 	struct params	*p;
 	FILE		*f;
+	char		filename[MAXPATHLEN];
+	struct stat	st;
+
+	if (fn[0] != '/' && stat(fn, &st) == -1 && errno == ENOENT) {
+		snprintf(filename, sizeof(filename), "%s/%s",
+		CGDCONFIG_DIR, fn);
+		fn = filename;
+	}
 
 	if ((f = fopen(fn, "r")) == NULL) {
 		warn("failed to open params file \"%s\"", fn);



CVS commit: src/sys/arch

2015-11-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Nov 22 18:44:25 UTC 2015

Modified Files:
src/sys/arch/landisk/landisk: machdep.c
src/sys/arch/sh3/sh3: sh3_machdep.c

Log Message:
Remove \n from set_cpumodel(), and explicitly print \n during boot instead.

Fixes dmesg on NetBSD/dreamcast 7.0 (and probably NetBSD/hpcsh 7.0):
---
NetBSD 7.0 (GENERIC.201509250726Z)
SEGA Dreamcasttotal memory = 16384 KB
avail memory = 13668 KB
---
which was mangled when cpu_getmode() and cpu_setmodel() were introduced:
 http://mail-index.netbsd.org/source-changes/2014/03/24/msg053273.html

Should be pulled up to netbsd-7 and netbsd-7-0.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/landisk/landisk/machdep.c
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/sh3/sh3/sh3_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/landisk/landisk/machdep.c
diff -u src/sys/arch/landisk/landisk/machdep.c:1.17 src/sys/arch/landisk/landisk/machdep.c:1.18
--- src/sys/arch/landisk/landisk/machdep.c:1.17	Mon Mar 24 20:06:32 2014
+++ src/sys/arch/landisk/landisk/machdep.c	Sun Nov 22 18:44:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.17 2014/03/24 20:06:32 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.18 2015/11/22 18:44:25 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.17 2014/03/24 20:06:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2015/11/22 18:44:25 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -147,7 +147,7 @@ cpu_startup(void)
 {
 
 	/* XXX: show model (LANDISK/USL-5P) */
-	cpu_setmodel("Model: I-O DATA LANDISK\n");
+	cpu_setmodel("Model: I-O DATA LANDISK");
 
 sh_startup();
 }

Index: src/sys/arch/sh3/sh3/sh3_machdep.c
diff -u src/sys/arch/sh3/sh3/sh3_machdep.c:1.102 src/sys/arch/sh3/sh3/sh3_machdep.c:1.103
--- src/sys/arch/sh3/sh3/sh3_machdep.c:1.102	Mon Mar 24 20:06:32 2014
+++ src/sys/arch/sh3/sh3/sh3_machdep.c	Sun Nov 22 18:44:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sh3_machdep.c,v 1.102 2014/03/24 20:06:32 christos Exp $	*/
+/*	$NetBSD: sh3_machdep.c,v 1.103 2015/11/22 18:44:25 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sh3_machdep.c,v 1.102 2014/03/24 20:06:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sh3_machdep.c,v 1.103 2015/11/22 18:44:25 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -277,7 +277,7 @@ sh_startup(void)
 
 	printf("%s%s", copyright, version);
 	if (*model != '\0')
-		printf("%s", model);
+		printf("%s\n", model);
 #ifdef DEBUG
 	printf("general exception handler:\t%d byte\n",
 	sh_vector_generic_end - sh_vector_generic);



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

2015-11-22 Thread Aymeric Vincent
Module Name:src
Committed By:   aymeric
Date:   Sun Nov 22 17:50:48 UTC 2015

Modified Files:
src/sys/arch/arm/allwinner: awin_debe.c files.awin

Log Message:
do not fail if no awintcon is present so that ALLWINNER_A80 compiles again


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/allwinner/awin_debe.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/allwinner/files.awin

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

Modified files:

Index: src/sys/arch/arm/allwinner/awin_debe.c
diff -u src/sys/arch/arm/allwinner/awin_debe.c:1.19 src/sys/arch/arm/allwinner/awin_debe.c:1.20
--- src/sys/arch/arm/allwinner/awin_debe.c:1.19	Thu Nov 19 18:48:22 2015
+++ src/sys/arch/arm/allwinner/awin_debe.c	Sun Nov 22 17:50:48 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_debe.c,v 1.19 2015/11/19 18:48:22 bouyer Exp $ */
+/* $NetBSD: awin_debe.c,v 1.20 2015/11/22 17:50:48 aymeric Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -29,6 +29,7 @@
 #include "opt_allwinner.h"
 #include "genfb.h"
 #include "awin_mp.h"
+#include "awin_tcon.h"
 
 #ifndef AWIN_DEBE_VIDEOMEM
 #define AWIN_DEBE_VIDEOMEM	(16 * 1024 * 1024)
@@ -37,7 +38,7 @@
 #define AWIN_DEBE_CURMAX	64
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: awin_debe.c,v 1.19 2015/11/19 18:48:22 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_debe.c,v 1.20 2015/11/22 17:50:48 aymeric Exp $");
 
 #include 
 #include 
@@ -602,8 +603,10 @@ awin_debe_ioctl(device_t self, u_long cm
 			val &= ~AWIN_DEBE_MODCTL_HWC_EN;
 		}
 		DEBE_WRITE(sc, AWIN_DEBE_MODCTL_REG, val);
+#if NAWIN_TCON > 0
 		/* debe0 always connected to tcon0, debe1 to tcon1*/
 		awin_tcon_setvideo(device_unit(sc->sc_dev), enable);
+#endif
 		return 0;
 	case WSDISPLAYIO_GVIDEO:
 		val = DEBE_READ(sc, AWIN_DEBE_MODCTL_REG);

Index: src/sys/arch/arm/allwinner/files.awin
diff -u src/sys/arch/arm/allwinner/files.awin:1.32 src/sys/arch/arm/allwinner/files.awin:1.33
--- src/sys/arch/arm/allwinner/files.awin:1.32	Sat Jul 25 15:19:54 2015
+++ src/sys/arch/arm/allwinner/files.awin	Sun Nov 22 17:50:48 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.awin,v 1.32 2015/07/25 15:19:54 jmcneill Exp $
+#	$NetBSD: files.awin,v 1.33 2015/11/22 17:50:48 aymeric Exp $
 #
 # Configuration info for Allwinner ARM Peripherals
 #
@@ -152,7 +152,7 @@ file	arch/arm/allwinner/awin_hdmiaudio.c
 # A10/A20/A31 LCD/TV timing controller (TCON)
 device	awintcon
 attach	awintcon at awinio with awin_tcon
-file	arch/arm/allwinner/awin_tcon.c		awin_tcon | awin_hdmi
+file	arch/arm/allwinner/awin_tcon.c		awin_tcon | awin_hdmi	needs-flag
 
 # A10/A20/A31 Display engine backend (DE-BE)
 device	awindebe { }



CVS commit: src/sbin/fdisk

2015-11-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 22 15:53:10 UTC 2015

Modified Files:
src/sbin/fdisk: fdisk.c

Log Message:
explain how to clear an entry (without reading the source)


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sbin/fdisk/fdisk.c

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

Modified files:

Index: src/sbin/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.152 src/sbin/fdisk/fdisk.c:1.153
--- src/sbin/fdisk/fdisk.c:1.152	Tue Jun 16 19:58:30 2015
+++ src/sbin/fdisk/fdisk.c	Sun Nov 22 10:53:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.152 2015/06/16 23:58:30 christos Exp $ */
+/*	$NetBSD: fdisk.c,v 1.153 2015/11/22 15:53:10 christos Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: fdisk.c,v 1.152 2015/06/16 23:58:30 christos Exp $");
+__RCSID("$NetBSD: fdisk.c,v 1.153 2015/11/22 15:53:10 christos Exp $");
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -2975,7 +2975,7 @@ string(const char *prompt, int length, c
 	int len;
 
 	for (;;) {
-		printf("%s: [%.*s] ", prompt, length, buf);
+		printf("%s: [%.*s] (space to clear)", prompt, length, buf);
 
 		if (!fgets(lbuf, LBUF, stdin))
 			errx(1, "EOF");



CVS commit: [netbsd-7] src/doc

2015-11-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 22 14:23:41 UTC 2015

Modified Files:
src/doc [netbsd-7]: CHANGES-7.1

Log Message:
tickets 1042, 1046, 1047


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.35 -r1.1.2.36 src/doc/CHANGES-7.1

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-7.1
diff -u src/doc/CHANGES-7.1:1.1.2.35 src/doc/CHANGES-7.1:1.1.2.36
--- src/doc/CHANGES-7.1:1.1.2.35	Wed Nov 18 08:56:05 2015
+++ src/doc/CHANGES-7.1	Sun Nov 22 14:23:41 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1,v 1.1.2.35 2015/11/18 08:56:05 msaitoh Exp $
+# $NetBSD: CHANGES-7.1,v 1.1.2.36 2015/11/22 14:23:41 bouyer Exp $
 
 A complete list of changes from the NetBSD 7.0 release to the NetBSD 7.1
 release:
@@ -1621,3 +1621,24 @@ sys/external/bsd/drm2/include/linux/hdmi
 	Fix HDMI infoframe checksum calculations for the display to
 	not to ignore the packets.
 	[jmcneill, ticket #1039]
+
+sys/fs/adosfs/advfsops.c			1.75
+
+	Patch by hannken@ to fix a bug which has been introduced with 1.71.
+	The kernel crashed with uvm fault when mounting an ados file system.
+	[phx, ticket #1042]
+
+lib/libc/db/hash/hash.c1.36 - 1.38
+lib/libc/db/hash/hash.h1.16
+lib/libc/db/hash/hash_bigkey.c			1.25
+lib/libc/db/hash/hash_page.c			1.27, 1.28
+
+	Fix handling of 64k blocksize, which overflows a uint16_t.
+	Fixes PR/50441.
+	[christos, ticket #1046]
+
+share/terminfo/terminfo1.8
+
+	Correct the x68k's Backspace key behavior.
+	[isaki, ticket #1047]
+



CVS commit: [netbsd-7-0] src/doc

2015-11-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 22 14:22:16 UTC 2015

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.1

Log Message:
Formatting fix


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.18 -r1.1.2.19 src/doc/CHANGES-7.0.1

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-7.0.1
diff -u src/doc/CHANGES-7.0.1:1.1.2.18 src/doc/CHANGES-7.0.1:1.1.2.19
--- src/doc/CHANGES-7.0.1:1.1.2.18	Sun Nov 22 14:21:20 2015
+++ src/doc/CHANGES-7.0.1	Sun Nov 22 14:22:16 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.1,v 1.1.2.18 2015/11/22 14:21:20 bouyer Exp $
+# $NetBSD: CHANGES-7.0.1,v 1.1.2.19 2015/11/22 14:22:16 bouyer Exp $
 
 A complete list of changes from the NetBSD 7.0 release to the NetBSD 7.0.1
 release:
@@ -784,6 +784,7 @@ sys/netinet6/mld6.c1.64
 	Ensure that the callout of the multicast address is valid before
 	hooking it up to prevent panic.
 	[joerg, ticket #1035]
+
 sys/fs/adosfs/advfsops.c			1.75
 
 	Patch by hannken@ to fix a bug which has been introduced with 1.71.



CVS commit: [netbsd-7-0] src/doc

2015-11-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 22 14:21:20 UTC 2015

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.1

Log Message:
tickets 1042, 1047


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.17 -r1.1.2.18 src/doc/CHANGES-7.0.1

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-7.0.1
diff -u src/doc/CHANGES-7.0.1:1.1.2.17 src/doc/CHANGES-7.0.1:1.1.2.18
--- src/doc/CHANGES-7.0.1:1.1.2.17	Wed Nov 18 08:56:38 2015
+++ src/doc/CHANGES-7.0.1	Sun Nov 22 14:21:20 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.1,v 1.1.2.17 2015/11/18 08:56:38 msaitoh Exp $
+# $NetBSD: CHANGES-7.0.1,v 1.1.2.18 2015/11/22 14:21:20 bouyer Exp $
 
 A complete list of changes from the NetBSD 7.0 release to the NetBSD 7.0.1
 release:
@@ -784,3 +784,14 @@ sys/netinet6/mld6.c1.64
 	Ensure that the callout of the multicast address is valid before
 	hooking it up to prevent panic.
 	[joerg, ticket #1035]
+sys/fs/adosfs/advfsops.c			1.75
+
+	Patch by hannken@ to fix a bug which has been introduced with 1.71.
+	The kernel crashed with uvm fault when mounting an ados file system.
+	[phx, ticket #1042]
+
+share/terminfo/terminfo1.8
+
+	Correct the x68k's Backspace key behavior.
+	[isaki, ticket #1047]
+



CVS commit: [netbsd-7] src/share/terminfo

2015-11-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 22 14:20:06 UTC 2015

Modified Files:
src/share/terminfo [netbsd-7]: terminfo

Log Message:
Pull up following revision(s) (requested by isaki in ticket #1047):
share/terminfo/terminfo: revision 1.8
Correct the x68k's Backspace key behavior.
With this fix, the Backspace key on x68k keyboard erases
previous one character, instead of outputting '^?' character.
Reported by Yasushi Oshima (two months ago..)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.4.1 src/share/terminfo/terminfo

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

Modified files:

Index: src/share/terminfo/terminfo
diff -u src/share/terminfo/terminfo:1.7 src/share/terminfo/terminfo:1.7.4.1
--- src/share/terminfo/terminfo:1.7	Tue Oct  1 09:17:41 2013
+++ src/share/terminfo/terminfo	Sun Nov 22 14:20:06 2015
@@ -6,8 +6,8 @@
 # Report bugs and new terminal descriptions to
 #	bug-ncur...@gnu.org
 #
-#	$Revision: 1.7 $
-#	$Date: 2013/10/01 09:17:41 $
+#	$Revision: 1.7.4.1 $
+#	$Date: 2015/11/22 14:20:06 $
 #
 # The original header is preserved below for reference.  It is noted that there
 # is a "newer" version which differs in some cosmetic details (but actually
@@ -2325,7 +2325,7 @@ arm100-w|arm100-wam|Arm(RiscPC) ncurses 
 # From Minoura Makoto , 12 May 1996
 x68k|x68k-ite|NetBSD/x68k ITE,
 	cols#96, lines#32,
-	kclr=\E[9~, khlp=\E[28~, use=vt220,
+	kbs=\177, kclr=\E[9~, khlp=\E[28~, use=vt220,
 
 # :
 # Entry for the DNARD OpenFirmware console, close to ANSI but not quite.



CVS commit: [netbsd-7-0] src/share/terminfo

2015-11-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 22 14:19:19 UTC 2015

Modified Files:
src/share/terminfo [netbsd-7-0]: terminfo

Log Message:
Pull up following revision(s) (requested by isaki in ticket #1047):
share/terminfo/terminfo: revision 1.8
Correct the x68k's Backspace key behavior.
With this fix, the Backspace key on x68k keyboard erases
previous one character, instead of outputting '^?' character.
Reported by Yasushi Oshima (two months ago..)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.6.1 src/share/terminfo/terminfo

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

Modified files:

Index: src/share/terminfo/terminfo
diff -u src/share/terminfo/terminfo:1.7 src/share/terminfo/terminfo:1.7.6.1
--- src/share/terminfo/terminfo:1.7	Tue Oct  1 09:17:41 2013
+++ src/share/terminfo/terminfo	Sun Nov 22 14:19:19 2015
@@ -6,8 +6,8 @@
 # Report bugs and new terminal descriptions to
 #	bug-ncur...@gnu.org
 #
-#	$Revision: 1.7 $
-#	$Date: 2013/10/01 09:17:41 $
+#	$Revision: 1.7.6.1 $
+#	$Date: 2015/11/22 14:19:19 $
 #
 # The original header is preserved below for reference.  It is noted that there
 # is a "newer" version which differs in some cosmetic details (but actually
@@ -2325,7 +2325,7 @@ arm100-w|arm100-wam|Arm(RiscPC) ncurses 
 # From Minoura Makoto , 12 May 1996
 x68k|x68k-ite|NetBSD/x68k ITE,
 	cols#96, lines#32,
-	kclr=\E[9~, khlp=\E[28~, use=vt220,
+	kbs=\177, kclr=\E[9~, khlp=\E[28~, use=vt220,
 
 # :
 # Entry for the DNARD OpenFirmware console, close to ANSI but not quite.



CVS commit: [netbsd-7] src/lib/libc/db/hash

2015-11-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 22 14:15:14 UTC 2015

Modified Files:
src/lib/libc/db/hash [netbsd-7]: hash.c hash.h hash_bigkey.c
hash_page.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1046):
lib/libc/db/hash/hash_page.c: revision 1.27
lib/libc/db/hash/hash_page.c: revision 1.28
lib/libc/db/hash/hash.h: revision 1.16
lib/libc/db/hash/hash.c: revision 1.36
lib/libc/db/hash/hash.c: revision 1.37
lib/libc/db/hash/hash.c: revision 1.38
lib/libc/db/hash/hash_bigkey.c: revision 1.25
Account for the -1 hack to fit 0x1 in a short in hash_page.c
Introduce a HASH_BSIZE macro to return the blocksize; in the 64K case this
returns 0x to avoid overflow. This is used where sizes are stored.
If MAX_BSIZE == hashp->BSIZE (65536) then it does not fit in a short, and
we end up storing 0... This means that every entry needs a page. We store
MAX_BSIZE - 1 here, but it would be better to always store (avail - 1) here
so that we don't waste a byte and be consistent.
PR/50441: Manuel Bouyer: hash seq enumeration skips keys on big data.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.33.4.1 -r1.33.4.2 src/lib/libc/db/hash/hash.c
cvs rdiff -u -r1.15 -r1.15.40.1 src/lib/libc/db/hash/hash.h
cvs rdiff -u -r1.24 -r1.24.10.1 src/lib/libc/db/hash/hash_bigkey.c
cvs rdiff -u -r1.26 -r1.26.4.1 src/lib/libc/db/hash/hash_page.c

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

Modified files:

Index: src/lib/libc/db/hash/hash.c
diff -u src/lib/libc/db/hash/hash.c:1.33.4.1 src/lib/libc/db/hash/hash.c:1.33.4.2
--- src/lib/libc/db/hash/hash.c:1.33.4.1	Thu Aug  6 21:50:36 2015
+++ src/lib/libc/db/hash/hash.c	Sun Nov 22 14:15:14 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.c,v 1.33.4.1 2015/08/06 21:50:36 snj Exp $	*/
+/*	$NetBSD: hash.c,v 1.33.4.2 2015/11/22 14:15:14 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: hash.c,v 1.33.4.1 2015/08/06 21:50:36 snj Exp $");
+__RCSID("$NetBSD: hash.c,v 1.33.4.2 2015/11/22 14:15:14 bouyer Exp $");
 
 #include "namespace.h"
 #include 
@@ -585,7 +585,7 @@ hash_access(HTAB *hashp, ACTION action, 
 	hash_accesses++;
 #endif
 
-	off = hashp->BSIZE;
+	off = HASH_BSIZE(hashp);
 	size = key->size;
 	kp = (char *)key->data;
 	rbufp = __get_buf(hashp, __call_hash(hashp, kp, (int)size), NULL, 0);
@@ -617,7 +617,7 @@ hash_access(HTAB *hashp, ACTION action, 
 			bp = (uint16_t *)(void *)rbufp->page;
 			n = *bp++;
 			ndx = 1;
-			off = hashp->BSIZE;
+			off = HASH_BSIZE(hashp);
 		} else if (bp[1] < REAL_KEY) {
 			if ((ndx =
 			__find_bigpair(hashp, rbufp, ndx, kp, (int)size)) > 0)
@@ -640,7 +640,7 @@ hash_access(HTAB *hashp, ACTION action, 
 bp = (uint16_t *)(void *)rbufp->page;
 n = *bp++;
 ndx = 1;
-off = hashp->BSIZE;
+off = HASH_BSIZE(hashp);
 			} else {
 save_bufp->flags &= ~BUF_PIN;
 return (ERROR);
@@ -770,7 +770,7 @@ next_bucket:
 hashp->cndx = 1;
 			}
 		} else {
-			bp = (uint16_t *)(void *)hashp->cpage->page;
+			bp = (uint16_t *)(void *)bufp->page;
 			if (flag == R_NEXT || flag == 0) {
 if (hashp->cndx > bp[0]) {
 	hashp->cpage = NULL;
@@ -802,15 +802,16 @@ next_bucket:
 	if (bp[ndx + 1] < REAL_KEY) {
 		if (__big_keydata(hashp, bufp, key, data, 1))
 			return (ERROR);
+		hashp->cndx = 1;
 	} else {
 		if (hashp->cpage == NULL)
 			return (ERROR);
 		key->data = (uint8_t *)hashp->cpage->page + bp[ndx];
-		key->size = (ndx > 1 ? bp[ndx - 1] : hashp->BSIZE) - bp[ndx];
+		key->size = (ndx > 1 ? bp[ndx - 1] : HASH_BSIZE(hashp)) - bp[ndx];
 		data->data = (uint8_t *)hashp->cpage->page + bp[ndx + 1];
 		data->size = bp[ndx] - bp[ndx + 1];
+		hashp->cndx += 2;
 	}
-	hashp->cndx += 2;
 	return (SUCCESS);
 }
 

Index: src/lib/libc/db/hash/hash.h
diff -u src/lib/libc/db/hash/hash.h:1.15 src/lib/libc/db/hash/hash.h:1.15.40.1
--- src/lib/libc/db/hash/hash.h:1.15	Tue Aug 26 21:18:38 2008
+++ src/lib/libc/db/hash/hash.h	Sun Nov 22 14:15:14 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.h,v 1.15 2008/08/26 21:18:38 joerg Exp $	*/
+/*	$NetBSD: hash.h,v 1.15.40.1 2015/11/22 14:15:14 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -123,6 +123,11 @@ typedef struct htab	 {		/* Memory reside
  * Constants
  */
 #define	MAX_BSIZE		65536		/* 2^16 */
+/*
+ * Make it fit in uint16_t; a better way would be to store size - 1, but
+ * then we'd need to bump the version.
+ */
+#define HASH_BSIZE(hp)	((hp)->BSIZE == MAX_BSIZE ? MAX_BSIZE - 1 : (hp)->BSIZE)
 #define MIN_BUFFERS		6
 #define MINHDRSIZE		512
 #define DEF_BUFSIZE		65536		/* 64 K */

Index: src/lib/libc/db/hash/hash_bigkey.c
diff -u src/lib/libc/db/hash/hash_bigkey.c:1.24 src/lib/libc/db/hash/hash_bigkey.c:1.24.10.1
--- src/lib/libc/db/hash/hash_bigkey.c:1.24	Tue Mar 13 21:13:32 2012
+++ src/lib/libc/db/hash/hash_bigkey.c	Sun No

CVS commit: src/sys/arch/amd64/amd64

2015-11-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Nov 22 14:06:08 UTC 2015

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

Log Message:
Remove cpu_vendorname (unused). It is retrieved later in identcpu.c.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/amd64/amd64/locore.S

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

Modified files:

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.81 src/sys/arch/amd64/amd64/locore.S:1.82
--- src/sys/arch/amd64/amd64/locore.S:1.81	Sun Nov 22 10:18:59 2015
+++ src/sys/arch/amd64/amd64/locore.S	Sun Nov 22 14:06:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.81 2015/11/22 10:18:59 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.82 2015/11/22 14:06:08 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -247,7 +247,6 @@ _C_LABEL(lapic_isr):
 END(lapic_isr)
 #endif
 
-	.globl	_C_LABEL(cpu_vendorname)
 	.globl	_C_LABEL(cpuid_level)
 	.globl	_C_LABEL(esym)
 	.globl	_C_LABEL(eblob)
@@ -267,10 +266,6 @@ END(cputype)
 LABEL(cpuid_level)	.long	-1	# max. level accepted by 'cpuid'
 	#   instruction
 END(cpuid_level)
-	.type	_C_LABEL(cpu_vendorname), @object
-LABEL(cpu_vendorname)	.space	16	# vendor string returned by `cpuid'
-	#   instruction
-END(cpu_vendorname)
 	.type	_C_LABEL(esym), @object
 LABEL(esym)		.quad	0	# ptr to end of syms
 END(esym)
@@ -472,11 +467,6 @@ bootinfo_finished:
 	xorl	%eax,%eax
 	cpuid
 	movl	%eax,RELOC(cpuid_level)
-	movl	$RELOC(cpu_vendorname),%ebp
-	movl	%ebx,(%ebp)
-	movl	%edx,4(%ebp)
-	movl	%ecx,8(%ebp)
-	movl	$0, 12(%ebp)
 
 	/*
 	 * Finished with old stack; load new %esp now instead of later so we



CVS commit: [netbsd-7-0] src/sys/fs/adosfs

2015-11-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 22 14:02:40 UTC 2015

Modified Files:
src/sys/fs/adosfs [netbsd-7-0]: advfsops.c

Log Message:
Pull up following revision(s) (requested by phx in ticket #1042):
sys/fs/adosfs/advfsops.c: revision 1.75
Patch by hannken@ to fix a bug which has been introduced with 1.71.
The kernel crashed with uvm fault when mounting an ados file system.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.71.6.1 src/sys/fs/adosfs/advfsops.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/adosfs/advfsops.c
diff -u src/sys/fs/adosfs/advfsops.c:1.71 src/sys/fs/adosfs/advfsops.c:1.71.6.1
--- src/sys/fs/adosfs/advfsops.c:1.71	Tue Aug  5 08:50:54 2014
+++ src/sys/fs/adosfs/advfsops.c	Sun Nov 22 14:02:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: advfsops.c,v 1.71 2014/08/05 08:50:54 hannken Exp $	*/
+/*	$NetBSD: advfsops.c,v 1.71.6.1 2015/11/22 14:02:39 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.71 2014/08/05 08:50:54 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.71.6.1 2015/11/22 14:02:39 bouyer Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -369,9 +369,12 @@ adosfs_statvfs(struct mount *mp, struct 
 int
 adosfs_vget(struct mount *mp, ino_t an, struct vnode **vpp)
 {
+	u_long block;
 	int error;
 
-	error = vcache_get(mp, &an, sizeof(an), vpp);
+	block = an;
+	KASSERT(block == an);
+	error = vcache_get(mp, &block, sizeof(block), vpp);
 	if (error)
 		return error;
 	error = vn_lock(*vpp, LK_EXCLUSIVE);
@@ -394,7 +397,7 @@ adosfs_loadvnode(struct mount *mp, struc
 	struct adosfsmount *amp;
 	struct anode *ap;
 	struct buf *bp;
-	ino_t an;
+	u_long an;
 	char *nam, *tmp;
 	int namlen, error;
 



CVS commit: [netbsd-7] src/sys/fs/adosfs

2015-11-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 22 14:02:31 UTC 2015

Modified Files:
src/sys/fs/adosfs [netbsd-7]: advfsops.c

Log Message:
Pull up following revision(s) (requested by phx in ticket #1042):
sys/fs/adosfs/advfsops.c: revision 1.75
Patch by hannken@ to fix a bug which has been introduced with 1.71.
The kernel crashed with uvm fault when mounting an ados file system.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.71.2.1 src/sys/fs/adosfs/advfsops.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/adosfs/advfsops.c
diff -u src/sys/fs/adosfs/advfsops.c:1.71 src/sys/fs/adosfs/advfsops.c:1.71.2.1
--- src/sys/fs/adosfs/advfsops.c:1.71	Tue Aug  5 08:50:54 2014
+++ src/sys/fs/adosfs/advfsops.c	Sun Nov 22 14:02:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: advfsops.c,v 1.71 2014/08/05 08:50:54 hannken Exp $	*/
+/*	$NetBSD: advfsops.c,v 1.71.2.1 2015/11/22 14:02:31 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.71 2014/08/05 08:50:54 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.71.2.1 2015/11/22 14:02:31 bouyer Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -369,9 +369,12 @@ adosfs_statvfs(struct mount *mp, struct 
 int
 adosfs_vget(struct mount *mp, ino_t an, struct vnode **vpp)
 {
+	u_long block;
 	int error;
 
-	error = vcache_get(mp, &an, sizeof(an), vpp);
+	block = an;
+	KASSERT(block == an);
+	error = vcache_get(mp, &block, sizeof(block), vpp);
 	if (error)
 		return error;
 	error = vn_lock(*vpp, LK_EXCLUSIVE);
@@ -394,7 +397,7 @@ adosfs_loadvnode(struct mount *mp, struc
 	struct adosfsmount *amp;
 	struct anode *ap;
 	struct buf *bp;
-	ino_t an;
+	u_long an;
 	char *nam, *tmp;
 	int namlen, error;
 



CVS commit: src/sys/arch/amd64/amd64

2015-11-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Nov 22 13:41:24 UTC 2015

Modified Files:
src/sys/arch/amd64/amd64: amd64_trap.S autoconf.c bios32.c gdt.c
kgdb_machdep.c linux32_sigcode.S machdep.c mptramp.S
netbsd32_machdep.c spl.S trap.c vector.S

Log Message:
KNF a bit, so I don't get scared each time I open a file


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amd64/amd64/amd64_trap.S \
src/sys/arch/amd64/amd64/linux32_sigcode.S
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/amd64/amd64/autoconf.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/amd64/amd64/bios32.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/amd64/amd64/gdt.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amd64/amd64/kgdb_machdep.c
cvs rdiff -u -r1.213 -r1.214 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/amd64/amd64/mptramp.S
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amd64/amd64/spl.S
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/amd64/amd64/trap.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/amd64/amd64/vector.S

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

Modified files:

Index: src/sys/arch/amd64/amd64/amd64_trap.S
diff -u src/sys/arch/amd64/amd64/amd64_trap.S:1.2 src/sys/arch/amd64/amd64/amd64_trap.S:1.3
--- src/sys/arch/amd64/amd64/amd64_trap.S:1.2	Wed Feb 12 19:53:49 2014
+++ src/sys/arch/amd64/amd64/amd64_trap.S	Sun Nov 22 13:41:24 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.2 2014/02/12 19:53:49 dsl Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.3 2015/11/22 13:41:24 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 
 #if 0
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.2 2014/02/12 19:53:49 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.3 2015/11/22 13:41:24 maxv Exp $");
 #endif
 
 /*
@@ -144,7 +144,7 @@ IDTVEC(trap03)
 #else
 	ZTRAP_NJ(T_BPTFLT)
 	INTRENTRY
-  	STI(si)
+	STI(si)
 	/*
 	 * DTrace Function Boundary Trace (fbt) probes are triggered
 	 * by int3 (0xcc).
@@ -378,7 +378,7 @@ END(trap_return_fault_return)
  */
 NENTRY(alltraps)
 	INTRENTRY
-  	STI(si)
+	STI(si)
 
 calltrap:
 #ifdef DIAGNOSTIC
@@ -393,11 +393,11 @@ calltrap:
 .Lalltraps_checkast:
 	movq	CPUVAR(CURLWP),%r14
 	/* Check for ASTs on exit to user mode. */
-  	CLI(si)
+	CLI(si)
 	CHECK_ASTPENDING(%r14)
 	je	3f
 	CLEAR_ASTPENDING(%r14)
-  	STI(si)
+	STI(si)
 	movl	$T_ASTFLT,TF_TRAPNO(%rsp)
 	movq	%rsp,%rdi
 	incq	CPUVAR(NTRAP)
@@ -411,7 +411,7 @@ calltrap:
 6:	cmpl	CPUVAR(ILEVEL),%ebx
 	jne	3f
 	INTRFASTEXIT
-3:  	STI(si)
+3:	STI(si)
 	movabsq	$4f,%rdi
 	movl	CPUVAR(ILEVEL),%esi
 	movl	%ebx,%edx
Index: src/sys/arch/amd64/amd64/linux32_sigcode.S
diff -u src/sys/arch/amd64/amd64/linux32_sigcode.S:1.2 src/sys/arch/amd64/amd64/linux32_sigcode.S:1.3
--- src/sys/arch/amd64/amd64/linux32_sigcode.S:1.2	Mon Aug  1 22:21:01 2011
+++ src/sys/arch/amd64/amd64/linux32_sigcode.S	Sun Nov 22 13:41:24 2015
@@ -1,28 +1,28 @@
-/*	$NetBSD: linux32_sigcode.S,v 1.2 2011/08/01 22:21:01 joerg Exp $ */
+/*	$NetBSD: linux32_sigcode.S,v 1.3 2015/11/22 13:41:24 maxv Exp $ */
 
 #include "assym.h"
 #include 
 
 	.code32
 NENTRY(linux32_sigcode)
-	 call*LINUX32_SF_HANDLER(%esp)
-	 lealLINUX32_SF_SC(%esp),%ebx # scp
-	 pushl   %eax
-	 movl$LINUX32_SYS_sigreturn,%eax
-	 int $0x80
-	 movl$LINUX32_SYS_exit,%eax
-	 int $0x80
-  
-	.balign 16
+	call	*LINUX32_SF_HANDLER(%esp)
+	leal	LINUX32_SF_SC(%esp),%ebx	# scp
+	pushl	%eax
+	movl	$LINUX32_SYS_sigreturn,%eax
+	int	$0x80
+	movl	$LINUX32_SYS_exit,%eax
+	int	$0x80
+
+	.balign	16
 NENTRY(linux32_rt_sigcode)
-	 call*LINUX32_RT_SF_HANDLER(%esp)
-	 lealLINUX32_RT_SF_UC(%esp),%ebx # scp
-	 pushl   %eax
-	 movl$LINUX32_SYS_rt_sigreturn,%eax
-	 int $0x80
-	 movl$LINUX32_SYS_exit,%eax
-	 int $0x80
-	.balign 16
-	 .globl  _C_LABEL(linux32_esigcode)
-_C_LABEL(linux32_esigcode): 
+	call	*LINUX32_RT_SF_HANDLER(%esp)
+	leal	LINUX32_RT_SF_UC(%esp),%ebx	# scp
+	pushl	%eax
+	movl	$LINUX32_SYS_rt_sigreturn,%eax
+	int	$0x80
+	movl	$LINUX32_SYS_exit,%eax
+	int	$0x80
+	.balign	16
+	.globl	_C_LABEL(linux32_esigcode)
+_C_LABEL(linux32_esigcode):
 

Index: src/sys/arch/amd64/amd64/autoconf.c
diff -u src/sys/arch/amd64/amd64/autoconf.c:1.24 src/sys/arch/amd64/amd64/autoconf.c:1.25
--- src/sys/arch/amd64/amd64/autoconf.c:1.24	Thu Nov  8 02:00:44 2012
+++ src/sys/arch/amd64/amd64/autoconf.c	Sun Nov 22 13:41:24 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.24 2012/11/08 02:00:44 chs Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.25 2015/11/22 13:41:24 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.24 2012/11/08 02:00:44 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.25 2015/11/22 13:41:24 maxv Exp $");
 
 #include "opt_multip

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

2015-11-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 22 12:26:11 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_mc.c

Log Message:
replace inline mc_read/write with MC_READ/WRITE macros, install intr handler 
with IST_MPSAFE flag


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra_mc.c

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_mc.c
diff -u src/sys/arch/arm/nvidia/tegra_mc.c:1.3 src/sys/arch/arm/nvidia/tegra_mc.c:1.4
--- src/sys/arch/arm/nvidia/tegra_mc.c:1.3	Sat Nov 21 16:50:29 2015
+++ src/sys/arch/arm/nvidia/tegra_mc.c	Sun Nov 22 12:26:11 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_mc.c,v 1.3 2015/11/21 16:50:29 jakllsch Exp $ */
+/* $NetBSD: tegra_mc.c,v 1.4 2015/11/22 12:26:11 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_mc.c,v 1.3 2015/11/21 16:50:29 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_mc.c,v 1.4 2015/11/22 12:26:11 jmcneill Exp $");
 
 #include 
 #include 
@@ -59,18 +59,12 @@ static struct tegra_mc_softc *mc_softc =
 CFATTACH_DECL_NEW(tegra_mc, sizeof(struct tegra_mc_softc),
 	tegra_mc_match, tegra_mc_attach, NULL, NULL);
 
-static inline uint32_t
-mc_read(const struct tegra_mc_softc * const sc, const bus_size_t offset)
-{
-	return bus_space_read_4(sc->sc_bst, sc->sc_bsh, offset);
-}
-
-static inline void
-mc_write(const struct tegra_mc_softc * const sc, const bus_size_t offset,
-const uint32_t value)
-{
-	bus_space_write_4(sc->sc_bst, sc->sc_bsh, offset, value);
-}
+#define MC_READ(sc, reg)		\
+bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg))
+#define MC_WRITE(sc, reg, val)		\
+bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val))
+#define MC_SET_CLEAR(sc, reg, set, clr)	\
+tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (reg), (set), (clr))
 
 static int
 tegra_mc_match(device_t parent, cfdata_t cf, void *aux)
@@ -96,7 +90,7 @@ tegra_mc_attach(device_t parent, device_
 	aprint_naive("\n");
 	aprint_normal(": MC\n");
 
-	sc->sc_ih = intr_establish(loc->loc_intr, IPL_VM, IST_LEVEL,
+	sc->sc_ih = intr_establish(loc->loc_intr, IPL_VM, IST_LEVEL|IST_MPSAFE,
 	tegra_mc_intr, sc);
 	if (sc->sc_ih == NULL) {
 		aprint_error_dev(self, "failed to establish interrupt %d\n",
@@ -105,8 +99,8 @@ tegra_mc_attach(device_t parent, device_
 	}
 	aprint_normal_dev(self, "interrupting on irq %d\n", loc->loc_intr);
 
-	mc_write(sc, MC_INTSTATUS_REG, MC_INT__ALL);
-	mc_write(sc, MC_INTMASK_REG, MC_INT__ALL);
+	MC_WRITE(sc, MC_INTSTATUS_REG, MC_INT__ALL);
+	MC_WRITE(sc, MC_INTMASK_REG, MC_INT__ALL);
 }
 
 int
@@ -114,19 +108,19 @@ tegra_mc_intr(void *v)
 {
 	struct tegra_mc_softc * const sc = v;
 
-	const uint32_t status = mc_read(sc, MC_INTSTATUS_REG);
+	const uint32_t status = MC_READ(sc, MC_INTSTATUS_REG);
 
 	if (status == 0) {
 		return 0;
 	}
 
-	const uint32_t err_status = mc_read(sc, MC_ERR_STATUS_REG);
-	const uint32_t err_adr = mc_read(sc, MC_ERR_ADR_REG);
+	const uint32_t err_status = MC_READ(sc, MC_ERR_STATUS_REG);
+	const uint32_t err_adr = MC_READ(sc, MC_ERR_ADR_REG);
 
 	device_printf(sc->sc_dev, "intrstatus %#x err %#x adr %#x\n",
 	status, err_status, err_adr);
 
-	mc_write(sc, MC_INTSTATUS_REG, status);
+	MC_WRITE(sc, MC_INTSTATUS_REG, status);
 
 	return status;
 }



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

2015-11-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 22 11:42:55 UTC 2015

Modified Files:
src/sys/arch/sparc64/include: vmparam.h

Log Message:
Reduce the "MAXDSIZ" limit for bottom-up-VA (i.e. old binaries) processes
to the old limit of 1 GB. Some old binaries can not deal with more.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sparc64/include/vmparam.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/sparc64/include/vmparam.h
diff -u src/sys/arch/sparc64/include/vmparam.h:1.35 src/sys/arch/sparc64/include/vmparam.h:1.36
--- src/sys/arch/sparc64/include/vmparam.h:1.35	Sun Nov 15 20:35:33 2015
+++ src/sys/arch/sparc64/include/vmparam.h	Sun Nov 22 11:42:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.35 2015/11/15 20:35:33 martin Exp $ */
+/*	$NetBSD: vmparam.h,v 1.36 2015/11/22 11:42:55 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -102,7 +102,7 @@
  * model.
  */
 #define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \
-round_page((vaddr_t)(da) + (vsize_t)max(maxdmap,2UL*1024*1024*1024))
+round_page((vaddr_t)(da) + (vsize_t)max(maxdmap,1UL*1024*1024*1024))
 #endif
 #ifndef	DFLSSIZ
 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */



CVS commit: src/sys/arch/sparc64/sparc64

2015-11-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 22 11:24:08 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64: netbsd32_machdep.c

Log Message:
Use NETBSD32PTR32I() for pointer-to-32bit value conversion, requested
by mrg.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/sparc64/sparc64/netbsd32_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/sparc64/sparc64/netbsd32_machdep.c
diff -u src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.107 src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.108
--- src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.107	Sun Nov 22 09:32:34 2015
+++ src/sys/arch/sparc64/sparc64/netbsd32_machdep.c	Sun Nov 22 11:24:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.107 2015/11/22 09:32:34 martin Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.108 2015/11/22 11:24:08 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.107 2015/11/22 09:32:34 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.108 2015/11/22 11:24:08 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -249,7 +249,7 @@ netbsd32_sendsig_sigcontext(const ksigin
 	printf("sendsig: saving sf to %p, setting stack pointer %p to %p\n",
 		   fp, &(((struct rwindow32 *)newsp)->rw_in[6]), oldsp);
 #endif
-	sp = (register32_t)(uintptr_t)oldsp;
+	sp = NETBSD32PTR32I(oldsp);
 	error = (rwindow_save(l) || 
 	copyout(&sf, fp, sizeof sf) || 
 	copyout(&sp, &(((struct rwindow32 *)newsp)->rw_in[6]),
@@ -368,7 +368,7 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	netbsd32_si_to_si32(&si32, (const siginfo_t *)&ksi->ksi_info);
 	ucsz = (int)(intptr_t)&uc.__uc_pad - (int)(intptr_t)&uc;
 	newsp = (struct rwindow32*)((intptr_t)fp - sizeof(struct frame32));
-	sp = (register32_t)(uintptr_t)oldsp;
+	sp = NETBSD32PTR32I(oldsp);
 	error = (copyout(&si32, &fp->sf_si, sizeof si32) ||
 	copyout(&uc, &fp->sf_uc, ucsz) ||
 	copyout(&sp, &newsp->rw_in[6], sizeof(sp)));



CVS commit: src/sys/arch/amd64/amd64

2015-11-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Nov 22 10:19:00 UTC 2015

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

Log Message:
Clarify:
 - add some comments
 - rename some jumps
 - KNF
No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/amd64/amd64/locore.S

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

Modified files:

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.80 src/sys/arch/amd64/amd64/locore.S:1.81
--- src/sys/arch/amd64/amd64/locore.S:1.80	Fri Nov 20 11:58:00 2015
+++ src/sys/arch/amd64/amd64/locore.S	Sun Nov 22 10:18:59 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.80 2015/11/20 11:58:00 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.81 2015/11/22 10:18:59 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -357,70 +357,94 @@ tmpstk:
 ENTRY(start)
 #ifndef XEN
 	.code32
-	movw	$0x1234,0x472			# warm boot
+
+	/* Warm boot */
+	movw	$0x1234,0x472
+
 	/*
-	 * Load parameters from stack
-	 * (howto, [bootdev], bootinfo, esym, basemem, extmem).
+	 * Load parameters from the stack (32 bits):   
+	 * boothowto, [bootdev], bootinfo, esym, basemem, extmem
+	 * We are not interested in 'bootdev'.
 	 */
+
+	/* Load 'boothowto' */
 	movl	4(%esp),%eax
 	movl	%eax,RELOC(boothowto)
+
+	/* Load 'bootinfo' */
 	movl	12(%esp),%eax
-	testl	%eax, %eax
-	jz	1f
-	movl	(%eax), %ebx		/* number of entries */
+	testl	%eax,%eax		/* bootinfo = NULL? */
+	jz	bootinfo_finished
+
+	movl	(%eax),%ebx		/* number of entries */
 	movl	$RELOC(bootinfo),%ebp
-	movl	%ebp, %edx
+	movl	%ebp,%edx
 	addl	$BOOTINFO_MAXSIZE,%ebp
-	movl	%ebx, (%edx)
-	addl	$4, %edx
-2:
-	testl	%ebx, %ebx
-	jz	1f
-	addl	$4, %eax
-	movl	(%eax), %ecx		/* address of entry */
+	movl	%ebx,(%edx)
+	addl	$4,%edx
+
+bootinfo_entryloop:
+	testl	%ebx,%ebx		/* no remaining entries? */
+	jz	bootinfo_finished
+
+	addl	$4,%eax
+	movl	(%eax),%ecx		/* address of entry */
 	pushl	%edi
 	pushl	%esi
 	pushl	%eax
 
-	movl	(%ecx),%eax	/* len */
+	movl	(%ecx),%eax		/* size of entry */
 	movl	%edx,%edi
-	addl	(%ecx), %edx		/* update dest pointer */
-	cmpl	%ebp, %edx
-	jg	2f
+	addl	(%ecx),%edx		/* update dest pointer */
+	cmpl	%ebp,%edx		/* beyond bootinfo+BOOTINFO_MAXSIZE? */
+	jg	bootinfo_overflow
+
 	movl	%ecx,%esi
 	movl	%eax,%ecx
+
 	/*
-	 * If any modules were loaded, record where they
-	 * end.  We'll need to skip over them.
+	 * If any modules were loaded, record where they end.  We'll need to
+	 * skip over them.
 	 */
-	cmpl	$BTINFO_MODULELIST, 4(%esi)
+	cmpl	$BTINFO_MODULELIST,4(%esi)
 	jne	0f
+
 	pushl	12(%esi)		/* endpa */
 	popl	RELOC(eblob)
-	addl	$KERNBASE_LO, RELOC(eblob)
-	adcl	$KERNBASE_HI, RELOC(eblob)+4
+	addl	$KERNBASE_LO,RELOC(eblob)
+	adcl	$KERNBASE_HI,RELOC(eblob)+4
+
 0:
 	rep
-	movsb
+	movsb/* copy esi -> edi */
 	popl	%eax
 	popl	%esi
 	popl	%edi
-	subl	$1, %ebx
-	jmp	2b
-2:	/* cleanup for overflow case */
+	subl	$1,%ebx			/* decrement the # of entries */
+	jmp	bootinfo_entryloop
+
+bootinfo_overflow:
+	/*
+	 * Cleanup for overflow case. Pop the registers, and correct the number
+	 * of entries.
+	 */
 	popl	%eax
 	popl	%esi
 	popl	%edi
 	movl	$RELOC(bootinfo),%ebp
-	movl	%ebp, %edx
-	subl	%ebx, (%edx)		/* correct number of entries */
-1:
+	movl	%ebp,%edx
+	subl	%ebx,(%edx)		/* correct the number of entries */
 
+bootinfo_finished:
+	/* Load 'esym' */
 	movl	16(%esp),%eax
-	testl	%eax,%eax
+	testl	%eax,%eax		/* esym = NULL? */
 	jz	1f
+
 	addl	$KERNBASE_LO,%eax
-1: 	movl	$RELOC(esym),%ebp
+
+1:
+	movl	$RELOC(esym),%ebp
 	movl	%eax,(%ebp)
 	movl	$KERNBASE_HI,4(%ebp)
 
@@ -428,8 +452,10 @@ ENTRY(start)
 	movl	(%ebp),%eax
 	testl	%eax,%eax
 	jnz	1f
+
 	movl	20(%esp),%eax
 	movl	%eax,(%ebp)
+
 1:
 	movl	$RELOC(biosbasemem),%ebp
 	movl	(%ebp),%eax
@@ -470,7 +496,7 @@ ENTRY(start)
  * Virtual address space of kernel:
  *
  * text | data | bss | [syms] | page dir | proc0 kstack | L1 ptp | L2 ptp | L3
- *			  0  1   2  3
+ *0  1   2  3
  */
 
 #if L2_SLOT_KERNBASE > 0
@@ -485,7 +511,6 @@ ENTRY(start)
 #define TABLE_L3_ENTRIES NKL3_KIMG_ENTRIES
 #endif
 
-
 #define PROC0_PML4_OFF	0
 #define PROC0_STK_OFF	(PROC0_PML4_OFF + PAGE_SIZE)
 #define PROC0_PTP3_OFF	(PROC0_STK_OFF + UPAGES * PAGE_SIZE)
@@ -507,7 +532,7 @@ ENTRY(start)
 #define fillkpt	\
 1:	movl	%eax,(%ebx)		; 	/* store phys addr */	\
 	movl	$0,(PDE_SIZE-4)(%ebx)	; 	/* upper 32 bits 0 */	\
-	addl	$PDE_SIZE,%ebx		; 	/* next pte/pde */	\
+	addl	$PDE_SIZE,%ebx		; 	/* next PTE/PDE */	\
 	addl	$PAGE_SIZE,%eax		; 	/* next phys page */	\
 	loop	1b			;
 
@@ -529,12 +554,13 @@ ENTRY(start)
 	subl	$KERNBASE_LO,%eax	/* XXX */
 	movl	%eax,%edi
 1:
+
 	/* Compute sizes */
 	movl	%edi,%esi
-	addl	$PGOFSET,%esi			# page align up
+	addl	$PGOFSET,%esi		/* page align up */
 	andl	$~PGOFSET,%esi
-
 	movl	%esi,%edi
+
 	xorl	%eax,%eax
 	cld
 	movl	$TABLESIZE,%ecx
@@ -542,11 +568,17 @@ ENT

CVS commit: src/sys/arch/sparc64/sparc64

2015-11-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 22 10:18:14 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64: copy.S

Log Message:
Removy now unused {s,f}uword


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/sparc64/copy.S

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/copy.S
diff -u src/sys/arch/sparc64/sparc64/copy.S:1.5 src/sys/arch/sparc64/sparc64/copy.S:1.6
--- src/sys/arch/sparc64/sparc64/copy.S:1.5	Sat Oct 17 19:29:48 2015
+++ src/sys/arch/sparc64/sparc64/copy.S	Sun Nov 22 10:18:14 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: copy.S,v 1.5 2015/10/17 19:29:48 nakayama Exp $	*/
+/*	$NetBSD: copy.S,v 1.6 2015/11/22 10:18:14 martin Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -679,23 +679,6 @@ ENTRY(ucas_64)
 /*
  * {fu,su}{,i}{byte,word}
  */
-ALTENTRY(fuiword)
-ENTRY(fuword)
-	btst	3, %o0			! has low bits set...
-	bnz	Lfsbadaddr		!	go return -1
-	 .empty
-	sethi	%hi(CPCB), %o2		! cpcb->pcb_onfault = Lfserr;
-	set	Lfserr, %o3
-	LDPTR	[%o2 + %lo(CPCB)], %o2
-	membar	#LoadStore
-	STPTR	%o3, [%o2 + PCB_ONFAULT]
-	membar	#Sync
-	LDPTRA	[%o0] ASI_AIUS, %o0	! fetch the word
-	membar	#Sync
-	STPTR	%g0, [%o2 + PCB_ONFAULT]! but first clear onfault
-	retl! phew, made it, return the word
-	 membar	#StoreStore|#StoreLoad
-
 Lfserr:
 	STPTR	%g0, [%o2 + PCB_ONFAULT]! error in r/w, clear pcb_onfault
 	membar	#StoreStore|#StoreLoad
@@ -759,23 +742,6 @@ ENTRY(fubyte)
 	retl! made it
 	 membar	#StoreStore|#StoreLoad
 
-ALTENTRY(suiword)
-ENTRY(suword)
-	btst	3, %o0			! or has low bits set ...
-	bnz	Lfsbadaddr		!	go return error
-	 .empty
-	sethi	%hi(CPCB), %o2		! cpcb->pcb_onfault = Lfserr;
-	LDPTR	[%o2 + %lo(CPCB)], %o2
-	set	Lfserr, %o3
-	STPTR	%o3, [%o2 + PCB_ONFAULT]
-	membar	#Sync
-	STPTRA	%o1, [%o0] ASI_AIUS	! store the word
-	membar	#Sync
-	STPTR	%g0, [%o2 + PCB_ONFAULT]! made it, clear onfault
-	membar	#StoreStore|#StoreLoad
-	retl! and return 0
-	 clr	%o0
-
 ENTRY(suswintr)
 	sethi	%hi(CPCB), %o2		! cpcb->pcb_onfault = _Lfsbail;
 	LDPTR	[%o2 + %lo(CPCB)], %o2
@@ -802,7 +768,6 @@ ENTRY(susword)
 	retl! and return 0
 	 clr	%o0
 
-ALTENTRY(suibyte)
 ENTRY(subyte)
 	sethi	%hi(CPCB), %o2		! cpcb->pcb_onfault = Lfserr;
 	LDPTR	[%o2 + %lo(CPCB)], %o2



CVS commit: src/share/man/man3

2015-11-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Nov 22 09:37:33 UTC 2015

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

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/share/man/man3/intro.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/intro.3
diff -u src/share/man/man3/intro.3:1.30 src/share/man/man3/intro.3:1.31
--- src/share/man/man3/intro.3:1.30	Sun Nov 22 05:12:22 2015
+++ src/share/man/man3/intro.3	Sun Nov 22 09:37:33 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: intro.3,v 1.30 2015/11/22 05:12:22 kamil Exp $
+.\"	$NetBSD: intro.3,v 1.31 2015/11/22 09:37:33 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)intro.3	8.1 (Berkeley) 6/5/93
 .\"
-.Dd July 3, 2012
+.Dd November 22, 2015
 .Dt INTRO 3
 .Os
 .Sh NAME



CVS commit: src/sys/arch/sparc64/sparc64

2015-11-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 22 09:32:34 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64: machdep.c netbsd32_machdep.c
sunos_machdep.c

Log Message:
remove all MD uses of suword(), replace by copyout()


To generate a diff of this commit:
cvs rdiff -u -r1.282 -r1.283 src/sys/arch/sparc64/sparc64/machdep.c
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/sparc64/sparc64/sunos_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/sparc64/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.282 src/sys/arch/sparc64/sparc64/machdep.c:1.283
--- src/sys/arch/sparc64/sparc64/machdep.c:1.282	Thu Jun 11 21:00:05 2015
+++ src/sys/arch/sparc64/sparc64/machdep.c	Sun Nov 22 09:32:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.282 2015/06/11 21:00:05 palle Exp $ */
+/*	$NetBSD: machdep.c,v 1.283 2015/11/22 09:32:34 martin Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.282 2015/06/11 21:00:05 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.283 2015/11/22 09:32:34 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -447,6 +447,7 @@ sendsig_siginfo(const ksiginfo_t *ksi, c
 	sig_t catcher = SIGACTION(p, sig).sa_handler;
 	struct trapframe64 *tf = l->l_md.md_tf;
 	struct rwindow *newsp;
+	register_t sp;
 	/* Allocate an aligned sigframe */
 	fp = (void *)((u_long)(fp - 1) & ~0x0f);
 
@@ -472,9 +473,11 @@ sendsig_siginfo(const ksiginfo_t *ksi, c
 	 * C stack frame.
 	 */
 	newsp = (struct rwindow *)((u_long)fp - CCFSZ);
-	error = (copyout(&ksi->ksi_info, &fp->sf_si, sizeof(ksi->ksi_info)) != 0 ||
+	sp = (register_t)(uintptr_t)tf->tf_out[6];
+	error = (copyout(&ksi->ksi_info, &fp->sf_si,
+			sizeof(ksi->ksi_info)) != 0 ||
 	copyout(&uc, &fp->sf_uc, ucsz) != 0 ||
-	suword(&newsp->rw_in[6], (uintptr_t)tf->tf_out[6]) != 0);
+	copyout(&sp, &newsp->rw_in[6], sizeof(sp)) != 0);
 	mutex_enter(p->p_lock);
 
 	if (error) {

Index: src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
diff -u src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.106 src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.107
--- src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.106	Sat Nov  7 21:07:18 2015
+++ src/sys/arch/sparc64/sparc64/netbsd32_machdep.c	Sun Nov 22 09:32:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.106 2015/11/07 21:07:18 martin Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.107 2015/11/22 09:32:34 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.106 2015/11/07 21:07:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.107 2015/11/22 09:32:34 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -178,6 +178,7 @@ netbsd32_sendsig_sigcontext(const ksigin
 	struct trapframe64 *tf;
 	int addr, onstack, error;
 	struct rwindow32 *oldsp, *newsp;
+	register32_t sp;
 	sig_t catcher = SIGACTION(p, sig).sa_handler;
 	struct sparc32_sigframe sf;
 	extern char netbsd32_sigcode[], netbsd32_esigcode[];
@@ -248,9 +249,11 @@ netbsd32_sendsig_sigcontext(const ksigin
 	printf("sendsig: saving sf to %p, setting stack pointer %p to %p\n",
 		   fp, &(((struct rwindow32 *)newsp)->rw_in[6]), oldsp);
 #endif
+	sp = (register32_t)(uintptr_t)oldsp;
 	error = (rwindow_save(l) || 
-	copyout((void *)&sf, (void *)fp, sizeof sf) || 
-	suword(&(((struct rwindow32 *)newsp)->rw_in[6]), (u_long)oldsp));
+	copyout(&sf, fp, sizeof sf) || 
+	copyout(&sp, &(((struct rwindow32 *)newsp)->rw_in[6]),
+	sizeof(sp)));
 	mutex_enter(p->p_lock);
 	if (error) {
 		/*
@@ -320,6 +323,7 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	netbsd32_intptr_t catcher;
 	struct trapframe64 *tf = l->l_md.md_tf;
 	struct rwindow32 *oldsp, *newsp;
+	register32_t sp;
 	int ucsz, error;
 
 	/* Need to attempt to zero extend this 32-bit pointer */
@@ -364,9 +368,10 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	netbsd32_si_to_si32(&si32, (const siginfo_t *)&ksi->ksi_info);
 	ucsz = (int)(intptr_t)&uc.__uc_pad - (int)(intptr_t)&uc;
 	newsp = (struct rwindow32*)((intptr_t)fp - sizeof(struct frame32));
+	sp = (register32_t)(uintptr_t)oldsp;
 	error = (copyout(&si32, &fp->sf_si, sizeof si32) ||
 	copyout(&uc, &fp->sf_uc, ucsz) ||
-	suword(&newsp->rw_in[6], (intptr_t)oldsp));
+	copyout(&sp, &newsp->rw_in[6], sizeof(sp)));
 	mutex_enter(p->p_lock);
 
 	if (error) {

Index: src/sys/arch/sparc64/sparc64/sunos_machdep.c
diff -u src/sys/arch/sparc64/sparc64/sunos_machdep.c:1.32 src/sys/arch/sparc64/sparc64/sunos_machdep.c:1.33
--- src/sys/arch/sparc64/sparc64/sunos_machdep.c:1.32	Wed Nov 27 14:22:45 2013
+++ src/sys/arch/spar