CVS commit: src/sys/arch/sandpoint/stand/altboot

2017-08-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Aug  3 09:42:34 UTC 2017

Modified Files:
src/sys/arch/sandpoint/stand/altboot: brdsetup.c

Log Message:
Fixed overflow in delay() for delays greater than 2 seconds.
Replaced u_long by uint32_t and u_quad by uint64_t whenever the exact
32- or 64-bit word is needed.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/sandpoint/stand/altboot/brdsetup.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/sandpoint/stand/altboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.37 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.38
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.37	Thu Oct 15 12:00:02 2015
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Thu Aug  3 09:42:34 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.37 2015/10/15 12:00:02 nisimura Exp $ */
+/* $NetBSD: brdsetup.c,v 1.38 2017/08/03 09:42:34 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@ static void send_iomega(int, int, int, i
 static inline uint32_t mfmsr(void);
 static inline void mtmsr(uint32_t);
 static inline uint32_t cputype(void);
-static inline u_quad_t mftb(void);
+static inline uint64_t mftb(void);
 static void init_uart(unsigned, unsigned, uint8_t);
 static void send_sat(char *);
 static unsigned mpc107memsize(void);
@@ -1012,7 +1012,7 @@ _rtt(void)
 satime_t
 getsecs(void)
 {
-	u_quad_t tb = mftb();
+	uint64_t tb = mftb();
 
 	return (tb / ticks_per_sec);
 }
@@ -1021,13 +1021,13 @@ getsecs(void)
  * Wait for about n microseconds (at least!).
  */
 void
-delay(u_int n)
+delay(unsigned n)
 {
-	u_quad_t tb;
-	u_long scratch, tbh, tbl;
+	uint64_t tb;
+	uint32_t scratch, tbh, tbl;
 
 	tb = mftb();
-	tb += (n * 1000 + ns_per_tick - 1) / ns_per_tick;
+	tb += ((uint64_t)n * 1000 + ns_per_tick - 1) / ns_per_tick;
 	tbh = tb >> 32;
 	tbl = tb;
 	asm volatile ("1: mftbu %0; cmpw %0,%1; blt 1b; bgt 2f; mftb %0; cmpw 0, %0,%2; blt 1b; 2:" : "=&r"(scratch) : "r"(tbh), "r"(tbl));
@@ -1113,11 +1113,11 @@ cputype(void)
 	return pvr >> 16;
 }
 
