CVS commit: src/external/gpl3/gdb/lib/libgdb/arch/hppa

2017-12-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec  4 03:08:34 UTC 2017

Modified Files:
src/external/gpl3/gdb/lib/libgdb/arch/hppa: defs.mk init.c

Log Message:
regen hppa


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/lib/libgdb/arch/hppa/defs.mk
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/lib/libgdb/arch/hppa/init.c

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

Modified files:

Index: src/external/gpl3/gdb/lib/libgdb/arch/hppa/defs.mk
diff -u src/external/gpl3/gdb/lib/libgdb/arch/hppa/defs.mk:1.12 src/external/gpl3/gdb/lib/libgdb/arch/hppa/defs.mk:1.13
--- src/external/gpl3/gdb/lib/libgdb/arch/hppa/defs.mk:1.12	Fri Dec  1 19:00:58 2017
+++ src/external/gpl3/gdb/lib/libgdb/arch/hppa/defs.mk	Sun Dec  3 22:08:34 2017
@@ -2,7 +2,6 @@
 # Generated from: NetBSD: mknative-gdb,v 1.7 2016/10/16 04:37:42 mrg Exp 
 # Generated from: NetBSD: mknative.common,v 1.15 2017/11/29 03:32:28 christos Exp 
 #
-config.status: creating Makefile
 G_INTERNAL_CFLAGS=   -I. -I${GNUHOSTDIST}/gdb -I${GNUHOSTDIST}/gdb/common -I${GNUHOSTDIST}/gdb/config -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H -I${GNUHOSTDIST}/gdb/../include/opcode -I${GNUHOSTDIST}/gdb/../opcodes/.. -I${GNUHOSTDIST}/gdb/../readline/.. -I${GNUHOSTDIST}/gdb/../zlib -I../bfd -I${GNUHOSTDIST}/gdb/../bfd -I${GNUHOSTDIST}/gdb/../include -I../libdecnumber -I${GNUHOSTDIST}/gdb/../libdecnumber -I./../intl -I${GNUHOSTDIST}/gdb/gnulib/import -Ibuild-gnulib/import   -DTUI=1  -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-narrowing -Wformat-nonliteral 
 G_LIBGDB_OBS=hppa-tdep.o hppa-bsd-tdep.o hppa-nbsd-tdep.o solib-svr4.o ser-base.o ser-unix.o ser-pipe.o ser-tcp.o fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o ax-gdb.o ax-general.o ctf.o dcache.o remote.o remote-fileio.o remote-notif.o tracefile.o tracefile-tfile.o tracepoint.o  cli-cmds.o cli-decode.o cli-dump.o cli-interp.o cli-logging.o cli-script.o cli-setshow.o cli-utils.o mi-cmd-break.o mi-cmd-catch.o mi-cmd-disas.o mi-cmd-env.o mi-cmd-file.o mi-cmd-info.o mi-cmd-stack.o mi-cmd-target.o mi-cmd-var.o mi-cmds.o mi-console.o mi-getopt.o mi-interp.o mi-main.o mi-out.o mi-parse.o mi-symbol-cmds.o tui.o tui-command.o tui-data.o tui-disasm.o tui-file.o tui-hooks.o tui-interp.o tui-io.o tui-layout.o tui-out.o tui-regs.o tui-source.o tui-stack.o tui-win.o tui-windata.o tui-wingeneral.o tui-winsource.o python.o guile.o elfread.o stap-probe.o dtrace-probe.o posix-hdep.o posix-strerror.o ada-exp.o c-exp.o cp-name-parser.o d-exp.o f-exp.o go-exp.o m2-exp.o p-exp.o rust-exp.o ada-la
 ng.o ada-tasks.o ada-typeprint.o ada-valprint.o ada-varobj.o addrmap.o agent.o annotate.o arch-utils.o auto-load.o auxv.o bcache.o bfd-target.o block.o blockframe.o break-catch-sig.o break-catch-syscall.o break-catch-throw.o breakpoint.o btrace.o btrace-common.o buffer.o build-id.o buildsym.o c-lang.o c-typeprint.o c-valprint.o c-varobj.o charset.o cleanups.o cli-out.o coff-pe-read.o coffread.o common-agent.o common-debug.o common-exceptions.o common-regcache.o common-utils.o complaints.o completer.o continuations.o copying.o corefile.o corelow.o cp-abi.o cp-namespace.o cp-support.o cp-valprint.o d-lang.o d-namespace.o d-valprint.o dbxread.o debug.o demangle.o dfp.o dictionary.o disasm.o disasm-selftests.o doublest.o dummy-frame.o dwarf2-frame.o dwarf2-frame-tailcall.o dwarf2expr.o dwarf2loc.o dwarf2read.o environ.o errors.o eval.o event-loop.o event-top.o exceptions.o exec.o expprint.o extension.o f-lang.o f-typeprint.o f-valprint.o fileio.o filestuff.o filesystem.o findcmd.o findv
 ar.o format.o frame.o frame-base.o frame-unwind.o gcore.o gdb_bfd.o gdb-dlfcn.o gdb_obstack.o gdb_usleep.o gdb_vecs.o gdbarch.o gdbtypes.o gnu-v2-abi.o gnu-v3-abi.o go-lang.o go-typeprint.o go-valprint.o inf-child.o inf-loop.o infcall.o infcmd.o inferior.o infrun.o inline-frame.o interps.o jit.o language.o linespec.o location.o m2-lang.o m2-typeprint.o m2-valprint.o macrocmd.o macroexp.o macroscope.o macrotab.o main.o maint.o mdebugread.o mem-break.o memattr.o memory-map.o memrange.o mi-common.o minidebug.o minsyms.o mipsread.o namespace.o new-op.o objc-lang.o objfiles.o observer.o opencl-lang.o osabi.o osdata.o p-lang.o p-typeprint.o p-valprint.o parse.o print-utils.o printcmd.o probe.o progspace.o prologue-value.o psymtab.o ptid.o record.o record-btrace.o record-full.o regcache.o reggroups.o registry.o reverse.o rsp-low.o run-time-clock.o rust-lang.o selftest.o selftest-arch.o sentinel-frame.o ser-event.o serial.o signals.o signals-state-save-restore.o skip.o solib.o solib-target.
 o source.o stabsread.o stack.o std-regs.o symfile.o symfile-debug.o symmisc.o symtab.o target.o target-dcache.o target-descriptions.o target-memory.o thread.o thread-fsm.o tid-parse.o top.o trad-frame.o tramp-

CVS commit: src/usr.bin/vmstat

2017-12-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Dec  4 03:05:57 UTC 2017

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

Log Message:
deref the right address to get the pool_allocator.


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/usr.bin/vmstat/vmstat.c

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

Modified files:

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.223 src/usr.bin/vmstat/vmstat.c:1.224
--- src/usr.bin/vmstat/vmstat.c:1.223	Sun Dec  3 21:10:01 2017
+++ src/usr.bin/vmstat/vmstat.c	Mon Dec  4 03:05:57 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.223 2017/12/03 21:10:01 mrg Exp $ */
+/* $NetBSD: vmstat.c,v 1.224 2017/12/04 03:05:57 mrg Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.223 2017/12/03 21:10:01 mrg Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.224 2017/12/04 03:05:57 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -968,8 +968,8 @@ dosum(void)
 		uvmexp.poolpages = 0;
 		for (; addr != NULL; addr = TAILQ_NEXT(pp, pr_poollist)) {
 			deref_kptr(addr, pp, sizeof(*pp), "pool chain trashed");
-			deref_kptr(addr, &pa, sizeof(pa),
-   "pool_allocator trashed");
+			deref_kptr(pp->pr_alloc, &pa, sizeof(pa),
+			"pool allocator trashed");
 			bytes = pp->pr_npages * pa.pa_pagesz;
 			if ((pp->pr_roflags & PR_RECURSIVE) != 0)
 bytes -= (pp->pr_nout * pp->pr_size);



CVS commit: src/sys/kern

2017-12-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Dec  4 03:05:24 UTC 2017

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

Log Message:
properly account PR_RECURSIVE pools like vmstat does.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/sys/kern/subr_pool.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_pool.c
diff -u src/sys/kern/subr_pool.c:1.217 src/sys/kern/subr_pool.c:1.218
--- src/sys/kern/subr_pool.c:1.217	Sat Dec  2 08:15:42 2017
+++ src/sys/kern/subr_pool.c	Mon Dec  4 03:05:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pool.c,v 1.217 2017/12/02 08:15:42 mrg Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.218 2017/12/04 03:05:24 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.217 2017/12/02 08:15:42 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.218 2017/12/04 03:05:24 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1459,18 +1459,19 @@ int
 pool_totalpages(void)
 {
 	struct pool *pp;
-	int total = 0;
+	uint64_t total = 0;
 
 	mutex_enter(&pool_head_lock);
-	TAILQ_FOREACH(pp, &pool_head, pr_poollist)
-		/*
-		 * XXXMRG
-		if ((pp->pr_roflags & PR_RECURSIVE) == 0)
-		 */
-			total += pp->pr_npages;
+	TAILQ_FOREACH(pp, &pool_head, pr_poollist) {
+		uint64_t bytes = pp->pr_npages * pp->pr_alloc->pa_pagesz;
+
+		if ((pp->pr_roflags & PR_RECURSIVE) != 0)
+			bytes -= (pp->pr_nout * pp->pr_size);
+		total += bytes;
+	}
 	mutex_exit(&pool_head_lock);
 