-static inline u_quad_t
+static inline uint64_t
 mftb(void)
 {
-	u_long scratch;
-	u_quad_t tb;
+	uint32_t scratch;
+	uint64_t tb;
 
 	asm ("1: mftbu %0; mftb %0+1; mftbu %1; cmpw %0,%1; bne 1b"
 	: "=r"(tb), "=r"(scratch));



CVS commit: src/sys/dev

2017-08-03 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Thu Aug  3 11:39:06 UTC 2017

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

Log Message:
Fix resource leaks on error handling in audio_open().


To generate a diff of this commit:
cvs rdiff -u -r1.384 -r1.385 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.384 src/sys/dev/audio.c:1.385
--- src/sys/dev/audio.c:1.384	Sun Jul 30 02:41:58 2017
+++ src/sys/dev/audio.c	Thu Aug  3 11:39:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.384 2017/07/30 02:41:58 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.385 2017/08/03 11:39:06 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.384 2017/07/30 02:41:58 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.385 2017/08/03 11:39:06 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -2162,19 +2162,12 @@ audio_open(dev_t dev, struct audio_softc
 	DPRINTF(("audio_open: flags=0x%x sc=%p hdl=%p\n",
 		 flags, sc, sc->hw_hdl));
 
-	error = audio_alloc_ring(sc, &vc->sc_mpr,
-		AUMODE_PLAY, AU_RING_SIZE);
-	if (!error) {
-		error = audio_alloc_ring(sc, &vc->sc_mrr,
-		AUMODE_RECORD, AU_RING_SIZE);
-	}
-	if (error) {
-		audio_free_ring(sc, &vc->sc_mrr);
-		audio_free_ring(sc, &vc->sc_mpr);
-		kmem_free(vc, sizeof(struct virtual_channel));
-		kmem_free(chan, sizeof(struct audio_chan));
-		return error;
-	}
+	error = audio_alloc_ring(sc, &vc->sc_mpr, AUMODE_PLAY, AU_RING_SIZE);
+	if (error)
+		goto bad;
+	error = audio_alloc_ring(sc, &vc->sc_mrr, AUMODE_RECORD, AU_RING_SIZE);
+	if (error)
+		goto bad;
 
 	if (sc->sc_opens == 0) {
 		sc->sc_credentials = kauth_cred_get();
@@ -2184,11 +2177,7 @@ audio_open(dev_t dev, struct audio_softc
 			error = hw->open(sc->hw_hdl, flags);
 			mutex_exit(sc->sc_intr_lock);
 			if (error) {
-kmem_free(vc,
-sizeof(struct virtual_channel));
-kmem_free(chan,
-sizeof(struct audio_chan));
-return error;
+goto bad;
 			}
 		}
 		audio_initbufs(sc, NULL);
@@ -2262,7 +2251,7 @@ audio_open(dev_t dev, struct audio_softc
 
 	error = fd_allocfile(&fp, &fd);
 	if (error)
-		return error;
+		goto bad;
 
 	DPRINTF(("audio_open: done sc_mode = 0x%x\n", vc->sc_mode));
 



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

2017-08-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  3 12:34:32 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: std.marvell

Log Message:
Add options MODULAR


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/std.marvell

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/std.marvell
diff -u src/sys/arch/evbarm/conf/std.marvell:1.4 src/sys/arch/evbarm/conf/std.marvell:1.5
--- src/sys/arch/evbarm/conf/std.marvell:1.4	Tue Feb 28 15:00:32 2017
+++ src/sys/arch/evbarm/conf/std.marvell	Thu Aug  3 12:34:32 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: std.marvell,v 1.4 2017/02/28 15:00:32 skrll Exp $
+#	$NetBSD: std.marvell,v 1.5 2017/08/03 12:34:32 martin Exp $
 #
 # standard NetBSD/evbarm for MARVELL options
 
@@ -7,6 +7,9 @@ include		"arch/evbarm/conf/std.evbarm"
 
 include 	"arch/evbarm/conf/files.marvell"
 
+options 	MODULAR
+options 	MODULAR_DEFAULT_AUTOLOAD
+
 options 	__HAVE_PCI_CONF_HOOK		# should be in types.h
 options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
 
@@ -16,3 +19,4 @@ options 	KERNEL_BASE_EXT=0xc000
 makeoptions	LOADADDRESS="0xc0008000"
 makeoptions	BOARDMKFRAG="${THISARM}/conf/mk.marvell"
 options 	ARM_INTR_IMPL=""
+



CVS commit: src/external/mit/lua/dist/src

2017-08-03 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Thu Aug  3 13:40:07 UTC 2017

Modified Files:
src/external/mit/lua/dist/src: ldebug.c

Log Message:
Apply a bug fix from lua.org/bugs.html:  Lua does not check GC when creating
error messages.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/mit/lua/dist/src/ldebug.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/mit/lua/dist/src/ldebug.c
diff -u src/external/mit/lua/dist/src/ldebug.c:1.9 src/external/mit/lua/dist/src/ldebug.c:1.10
--- src/external/mit/lua/dist/src/ldebug.c:1.9	Wed Apr 26 13:17:33 2017
+++ src/external/mit/lua/dist/src/ldebug.c	Thu Aug  3 13:40:07 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldebug.c,v 1.9 2017/04/26 13:17:33 mbalmer Exp $	*/
+/*	$NetBSD: ldebug.c,v 1.10 2017/08/03 13:40:07 mbalmer Exp $	*/
 
 /*
 ** Id: ldebug.c,v 2.121 2016/10/19 12:32:10 roberto Exp 
@@ -661,6 +661,7 @@ l_noret luaG_runerror (lua_State *L, con
   CallInfo *ci = L->ci;
   const char *msg;
   va_list argp;
+  luaC_checkGC(L);  /* error message uses memory */
   va_start(argp, fmt);
   msg = luaO_pushvfstring(L, fmt, argp);  /* format message */
   va_end(argp);



CVS commit: src/sbin/gpt

2017-08-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug  3 14:39:31 UTC 2017

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

Log Message:
Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sbin/gpt/gpt.8

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

Modified files:

Index: src/sbin/gpt/gpt.8
diff -u src/sbin/gpt/gpt.8:1.52 src/sbin/gpt/gpt.8:1.53
--- src/sbin/gpt/gpt.8:1.52	Thu Feb 16 03:32:17 2017
+++ src/sbin/gpt/gpt.8	Thu Aug  3 14:39:31 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: gpt.8,v 1.52 2017/02/16 03:32:17 christos Exp $
+.\" $NetBSD: gpt.8,v 1.53 2017/08/03 14:39:31 msaitoh Exp $
 .\"
 .\" Copyright (c) 2002 Marcel Moolenaar
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD: src/sbin/gpt/gpt.8,v 1.17 2006/06/22 22:22:32 marcel Exp $
 .\"
-.Dd February 15, 2017
+.Dd August 3, 2017
 .Dt GPT 8
 .Os
 .Sh NAME
@@ -534,6 +534,8 @@ by legacy BIOS boot code.
 See the
 .Ic biosboot
 command for more information.
+The bootme flag is used to indicate which partiotion should be booted
+by UEFI boot code.
 The other attributes are for compatibility with
 .Fx
 and are not currently used by any



CVS commit: src/sys/arch/sandpoint/stand/altboot

2017-08-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Aug  3 19:22:15 UTC 2017

Modified Files:
src/sys/arch/sandpoint/stand/altboot: brdsetup.c siisata.c version

Log Message:
Some Synology network devices show vendor 0x1148 (Schneider & Koch) instead
of 0x11ab (Marvell). Detect both.
Improve spinning up of both disk drives on Synology DS20x by adding some
more delays (directly at the start and after powering up the second drive).


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/sandpoint/stand/altboot/brdsetup.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/stand/altboot/siisata.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sandpoint/stand/altboot/version

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

Modified files:

Index: src/sys/arch/sandpoint/stand/altboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.38 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.39
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.38	Thu Aug  3 09:42:34 2017
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Thu Aug  3 19:22:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.38 2017/08/03 09:42:34 phx Exp $ */
+/* $NetBSD: brdsetup.c,v 1.39 2017/08/03 19:22:15 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -269,7 +269,8 @@ brdsetup(void)
 brdtype = BRD_KUROBOXT4;
 		}
 	}
-	else if (PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x11ab) {
+	else if (PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x1148
+	|| PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x11ab) {
 		/* SKnet/Marvell (sk) at dev 15 */
 		brdtype = BRD_SYNOLOGY;
 	}
@@ -873,8 +874,11 @@ synopcifix(struct brdprop *brd)
 		 * with several seconds delay, but no CPLD register to
 		 * monitor the power state. So all we can do is to
 		 * wait some more seconds during SATA-init.
+		 * Also wait some seconds now, to make sure the first
+		 * disk is ready after a cold start.
 		 */
 		sata_delay[1] = SYNO_DISK_DELAY;
+		delay(10 * 1024 * 1024);
 	}
 
   cpld_done:

Index: src/sys/arch/sandpoint/stand/altboot/siisata.c
diff -u src/sys/arch/sandpoint/stand/altboot/siisata.c:1.6 src/sys/arch/sandpoint/stand/altboot/siisata.c:1.7
--- src/sys/arch/sandpoint/stand/altboot/siisata.c:1.6	Wed Sep 30 14:14:32 2015
+++ src/sys/arch/sandpoint/stand/altboot/siisata.c	Thu Aug  3 19:22:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.6 2015/09/30 14:14:32 phx Exp $ */
+/* $NetBSD: siisata.c,v 1.7 2017/08/03 19:22:15 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -125,6 +125,15 @@ siisata_init(unsigned tag, void *data)
 			if (l->presense[n] == 0) {
 DPRINTF(("port %d not present\n", n));
 continue;
+			} else {
+/*
+ * XXX perform_atareset() does not work
+ * when the drive is not completely spun up?
+ * So insert another delay here.
+ */
+printf("Waiting 15 seconds for port %d "
+"to spin up.\n", n);
+delay(15 * 1000 * 1000);
 			}
 		}
 		if (atachkpwr(l, n) != ATA_PWR_ACTIVE) {

Index: src/sys/arch/sandpoint/stand/altboot/version
diff -u src/sys/arch/sandpoint/stand/altboot/version:1.8 src/sys/arch/sandpoint/stand/altboot/version:1.9
--- src/sys/arch/sandpoint/stand/altboot/version:1.8	Wed Sep 30 14:14:32 2015
+++ src/sys/arch/sandpoint/stand/altboot/version	Thu Aug  3 19:22:15 2017
@@ -18,3 +18,5 @@
 	NIC.
 1.11:	Pass precise model information and flags with bootinfo.
 	Synology DS207/209 LED and 2nd disk power-up support.
+1.12:	Some more Synology DS20x fixes, to make sure both drives have been
+	spun up. Also detect PCI-vendor 0x1148 (S&K) as Synology.



CVS commit: src/sys/arch/sandpoint/stand/altboot

2017-08-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Aug  3 19:51:00 UTC 2017

Modified Files:
src/sys/arch/sandpoint/stand/altboot: skg.c

Log Message:
This driver should also support Schneider & Koch SK-9821 v2.0, besides
Marvell SKnet.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sandpoint/stand/altboot/skg.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/sandpoint/stand/altboot/skg.c
diff -u src/sys/arch/sandpoint/stand/altboot/skg.c:1.4 src/sys/arch/sandpoint/stand/altboot/skg.c:1.5
--- src/sys/arch/sandpoint/stand/altboot/skg.c:1.4	Sun Oct 30 21:08:33 2011
+++ src/sys/arch/sandpoint/stand/altboot/skg.c	Thu Aug  3 19:51:00 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: skg.c,v 1.4 2011/10/30 21:08:33 phx Exp $ */
+/* $NetBSD: skg.c,v 1.5 2017/08/03 19:51:00 phx Exp $ */
 
 /*-
  * Copyright (c) 2010 Frank Wille.
@@ -193,6 +193,7 @@ skg_match(unsigned tag, void *data)
 
 	v = pcicfgread(tag, PCI_ID_REG);
 	switch (v) {
+	case PCI_DEVICE(0x1148, 0x4320):
 	case PCI_DEVICE(0x11ab, 0x4320):
 		return 1;
 	}



CVS commit: src/external/gpl3

2017-08-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug  3 22:01:30 UTC 2017

Modified Files:
src/external/gpl3/gcc.old/lib/libgcc/libgcc: Makefile
src/external/gpl3/gcc/lib/libgcc/libgcc: Makefile

Log Message:
pass the target specific CPUFLAGS and CPPFLAGS for the .c.o rule.
should fix a problem rjs@ reported.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/lib/libgcc/libgcc/Makefile
cvs rdiff -u -r1.27 -r1.28 src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile

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

Modified files:

Index: src/external/gpl3/gcc.old/lib/libgcc/libgcc/Makefile
diff -u src/external/gpl3/gcc.old/lib/libgcc/libgcc/Makefile:1.6 src/external/gpl3/gcc.old/lib/libgcc/libgcc/Makefile:1.7
--- src/external/gpl3/gcc.old/lib/libgcc/libgcc/Makefile:1.6	Sun Jul 23 01:11:54 2017
+++ src/external/gpl3/gcc.old/lib/libgcc/libgcc/Makefile	Thu Aug  3 22:01:29 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2017/07/23 01:11:54 mrg Exp $
+#	$NetBSD: Makefile,v 1.7 2017/08/03 22:01:29 mrg Exp $
 
 REQUIRETOOLS=	yes
 NOLINT=		# defined
@@ -55,7 +55,7 @@ CLEANFILES+=	${SOBJS:=.tmp1} ${SOBJS:=.t
 
 .c.o:
 	${_MKTARGET_COMPILE}
-	${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}.tmp1
+	${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}.tmp1
 	${NM} -pg ${.TARGET}.tmp1 | \
 	${TOOL_AWK} 'NF == 3 { print "\t.hidden", $$3 }' | \
 	${CC} ${COPTS} -r -nostdinc -nostdlib ${CPUFLAGS} -o ${.TARGET}.tmp2 ${.TARGET}.tmp1 -xassembler -

Index: src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile
diff -u src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.27 src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.28
--- src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.27	Wed Mar 22 23:11:07 2017
+++ src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile	Thu Aug  3 22:01:30 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.27 2017/03/22 23:11:07 chs Exp $
+#	$NetBSD: Makefile,v 1.28 2017/08/03 22:01:30 mrg Exp $
 
 REQUIRETOOLS=	yes
 NOLINT=		# defined
@@ -55,7 +55,7 @@ CLEANFILES+=	${SOBJS:=.tmp1} ${SOBJS:=.t
 
 .c.o:
 	${_MKTARGET_COMPILE}
-	${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}.tmp1
+	${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}.tmp1
 	${NM} -pg ${.TARGET}.tmp1 | \
 	${TOOL_AWK} 'NF == 3 { print "\t.hidden", $$3 }' | \
 	${CC} ${COPTS} -r -nostdinc -nostdlib ${CPUFLAGS} -o ${.TARGET}.tmp2 ${.TARGET}.tmp1 -xassembler -



CVS commit: src/external/gpl3

2017-08-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug  3 22:00:38 UTC 2017

Removed Files:
src/external/gpl3/gcc.old/lib/libgcc: Makefile.wrapper
src/external/gpl3/gcc/lib/libgcc: Makefile.wrapper

Log Message:
remove unused files


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r0 src/external/gpl3/gcc.old/lib/libgcc/Makefile.wrapper
cvs rdiff -u -r1.1 -r0 src/external/gpl3/gcc/lib/libgcc/Makefile.wrapper

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



CVS commit: src/sys/dev/hdaudio

2017-08-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  4 00:25:24 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdafg.c hdafg_dd.c

Log Message:
put all the ELD debugging messages under #ifdef HDAFG_HDMI_DEBUG.
this silences a frequent and largely useless series of messages
in my dmesg.  ok jmcneill.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/hdaudio/hdafg.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/hdaudio/hdafg_dd.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/hdaudio/hdafg.c
diff -u src/sys/dev/hdaudio/hdafg.c:1.12 src/sys/dev/hdaudio/hdafg.c:1.13
--- src/sys/dev/hdaudio/hdafg.c:1.12	Thu Jun  1 02:45:10 2017
+++ src/sys/dev/hdaudio/hdafg.c	Fri Aug  4 00:25:23 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.12 2017/06/01 02:45:10 chs Exp $ */
+/* $NetBSD: hdafg.c,v 1.13 2017/08/04 00:25:23 mrg Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.12 2017/06/01 02:45:10 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.13 2017/08/04 00:25:23 mrg Exp $");
 
 #include 
 #include 
@@ -879,15 +879,19 @@ hdafg_assoc_dump_dd(struct hdafg_softc *
 			res = (*cmd)(sc->sc_codec, as->as_pins[pin],
 			CORB_GET_HDMI_ELD_DATA, i);
 			if (!(res & COP_ELD_VALID)) {
+#ifdef HDAFG_HDMI_DEBUG
 hda_error(sc, "bad ELD size (%u/%u)\n",
 i, elddatalen);
+#endif
 break;
 			}
 			elddata[i] = COP_ELD_DATA(res);
 		}
 
 		if (hdafg_dd_parse_info(elddata, elddatalen, &hdi) != 0) {
+#ifdef HDAFG_HDMI_DEBUG
 			hda_error(sc, "failed to parse ELD data\n");
+#endif
 			return;
 		}
 
@@ -4342,7 +4346,9 @@ hdafg_unsol(device_t self, uint8_t tag)
 
 	switch (tag) {
 	case HDAUDIO_UNSOLTAG_EVENT_DD:
+#ifdef HDAFG_HDMI_DEBUG
 		hda_print(sc, "unsol: display device hotplug\n");
+#endif
 		for (i = 0; i < sc->sc_nassocs; i++) {
 			if (as[i].as_displaydev == false)
 continue;
@@ -4354,7 +4360,9 @@ hdafg_unsol(device_t self, uint8_t tag)
 		}
 		break;
 	default:
+#ifdef HDAFG_HDMI_DEBUG
 		hda_print(sc, "unsol: tag=%u\n", tag);
+#endif
 		break;
 	}
 

Index: src/sys/dev/hdaudio/hdafg_dd.c
diff -u src/sys/dev/hdaudio/hdafg_dd.c:1.1 src/sys/dev/hdaudio/hdafg_dd.c:1.2
--- src/sys/dev/hdaudio/hdafg_dd.c:1.1	Sat Mar 28 14:09:59 2015
+++ src/sys/dev/hdaudio/hdafg_dd.c	Fri Aug  4 00:25:23 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg_dd.c,v 1.1 2015/03/28 14:09:59 jmcneill Exp $ */
+/* $NetBSD: hdafg_dd.c,v 1.2 2017/08/04 00:25:23 mrg Exp $ */
 
 /*
  * Copyright (c) 2011 Jared D. McNeill 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.1 2015/03/28 14:09:59 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.2 2017/08/04 00:25:23 mrg Exp $");
 
 #include 
 #include 
@@ -50,12 +50,16 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	struct eld_baseline_block *block = &hdi->eld;
 	unsigned int i;
 
+#ifdef HDAFG_HDMI_DEBUG
 	printf("hdafg_dd_parse_info: datalen=%u\n", (unsigned int)datalen);
+#endif
 
 	memset(hdi, 0, sizeof(*hdi));
 
 	if (datalen < sizeof(block->header)) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" no room for header\n");
+#endif
 		return EINVAL;
 	}
 
@@ -65,7 +69,9 @@ hdafg_dd_parse_info(uint8_t *data, size_
 
 	if (datalen < block->header.baseline_eld_len * 4 ||
 	datalen < sizeof(*block) - sizeof(block->header)) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" ack!\n");
+#endif
 		return EINVAL;
 	}
 
@@ -76,7 +82,9 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	datalen -= sizeof(*block) - sizeof(block->header);
 
 	if (datalen < ELD_MNL(block)) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" MNL=%u\n", ELD_MNL(block));
+#endif
 		return EINVAL;
 	}
 
@@ -85,10 +93,12 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	datalen -= ELD_MNL(block);
 
 	if (datalen != ELD_SAD_COUNT(block) * sizeof(hdi->sad[0])) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" datalen %u sadcount %u sizeof sad %u\n",
 		(unsigned int)datalen,
 		ELD_SAD_COUNT(block),
 		(unsigned int)sizeof(hdi->sad[0]));
+#endif
 		return EINVAL;
 	}
 	hdi->nsad = ELD_SAD_COUNT(block);
@@ -98,7 +108,9 @@ hdafg_dd_parse_info(uint8_t *data, size_
 		datalen -= sizeof(hdi->sad[i]);
 	}
 
+#ifdef HDAFG_HDMI_DEBUG
 	printf("datalen = %u\n", (unsigned int)datalen);
+#endif
 	KASSERT(datalen == 0);
 
 	return 0;



CVS commit: src/lib/libc/gen

2017-08-03 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Fri Aug  4 01:06:22 UTC 2017

Modified Files:
src/lib/libc/gen: vis.3

Log Message:
There are more than four types of encoding.  The combination of
VIS_CSTYLE | VIS_OCTAL is different from either separately.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/lib/libc/gen/vis.3

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

Modified files:

Index: src/lib/libc/gen/vis.3
diff -u src/lib/libc/gen/vis.3:1.47 src/lib/libc/gen/vis.3:1.48
--- src/lib/libc/gen/vis.3:1.47	Sun Apr 23 13:23:02 2017
+++ src/lib/libc/gen/vis.3	Fri Aug  4 01:06:22 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vis.3,v 1.47 2017/04/23 13:23:02 christos Exp $
+.\"	$NetBSD: vis.3,v 1.48 2017/08/04 01:06:22 ginsbach Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -311,7 +311,7 @@ warning on the use of the
 .Dv VIS_NOSLASH
 flag below).
 .Pp
-There are four forms of encoding.
+There are six forms of encoding.
 All forms use the backslash character
 .Ql \e
 to introduce a special
@@ -403,6 +403,9 @@ If
 .Fa nextc
 is an octal digit, the latter representation is used to
 avoid ambiguity.
+.Pp
+Non-printable characters without C-style
+backslash sequences use the default representation.
 .It Dv VIS_OCTAL
 Use a three digit octal sequence.
 The form is
@@ -410,6 +413,11 @@ The form is
 where
 .Em d
 represents an octal digit.
+.It Dv VIS_CSTYLE \&| Dv VIS_OCTAL
+Same as
+.Dv VIS_CSTYLE
+except that non-printable characters without C-style
+backslash sequences use a three digit octal sequence.
 .It Dv VIS_HTTPSTYLE
 Use URI encoding as described in RFC 1738.
 The form is



CVS commit: src/external/gpl3

2017-08-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  4 01:18:39 UTC 2017

Modified Files:
src/external/gpl3/gcc.old/usr.bin: Makefile.backend Makefile.inc
src/external/gpl3/gcc/usr.bin: Makefile.backend Makefile.inc

Log Message:
put the location of gmp/mpc/mpfr in a variable so we can .old them.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc.old/usr.bin/Makefile.backend
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/usr.bin/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc/usr.bin/Makefile.backend
cvs rdiff -u -r1.27 -r1.28 src/external/gpl3/gcc/usr.bin/Makefile.inc

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

Modified files:

Index: src/external/gpl3/gcc.old/usr.bin/Makefile.backend
diff -u src/external/gpl3/gcc.old/usr.bin/Makefile.backend:1.5 src/external/gpl3/gcc.old/usr.bin/Makefile.backend:1.6
--- src/external/gpl3/gcc.old/usr.bin/Makefile.backend:1.5	Sun Jul 23 01:12:16 2017
+++ src/external/gpl3/gcc.old/usr.bin/Makefile.backend	Fri Aug  4 01:18:39 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.backend,v 1.5 2017/07/23 01:12:16 mrg Exp $
+#	$NetBSD: Makefile.backend,v 1.6 2017/08/04 01:18:39 mrg Exp $
 
 .ifndef _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_BACKEND_
 _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_BACKEND_=1
@@ -32,9 +32,9 @@ CFLAGS:=	${CXXFLAGS}
 	@true
 
 # Find our (local) libraries
-LIBGMPDIR!=	cd ${NETBSDSRCDIR}/external/lgpl3/gmp/lib/libgmp && ${PRINTOBJDIR}
-LIBMPFRDIR!=	cd ${NETBSDSRCDIR}/external/lgpl3/mpfr/lib/libmpfr && ${PRINTOBJDIR}
-LIBMPCDIR!=	cd ${NETBSDSRCDIR}/external/lgpl3/mpc/lib/libmpc && ${PRINTOBJDIR}
+LIBGMPDIR!=	cd ${GMPDISTDIR}/lib/libgmp && ${PRINTOBJDIR}
+LIBMPFRDIR!=	cd ${MPFRDISTDIR}/lib/libmpfr && ${PRINTOBJDIR}
+LIBMPCDIR!=	cd ${MPCDISTDIR}/lib/libmpc && ${PRINTOBJDIR}
 
 LIBGMP=		${LIBGMPDIR}/libgmp.a
 LIBMPFR=	${LIBMPFRDIR}/libmpfr.a

Index: src/external/gpl3/gcc.old/usr.bin/Makefile.inc
diff -u src/external/gpl3/gcc.old/usr.bin/Makefile.inc:1.6 src/external/gpl3/gcc.old/usr.bin/Makefile.inc:1.7
--- src/external/gpl3/gcc.old/usr.bin/Makefile.inc:1.6	Sun Jul 23 01:12:16 2017
+++ src/external/gpl3/gcc.old/usr.bin/Makefile.inc	Fri Aug  4 01:18:39 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.6 2017/07/23 01:12:16 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.7 2017/08/04 01:18:39 mrg Exp $
 
 .ifndef _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_
 _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_=1
@@ -19,11 +19,15 @@ CPPFLAGS+=	-DLOCALEDIR=\"/usr/share/loca
 HOST_CPPFLAGS+=	-I${.CURDIR}/..
 
 # Link in the GMP/MPFR/MPC headers since we don't install them
-BUILDSYMLINKS+=	${NETBSDSRCDIR}/external/lgpl3/gmp/lib/libgmp/arch/${GMP_MACHINE_ARCH}/gmp.h gmp.h
-BUILDSYMLINKS+=	${NETBSDSRCDIR}/external/lgpl3/mpfr/dist/src/mpfr.h mpfr.h
-BUILDSYMLINKS+=	${NETBSDSRCDIR}/external/lgpl3/mpfr/dist/src/mpf2mpfr.h mpf2mpfr.h
-BUILDSYMLINKS+=	${NETBSDSRCDIR}/external/lgpl3/mpc/dist/src/mpc.h mpc.h
-BUILDSYMLINKS+=	${NETBSDSRCDIR}/external/lgpl3/mpc/dist/src/mpc-log.h mpc-log.h
+GMPDISTDIR=	${NETBSDSRCDIR}/external/lgpl3/gmp
+MPFRDISTDIR=	${NETBSDSRCDIR}/external/lgpl3/mpfr
+MPCDISTDIR=	${NETBSDSRCDIR}/external/lgpl3/mpc
+
+BUILDSYMLINKS+=	${GMPDISTDIR}/lib/libgmp/arch/${GMP_MACHINE_ARCH}/gmp.h gmp.h
+BUILDSYMLINKS+=	${MPFRDISTDIR}/dist/src/mpfr.h mpfr.h
+BUILDSYMLINKS+=	${MPFRDISTDIR}/dist/src/mpf2mpfr.h mpf2mpfr.h
+BUILDSYMLINKS+=	${MPCDISTDIR}/dist/src/mpc.h mpc.h
+BUILDSYMLINKS+=	${MPCDISTDIR}/dist/src/mpc-log.h mpc-log.h
 CPPFLAGS+=	-I.
 # XXX
 DPSRCS+= gmp.h mpfr.h mpf2mpfr.h mpc.h mpc-log.h

Index: src/external/gpl3/gcc/usr.bin/Makefile.backend
diff -u src/external/gpl3/gcc/usr.bin/Makefile.backend:1.5 src/external/gpl3/gcc/usr.bin/Makefile.backend:1.6
--- src/external/gpl3/gcc/usr.bin/Makefile.backend:1.5	Fri Apr  4 01:19:14 2014
+++ src/external/gpl3/gcc/usr.bin/Makefile.backend	Fri Aug  4 01:18:39 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.backend,v 1.5 2014/04/04 01:19:14 christos Exp $
+#	$NetBSD: Makefile.backend,v 1.6 2017/08/04 01:18:39 mrg Exp $
 
 .ifndef _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_BACKEND_
 _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_BACKEND_=1
@@ -32,9 +32,9 @@ CFLAGS:=	${CXXFLAGS}
 	@true
 
 # Find our (local) libraries
-LIBGMPDIR!=	cd ${NETBSDSRCDIR}/external/lgpl3/gmp/lib/libgmp && ${PRINTOBJDIR}
-LIBMPFRDIR!=	cd ${NETBSDSRCDIR}/external/lgpl3/mpfr/lib/libmpfr && ${PRINTOBJDIR}
-LIBMPCDIR!=	cd ${NETBSDSRCDIR}/external/lgpl3/mpc/lib/libmpc && ${PRINTOBJDIR}
+LIBGMPDIR!=	cd ${GMPDISTDIR}/lib/libgmp && ${PRINTOBJDIR}
+LIBMPFRDIR!=	cd ${MPFRDISTDIR}/lib/libmpfr && ${PRINTOBJDIR}
+LIBMPCDIR!=	cd ${MPCDISTDIR}/lib/libmpc && ${PRINTOBJDIR}
 
 LIBGMP=		${LIBGMPDIR}/libgmp.a
 LIBMPFR=	${LIBMPFRDIR}/libmpfr.a

Index: src/external/gpl3/gcc/usr.bin/Makefile.inc
diff -u src/external/gpl3/gcc/usr.bin/Makefile.inc:1.27 src/external/gpl3/gcc/usr.bin/Makefile.inc:1.28
--- src/external/gpl3/gcc/usr.bin/Makefile.inc:1.27	Tue Apr 19 21:11:05 2016
+++ src/external/gp

CVS commit: src/usr.sbin/traceroute6

2017-08-03 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Fri Aug  4 02:08:22 UTC 2017

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

Log Message:
Expand the traceroute6 man page

- Add a proper description paragraph before launching into describing the
  options.  More closely follow format of the traceroute(8) man page.
- Improve the wording for some option descriptions.
- Add description what what is printed and define what the possible
  annotations mean.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/traceroute6/traceroute6.8

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

Modified files:

Index: src/usr.sbin/traceroute6/traceroute6.8
diff -u src/usr.sbin/traceroute6/traceroute6.8:1.15 src/usr.sbin/traceroute6/traceroute6.8:1.16
--- src/usr.sbin/traceroute6/traceroute6.8:1.15	Tue Jul  4 07:13:18 2017
+++ src/usr.sbin/traceroute6/traceroute6.8	Fri Aug  4 02:08:21 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: traceroute6.8,v 1.15 2017/07/04 07:13:18 wiz Exp $
+.\"	$NetBSD: traceroute6.8,v 1.16 2017/08/04 02:08:21 ginsbach Exp $
 .\"	$KAME: traceroute6.8,v 1.8 2000/06/12 16:29:18 itojun Exp $
 .\"
 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -28,7 +28,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd September 17, 2005
+.Dd January 18, 2007
 .Dt TRACEROUTE6 8
 .Os
 .\"
@@ -51,13 +51,27 @@
 .Op Ar datalen
 .\"
 .Sh DESCRIPTION
+.Nm
+uses the IPv6 protocol hop limit field to elicit an ICMPv6
+.Dv TIME_EXCEEDED
+response from each gateway along the path to some host.
+.Pp
+The only mandatory parameter is the destination host name or IPv6 address.
+The default probe datagram carries 12 bytes of payload,
+in addition to the IPv6 header.
+The size of the payload can be specified by giving a length
+.Po in bytes
+.Pc
+after the destination host name.
+.Pp
+Other options are:
 .Bl -tag -width Ds
 .It Fl A
 Turn on AS# lookups and use the given server instead of the default.
 .It Fl a
 Turn on AS# lookups for each hop encountered.
 .It Fl d
-Debug mode.
+Turn on socket-level debugging.
 .It Fl f Ar firsthop
 Specify how many hops to skip in trace.
 .It Fl g Ar gateway
@@ -78,15 +92,32 @@ is not specified, and only numeric addre
 .Fl n
 is specified.
 .It Fl m Ar hoplimit
-Specify maximum hoplimit.
+Specify maximum
+.Ar hoplimit,
+up to 255.
+The default is 30 hops.
 .It Fl n
 Do not resolve numeric address to hostname.
 .It Fl p Ar port
-Set UDP port number to
+Set the base UDP port number use in probes to
 .Ar port .
+The default is 33434.
+.Nm
+hopes that nothing is listening on UDP ports
+.Va base
+to
+.Va base + nhops - 1
+at the destination host (so an ICMPv6
+.Dv PORT_UNREACHABLE
+message will be returned to terminate the route tracing).
+If something is listening on a port in the default range,
+this option can be used to pick an unused port range.
 .It Fl q Ar probes
-Set the number of probe per hop count to
+Set the number of probe packets sent per hop count to
 .Ar probes .
+By default,
+.Nm
+sends three probe packets.
 .It Fl r
 Bypass the normal routing tables and send directly to
 a host on an attached network.
@@ -97,12 +128,47 @@ through an interface that has no route t
 (e.g., after the interface was dropped by
 .Xr route6d 8 ) .
 .It Fl s Ar src
-.Ar Src
-specifies the source IPv6 address to be used.
+Use the IPv6 address,
+.Ar src ,
+as the source address in outgoing probe packets.
 .It Fl v
 Be verbose.
+Received ICMPv6 packets other than
+.Dv TIME_EXCEEDED
+and
+.Dv UNREACHABLEs
+are listed.
 .It Fl w Ar waittime
-Specify the delay time between probes.
+Use
+.Ar waittime
+as the delay in seconds, between probes.
+The default is 5 seconds.
+.El
+.Pp
+This program prints the route to the given destination
+and the round-trip time to each gateway,
+in the same manner as traceroute.
+.Pp
+Here is a list of possible annotations after the
+round-trip time for each gateway:
+.Pp
+.Bl -hang -offset indent
+.It  !N
+Destination Unreachable - No Route to Host.
+.It  !X
+Destination Unreachable - Administratively Prohibited.
+.It  !S
+Destination Unreachable - Not a Neighbour.
+.It  !H
+Destination Unreachable - Address Unreachable.
+.It  !
+This is printed if the hop limit is <= 1 on a port unreachable message.
+This means that the packet got to the destination,
+but that the reply had a hop limit that was just
+large enough to allow it to get back to the source of the
+.Nm .
+This was more interesting in the IPv4 case,
+where some IP stack bugs could be identified by this behaviour.
 .El
 .\"
 .Sh EXIT STATUS



CVS commit: src/sbin/gpt

2017-08-03 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug  4 02:43:56 UTC 2017

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

Log Message:
Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sbin/gpt/gpt.8

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

Modified files:

Index: src/sbin/gpt/gpt.8
diff -u src/sbin/gpt/gpt.8:1.53 src/sbin/gpt/gpt.8:1.54
--- src/sbin/gpt/gpt.8:1.53	Thu Aug  3 14:39:31 2017
+++ src/sbin/gpt/gpt.8	Fri Aug  4 02:43:56 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: gpt.8,v 1.53 2017/08/03 14:39:31 msaitoh Exp $
+.\" $NetBSD: gpt.8,v 1.54 2017/08/04 02:43:56 kre Exp $
 .\"
 .\" Copyright (c) 2002 Marcel Moolenaar
 .\" All rights reserved.
@@ -247,8 +247,8 @@ bootstrap code, as installed via
 The
 .Fl L
 option selects the partition by label.
-If there are multiple partitions with the same label, it will use the
-first one found.
+If there are multiple partitions with the same label, the
+first one found will be used.
 .\"  create 
 .It Nm Ic create Oo Fl AfP Oc Oo Fl p Ar partitions Oc
 The
@@ -534,16 +534,15 @@ by legacy BIOS boot code.
 See the
 .Ic biosboot
 command for more information.
-The bootme flag is used to indicate which partiotion should be booted
+The bootme flag is used to indicate which partition should be booted
 by UEFI boot code.
 The other attributes are for compatibility with
 .Fx
-and are not currently used by any
-.Nx
-code.
+and are not currently used by
+.Nx .
 They may be used by
 .Nx
-code in the future.
+in the future.
 .\"  show 
 .It Nm Ic show Oo Fl aglu Oc Oo Fl i Ar index Oc
 The



CVS commit: src/usr.sbin/acpitools/acpidump

2017-08-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  4 06:30:36 UTC 2017

Modified Files:
src/usr.sbin/acpitools/acpidump: acpi.c acpi_user.c acpidump.8
acpidump.c acpidump.h

Log Message:
Sync with FreeBSD's r321294:
 - Dump TCG ACPI spec table (TCPA) more.
 - Dump DMA Remapping Reporting table (DMAR).
 - Consistently cast ACPICA 64-bit integer types when we print them.
 - Display the 'Flags' field in the HPET Description Table.
 - Do not crash when RSDT/XSDT contains an empty entry.
 - Print 64-bit addresses clearly with leading zeros to avoid confusions.
 - Create temp file safely.
 - Add missing flags into FADT.
 - Print some new ACPI 5.1 MADT entries.
 - Use __arraycount().
 - Warn and exit loop on invalid subtable length.
 - Fix the type used to hold the value returned from getopt. On arm64 char is
   unsigned so will never be -1.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/acpitools/acpidump/acpi.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/acpitools/acpidump/acpi_user.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/acpitools/acpidump/acpidump.8
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/acpitools/acpidump/acpidump.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/acpitools/acpidump/acpidump.h

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/acpitools/acpidump/acpi.c
diff -u src/usr.sbin/acpitools/acpidump/acpi.c:1.15 src/usr.sbin/acpitools/acpidump/acpi.c:1.16
--- src/usr.sbin/acpitools/acpidump/acpi.c:1.15	Sat Feb 27 16:40:22 2016
+++ src/usr.sbin/acpitools/acpidump/acpi.c	Fri Aug  4 06:30:36 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.15 2016/02/27 16:40:22 christos Exp $ */
+/* $NetBSD: acpi.c,v 1.16 2017/08/04 06:30:36 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -26,11 +26,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/usr.sbin/acpi/acpidump/acpi.c,v 1.37 2009/08/25 20:35:57 jhb Exp $
+ *	$FreeBSD: head/usr.sbin/acpi/acpidump/acpi.c 321299 2017-07-20 17:36:17Z emaste $
  */
 
 #include 
-__RCSID("$NetBSD: acpi.c,v 1.15 2016/02/27 16:40:22 christos Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.16 2017/08/04 06:30:36 msaitoh Exp $");
 
 #include 
 #include 
@@ -116,6 +116,71 @@ static void	acpi_walk_subtables(ACPI_TAB
 /* Size of an address. 32-bit for ACPI 1.0, 64-bit for ACPI 2.0 and up. */
 static int addr_size;
 
+/* Strings used in the TCPA table */
+static const char *tcpa_event_type_strings[] = {
+	"PREBOOT Certificate",
+	"POST Code",
+	"Unused",
+	"No Action",
+	"Separator",
+	"Action",
+	"Event Tag",
+	"S-CRTM Contents",
+	"S-CRTM Version",
+	"CPU Microcode",
+	"Platform Config Flags",
+	"Table of Devices",
+	"Compact Hash",
+	"IPL",
+	"IPL Partition Data",
+	"Non-Host Code",
+	"Non-Host Config",
+	"Non-Host Info"
+};
+
+static const char *TCPA_pcclient_strings[] = {
+	"",
+	"SMBIOS",
+	"BIS Certificate",
+	"POST BIOS ROM Strings",
+	"ESCD",
+	"CMOS",
+	"NVRAM",
+	"Option ROM Execute",
+	"Option ROM Configurateion",
+	"",
+	"Option ROM Microcode Update ",
+	"S-CRTM Version String",
+	"S-CRTM Contents",
+	"POST Contents",
+	"Table of Devices",
+};
+
+#define	PRINTFLAG_END()		printflag_end()
+
+static char pf_sep = '{';
+
+static void
+printflag_end(void)
+{
+
+	if (pf_sep != '{') {
+		printf("}");
+		pf_sep = '{';
+	}
+	printf("\n");
+}
+
+static void
+printflag(uint64_t var, uint64_t mask, const char *name)
+{
+
+	if (var & mask) {
+		printf("%c%s", pf_sep, name);
+		pf_sep = ',';
+	}
+}
+
 static void
 acpi_print_string(char *s, size_t length)
 {
@@ -136,12 +201,18 @@ acpi_print_gas(ACPI_GENERIC_ADDRESS *gas
 {
 	switch(gas->SpaceId) {
 	case ACPI_GAS_MEMORY:
-		printf("0x%08lx:%u[%u] (Memory)", (u_long)gas->Address,
-		   gas->BitOffset, gas->BitWidth);
+		if (gas->BitWidth <= 32)
+			printf("0x%08x:%u[%u] (Memory)",
+			(u_int)gas->Address, gas->BitOffset,
+			gas->BitWidth);
+		else
+			printf("0x%016jx:%u[%u] (Memory)",
+			(uintmax_t)gas->Address, gas->BitOffset,
+			gas->BitWidth);
 		break;
 	case ACPI_GAS_IO:
-		printf("0x%02lx:%u[%u] (IO)", (u_long)gas->Address,
-		   gas->BitOffset, gas->BitWidth);
+		printf("0x%02x:%u[%u] (IO)", (u_int)gas->Address,
+		gas->BitOffset, gas->BitWidth);
 		break;
 	case ACPI_GAS_PCI:
 		printf("%x:%x+0x%x (PCI)", (uint16_t)(gas->Address >> 32),
@@ -162,7 +233,7 @@ acpi_print_gas(ACPI_GENERIC_ADDRESS *gas
 	case ACPI_GAS_DATATABLE:
 	case ACPI_GAS_FIXED:
 	default:
-		printf("0x%08lx (?)", (u_long)gas->Address);
+		printf("0x%016jx (?)", (uintmax_t)gas->Address);
 		break;
 	}
 }
@@ -720,6 +791,10 @@ acpi_walk_subtables(ACPI_TABLE_HEADER *t
 	end = (char *)table + table->Length;
 	while ((char *)subtable < end) {
 		printf("\n");
+		if (subtable->Length < sizeof(ACPI_SUBTABLE_HEADER)) {
+			warnx("invalid subtable length %u", subtable->Length);
+			return;
+		}
 		action(subtable);
 		subtable =