-	return total;
+	return atop(total);
 }
 
 /*



CVS commit: src/usr.sbin/npf/npfctl

2017-12-03 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec  3 23:48:03 UTC 2017

Modified Files:
src/usr.sbin/npf/npfctl: npf_parse.y

Log Message:
allow PASS opt_proto ALL syntax in map statement.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.sbin/npf/npfctl/npf_parse.y

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

Modified files:

Index: src/usr.sbin/npf/npfctl/npf_parse.y
diff -u src/usr.sbin/npf/npfctl/npf_parse.y:1.44 src/usr.sbin/npf/npfctl/npf_parse.y:1.45
--- src/usr.sbin/npf/npfctl/npf_parse.y:1.44	Fri Jan 20 23:00:30 2017
+++ src/usr.sbin/npf/npfctl/npf_parse.y	Sun Dec  3 23:48:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_parse.y,v 1.44 2017/01/20 23:00:30 rmind Exp $	*/
+/*	$NetBSD: npf_parse.y,v 1.45 2017/12/03 23:48:03 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2011-2017 The NetBSD Foundation, Inc.
@@ -353,7 +353,7 @@ mapseg
 
 map
 	: MAP ifref map_sd map_algo mapseg map_type mapseg
-	  PASS opt_proto filt_opts
+	  PASS opt_proto all_or_filt_opts
 	{
 		npfctl_build_natseg($3, $6, $2, &$5, &$7, &$9, &$10, $4);
 	}



CVS commit: src/sys/dev/acpi/wmi

2017-12-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  3 23:43:00 UTC 2017

Modified Files:
src/sys/dev/acpi/wmi: wmi_dell.c

Log Message:
make this compile again and:
- remove extra space
- use alternate form %x printing
- use aprint_debug_dev instead of printf


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/acpi/wmi/wmi_dell.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/acpi/wmi/wmi_dell.c
diff -u src/sys/dev/acpi/wmi/wmi_dell.c:1.10 src/sys/dev/acpi/wmi/wmi_dell.c:1.11
--- src/sys/dev/acpi/wmi/wmi_dell.c:1.10	Sun Dec  3 12:40:48 2017
+++ src/sys/dev/acpi/wmi/wmi_dell.c	Sun Dec  3 18:43:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_dell.c,v 1.10 2017/12/03 17:40:48 bouyer Exp $ */
+/*	$NetBSD: wmi_dell.c,v 1.11 2017/12/03 23:43:00 christos Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wmi_dell.c,v 1.10 2017/12/03 17:40:48 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_dell.c,v 1.11 2017/12/03 23:43:00 christos Exp $");
 
 #include 
 #include 
@@ -164,8 +164,10 @@ wmi_dell_attach(device_t parent, device_
 		}
 	}
 	data = (uint32_t *)obj->Buffer.Pointer;
-	if (data[0] != 0x4C4C4544 || data[1] != 0x494D5720) {
-		aprint_error(": wrong WMI descriptor signature 0x%x 0x%x",
+#define WMI_LLED 	0x4C4C4544 
+#define WMI_IMWsp	0x494D5720
+	if (data[0] != WMI_LLED || data[1] != WMI_IMWsp) {
+		aprint_error(": wrong WMI descriptor signature %#x %#x",
 		data[0], data[1]);
 	}
 	sc->sc_version = data[2];
@@ -230,7 +232,7 @@ wmi_dell_resume(device_t self, const pmf
 static void
 wmi_dell_action(struct wmi_dell_softc *sc, uint16_t *data, int len)
 {
-	int i;
+	size_t i;
 	for (i = 0; i < __arraycount(wmi_dell_actions); i++) {
 		const struct wmi_dell_actions *wda = &wmi_dell_actions[i];
 		if (wda->wda_type == data[0] &&
@@ -240,27 +242,25 @@ wmi_dell_action(struct wmi_dell_softc *s
 DPRINTF((" ignored"));
 return;
 			case WMI_DELLA_PMF:
-DPRINTF((" pmf %d",
-wda->wda_data));
-pmf_event_inject(NULL,
-wda->wda_data);
+DPRINTF((" pmf %d", wda->wda_data));
+pmf_event_inject(NULL, wda->wda_data);
 return;
 			case WMI_DELLA_PSW:
-DPRINTF((" psw %d",
-wda->wda_data));
+DPRINTF((" psw %d", wda->wda_data));
 sysmon_pswitch_event(
 &sc->sc_smpsw[wda->wda_data],
 PSWITCH_EVENT_PRESSED);
 return;
 			default:
-printf("unknown dell wmi action %d\n",
+aprint_debug_dev(sc->sc_dev,
+"unknown dell wmi action %d\n",
 wda->wda_action);
 return;
 			}
 
 		}
 	}
-	aprint_debug_dev(sc->sc_dev, "unkown event 0x%4X 0x%4X\n",
+	aprint_debug_dev(sc->sc_dev, "unknown event %#4X %#4X\n",
 	data[0], data[1]);
 }
 
@@ -312,7 +312,7 @@ wmi_dell_notify_handler(ACPI_HANDLE hdl,
 			continue;
 		}
 		for (i = 1; i < len; i++)
-			DPRINTF((" 0x%04X", data[i]));
+			DPRINTF((" %#04X", data[i]));
 		wmi_dell_action(sc, &data[1], len - 1);
 		DPRINTF(("\n"));
 		data = &data[len];
@@ -332,7 +332,7 @@ out:
 
 	if (ACPI_FAILURE(rv))
 		aprint_error_dev(sc->sc_dev, "failed to get data for "
-		"event 0x%02X: %s\n", evt, AcpiFormatException(rv));
+		"event %#02X: %s\n", evt, AcpiFormatException(rv));
 }
 
 MODULE(MODULE_CLASS_DRIVER, wmidell, "acpiwmi,sysmon_power");
@@ -347,9 +347,7 @@ wmidell_modcmd(modcmd_t cmd, void *aux)
 	int rv = 0;
 
 	switch (cmd) {
-
 	case MODULE_CMD_INIT:
-
 #ifdef _MODULE
 		rv = config_init_component(cfdriver_ioconf_wmidell,
 		cfattach_ioconf_wmidell, cfdata_ioconf_wmidell);
@@ -357,7 +355,6 @@ wmidell_modcmd(modcmd_t cmd, void *aux)
 		break;
 
 	case MODULE_CMD_FINI:
-
 #ifdef _MODULE
 		rv = config_fini_component(cfdriver_ioconf_wmidell,
 		cfattach_ioconf_wmidell, cfdata_ioconf_wmidell);



CVS commit: othersrc/external/bsd/agcre/dist

2017-12-03 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Sun Dec  3 21:25:56 UTC 2017

Modified Files:
othersrc/external/bsd/agcre/dist: comp.c error.c exec.c
othersrc/external/bsd/agcre/dist/tests: 54.expected

Log Message:
remove some functions which were unused (obscured by being inline functions)

preserve the compilation flags across calls to exec()

update a test for current behavior


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/dist/comp.c \
othersrc/external/bsd/agcre/dist/error.c \
othersrc/external/bsd/agcre/dist/exec.c
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/dist/tests/54.expected

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

Modified files:

Index: othersrc/external/bsd/agcre/dist/comp.c
diff -u othersrc/external/bsd/agcre/dist/comp.c:1.1 othersrc/external/bsd/agcre/dist/comp.c:1.2
--- othersrc/external/bsd/agcre/dist/comp.c:1.1	Wed Aug 16 23:38:13 2017
+++ othersrc/external/bsd/agcre/dist/comp.c	Sun Dec  3 21:25:56 2017
@@ -647,7 +647,7 @@ regextend(const char *in, size_t insize,
 
 /* parse the string */
 static retoken_t *
-parse_string(re_t *re, input_t *in)
+parse_string(input_t *in)
 {
 	retoken_t	*dotstar;
 	retoken_t	*token;
@@ -676,7 +676,7 @@ agcre_parse_extended(agcre_re_t *agcre, 
 	re_t		*re;
 
 	re = agcre->re_g;
-	if ((entry = parse_string(re, in)) == 0) {
+	if ((entry = parse_string(in)) == 0) {
 		memcpy(re->msg, in->msg, in->msgc);
 		return 0;
 	}
Index: othersrc/external/bsd/agcre/dist/error.c
diff -u othersrc/external/bsd/agcre/dist/error.c:1.1 othersrc/external/bsd/agcre/dist/error.c:1.2
--- othersrc/external/bsd/agcre/dist/error.c:1.1	Wed Aug 16 23:38:13 2017
+++ othersrc/external/bsd/agcre/dist/error.c	Sun Dec  3 21:25:56 2017
@@ -32,12 +32,17 @@
 #include "internal.h"
 #include "agcre.h"
 
+#ifndef USE_ARG
+#define USE_ARG(x)  /*LINTED*/(void)&x
+#endif
+
 /* format the error nicely */
 size_t
 agcre_regerror(int errcode, const agcre_re_t *agcre, char *errbuf, size_t size)
 {
 	re_t	*re;
 
+	USE_ARG(errcode);
 	if (agcre == NULL || size == 0 || errbuf == NULL) {
 		return 0;
 	}
Index: othersrc/external/bsd/agcre/dist/exec.c
diff -u othersrc/external/bsd/agcre/dist/exec.c:1.1 othersrc/external/bsd/agcre/dist/exec.c:1.2
--- othersrc/external/bsd/agcre/dist/exec.c:1.1	Wed Aug 16 23:38:13 2017
+++ othersrc/external/bsd/agcre/dist/exec.c	Sun Dec  3 21:25:56 2017
@@ -172,21 +172,6 @@ make_new_context(re_t *re, int n)
 	return ctx;
 }
 
-/* copy context entry */
-static inline void
-copy_context(context_t *to, context_t *from, uint32_t n)
-{
-	uint32_t	i;
-
-	to->next = NULL;
-	to->ref = 1;
-	to->c = from->c;
-	to->nsub = from->nsub;
-	for (i = 0 ; i < n ; i++) {
-		to->sub[i] = from->sub[i];
-	}
-}
-
 /* increment reference count in the context */
 static inline context_t *
 incref(context_t *ctx)
@@ -374,18 +359,6 @@ is_better_match(context_t *ctx, context_
 	return (ctxlen == prevlen) ? (ctx->sub[0].rm_so < prev->sub[0].rm_so) : 0;
 }
 
-/* free all contexts */
-static inline void
-free_contexts(context_t *ctx)
-{
-	context_t	*next;
-
-	for ( ; ctx ; ctx = next) {
-		next = ctx->next;
-		free(ctx);
-	}
-}
-
 /* get length of utf16 string in 16bit chars */
 static inline size_t 
 strlen16(const uint16_t *s)
@@ -435,6 +408,7 @@ agcre_regexec(agcre_re_t *agcre, const v
 	threadlist_t	*tmp;
 	context_t	*matched;
 	context_t	*ctx;
+	uint32_t	 prevflags;
 	input_t		 in;
 	instr_t		*instr;
 	size_t		 i;
@@ -470,6 +444,7 @@ agcre_regexec(agcre_re_t *agcre, const v
 	current = threadlist(re->instrc);
 	next = threadlist(re->instrc);
 	re->gen += 1;
+	prevflags = re->flags;
 	re->flags |= flags;
 	addthread(re, current, newthread(re->prog, ctx), &in, 0, 1);
 	ret = AGCRE_REG_FAILURE;
@@ -570,5 +545,6 @@ break_for:
 	free(current);
 	free(next);
 	decref(re, ctx);
+	re->flags = prevflags;
 	return ret;
 }

Index: othersrc/external/bsd/agcre/dist/tests/54.expected
diff -u othersrc/external/bsd/agcre/dist/tests/54.expected:1.1 othersrc/external/bsd/agcre/dist/tests/54.expected:1.2
--- othersrc/external/bsd/agcre/dist/tests/54.expected:1.1	Wed Aug 16 23:38:13 2017
+++ othersrc/external/bsd/agcre/dist/tests/54.expected	Sun Dec  3 21:25:56 2017
@@ -1,4 +1,4 @@
 /usr/include/rump/rumpuser_port.h:260:#ifndef __arraycount
 /usr/include/rump/rumpuser_port.h:261:#define __arraycount(_ar_) (sizeof(_ar_)/sizeof(_ar_[0]))
 /usr/include/sys/bitops.h:324:	for (__i = 0; __i < __arraycount(__v->_b); __i++)		\
-/usr/include/sys/cdefs.h:572:#define	__arraycount(__x)	(sizeof(__x) / sizeof(__x[0]))
+/usr/include/sys/cdefs.h:573:#define	__arraycount(__x)	(sizeof(__x) / sizeof(__x[0]))



CVS commit: src/usr.bin/vmstat

2017-12-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Dec  3 21:10:01 UTC 2017

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

Log Message:
remove now wrong comment.  minor KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.222 -r1.223 src/usr.bin/vmstat/vmstat.c

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

Modified files:

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.222 src/usr.bin/vmstat/vmstat.c:1.223
--- src/usr.bin/vmstat/vmstat.c:1.222	Sun Dec  3 21:09:01 2017
+++ src/usr.bin/vmstat/vmstat.c	Sun Dec  3 21:10:01 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.222 2017/12/03 21:09:01 mrg Exp $ */
+/* $NetBSD: vmstat.c,v 1.223 2017/12/03 21:10:01 mrg Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.222 2017/12/03 21:09:01 mrg Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.223 2017/12/03 21:10:01 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -968,8 +968,8 @@ dosum(void)
 		uvmexp.poolpages = 0;
 		for (; addr != NULL; addr = TAILQ_NEXT(pp, pr_poollist)) {
 			deref_kptr(addr, pp, sizeof(*pp), "pool chain trashed");
-			deref_kptr(addr, &pa, sizeof(pa), "pool_allocator trashed");
-			 // XXX deref pr_alloc first
+			deref_kptr(addr, &pa, sizeof(pa),
+   "pool_allocator trashed");
 			bytes = pp->pr_npages * pa.pa_pagesz;
 			if ((pp->pr_roflags & PR_RECURSIVE) != 0)
 bytes -= (pp->pr_nout * pp->pr_size);



CVS commit: src/usr.bin/vmstat

2017-12-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Dec  3 21:09:01 UTC 2017

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

Log Message:
fix the kvm version of counting pool pages for vmstat -s.


To generate a diff of this commit:
cvs rdiff -u -r1.221 -r1.222 src/usr.bin/vmstat/vmstat.c

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

Modified files:

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.221 src/usr.bin/vmstat/vmstat.c:1.222
--- src/usr.bin/vmstat/vmstat.c:1.221	Sat Dec  2 08:15:43 2017
+++ src/usr.bin/vmstat/vmstat.c	Sun Dec  3 21:09:01 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.221 2017/12/02 08:15:43 mrg Exp $ */
+/* $NetBSD: vmstat.c,v 1.222 2017/12/03 21:09:01 mrg Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.221 2017/12/02 08:15:43 mrg Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.222 2017/12/03 21:09:01 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -893,8 +893,10 @@ dosum(void)
 	} else {
 		struct uvmexp uvmexp_kernel;
 		struct pool pool, *pp = &pool;
+		struct pool_allocator pa;
 		TAILQ_HEAD(,pool) pool_head;
 		void *addr;
+		uint64_t bytes;
 
 		kread(namelist, X_UVMEXP, &uvmexp_kernel, sizeof(uvmexp_kernel));
 #define COPY(field) uvmexp.field = uvmexp_kernel.field
@@ -963,13 +965,15 @@ dosum(void)
 #undef COPY
 		kread(namelist, X_POOLHEAD, &pool_head, sizeof(pool_head));
 		addr = TAILQ_FIRST(&pool_head);
+		uvmexp.poolpages = 0;
 		for (; addr != NULL; addr = TAILQ_NEXT(pp, pr_poollist)) {
 			deref_kptr(addr, pp, sizeof(*pp), "pool chain trashed");
-			/*
-			 * XXXMRG
-			if ((pp->pr_roflags & PR_RECURSIVE) == 0)
-			 */
-uvmexp.poolpages += pp->pr_npages;
+			deref_kptr(addr, &pa, sizeof(pa), "pool_allocator trashed");
+			 // XXX deref pr_alloc first
+			bytes = pp->pr_npages * pa.pa_pagesz;
+			if ((pp->pr_roflags & PR_RECURSIVE) != 0)
+bytes -= (pp->pr_nout * pp->pr_size);
+			uvmexp.poolpages += bytes / uvmexp.pagesize;
 		}
 	}
 



CVS commit: src/sys/dev/acpi/wmi

2017-12-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Dec  3 17:40:48 UTC 2017

Modified Files:
src/sys/dev/acpi/wmi: wmi_dell.c

Log Message:
Fix dell WMI mappings:
- query the descriptor to get the interface version, needed to workaround
  a bug in the BIOS/ACPI
- properly decode the event buffer in type/subtype, and handle multiple events
  per handler call
- record some known type/subtype in a table, with associated actions.

Informations mostly from linux. Tested on a Dell 5480 laptop.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/acpi/wmi/wmi_dell.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/acpi/wmi/wmi_dell.c
diff -u src/sys/dev/acpi/wmi/wmi_dell.c:1.9 src/sys/dev/acpi/wmi/wmi_dell.c:1.10
--- src/sys/dev/acpi/wmi/wmi_dell.c:1.9	Thu Apr 23 23:23:00 2015
+++ src/sys/dev/acpi/wmi/wmi_dell.c	Sun Dec  3 17:40:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_dell.c,v 1.9 2015/04/23 23:23:00 pgoyette Exp $ */
+/*	$NetBSD: wmi_dell.c,v 1.10 2017/12/03 17:40:48 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wmi_dell.c,v 1.9 2015/04/23 23:23:00 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_dell.c,v 1.10 2017/12/03 17:40:48 bouyer Exp $");
 
 #include 
 #include 
@@ -43,29 +43,69 @@ __KERNEL_RCSID(0, "$NetBSD: wmi_dell.c,v
 
 #include 
 
+#ifdef WMI_DEBUG
+#define DPRINTF(x)	printf x
+#else
+#define DPRINTF(x)
+#endif
+
 #define _COMPONENT			ACPI_RESOURCE_COMPONENT
 ACPI_MODULE_NAME			("wmi_dell")
 
-#define WMI_DELL_HOTKEY_BRIGHTNESS_DOWN	0xE005
-#define WMI_DELL_HOTKEY_BRIGHTNESS_UP	0xE006
-#define WMI_DELL_HOTKEY_DISPLAY_CYCLE	0xE00B
-#define WMI_DELL_HOTKEY_VOLUME_MUTE	0xE020
-#define WMI_DELL_HOTKEY_VOLUME_DOWN	0xE02E
-#define WMI_DELL_HOTKEY_VOLUME_UP	0xE030
-/*  WMI_DELL_HOTKEY_UNKNOWN		0x */
-
 #define WMI_DELL_PSW_DISPLAY_CYCLE	0
 #define WMI_DELL_PSW_COUNT		1
 
 #define WMI_DELL_GUID_EVENT		"9DBB5994-A997-11DA-B012-B622A1EF5492"
+#define WMI_DELL_GUID_DESC		"8D9DDCBC-A997-11DA-B012-B622A1EF5492"
 
 struct wmi_dell_softc {
 	device_t		sc_dev;
 	device_t		sc_parent;
+	int			sc_version;
 	struct sysmon_pswitch	sc_smpsw[WMI_DELL_PSW_COUNT];
 	bool			sc_smpsw_valid;
 };
 
+#define WMI_DELLA_PMF	0x0
+#define WMI_DELLA_PSW	0x1
+#define WMI_DELLA_IGN	0x2
+
+const struct wmi_dell_actions {
+	u_int	wda_action;
+	u_int	wda_type;
+	u_int	wda_subtype;
+	u_int	wda_data;
+} wmi_dell_actions[] = {
+	/* type 0 */
+	/* brightness control */
+	{WMI_DELLA_PMF, 0x, 0xe005, PMFE_DISPLAY_BRIGHTNESS_DOWN},
+	{WMI_DELLA_PMF, 0x, 0xe006, PMFE_DISPLAY_BRIGHTNESS_UP},
+	{WMI_DELLA_PSW, 0x, 0xe00b, WMI_DELL_PSW_DISPLAY_CYCLE},
+
+	{WMI_DELLA_PMF, 0x, 0xe008, PMFE_RADIO_TOGGLE},
+	{WMI_DELLA_IGN, 0x, 0xe00c, 0}, /* keyboard illumination */
+
+	/* volume control */
+	{WMI_DELLA_PMF, 0x, 0xe020, PMFE_AUDIO_VOLUME_TOGGLE},
+	{WMI_DELLA_PMF, 0x, 0xe02e, PMFE_AUDIO_VOLUME_DOWN},
+	{WMI_DELLA_PMF, 0x, 0xe030, PMFE_AUDIO_VOLUME_UP},
+	{WMI_DELLA_PMF, 0x, 0xe0f8, PMFE_AUDIO_VOLUME_DOWN},
+	{WMI_DELLA_PMF, 0x, 0xe0f9, PMFE_AUDIO_VOLUME_UP},
+
+
+	/* type 0x10 */
+	{WMI_DELLA_PMF, 0x0010, 0x0057, PMFE_DISPLAY_BRIGHTNESS_DOWN},
+	{WMI_DELLA_PMF, 0x0010, 0x0058, PMFE_DISPLAY_BRIGHTNESS_UP},
+	{WMI_DELLA_IGN, 0x0010, 0x0151, 0}, /* Fn-lock */
+	{WMI_DELLA_IGN, 0x0010, 0x0152, 0}, /* keyboard illumination */
+	{WMI_DELLA_PMF, 0x0010, 0x0153, PMFE_RADIO_TOGGLE},
+	{WMI_DELLA_IGN, 0x0010, 0x0155, 0}, /* Stealth mode toggle */
+	{WMI_DELLA_IGN, 0x0010, 0xE035, 0}, /* Fn-lock */
+
+	/* type 0x11 */
+	{WMI_DELLA_IGN, 0x0011, 0x02eb5, 0}, /* keyboard illumination */
+};
+
 static int	wmi_dell_match(device_t, cfdata_t, void *);
 static void	wmi_dell_attach(device_t, device_t, void *);
 static int	wmi_dell_detach(device_t, int);
@@ -87,6 +127,9 @@ wmi_dell_attach(device_t parent, device_
 {
 	struct wmi_dell_softc *sc = device_private(self);
 	ACPI_STATUS rv;
+	ACPI_BUFFER obuf;
+	ACPI_OBJECT *obj;
+	uint32_t *data;
 	int e;
 
 	sc->sc_dev = self;
@@ -100,8 +143,34 @@ wmi_dell_attach(device_t parent, device_
 		return;
 	}
 
+	memset(&obuf, 0, sizeof(obuf));
+	rv = acpi_wmi_data_query(parent, WMI_DELL_GUID_DESC, 0, &obuf);
+	if (ACPI_FAILURE(rv)) {
+		aprint_error(": failed to query WMI descriptor: %s\n",
+		AcpiFormatException(rv));
+		return;
+	}
+	obj = obuf.Pointer;
+	if (obj->Type != ACPI_TYPE_BUFFER) {
+		aprint_error(": wrong type %d for WMI descriptor\n", obj->Type);
+		return;
+	}
+	if (obj->Buffer.Length != 128) {
+		aprint_error(": wrong len %d for WMI descriptor",
+		obj->Buffer.Length);
+		if (obj->Buffer.Length < 16) {
+			aprint_error("\n");
+			return;
+		}
+	}
+	data = (uint32_t *)obj->Buffer.Pointer;
+	if (data[0] != 0x4C4C4544 || data[1] != 0x494D5720) {
+		aprint_error(": wrong WMI descriptor signature 0x%x 0x%x",
+		data[0], dat

CVS commit: src/sys/dev/acpi/wmi

2017-12-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Dec  3 17:34:51 UTC 2017

Modified Files:
src/sys/dev/acpi/wmi: wmi_acpi.c

Log Message:
- make sure strtoul() is called with a NULL-terminated string.
- acpi_wmi_input(): a valid data block may have flags set to 0.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/acpi/wmi/wmi_acpi.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/acpi/wmi/wmi_acpi.c
diff -u src/sys/dev/acpi/wmi/wmi_acpi.c:1.15 src/sys/dev/acpi/wmi/wmi_acpi.c:1.16
--- src/sys/dev/acpi/wmi/wmi_acpi.c:1.15	Thu Jun  1 02:45:09 2017
+++ src/sys/dev/acpi/wmi/wmi_acpi.c	Sun Dec  3 17:34:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_acpi.c,v 1.15 2017/06/01 02:45:09 chs Exp $	*/
+/*	$NetBSD: wmi_acpi.c,v 1.16 2017/12/03 17:34:50 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Jukka Ruohonen 
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.15 2017/06/01 02:45:09 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.16 2017/12/03 17:34:50 bouyer Exp $");
 
 #include 
 #include 
@@ -323,7 +323,7 @@ acpi_wmi_guid_get(struct acpi_wmi_softc 
 	struct wmi_t *wmi;
 	struct guid_t *guid;
 	char bin[16];
-	char hex[2];
+	char hex[3];
 	const char *ptr;
 	uint8_t i;
 
@@ -336,6 +336,7 @@ acpi_wmi_guid_get(struct acpi_wmi_softc 
 			ptr++;
 
 		(void)memcpy(hex, ptr, 2);
+		hex[2] = '\0';
 
 		if (HEXCHAR(hex[0]) == 0 || HEXCHAR(hex[1]) == 0)
 			return AE_BAD_HEX_CONSTANT;
@@ -613,8 +614,10 @@ acpi_wmi_enable_collection(ACPI_HANDLE h
 static bool
 acpi_wmi_input(struct wmi_t *wmi, uint8_t flag, uint8_t idx)
 {
-
-	if ((wmi->guid.flags & flag) == 0)
+	/* A data block may have no flags at all */
+	if ((wmi->guid.flags & flag) == 0 &&
+	(flag == ACPI_WMI_FLAG_DATA  &&
+	 (wmi->guid.flags & ~ACPI_WMI_FLAG_EXPENSIVE) != 0))
 		return false;
 
 	if (wmi->guid.count == 0x00)



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

2017-12-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Dec  3 17:18:53 UTC 2017

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

Log Message:
add H5 dts files


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/evbarm/conf/SUNXI

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

Modified files:

Index: src/sys/arch/evbarm/conf/SUNXI
diff -u src/sys/arch/evbarm/conf/SUNXI:1.54 src/sys/arch/evbarm/conf/SUNXI:1.55
--- src/sys/arch/evbarm/conf/SUNXI:1.54	Thu Nov 30 19:52:23 2017
+++ src/sys/arch/evbarm/conf/SUNXI	Sun Dec  3 17:18:53 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: SUNXI,v 1.54 2017/11/30 19:52:23 jmcneill Exp $
+#	$NetBSD: SUNXI,v 1.55 2017/12/03 17:18:53 jmcneill Exp $
 #
 #	Allwinner sunxi family
 #
@@ -113,6 +113,12 @@ makeoptions	DTS="
 	sun50i-a64-pine64.dts
 	sun50i-a64-pinebook.dts
 	sun50i-a64-sopine-baseboard.dts
+
+	sun50i-h5-nanopi-neo-plus2.dts
+	sun50i-h5-nanopi-neo2.dts
+	sun50i-h5-orangepi-pc2.dts
+	sun50i-h5-orangepi-prime.dts
+	sun50i-h5-orangepi-zero-plus2.dts
 "
 
 options 	MULTIPROCESSOR



CVS commit: src/sys/conf

2017-12-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  3 17:07:18 UTC 2017

Modified Files:
src/sys/conf: dts.mk

Log Message:
handle absolute $S paths; we want to add ../ if they are relative only.


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

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

Modified files:

Index: src/sys/conf/dts.mk
diff -u src/sys/conf/dts.mk:1.4 src/sys/conf/dts.mk:1.5
--- src/sys/conf/dts.mk:1.4	Sun Dec  3 11:36:05 2017
+++ src/sys/conf/dts.mk	Sun Dec  3 12:07:18 2017
@@ -1,4 +1,4 @@
-# $NetBSD: dts.mk,v 1.4 2017/12/03 16:36:05 christos Exp $
+# $NetBSD: dts.mk,v 1.5 2017/12/03 17:07:18 christos Exp $
 
 DTSARCH?=${MACHINE_CPU}
 DTSGNUARCH?=${DTSARCH}
@@ -7,7 +7,7 @@ DTSPADDING?=1024
 .BEGIN:
 	@mkdir -p dts
 .for _arch in ${DTSGNUARCH}
-	@ln -sf ../$S/external/gpl2/dts/dist/arch/${_arch}/boot/dts dts/${_arch}
+	@ln -sf ${S:S@^../@../../@}/external/gpl2/dts/dist/arch/${_arch}/boot/dts dts/${_arch}
 .endfor
 
 DTSINC?=$S/external/gpl2/dts/dist/include



CVS commit: src/sys/conf

2017-12-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  3 16:36:05 UTC 2017

Modified Files:
src/sys/conf: dts.mk

Log Message:
Add more complexity because of the path mess in the dts files. Requested
by jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/conf/dts.mk

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

Modified files:

Index: src/sys/conf/dts.mk
diff -u src/sys/conf/dts.mk:1.3 src/sys/conf/dts.mk:1.4
--- src/sys/conf/dts.mk:1.3	Thu Sep  7 17:22:19 2017
+++ src/sys/conf/dts.mk	Sun Dec  3 11:36:05 2017
@@ -1,9 +1,15 @@
-# $NetBSD: dts.mk,v 1.3 2017/09/07 21:22:19 jmcneill Exp $
+# $NetBSD: dts.mk,v 1.4 2017/12/03 16:36:05 christos Exp $
 
 DTSARCH?=${MACHINE_CPU}
 DTSGNUARCH?=${DTSARCH}
 DTSPADDING?=1024
 
+.BEGIN:
+	@mkdir -p dts
+.for _arch in ${DTSGNUARCH}
+	@ln -sf ../$S/external/gpl2/dts/dist/arch/${_arch}/boot/dts dts/${_arch}
+.endfor
+
 DTSINC?=$S/external/gpl2/dts/dist/include
 .for _arch in ${DTSARCH}
 DTSDIR+=$S/arch/${_arch}/dts
@@ -17,7 +23,7 @@ DTSDIR+=$S/external/gpl2/dts/dist/arch/$
 .endfor
 .endfor
 
-DTSPATH=${DTSINC} ${DTSDIR}
+DTSPATH=${DTSINC} ${DTSDIR} dts
 
 .SUFFIXES: .dtd .dtb .dts
 



CVS commit: src/sys/compat/common

2017-12-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  3 15:23:30 UTC 2017

Modified Files:
src/sys/compat/common: vfs_syscalls_12.c vfs_syscalls_43.c

Log Message:
Make code look the same, in particular zero out the rest of the directory
record.
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/common/vfs_syscalls_12.c
cvs rdiff -u -r1.61 -r1.62 src/sys/compat/common/vfs_syscalls_43.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/compat/common/vfs_syscalls_12.c
diff -u src/sys/compat/common/vfs_syscalls_12.c:1.34 src/sys/compat/common/vfs_syscalls_12.c:1.35
--- src/sys/compat/common/vfs_syscalls_12.c:1.34	Fri Jul 28 11:34:06 2017
+++ src/sys/compat/common/vfs_syscalls_12.c	Sun Dec  3 10:23:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_12.c,v 1.34 2017/07/28 15:34:06 riastradh Exp $	*/
+/*	$NetBSD: vfs_syscalls_12.c,v 1.35 2017/12/03 15:23:30 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.34 2017/07/28 15:34:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.35 2017/12/03 15:23:30 christos Exp $");
 
 #include 
 #include 
@@ -183,6 +183,10 @@ again:
 off += reclen;
 			continue;
 		}
+		if (bdp->d_namlen >= sizeof(idb.d_name))
+			idb.d_namlen = sizeof(idb.d_name) - 1;
+		else
+			idb.d_namlen = bdp->d_namlen;
 		old_reclen = _DIRENT_RECLEN(&idb, bdp->d_namlen);
 		if (reclen > len || resid < old_reclen) {
 			/* entry too big for buffer, so just stop */
@@ -197,9 +201,9 @@ again:
 		idb.d_fileno = (uint32_t)bdp->d_fileno;
 		idb.d_reclen = (uint16_t)old_reclen;
 		idb.d_type = (uint8_t)bdp->d_type;
-		idb.d_namlen = (uint8_t)bdp->d_namlen;
-		memcpy(idb.d_name, bdp->d_name, MIN(sizeof(idb.d_name),
-		bdp->d_namlen));
+		(void)memcpy(idb.d_name, bdp->d_name, idb.d_namlen);
+		memset(idb.d_name + idb.d_namlen, 0,
+		idb.d_reclen - _DIRENT_NAMEOFF(&idb) - idb.d_namlen);
 		if ((error = copyout(&idb, outp, old_reclen)))
 			goto out;
 		/* advance past this real entry */

Index: src/sys/compat/common/vfs_syscalls_43.c
diff -u src/sys/compat/common/vfs_syscalls_43.c:1.61 src/sys/compat/common/vfs_syscalls_43.c:1.62
--- src/sys/compat/common/vfs_syscalls_43.c:1.61	Sat Jul 29 00:02:49 2017
+++ src/sys/compat/common/vfs_syscalls_43.c	Sun Dec  3 10:23:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_43.c,v 1.61 2017/07/29 04:02:49 riastradh Exp $	*/
+/*	$NetBSD: vfs_syscalls_43.c,v 1.62 2017/12/03 15:23:30 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.61 2017/07/29 04:02:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.62 2017/12/03 15:23:30 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -463,6 +463,10 @@ again:
 off += reclen;
 			continue;
 		}
+		if (bdp->d_namlen >= sizeof(idb.d_name))
+			idb.d_namlen = sizeof(idb.d_name) - 1;
+		else
+			idb.d_namlen = bdp->d_namlen;
 		old_reclen = _DIRENT_RECLEN(&idb, bdp->d_namlen);
 		if (reclen > len || resid < old_reclen) {
 			/* entry too big for buffer, so just stop */
@@ -476,9 +480,10 @@ again:
 		 */
 		idb.d_fileno = (uint32_t)bdp->d_fileno;
 		idb.d_reclen = (uint16_t)old_reclen;
-		idb.d_namlen = (uint16_t)bdp->d_namlen;
-		memcpy(idb.d_name, bdp->d_name, MIN(sizeof(idb.d_name),
-		idb.d_namlen));
+		idb.d_fileno = (uint32_t)bdp->d_fileno;
+		(void)memcpy(idb.d_name, bdp->d_name, idb.d_namlen);
+		memset(idb.d_name + idb.d_namlen, 0,
+		idb.d_reclen - _DIRENT_NAMEOFF(&idb) - idb.d_namlen);
 		if ((error = copyout(&idb, outp, old_reclen)))
 			goto out;
 		/* advance past this real entry */



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

2017-12-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Dec  3 14:35:07 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sunxi_musb.c

Log Message:
first param for bs funcs is the cookie, not the tag


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sunxi_musb.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/sunxi/sunxi_musb.c
diff -u src/sys/arch/arm/sunxi/sunxi_musb.c:1.2 src/sys/arch/arm/sunxi/sunxi_musb.c:1.3
--- src/sys/arch/arm/sunxi/sunxi_musb.c:1.2	Sun Oct 29 16:02:46 2017
+++ src/sys/arch/arm/sunxi/sunxi_musb.c	Sun Dec  3 14:35:07 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_musb.c,v 1.2 2017/10/29 16:02:46 jmcneill Exp $ */
+/* $NetBSD: sunxi_musb.c,v 1.3 2017/12/03 14:35:07 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -32,7 +32,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_musb.c,v 1.2 2017/10/29 16:02:46 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_musb.c,v 1.3 2017/12/03 14:35:07 jmcneill Exp $");
 
 #include 
 #include 
@@ -182,106 +182,79 @@ sunxi_musb_filt(bus_size_t o)
 static uint8_t
 sunxi_musb_bs_r_1(void *t, bus_space_handle_t h, bus_size_t o)
 {
-	const struct bus_space *bs = t;
-	const struct bus_space *bs_parent = bs->bs_cookie;
-
 	switch (o) {
 	case MUSB2_REG_HWVERS:
 		return 0;	/* no known equivalent */
 	}
 
-	return bus_space_read_1(bs_parent, h, sunxi_musb_reg(o));
+	return bus_space_read_1((bus_space_tag_t)t, h, sunxi_musb_reg(o));
 }
 
 static uint16_t
 sunxi_musb_bs_r_2(void *t, bus_space_handle_t h, bus_size_t o)
 {
-	const struct bus_space *bs = t;
-	const struct bus_space *bs_parent = bs->bs_cookie;
-
-	return bus_space_read_2(bs_parent, h, sunxi_musb_reg(o));
+	return bus_space_read_2((bus_space_tag_t)t, h, sunxi_musb_reg(o));
 }
 
 static void
 sunxi_musb_bs_w_1(void *t, bus_space_handle_t h, bus_size_t o,
 uint8_t v)
 {
-	const struct bus_space *bs = t;
-	const struct bus_space *bs_parent = bs->bs_cookie;
-
 	if (sunxi_musb_filt(o) != 0)
 		return;
 
-	bus_space_write_1(bs_parent, h, sunxi_musb_reg(o), v);
+	bus_space_write_1((bus_space_tag_t)t, h, sunxi_musb_reg(o), v);
 }
 
 static void
 sunxi_musb_bs_w_2(void *t, bus_space_handle_t h, bus_size_t o,
 uint16_t v)
 {
-	const struct bus_space *bs = t;
-	const struct bus_space *bs_parent = bs->bs_cookie;
-
 	if (sunxi_musb_filt(o) != 0)
 		return;
 
-	bus_space_write_2(bs_parent, h, sunxi_musb_reg(o), v);
+	bus_space_write_2((bus_space_tag_t)t, h, sunxi_musb_reg(o), v);
 }
 
 static void
 sunxi_musb_bs_rm_1(void *t, bus_space_handle_t h, bus_size_t o,
 uint8_t *d, bus_size_t c)
 {
-	const struct bus_space *bs = t;
-	const struct bus_space *bs_parent = bs->bs_cookie;
-
-	bus_space_read_multi_1(bs_parent, h, sunxi_musb_reg(o), d, c);
+	bus_space_read_multi_1((bus_space_tag_t)t, h, sunxi_musb_reg(o), d, c);
 }
 
 static void
 sunxi_musb_bs_rm_4(void *t, bus_space_handle_t h, bus_size_t o,
 uint32_t *d, bus_size_t c)
 {
-	const struct bus_space *bs = t;
-	const struct bus_space *bs_parent = bs->bs_cookie;
-
-	bus_space_read_multi_4(bs_parent, h, sunxi_musb_reg(o), d, c);
+	bus_space_read_multi_4((bus_space_tag_t)t, h, sunxi_musb_reg(o), d, c);
 }
 
 static void
 sunxi_musb_bs_wm_1(void *t, bus_space_handle_t h, bus_size_t o,
 const uint8_t *d, bus_size_t c)
 {
-	const struct bus_space *bs = t;
-	const struct bus_space *bs_parent = bs->bs_cookie;
-
 	if (sunxi_musb_filt(o) != 0)
 		return;
 
-	bus_space_write_multi_1(bs_parent, h, sunxi_musb_reg(o), d, c);
+	bus_space_write_multi_1((bus_space_tag_t)t, h, sunxi_musb_reg(o), d, c);
 }
 
 static void
 sunxi_musb_bs_wm_4(void *t, bus_space_handle_t h, bus_size_t o,
 const uint32_t *d, bus_size_t c)
 {
-	const struct bus_space *bs = t;
-	const struct bus_space *bs_parent = bs->bs_cookie;
-
 	if (sunxi_musb_filt(o) != 0)
 		return;
 
-	bus_space_write_multi_4(bs_parent, h, sunxi_musb_reg(o), d, c);
+	bus_space_write_multi_4((bus_space_tag_t)t, h, sunxi_musb_reg(o), d, c);
 }
 
 static void
 sunxi_musb_bs_barrier(void *t, bus_space_handle_t h, bus_size_t o,
 bus_size_t l, int f)
 {
-	const struct bus_space *bs = t;
-	const struct bus_space *bs_parent = bs->bs_cookie;
-
-	bus_space_barrier(bs_parent, h, o, l, f);
+	bus_space_barrier((bus_space_tag_t)t, h, o, l, f);
 }
 
 static int



CVS commit: src/sys/dev/pci

2017-12-03 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Dec  3 14:26:38 UTC 2017

Modified Files:
src/sys/dev/pci: files.pci
Added Files:
src/sys/dev/pci: ips.c

Log Message:
port ips(4) driver from OpenBSD; needs a lot more work, right now just 
compilable


To generate a diff of this commit:
cvs rdiff -u -r1.391 -r1.392 src/sys/dev/pci/files.pci
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/ips.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/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.391 src/sys/dev/pci/files.pci:1.392
--- src/sys/dev/pci/files.pci:1.391	Tue Sep  5 08:01:43 2017
+++ src/sys/dev/pci/files.pci	Sun Dec  3 14:26:38 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.391 2017/09/05 08:01:43 skrll Exp $
+#	$NetBSD: files.pci,v 1.392 2017/12/03 14:26:38 jdolecek Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -107,6 +107,11 @@ file	dev/pci/icp_pci.c		icp_pci
 attach	aac at pci with aac_pci
 file	dev/pci/aac_pci.c		aac_pci
 
+# IBM ServeRAID RAID controllers
+device  ips: scsi
+attach  ips at pci
+filedev/pci/ips.c   ips
+
 # DPT EATA SCSI controllers
 attach	dpt at pci with dpt_pci
 file	dev/pci/dpt_pci.c		dpt_pci

Added files:

Index: src/sys/dev/pci/ips.c
diff -u /dev/null src/sys/dev/pci/ips.c:1.1
--- /dev/null	Sun Dec  3 14:26:38 2017
+++ src/sys/dev/pci/ips.c	Sun Dec  3 14:26:38 2017
@@ -0,0 +1,2013 @@
+/*	$NetBSD: ips.c,v 1.1 2017/12/03 14:26:38 jdolecek Exp $	*/
+/*	$OpenBSD: ips.c,v 1.113 2016/08/14 04:08:03 dlg Exp $	*/
+
+/*-
+ * Copyright (c) 2017 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2006, 2007, 2009 Alexander Yurchenko 
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * IBM (Adaptec) ServeRAID controllers driver.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: ips.c,v 1.1 2017/12/03 14:26:38 jdolecek Exp $");
+
+#include "bio.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+/* Debug levels */
+#define IPS_D_ERR	0x0001	/* errors */
+#define IPS_D_INFO	0x0002	/* information */
+#define IPS_D_XFER	0x0004	/* transfers */
+
+#ifdef IPS_DEBUG
+#define DPRINTF(a, b)	do { if (ips_debug & (a)) printf b; } while (0)
+int ips_debug = IPS_D_ERR;
+#else
+#define DPRINTF(a, b)
+#endif
+
+#define IPS_MAXDRIVES		8
+#define IPS_MAXCHANS		4
+#define IPS_MAXTARGETS		16
+#define IPS_MAXCHUNKS		16
+#define IPS_MAXCMDS		128
+
+#define IPS_MAXFER		(64 * 1024)
+#define IPS_MAXSGS		16
+#define IPS_MAXCDB		12
+
+#define IPS_SECSZ		512
+#define IPS_NVRAMPGSZ		128
+#define IPS_SQSZ		(IPS_MAXCMDS * sizeof

CVS commit: [tls-maxphys] src/sys

2017-12-03 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Dec  3 14:21:05 UTC 2017

Modified Files:
src/sys/arch/amiga/conf [tls-maxphys]: GENERIC
src/sys/dev/pci [tls-maxphys]: files.pci

Log Message:
fix back some more incorrect sync


To generate a diff of this commit:
cvs rdiff -u -r1.289.2.5 -r1.289.2.6 src/sys/arch/amiga/conf/GENERIC
cvs rdiff -u -r1.360.2.4 -r1.360.2.5 src/sys/dev/pci/files.pci

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/amiga/conf/GENERIC
diff -u src/sys/arch/amiga/conf/GENERIC:1.289.2.5 src/sys/arch/amiga/conf/GENERIC:1.289.2.6
--- src/sys/arch/amiga/conf/GENERIC:1.289.2.5	Sun Dec  3 11:35:48 2017
+++ src/sys/arch/amiga/conf/GENERIC	Sun Dec  3 14:21:05 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.289.2.5 2017/12/03 11:35:48 jdolecek Exp $
+# $NetBSD: GENERIC,v 1.289.2.6 2017/12/03 14:21:05 jdolecek Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.289.2.5 $"
+#ident 		"GENERIC-$Revision: 1.289.2.6 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -433,10 +433,10 @@ gencp*		at acafhbus?		# clockport on ACA
 
 wdc0		at mainbus0		# A4000 & A1200 IDE bus
 wdc*		at zbus0		# Buddha / Catweasel
-efa0		at mainbus0		# ELBOX FastATA 1200 Mk-III/Mk-IV 
+#efa0		at mainbus0		# ELBOX FastATA 1200 Mk-III/Mk-IV 
 
 atabus* 	at wdc? channel ?	# ATA bus
-atabus*	at efa? channel ?	# ATA bus 
+#atabus*	at efa? channel ?	# ATA bus 
 atabus*		at ata? channel ?	# ATA bus 
 wd*		at atabus? drive ?	#  + drives
 atapibus*	at atabus?		# ATAPI bus

Index: src/sys/dev/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.360.2.4 src/sys/dev/pci/files.pci:1.360.2.5
--- src/sys/dev/pci/files.pci:1.360.2.4	Sun Dec  3 11:37:07 2017
+++ src/sys/dev/pci/files.pci	Sun Dec  3 14:21:05 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.360.2.4 2017/12/03 11:37:07 jdolecek Exp $
+#	$NetBSD: files.pci,v 1.360.2.5 2017/12/03 14:21:05 jdolecek Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -107,11 +107,6 @@ file	dev/pci/icp_pci.c		icp_pci
 attach	aac at pci with aac_pci
 file	dev/pci/aac_pci.c		aac_pci
 
-# IBM ServeRAID RAID controllers
-device  ips: scsi
-attach  ips at pci
-filedev/pci/ips.c   ips
-
 # DPT EATA SCSI controllers
 attach	dpt at pci with dpt_pci
 file	dev/pci/dpt_pci.c		dpt_pci



CVS commit: src/distrib/utils/embedded/conf

2017-12-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Dec  3 13:31:45 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
On 64-bit boards, U-Boot expects to find .dtb files in an allwinner/ 
subdirectory


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.21 src/distrib/utils/embedded/conf/armv7.conf:1.22
--- src/distrib/utils/embedded/conf/armv7.conf:1.21	Thu Nov 30 19:55:47 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Sun Dec  3 13:31:45 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.21 2017/11/30 19:55:47 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.22 2017/12/03 13:31:45 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -103,7 +103,9 @@ EOF
 }
 
 populate_sunxi() {
-	:
+	# U-Boot expects 64-bit DTB files to live in an allwinner/ subdirectory
+	mkdir -p "${mnt}/boot/allwinner"
+	mv "${mnt}"/boot/sun50i-* "${mnt}/boot/allwinner/"
 }
 
 populate_tegra() {



CVS commit: src/sys/compat/ultrix

2017-12-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Dec  3 12:53:52 UTC 2017

Modified Files:
src/sys/compat/ultrix: ultrix_fs.c

Log Message:
Fix uninitialized pointer, found by Mootja. Not a surprise in untested
code.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/compat/ultrix/ultrix_fs.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/compat/ultrix/ultrix_fs.c
diff -u src/sys/compat/ultrix/ultrix_fs.c:1.57 src/sys/compat/ultrix/ultrix_fs.c:1.58
--- src/sys/compat/ultrix/ultrix_fs.c:1.57	Thu Apr 13 09:18:18 2017
+++ src/sys/compat/ultrix/ultrix_fs.c	Sun Dec  3 12:53:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ultrix_fs.c,v 1.57 2017/04/13 09:18:18 hannken Exp $	*/
+/*	$NetBSD: ultrix_fs.c,v 1.58 2017/12/03 12:53:52 maxv Exp $	*/
 
 /*
  * Copyright (c) 1995, 1997 Jonathan Stone
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.57 2017/04/13 09:18:18 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.58 2017/12/03 12:53:52 maxv Exp $");
 
 #include 
 #include 
@@ -276,7 +276,7 @@ ultrix_sys_getmnt(struct lwp *l, const s
 make_ultrix_mntent(sp, &tem);
 if ((error = copyout((void *)&tem, sfsp,
 sizeof(tem))) != 0) {
-	goto bad;
+	goto bad_freeiter;
 }
 sfsp++;
 count++;
@@ -289,8 +289,9 @@ ultrix_sys_getmnt(struct lwp *l, const s
 	else
 		*retval = count;
 
-bad:
+bad_freeiter:
 	mountlist_iterator_destroy(iter);
+bad:
 	if (path)
 		free(path, M_TEMP);
 	return error;



CVS commit: [tls-maxphys] src/sys/modules/nvme

2017-12-03 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Dec  3 11:52:57 UTC 2017

Added Files:
src/sys/modules/nvme [tls-maxphys]: Makefile

Log Message:
sync with HEAD


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.4.2.2 src/sys/modules/nvme/Makefile

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

Added files:

Index: src/sys/modules/nvme/Makefile
diff -u /dev/null src/sys/modules/nvme/Makefile:1.4.2.2
--- /dev/null	Sun Dec  3 11:52:57 2017
+++ src/sys/modules/nvme/Makefile	Sun Dec  3 11:52:57 2017
@@ -0,0 +1,11 @@
+#	$NetBSD: Makefile,v 1.4.2.2 2017/12/03 11:52:57 jdolecek Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/dev/pci ${S}/dev/ic
+
+KMOD=	nvme
+IOCONF=	nvme.ioconf
+SRCS=	nvme.c nvme_pci.c
+
+.include 



CVS commit: src/sys/modules/nvme

2017-12-03 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Dec  3 11:49:32 UTC 2017

Modified Files:
src/sys/modules/nvme: Makefile

Log Message:
again remove mistakely committed debug flags


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/nvme/Makefile

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

Modified files:

Index: src/sys/modules/nvme/Makefile
diff -u src/sys/modules/nvme/Makefile:1.3 src/sys/modules/nvme/Makefile:1.4
--- src/sys/modules/nvme/Makefile:1.3	Sun Dec  3 11:38:58 2017
+++ src/sys/modules/nvme/Makefile	Sun Dec  3 11:49:32 2017
@@ -1,11 +1,9 @@
-#	$NetBSD: Makefile,v 1.3 2017/12/03 11:38:58 jdolecek Exp $
+#	$NetBSD: Makefile,v 1.4 2017/12/03 11:49:32 jdolecek Exp $
 
 .include "../Makefile.inc"
 
 .PATH:	${S}/dev/pci ${S}/dev/ic
 
-CFLAGS+=	-DNVME_DEBUG -DDEBUG -DDIAGNOSTIC -DLOCKDEBUG
-
 KMOD=	nvme
 IOCONF=	nvme.ioconf
 SRCS=	nvme.c nvme_pci.c



CVS commit: [netbsd-7] src/doc

2017-12-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Dec  3 10:34:39 UTC 2017

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

Log Message:
1521, 1524


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.55 -r1.1.2.56 src/doc/CHANGES-7.2

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.2
diff -u src/doc/CHANGES-7.2:1.1.2.55 src/doc/CHANGES-7.2:1.1.2.56
--- src/doc/CHANGES-7.2:1.1.2.55	Sat Dec  2 10:54:01 2017
+++ src/doc/CHANGES-7.2	Sun Dec  3 10:34:39 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.55 2017/12/02 10:54:01 snj Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.56 2017/12/03 10:34:39 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -4882,3 +4882,19 @@ xsrc/xfree/xc/lib/font/fontfile/fontdir.
 	2017-13722, 2017-13720, 2017-16611, and 2017-16612.
 	[mrg, ticket #1535]
 
+share/man/man9/kmem.91.20 via patch
+share/man/man9/vmem.91.16
+sys/kern/subr_kmem.c1.62
+sys/kern/subr_vmem.c1.94
+
+	fix vmem_alloc() to never return an error for VM_SLEEP requests,
+	thus fixing kmem_alloc() to never return NULL for KM_SLEEP
+	requests. instead these operations will retry forever, which was
+	the intent.
+	[mlelstv, ticket #1521]
+
+sys/arch/arm/cortex/a9_mpsubr.S			1.52
+
+	Ensure CNTVOFF is 0 before dropping out of Hyp mode
+	[skrll, ticket #1524]
+



CVS commit: [netbsd-7] src/sys/arch/arm/cortex

2017-12-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Dec  3 10:29:12 UTC 2017

Modified Files:
src/sys/arch/arm/cortex [netbsd-7]: a9_mpsubr.S

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1524):
sys/arch/arm/cortex/a9_mpsubr.S: revision 1.52
Ensure CNTVOFF is 0 before dropping out of Hyp mode


To generate a diff of this commit:
cvs rdiff -u -r1.18.2.5 -r1.18.2.6 src/sys/arch/arm/cortex/a9_mpsubr.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/arm/cortex/a9_mpsubr.S
diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.18.2.5 src/sys/arch/arm/cortex/a9_mpsubr.S:1.18.2.6
--- src/sys/arch/arm/cortex/a9_mpsubr.S:1.18.2.5	Sat Jul  8 17:01:52 2017
+++ src/sys/arch/arm/cortex/a9_mpsubr.S	Sun Dec  3 10:29:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9_mpsubr.S,v 1.18.2.5 2017/07/08 17:01:52 snj Exp $	*/
+/*	$NetBSD: a9_mpsubr.S,v 1.18.2.6 2017/12/03 10:29:12 snj Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -338,6 +338,10 @@ cortex_init:
 	teq	r0, #(PSR_HYP32_MODE)	/* Hyp Mode? */
 	bne	1f
 
+	/* Set CNTVOFF to 0 */
+	mov	r0, #0
+	mcrr	p15, 4, r0, r0, c14
+
 	/* Ensure that IRQ, and FIQ will be disabled after eret */
 	mrs	r0, cpsr
 	bic	r0, r0, #(PSR_MODE)



CVS commit: [netbsd-7] src

2017-12-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Dec  3 10:25:02 UTC 2017

Modified Files:
src/share/man/man9 [netbsd-7]: kmem.9 vmem.9
src/sys/kern [netbsd-7]: subr_kmem.c subr_vmem.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #1521):
share/man/man9/kmem.9: revision 1.20 via patch
share/man/man9/vmem.9: revision 1.16
sys/kern/subr_kmem.c: revision 1.62
sys/kern/subr_vmem.c: revision 1.94
fix vmem_alloc() to never return an error for VM_SLEEP requests,
thus fixing kmem_alloc() to never return NULL for KM_SLEEP requests.
instead these operations will retry forever, which was the intent.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.4.1 src/share/man/man9/kmem.9
cvs rdiff -u -r1.15 -r1.15.8.1 src/share/man/man9/vmem.9
cvs rdiff -u -r1.60 -r1.60.2.1 src/sys/kern/subr_kmem.c
cvs rdiff -u -r1.92 -r1.92.4.1 src/sys/kern/subr_vmem.c

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/kmem.9
diff -u src/share/man/man9/kmem.9:1.14 src/share/man/man9/kmem.9:1.14.4.1
--- src/share/man/man9/kmem.9:1.14	Tue Nov 26 20:47:26 2013
+++ src/share/man/man9/kmem.9	Sun Dec  3 10:25:02 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kmem.9,v 1.14 2013/11/26 20:47:26 rmind Exp $
+.\"	$NetBSD: kmem.9,v 1.14.4.1 2017/12/03 10:25:02 snj Exp $
 .\"
 .\" Copyright (c)2006 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -25,7 +25,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" 
-.Dd November 26, 2013
+.Dd October 31, 2017
 .Dt KMEM 9
 .Os
 .\" 
@@ -75,6 +75,9 @@ Either of the following:
 .It KM_SLEEP
 If the allocation cannot be satisfied immediately, sleep until enough
 memory is available.
+If
+.Dv KM_SLEEP
+is specified, then the allocation cannot fail.
 .It KM_NOSLEEP
 Don't sleep.
 Immediately return

Index: src/share/man/man9/vmem.9
diff -u src/share/man/man9/vmem.9:1.15 src/share/man/man9/vmem.9:1.15.8.1
--- src/share/man/man9/vmem.9:1.15	Tue Jan 29 22:02:17 2013
+++ src/share/man/man9/vmem.9	Sun Dec  3 10:25:02 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vmem.9,v 1.15 2013/01/29 22:02:17 wiz Exp $
+.\"	$NetBSD: vmem.9,v 1.15.8.1 2017/12/03 10:25:02 snj Exp $
 .\"
 .\" Copyright (c)2006 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -25,7 +25,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" 
-.Dd January 29, 2013
+.Dd February 28, 2016
 .Dt VMEM 9
 .Os
 .\" 
@@ -83,7 +83,7 @@ other than virtual memory.
 .Fn vmem_create
 creates a new vmem arena.
 .Pp
-.Bl -tag -width qcache_max
+.Bl -tag -offset indent -width qcache_max
 .It Fa name
 The string to describe the vmem.
 .It Fa base
@@ -118,7 +118,7 @@ calls
 to import a span of size at least
 .Fa size .
 .Fa allocfn
-should accept the same
+must accept the same
 .Fa flags
 as
 .Fn vmem_alloc .
@@ -169,7 +169,8 @@ It is merely a hint and can be ignored.
 Either of:
 .Bl -tag -width VM_NOSLEEP
 .It Dv VM_SLEEP
-Can sleep until enough resources are available.
+If the allocation cannot be satisfied immediately, sleep until enough
+resources are available.
 .It Dv VM_NOSLEEP
 Don't sleep.
 Immediately return
@@ -184,7 +185,7 @@ Interrupt level to be blocked for alloca
 .Fn vmem_xcreate
 creates a new vmem arena.
 .Pp
-.Bl -tag -width qcache_max
+.Bl -tag -offset indent -width qcache_max
 .It Fa name
 The string to describe the vmem.
 .It Fa base
@@ -220,7 +221,7 @@ calls
 to import a span of size at least
 .Fa size .
 .Fa allocfn
-should accept the same
+must accept the same
 .Fa flags
 as
 .Fn vmem_alloc .
@@ -274,7 +275,8 @@ It is merely a hint and can be ignored.
 Either of:
 .Bl -tag -width VM_NOSLEEP
 .It Dv VM_SLEEP
-Can sleep until enough resources are available.
+If the allocation cannot be satisfied immediately, sleep until enough
+resources are available.
 .It Dv VM_NOSLEEP
 Don't sleep.
 Immediately return
@@ -297,23 +299,26 @@ Returns
 on success,
 .Dv ENOMEM
 on failure.
-.Fa flags
-should be one of:
+.Bl -tag -offset indent -width flags
+.It Fa flags
+Either of:
 .Bl -tag -width VM_NOSLEEP
 .It Dv VM_SLEEP
-Can sleep until enough resources are available.
+If the allocation cannot be satisfied immediately, sleep until enough
+resources are available.
 .It Dv VM_NOSLEEP
 Don't sleep.
 Immediately return
 .Dv ENOMEM
 if there are not enough resources available.
 .El
+.El
 .Pp
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .Fn vmem_xalloc
 allocates a resource from the arena.
 .Pp
-.Bl -tag -width nocross
+.Bl -tag -offset indent -width nocross
 .It Fa vm
 The arena which we allocate from.
 .It Fa size
@@ -333,10 +338,10 @@ If
 .Fa align
 is zero,
 .Fa phase
-should be zero.
+must be zero.
 Otherwise,
 .Fa phase
-should be smaller than
+must be smaller than
 .Fa al