CVS commit: src/libexec/httpd

2018-11-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Nov 24 02:35:13 UTC 2018

Modified Files:
src/libexec/httpd: bozohttpd.c

Log Message:
call this bozohttpd 20181124.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/libexec/httpd/bozohttpd.c

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

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.95 src/libexec/httpd/bozohttpd.c:1.96
--- src/libexec/httpd/bozohttpd.c:1.95	Sat Nov 24 00:47:51 2018
+++ src/libexec/httpd/bozohttpd.c	Sat Nov 24 02:35:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.95 2018/11/24 00:47:51 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.96 2018/11/24 02:35:13 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -109,7 +109,7 @@
 #define INDEX_HTML		"index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE		"bozohttpd/20181123"
+#define SERVER_SOFTWARE		"bozohttpd/20181124"
 #endif
 #ifndef PUBLIC_HTML
 #define PUBLIC_HTML		"public_html"



CVS commit: src/libexec/httpd

2018-11-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Nov 24 02:30:56 UTC 2018

Modified Files:
src/libexec/httpd: main.c

Log Message:
fix a bug in the rework for -i option:  move the real code in place.

for some reason gcc does not warn about this:

   case 'x':
 stuff_here();
 break;

 other_stuff_here();
 break;

and the other_stuff_here() was what was mis-placed.

should fix atf failures in networking.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/libexec/httpd/main.c

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

Modified files:

Index: src/libexec/httpd/main.c
diff -u src/libexec/httpd/main.c:1.20 src/libexec/httpd/main.c:1.21
--- src/libexec/httpd/main.c:1.20	Thu Nov 22 18:21:59 2018
+++ src/libexec/httpd/main.c	Sat Nov 24 02:30:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.20 2018/11/22 18:21:59 mrg Exp $	*/
+/*	$NetBSD: main.c,v 1.21 2018/11/24 02:30:56 mrg Exp $	*/
 
 /*	$eterna: main.c,v 1.6 2011/11/18 09:21:15 mrg Exp $	*/
 /* from: eterna: bozohttpd.c,v 1.159 2009/05/23 02:14:30 mrg Exp 	*/
@@ -253,6 +253,9 @@ main(int argc, char **argv)
 			if (!have_daemon_mode)
 goto no_daemon_mode;
 
+			bozo_set_pref(, , "bind address", optarg);
+			break;
+
 		case 'L':
 			if (!have_lua)
 bozoerr(, 1, "Lua support not enabled");
@@ -371,9 +374,6 @@ main(int argc, char **argv)
 			bozo_ssl_set_ciphers(, optarg);
 			break;
 
-			bozo_set_pref(, , "bind address", optarg);
-			break;
-
 		default:
 			usage(, progname);
 			/* NOTREACHED */



CVS commit: src/lib/libcurses

2018-11-23 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Nov 24 01:04:18 UTC 2018

Modified Files:
src/lib/libcurses: attributes.c

Log Message:
attron(), attroff() - don't take a shortcut.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libcurses/attributes.c

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

Modified files:

Index: src/lib/libcurses/attributes.c
diff -u src/lib/libcurses/attributes.c:1.29 src/lib/libcurses/attributes.c:1.30
--- src/lib/libcurses/attributes.c:1.29	Fri Nov 23 11:16:59 2018
+++ src/lib/libcurses/attributes.c	Sat Nov 24 01:04:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: attributes.c,v 1.29 2018/11/23 11:16:59 uwe Exp $	*/
+/*	$NetBSD: attributes.c,v 1.30 2018/11/24 01:04:18 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: attributes.c,v 1.29 2018/11/23 11:16:59 uwe Exp $");
+__RCSID("$NetBSD: attributes.c,v 1.30 2018/11/24 01:04:18 uwe Exp $");
 #endif/* not lint */
 
 #include "curses.h"
@@ -105,7 +105,7 @@ color_set(short pair, void *opts)
 int
 attron(int attr)
 {
-	return __wattr_on(stdscr, (attr_t) attr);
+	return wattron(stdscr, attr);
 }
 
 /*
@@ -115,7 +115,7 @@ attron(int attr)
 int
 attroff(int attr)
 {
-	return __wattr_off(stdscr, (attr_t) attr);
+	return wattroff(stdscr, attr);
 }
 
 /*



CVS commit: src/libexec/httpd

2018-11-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Nov 24 00:47:52 UTC 2018

Modified Files:
src/libexec/httpd: bozohttpd.c

Log Message:
s/time/val/ to avoid shadowing a global indentifier.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/libexec/httpd/bozohttpd.c

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

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.94 src/libexec/httpd/bozohttpd.c:1.95
--- src/libexec/httpd/bozohttpd.c:1.94	Fri Nov 23 08:11:20 2018
+++ src/libexec/httpd/bozohttpd.c	Sat Nov 24 00:47:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.94 2018/11/23 08:11:20 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.95 2018/11/24 00:47:51 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -395,7 +395,7 @@ alarmer(int sig)
  */
 int
 bozo_set_timeout(bozohttpd_t *httpd, bozoprefs_t *prefs,
-		 const char *target, const char *time)
+		 const char *target, const char *val)
 {
 	const char *cur, *timeouts[] = {
 		"initial timeout",
@@ -409,7 +409,7 @@ bozo_set_timeout(bozohttpd_t *httpd, boz
 
 	for (cur = timeouts[0]; len >= minlen && *cur; cur++) {
 		if (strncmp(target, cur, len) == 0) {
-			bozo_set_pref(httpd, prefs, cur, time);
+			bozo_set_pref(httpd, prefs, cur, val);
 			return 0;
 		}
 	}



CVS commit: src/bin/sh

2018-11-23 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Nov 23 23:41:20 UTC 2018

Modified Files:
src/bin/sh: redir.c

Log Message:
Fix the <> redirection operator, which has been broken since it was
first implemented in response to PR bin/4966  (PR Feb 1998, fix Feb 1999).

The file named should not be truncated.

No other shell truncates the file (<> was added to FreeBSD sh in Oct 2000,
and did not include O_TRUNC) and POSIX certainly does not suggest that
should happen (just that the file is to be created if it does not exist.)

Bug pointed out in off-list e-mail by Martijn Dekker


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/bin/sh/redir.c

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

Modified files:

Index: src/bin/sh/redir.c
diff -u src/bin/sh/redir.c:1.60 src/bin/sh/redir.c:1.61
--- src/bin/sh/redir.c:1.60	Mon Aug 13 22:13:02 2018
+++ src/bin/sh/redir.c	Fri Nov 23 23:41:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: redir.c,v 1.60 2018/08/13 22:13:02 kre Exp $	*/
+/*	$NetBSD: redir.c,v 1.61 2018/11/23 23:41:20 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)redir.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: redir.c,v 1.60 2018/08/13 22:13:02 kre Exp $");
+__RCSID("$NetBSD: redir.c,v 1.61 2018/11/23 23:41:20 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -299,7 +299,7 @@ openredirect(union node *redir, char mem
 		break;
 	case NFROMTO:
 		fname = redir->nfile.expfname;
-		if ((f = open(fname, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0)
+		if ((f = open(fname, O_RDWR|O_CREAT, 0666)) < 0)
 			goto ecreate;
 		VTRACE(DBG_REDIR, ("openredirect(<> '%s') -> %d", fname, f));
 		break;



CVS commit: src/bin/sh

2018-11-23 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Nov 23 23:37:22 UTC 2018

Modified Files:
src/bin/sh: eval.c

Log Message:
Handle eval $'continue\ncommand' (and similar) in a loop correctly ...
"command" should not be executed.  (The issue affects multi-line
eval strings only - ie: commands after the next \n are not skipped).

Bug noted by Martijn Dekker in off-list e-mail.

Fix from FreeBSD:
src/bin/sh/eval.c: Revision 272983 Sun Oct 12 13:12:06 2014 UTC by jilles


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/bin/sh/eval.c

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

Modified files:

Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.162 src/bin/sh/eval.c:1.163
--- src/bin/sh/eval.c:1.162	Tue Oct  9 02:43:41 2018
+++ src/bin/sh/eval.c	Fri Nov 23 23:37:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.162 2018/10/09 02:43:41 kre Exp $	*/
+/*	$NetBSD: eval.c,v 1.163 2018/11/23 23:37:22 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.162 2018/10/09 02:43:41 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.163 2018/11/23 23:37:22 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -233,6 +233,8 @@ evalstring(char *s, int flag)
 			else
 evaltree(n, flag);
 			any = 1;
+			if (evalskip)
+break;
 		}
 		rststackmark();
 	}



CVS commit: src/bin/sh

2018-11-23 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Nov 23 20:40:06 UTC 2018

Modified Files:
src/bin/sh: option.list sh.1

Log Message:
Avoid long option names that differ only in character case.
Change Xtrace (the name) to xlock instead.  Aside from the different
name, there is no change to functionality.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/bin/sh/option.list
cvs rdiff -u -r1.208 -r1.209 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/option.list
diff -u src/bin/sh/option.list:1.8 src/bin/sh/option.list:1.9
--- src/bin/sh/option.list:1.8	Tue Nov 21 03:42:39 2017
+++ src/bin/sh/option.list	Fri Nov 23 20:40:06 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: option.list,v 1.8 2017/11/21 03:42:39 kre Exp $ */
+/* $NetBSD: option.list,v 1.9 2018/11/23 20:40:06 kre Exp $ */
 
 /*
  * define the shell's settable options
@@ -66,7 +66,7 @@ qflag	quietprofile	q		# disable -v/-x in
 fnline1	local_lineno	L on		# number lines in funcs starting at 1
 promptcmds promptcmds			# allow $( ) in PS1 (et al).
 pipefail pipefail			# pipe exit status
-Xflag	Xtrace		X #ifndef SMALL	# sticky stderr for -x (implies -x)
+Xflag	xlock		X #ifndef SMALL	# sticky stderr for -x (implies -x)
 
 // editline/history related options ("vi" is standard, 'V' and others are not)
 // only one of vi/emacs can be set, hence the "set" definition, value

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.208 src/bin/sh/sh.1:1.209
--- src/bin/sh/sh.1:1.208	Tue Sep  4 23:16:30 2018
+++ src/bin/sh/sh.1	Fri Nov 23 20:40:06 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.208 2018/09/04 23:16:30 kre Exp $
+.\"	$NetBSD: sh.1,v 1.209 2018/11/23 20:40:06 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -443,7 +443,7 @@ section below.)
 .It Fl v Em verbose
 The shell writes its input to standard error as it is read.
 Useful for debugging.
-.It Fl X Em Xtrace
+.It Fl X Em xlock
 Cause output from the
 .Ic xtrace
 .Pq Fl x



CVS commit: src/sys/dev/pci

2018-11-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Nov 23 18:08:11 UTC 2018

Modified Files:
src/sys/dev/pci: ld_virtio.c

Log Message:
Use MSIX when available


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/ld_virtio.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/ld_virtio.c
diff -u src/sys/dev/pci/ld_virtio.c:1.25 src/sys/dev/pci/ld_virtio.c:1.26
--- src/sys/dev/pci/ld_virtio.c:1.25	Thu Jul 12 13:05:39 2018
+++ src/sys/dev/pci/ld_virtio.c	Fri Nov 23 18:08:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_virtio.c,v 1.25 2018/07/12 13:05:39 jakllsch Exp $	*/
+/*	$NetBSD: ld_virtio.c,v 1.26 2018/11/23 18:08:11 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.25 2018/07/12 13:05:39 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.26 2018/11/23 18:08:11 jmcneill Exp $");
 
 #include 
 #include 
@@ -276,7 +276,7 @@ ld_virtio_attach(device_t parent, device
 	sc->sc_virtio = vsc;
 
 	virtio_child_attach_start(vsc, self, IPL_BIO, >sc_vq,
-	NULL, virtio_vq_intr, 0,
+	NULL, virtio_vq_intr, VIRTIO_F_PCI_INTR_MSIX,
 	(VIRTIO_BLK_F_SIZE_MAX | VIRTIO_BLK_F_SEG_MAX |
 	 VIRTIO_BLK_F_GEOMETRY | VIRTIO_BLK_F_RO | VIRTIO_BLK_F_BLK_SIZE |
 	 VIRTIO_BLK_F_FLUSH | VIRTIO_BLK_F_CONFIG_WCE),



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

2018-11-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Nov 23 16:01:27 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
Only allocate what we need for ITT tables


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/cortex/gicv3_its.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/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.6 src/sys/arch/arm/cortex/gicv3_its.c:1.7
--- src/sys/arch/arm/cortex/gicv3_its.c:1.6	Fri Nov 23 11:48:12 2018
+++ src/sys/arch/arm/cortex/gicv3_its.c	Fri Nov 23 16:01:27 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.6 2018/11/23 11:48:12 jmcneill Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.7 2018/11/23 16:01:27 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,12 +32,13 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.6 2018/11/23 11:48:12 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.7 2018/11/23 16:01:27 jmcneill Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -281,19 +282,23 @@ gicv3_its_devid(pci_chipset_tag_t pc, pc
 	return (b << 8) | (d << 3) | f;
 }
 
-static void
-gicv3_its_device_map(struct gicv3_its *its, uint32_t devid)
+static int
+gicv3_its_device_map(struct gicv3_its *its, uint32_t devid, u_int count)
 {
 	struct gicv3_its_device *dev;
 
 	LIST_FOREACH(dev, >its_devices, dev_list)
 		if (dev->dev_id == devid)
-			return;
+			return EEXIST;
+
+	const u_int vectors = MAX(2, count);
+	if (!powerof2(vectors))
+		return EINVAL;
 
 	const uint64_t typer = gits_read_8(its, GITS_TYPER);
 	const u_int id_bits = __SHIFTOUT(typer, GITS_TYPER_ID_bits) + 1;
 	const u_int itt_entry_size = __SHIFTOUT(typer, GITS_TYPER_ITT_entry_size) + 1;
-	const u_int itt_size = roundup2((itt_entry_size * (1 << id_bits)) / NBBY, GITS_ITT_ALIGN);
+	const u_int itt_size = roundup(vectors * itt_entry_size, GITS_ITT_ALIGN);
 
 	dev = kmem_alloc(sizeof(*dev), KM_SLEEP);
 	dev->dev_id = devid;
@@ -305,6 +310,8 @@ gicv3_its_device_map(struct gicv3_its *i
 	 */
 	gits_command_mapd(its, devid, dev->dev_itt.segs[0].ds_addr, id_bits - 1, true);
 	gits_wait(its);
+
+	return 0;
 }
 
 static void
@@ -414,7 +421,8 @@ gicv3_its_msi_alloc(struct arm_pci_msi *
 
 	const uint32_t devid = gicv3_its_devid(pa->pa_pc, pa->pa_tag);
 
-	gicv3_its_device_map(its, devid);
+	if (gicv3_its_device_map(its, devid, *count) != 0)
+		return NULL;
 
 	vectors = kmem_alloc(sizeof(*vectors) * *count, KM_SLEEP);
 	for (n = 0; n < *count; n++) {
@@ -479,7 +487,10 @@ gicv3_its_msix_alloc(struct arm_pci_msi 
 
 	const uint32_t devid = gicv3_its_devid(pa->pa_pc, pa->pa_tag);
 
-	gicv3_its_device_map(its, devid);
+	if (gicv3_its_device_map(its, devid, *count) != 0) {
+		bus_space_unmap(bst, bsh, bsz);
+		return NULL;
+	}
 
 	vectors = kmem_alloc(sizeof(*vectors) * *count, KM_SLEEP);
 	for (n = 0; n < *count; n++) {



CVS commit: src/sys/dev/acpi

2018-11-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Nov 23 14:08:40 UTC 2018

Modified Files:
src/sys/dev/acpi: plgpio_acpi.c

Log Message:
Use acpi_intr_establish


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/acpi/plgpio_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/plgpio_acpi.c
diff -u src/sys/dev/acpi/plgpio_acpi.c:1.4 src/sys/dev/acpi/plgpio_acpi.c:1.5
--- src/sys/dev/acpi/plgpio_acpi.c:1.4	Tue Oct 23 09:19:02 2018
+++ src/sys/dev/acpi/plgpio_acpi.c	Fri Nov 23 14:08:40 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: plgpio_acpi.c,v 1.4 2018/10/23 09:19:02 jmcneill Exp $ */
+/* $NetBSD: plgpio_acpi.c,v 1.5 2018/11/23 14:08:40 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plgpio_acpi.c,v 1.4 2018/10/23 09:19:02 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plgpio_acpi.c,v 1.5 2018/11/23 14:08:40 jmcneill Exp $");
 
 #include 
 #include 
@@ -40,6 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: plgpio_acpi.
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -108,7 +109,7 @@ plgpio_acpi_attach(device_t parent, devi
 	}
 
 	irq = acpi_res_irq(, 0);
-	if (mem == NULL) {
+	if (irq == NULL) {
 		aprint_error_dev(self, "couldn't find irq resource\n");
 		goto done;
 	}
@@ -130,8 +131,8 @@ plgpio_acpi_attach(device_t parent, devi
 		goto done;
 	}
 
-	const int type = (irq->ar_type == ACPI_EDGE_SENSITIVE) ? IST_EDGE : IST_LEVEL;
-	ih = intr_establish(irq->ar_irq, IPL_VM, type, plgpio_acpi_intr, asc);
+	ih = acpi_intr_establish(self, (uint64_t)asc->sc_handle,
+	IPL_VM, false, plgpio_acpi_intr, asc, device_xname(self));
 	if (ih == NULL)
 		aprint_error_dev(self, "couldn't establish interrupt\n");
 



CVS commit: src/lib/libc/arch/aarch64/gen

2018-11-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 23 12:39:19 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/gen: swapcontext.S

Log Message:
Update comments to help explain what's going on


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/aarch64/gen/swapcontext.S

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/arch/aarch64/gen/swapcontext.S
diff -u src/lib/libc/arch/aarch64/gen/swapcontext.S:1.3 src/lib/libc/arch/aarch64/gen/swapcontext.S:1.4
--- src/lib/libc/arch/aarch64/gen/swapcontext.S:1.3	Fri Nov 23 11:38:07 2018
+++ src/lib/libc/arch/aarch64/gen/swapcontext.S	Fri Nov 23 12:39:18 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: swapcontext.S,v 1.3 2018/11/23 11:38:07 skrll Exp $ */
+/* $NetBSD: swapcontext.S,v 1.4 2018/11/23 12:39:18 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-RCSID("$NetBSD: swapcontext.S,v 1.3 2018/11/23 11:38:07 skrll Exp $")
+RCSID("$NetBSD: swapcontext.S,v 1.4 2018/11/23 12:39:18 skrll Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 /* LINTSTUB: int swapcontext(ucontext_t * restrict, ucontext_t * restrict); */
@@ -42,12 +42,12 @@ ENTRY(swapcontext)
 	sub	sp, sp, #32		/* allocate stack frame */
 	stp	x29, x30, [sp, #16]	/* save FP & LR */
 	add	x29, sp, #16		/* new FP */
-	stp	x0, x1, [sp, #0]	/* save oucp & ucp */
+	stp	x0, x1, [sp, #0]	/* save oucp (x0) & ucp (x1) */
 
 	bl	_C_LABEL(_getcontext)	/* getcontext(oucp) */
 	mov	x3, x0			/* save return value */
 
-	ldp	x2, x0, [sp, #0]	/* restore oucp & ucp */
+	ldp	x2, x0, [sp, #0]	/* load oucp (x2) & ucp (x0) */
 	ldp	x29, x30, [sp, #16]	/* restore FP & LR */
 	add	sp, sp, #32		/* free stack frame */
 



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

2018-11-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 23 12:15:14 UTC 2018

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

Log Message:
Enable CPU_THUNDERX


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/evbarm/conf/GENERIC64

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/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.65 src/sys/arch/evbarm/conf/GENERIC64:1.66
--- src/sys/arch/evbarm/conf/GENERIC64:1.65	Sun Nov 18 20:23:18 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Fri Nov 23 12:15:14 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.65 2018/11/18 20:23:18 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.66 2018/11/23 12:15:14 skrll Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -58,7 +58,7 @@ makeoptions	DTS="
 "
 options 	CPU_CORTEXA53
 options 	CPU_CORTEXA57
-#options 	CPU_THUNDERX
+options 	CPU_THUNDERX
 options 	SOC_BCM2837
 options 	SOC_RK3328
 options 	SOC_RK3399



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

2018-11-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Nov 23 11:49:04 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gicv3.c

Log Message:
Fix LPI pending table size, use correct LPI conf offset in 
gicv3_lpi_block_irqs, and set bit[7]=1 for G1NS interrupts when writing to the 
LPI configuration table.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/cortex/gicv3.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/cortex/gicv3.c
diff -u src/sys/arch/arm/cortex/gicv3.c:1.12 src/sys/arch/arm/cortex/gicv3.c:1.13
--- src/sys/arch/arm/cortex/gicv3.c:1.12	Wed Nov 21 11:44:26 2018
+++ src/sys/arch/arm/cortex/gicv3.c	Fri Nov 23 11:49:04 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3.c,v 1.12 2018/11/21 11:44:26 jmcneill Exp $ */
+/* $NetBSD: gicv3.c,v 1.13 2018/11/23 11:49:04 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -31,7 +31,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.12 2018/11/21 11:44:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.13 2018/11/23 11:49:04 jmcneill Exp $");
 
 #include 
 #include 
@@ -530,15 +530,14 @@ static void
 gicv3_lpi_block_irqs(struct pic_softc *pic, size_t irqbase, uint32_t mask)
 {
 	struct gicv3_softc * const sc = LPITOSOFTC(pic);
-	const u_int off = irqbase - pic->pic_irqbase;
 	int bit;
 
 	while ((bit = ffs(mask)) != 0) {
-		sc->sc_lpiconf.base[off + bit - 1] &= ~GIC_LPICONF_Enable;
+		sc->sc_lpiconf.base[irqbase + bit - 1] &= ~GIC_LPICONF_Enable;
 		mask &= ~__BIT(bit - 1);
 	}
 
-	bus_dmamap_sync(sc->sc_dmat, sc->sc_lpiconf.map, off, 32, BUS_DMASYNC_PREWRITE);
+	bus_dmamap_sync(sc->sc_dmat, sc->sc_lpiconf.map, irqbase, 32, BUS_DMASYNC_PREWRITE);
 }
 
 static void
@@ -546,7 +545,7 @@ gicv3_lpi_establish_irq(struct pic_softc
 {
 	struct gicv3_softc * const sc = LPITOSOFTC(pic);
 
-	sc->sc_lpiconf.base[is->is_irq] = IPL_TO_PRIORITY(is->is_ipl) | GIC_LPICONF_Res1;
+	sc->sc_lpiconf.base[is->is_irq] = 0x80 | IPL_TO_PRIORITY(is->is_ipl) | GIC_LPICONF_Res1;
 
 	bus_dmamap_sync(sc->sc_dmat, sc->sc_lpiconf.map, is->is_irq, 1, BUS_DMASYNC_PREWRITE);
 }
@@ -671,7 +670,7 @@ gicv3_lpi_init(struct gicv3_softc *sc)
 	/*
 	 * Allocate LPI pending tables
 	 */
-	const bus_size_t lpipend_sz = (sc->sc_lpi.pic_maxsources + sc->sc_lpi.pic_irqbase) / NBBY;
+	const bus_size_t lpipend_sz = sc->sc_lpi.pic_maxsources / NBBY;
 	for (int cpuindex = 0; cpuindex < ncpu; cpuindex++) {
 		gicv3_dma_alloc(sc, >sc_lpipend[cpuindex], lpipend_sz, 0x1);
 		KASSERT((sc->sc_lpipend[cpuindex].segs[0].ds_addr & ~GICR_PENDBASER_Physical_Address) == 0);



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

2018-11-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Nov 23 11:48:12 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
Fix ITT size, only need to MAPD once per device.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/cortex/gicv3_its.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/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.5 src/sys/arch/arm/cortex/gicv3_its.c:1.6
--- src/sys/arch/arm/cortex/gicv3_its.c:1.5	Thu Nov 22 20:47:37 2018
+++ src/sys/arch/arm/cortex/gicv3_its.c	Fri Nov 23 11:48:12 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.5 2018/11/22 20:47:37 jakllsch Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.6 2018/11/23 11:48:12 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.5 2018/11/22 20:47:37 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.6 2018/11/23 11:48:12 jmcneill Exp $");
 
 #include 
 #include 
@@ -281,26 +281,30 @@ gicv3_its_devid(pci_chipset_tag_t pc, pc
 	return (b << 8) | (d << 3) | f;
 }
 
-static struct gicv3_its_device *
-gicv3_its_device_lookup(struct gicv3_its *its, uint32_t devid)
+static void
+gicv3_its_device_map(struct gicv3_its *its, uint32_t devid)
 {
 	struct gicv3_its_device *dev;
 
 	LIST_FOREACH(dev, >its_devices, dev_list)
 		if (dev->dev_id == devid)
-			return dev;
+			return;
 
 	const uint64_t typer = gits_read_8(its, GITS_TYPER);
 	const u_int id_bits = __SHIFTOUT(typer, GITS_TYPER_ID_bits) + 1;
 	const u_int itt_entry_size = __SHIFTOUT(typer, GITS_TYPER_ITT_entry_size) + 1;
-	const u_int itt_size = roundup2(itt_entry_size * (1 << id_bits), GITS_ITT_ALIGN);
+	const u_int itt_size = roundup2((itt_entry_size * (1 << id_bits)) / NBBY, GITS_ITT_ALIGN);
 
 	dev = kmem_alloc(sizeof(*dev), KM_SLEEP);
 	dev->dev_id = devid;
 	gicv3_dma_alloc(its->its_gic, >dev_itt, itt_size, GITS_ITT_ALIGN);
 	LIST_INSERT_HEAD(>its_devices, dev, dev_list);
 
-	return dev;
+	/*
+	 * Map the device to the ITT
+	 */
+	gits_command_mapd(its, devid, dev->dev_itt.segs[0].ds_addr, id_bits - 1, true);
+	gits_wait(its);
 }
 
 static void
@@ -397,7 +401,6 @@ gicv3_its_msi_alloc(struct arm_pci_msi *
 {
 	struct gicv3_its * const its = msi->msi_priv;
 	struct cpu_info * const ci = cpu_lookup(0);
-	struct gicv3_its_device *dev;
 	pci_intr_handle_t *vectors;
 	int n, off;
 
@@ -411,12 +414,7 @@ gicv3_its_msi_alloc(struct arm_pci_msi *
 
 	const uint32_t devid = gicv3_its_devid(pa->pa_pc, pa->pa_tag);
 
-	/*
-	 * Map device
-	 */
-	dev = gicv3_its_device_lookup(its, devid);
-	gits_command_mapd(its, devid, dev->dev_itt.segs[0].ds_addr, id_bits - 1, true);
-	gits_wait(its);
+	gicv3_its_device_map(its, devid);
 
 	vectors = kmem_alloc(sizeof(*vectors) * *count, KM_SLEEP);
 	for (n = 0; n < *count; n++) {
@@ -450,7 +448,6 @@ gicv3_its_msix_alloc(struct arm_pci_msi 
 {
 	struct gicv3_its * const its = msi->msi_priv;
 	struct cpu_info *ci = cpu_lookup(0);
-	struct gicv3_its_device *dev;
 	pci_intr_handle_t *vectors;
 	bus_space_tag_t bst;
 	bus_space_handle_t bsh;
@@ -482,12 +479,7 @@ gicv3_its_msix_alloc(struct arm_pci_msi 
 
 	const uint32_t devid = gicv3_its_devid(pa->pa_pc, pa->pa_tag);
 
-	/*
-	 * Map device
-	 */
-	dev = gicv3_its_device_lookup(its, devid);
-	gits_command_mapd(its, devid, dev->dev_itt.segs[0].ds_addr, id_bits - 1, true);
-	gits_wait(its);
+	gicv3_its_device_map(its, devid);
 
 	vectors = kmem_alloc(sizeof(*vectors) * *count, KM_SLEEP);
 	for (n = 0; n < *count; n++) {



CVS commit: src/lib/libc/arch/aarch64/gen

2018-11-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 23 11:38:07 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/gen: swapcontext.S

Log Message:
Fix so the setcontext call is via the PLT and libpthread can override


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/gen/swapcontext.S

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/arch/aarch64/gen/swapcontext.S
diff -u src/lib/libc/arch/aarch64/gen/swapcontext.S:1.2 src/lib/libc/arch/aarch64/gen/swapcontext.S:1.3
--- src/lib/libc/arch/aarch64/gen/swapcontext.S:1.2	Wed Nov 21 21:04:15 2018
+++ src/lib/libc/arch/aarch64/gen/swapcontext.S	Fri Nov 23 11:38:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: swapcontext.S,v 1.2 2018/11/21 21:04:15 skrll Exp $ */
+/* $NetBSD: swapcontext.S,v 1.3 2018/11/23 11:38:07 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-RCSID("$NetBSD: swapcontext.S,v 1.2 2018/11/21 21:04:15 skrll Exp $")
+RCSID("$NetBSD: swapcontext.S,v 1.3 2018/11/23 11:38:07 skrll Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 /* LINTSTUB: int swapcontext(ucontext_t * restrict, ucontext_t * restrict); */
@@ -58,7 +58,9 @@ ENTRY(swapcontext)
 	str	x4, [x2, #_UC_REGS_SP]	/* Adjust saved SP. */
 	str	x30, [x2, #_UC_REGS_PC]	/* Adjust saved PC. */
 
-	cbz	x3, _C_LABEL(setcontext)/* setcontext if getcontext succeeded */
+	cbnz	x3, 1f
+	b	_C_LABEL(setcontext)	/* setcontext if getcontext succeeded */
+1:
 	mov	x0, x3			/* restore getcontext return value */
 	ret/* return on error from getcontext */
 END(swapcontext)



CVS commit: src/libexec/ld.elf_so/arch/aarch64

2018-11-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 23 11:26:05 UTC 2018

Modified Files:
src/libexec/ld.elf_so/arch/aarch64: mdreloc.c

Log Message:
Fix RTLD_DEBUG_RELOC build


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/libexec/ld.elf_so/arch/aarch64/mdreloc.c

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

Modified files:

Index: src/libexec/ld.elf_so/arch/aarch64/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.11 src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.12
--- src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.11	Fri Nov 23 10:59:20 2018
+++ src/libexec/ld.elf_so/arch/aarch64/mdreloc.c	Fri Nov 23 11:26:05 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: mdreloc.c,v 1.11 2018/11/23 10:59:20 skrll Exp $ */
+/* $NetBSD: mdreloc.c,v 1.12 2018/11/23 11:26:05 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.11 2018/11/23 10:59:20 skrll Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.12 2018/11/23 11:26:05 skrll Exp $");
 #endif /* not lint */
 
 #include 
@@ -215,7 +215,7 @@ _rtld_relocate_nonplt_objects(Obj_Entry 
 	for (const Elf_Rela *rela = obj->rela; rela < obj->relalim; rela++) {
 		Elf_Addr*where;
 		Elf_Addr	tmp;
-		unsigned long	symnum;
+		unsigned long	symnum = ULONG_MAX;
 
 		where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
 
@@ -310,12 +310,11 @@ _rtld_relocate_nonplt_objects(Obj_Entry 
 
 		default:
 			rdbg(("sym = %lu, type = %lu, offset = %p, "
-			"addend = %p, contents = %p, symbol = %s",
+			"addend = %p, contents = %p",
 			(u_long)ELF_R_SYM(rela->r_info),
 			(u_long)ELF_R_TYPE(rela->r_info),
 			(void *)rela->r_offset, (void *)rela->r_addend,
-			(void *)*where,
-			obj->strtab + obj->symtab[symnum].st_name));
+			(void *)*where));
 			_rtld_error("%s: Unsupported relocation type %ld "
 			"in non-PLT relocations",
 			obj->path, (u_long) ELF_R_TYPE(rela->r_info));



CVS commit: src/lib/libcurses

2018-11-23 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Nov 23 11:16:59 UTC 2018

Modified Files:
src/lib/libcurses: attributes.c

Log Message:
wattr_set - turn off all wide attributes (fix unedited copy/paste).


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libcurses/attributes.c

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

Modified files:

Index: src/lib/libcurses/attributes.c
diff -u src/lib/libcurses/attributes.c:1.28 src/lib/libcurses/attributes.c:1.29
--- src/lib/libcurses/attributes.c:1.28	Fri Nov 23 11:15:14 2018
+++ src/lib/libcurses/attributes.c	Fri Nov 23 11:16:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: attributes.c,v 1.28 2018/11/23 11:15:14 uwe Exp $	*/
+/*	$NetBSD: attributes.c,v 1.29 2018/11/23 11:16:59 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: attributes.c,v 1.28 2018/11/23 11:15:14 uwe Exp $");
+__RCSID("$NetBSD: attributes.c,v 1.29 2018/11/23 11:16:59 uwe Exp $");
 #endif/* not lint */
 
 #include "curses.h"
@@ -204,7 +204,7 @@ wattr_set(WINDOW *win, attr_t attr, shor
 	 */
 	attr = (attr & ~__COLOR) | COLOR_PAIR(pair);
 
-	__wattr_off(win, __ATTRIBUTES);
+	__wattr_off(win, WA_ATTRIBUTES);
 	__wattr_on(win, attr);
 	return OK;
 }



CVS commit: src/lib/libcurses

2018-11-23 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Nov 23 11:11:59 UTC 2018

Modified Files:
src/lib/libcurses: attributes.c

Log Message:
Refactor.  Move code to turn attributes on/off into separate
functions.  Express both old and new functions to manipulate
attributes using those functions.  Check that the the new API's opts
argument (reserved by the standard for future use) is NULL and error
out if not (like getcchar/setcchar).  No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/lib/libcurses/attributes.c

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

Modified files:

Index: src/lib/libcurses/attributes.c
diff -u src/lib/libcurses/attributes.c:1.26 src/lib/libcurses/attributes.c:1.27
--- src/lib/libcurses/attributes.c:1.26	Thu Nov 22 23:37:31 2018
+++ src/lib/libcurses/attributes.c	Fri Nov 23 11:11:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: attributes.c,v 1.26 2018/11/22 23:37:31 uwe Exp $	*/
+/*	$NetBSD: attributes.c,v 1.27 2018/11/23 11:11:59 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,14 +31,17 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: attributes.c,v 1.26 2018/11/22 23:37:31 uwe Exp $");
+__RCSID("$NetBSD: attributes.c,v 1.27 2018/11/23 11:11:59 uwe Exp $");
 #endif/* not lint */
 
 #include "curses.h"
 #include "curses_private.h"
 
+static int __wattr_off(WINDOW *, attr_t);
+static int __wattr_on(WINDOW *, attr_t);
 static void __wcolor_set(WINDOW *, attr_t);
 
+
 #ifndef _CURSES_USE_MACROS
 /*
  * attr_get --
@@ -102,7 +105,7 @@ color_set(short pair, void *opt)
 int
 attron(int attr)
 {
-	return wattr_on(stdscr, (attr_t) attr, NULL);
+	return __wattr_on(stdscr, (attr_t) attr);
 }
 
 /*
@@ -112,7 +115,7 @@ attron(int attr)
 int
 attroff(int attr)
 {
-	return wattr_off(stdscr, (attr_t) attr, NULL);
+	return __wattr_off(stdscr, (attr_t) attr);
 }
 
 /*
@@ -155,53 +158,13 @@ wattr_get(WINDOW *win, attr_t *attr, sho
  * wattr_on --
  *	Test and set wide attributes on window
  */
-/* ARGSUSED */
 int
 wattr_on(WINDOW *win, attr_t attr, void *opt)
 {
-	const TERMINAL *t = win->screen->term;
+	if (__predict_false(opt != NULL))
+		return ERR;
 
-#ifdef DEBUG
-	__CTRACE(__CTRACE_ATTR, "wattr_on: win %p, attr %08x\n", win, attr);
-#endif
-	/* If can enter modes, set the relevent attribute bits. */
-	if (t_exit_attribute_mode(t) != NULL) {
-		if (attr & __BLINK && t_enter_blink_mode(t) != NULL)
-			win->wattr |= __BLINK;
-		if (attr & __BOLD && t_enter_bold_mode(t) != NULL)
-			win->wattr |= __BOLD;
-		if (attr & __DIM && t_enter_dim_mode(t) != NULL)
-			win->wattr |= __DIM;
-		if (attr & __BLANK && t_enter_secure_mode(t) != NULL)
-			win->wattr |= __BLANK;
-		if (attr & __PROTECT && t_enter_protected_mode(t) != NULL)
-			win->wattr |= __PROTECT;
-		if (attr & __REVERSE && t_enter_reverse_mode(t) != NULL)
-			win->wattr |= __REVERSE;
-#ifdef HAVE_WCHAR
-		if (attr & WA_LOW && t_enter_low_hl_mode(t) != NULL)
-			win->wattr |= WA_LOW;
-		if (attr & WA_TOP && t_enter_top_hl_mode(t) != NULL)
-			win->wattr |= WA_TOP;
-		if (attr & WA_LEFT && t_enter_left_hl_mode(t) != NULL)
-			win->wattr |= WA_LEFT;
-		if (attr & WA_RIGHT && t_enter_right_hl_mode(t) != NULL)
-			win->wattr |= WA_RIGHT;
-		if (attr & WA_HORIZONTAL && t_enter_horizontal_hl_mode(t) != NULL)
-			win->wattr |= WA_HORIZONTAL;
-		if (attr & WA_VERTICAL && t_enter_vertical_hl_mode(t) != NULL)
-			win->wattr |= WA_VERTICAL;
-#endif /* HAVE_WCHAR */
-	}
-	if (attr & __STANDOUT && t_enter_standout_mode(t) != NULL &&
-	t_exit_standout_mode(t) != NULL)
-		wstandout(win);
-	if (attr & __UNDERSCORE && t_enter_underline_mode(t) != NULL &&
-	t_exit_underline_mode(t) != NULL)
-		wunderscore(win);
-	if (attr & __COLOR)
-		__wcolor_set(win, attr);
-	return OK;
+	return __wattr_on(win, attr);
 }
 
 /*
@@ -211,55 +174,16 @@ wattr_on(WINDOW *win, attr_t attr, void 
  *	Note that the 'me' sequence unsets all attributes.  We handle
  *	which attributes should really be set in refresh.c:makech().
  */
-/* ARGSUSED */
 int
 wattr_off(WINDOW *win, attr_t attr, void *opt)
 {
-	const TERMINAL *t = win->screen->term;
+	if (__predict_false(opt != NULL))
+		return ERR;
 
-#ifdef DEBUG
-	__CTRACE(__CTRACE_ATTR, "wattr_off: win %p, attr %08x\n", win, attr);
-#endif
-	/* If can do exit modes, unset the relevent attribute bits. */
-	if (t_exit_attribute_mode(t) != NULL) {
-		if (attr & __BLINK)
-			win->wattr &= ~__BLINK;
-		if (attr & __BOLD)
-			win->wattr &= ~__BOLD;
-		if (attr & __DIM)
-			win->wattr &= ~__DIM;
-		if (attr & __BLANK)
-			win->wattr &= ~__BLANK;
-		if (attr & __PROTECT)
-			win->wattr &= ~__PROTECT;
-		if (attr & __REVERSE)
-			win->wattr &= ~__REVERSE;
-#ifdef HAVE_WCHAR
-		if (attr & WA_LOW)
-			win->wattr &= ~WA_LOW;
-		if (attr & WA_TOP)
-			win->wattr &= ~WA_TOP;
-		if (attr & WA_LEFT)
-			win->wattr &= ~WA_LEFT;
-		if (attr & WA_RIGHT)
-			win->wattr &= ~WA_RIGHT;
-		if (attr & 

CVS commit: src/libexec/ld.elf_so/arch/aarch64

2018-11-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 23 10:59:20 UTC 2018

Modified Files:
src/libexec/ld.elf_so/arch/aarch64: mdreloc.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/libexec/ld.elf_so/arch/aarch64/mdreloc.c

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

Modified files:

Index: src/libexec/ld.elf_so/arch/aarch64/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.10 src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.11
--- src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.10	Thu Sep 20 19:02:22 2018
+++ src/libexec/ld.elf_so/arch/aarch64/mdreloc.c	Fri Nov 23 10:59:20 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: mdreloc.c,v 1.10 2018/09/20 19:02:22 jakllsch Exp $ */
+/* $NetBSD: mdreloc.c,v 1.11 2018/11/23 10:59:20 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.10 2018/09/20 19:02:22 jakllsch Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.11 2018/11/23 10:59:20 skrll Exp $");
 #endif /* not lint */
 
 #include 
@@ -439,7 +439,7 @@ _rtld_relocate_plt_objects(const Obj_Ent
 {
 	const Elf_Rela *rela;
 	int err = 0;
-	
+
 	for (rela = obj->pltrela; rela < obj->pltrelalim; rela++) {
 		err = _rtld_relocate_plt_object(obj, rela, NULL);
 		if (err)



CVS commit: src/libexec/httpd

2018-11-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Nov 23 08:11:20 UTC 2018

Modified Files:
src/libexec/httpd: bozohttpd.8 bozohttpd.c cgi-bozo.c content-bozo.c

Log Message:
minor style fixes.  simplify bozo_match_content_map().


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/libexec/httpd/bozohttpd.8
cvs rdiff -u -r1.93 -r1.94 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.43 -r1.44 src/libexec/httpd/cgi-bozo.c
cvs rdiff -u -r1.15 -r1.16 src/libexec/httpd/content-bozo.c

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

Modified files:

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.73 src/libexec/httpd/bozohttpd.8:1.74
--- src/libexec/httpd/bozohttpd.8:1.73	Tue Nov 20 01:06:46 2018
+++ src/libexec/httpd/bozohttpd.8	Fri Nov 23 08:11:20 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bozohttpd.8,v 1.73 2018/11/20 01:06:46 mrg Exp $
+.\"	$NetBSD: bozohttpd.8,v 1.74 2018/11/23 08:11:20 mrg Exp $
 .\"
 .\"	$eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $
 .\"
@@ -599,7 +599,7 @@ The focus has always been simplicity and
 and regular code audits.
 This manual documents
 .Nm
-version 20181119.
+version 20181123.
 .Sh AUTHORS
 .An -nosplit
 .Nm

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.93 src/libexec/httpd/bozohttpd.c:1.94
--- src/libexec/httpd/bozohttpd.c:1.93	Thu Nov 22 08:54:08 2018
+++ src/libexec/httpd/bozohttpd.c	Fri Nov 23 08:11:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.93 2018/11/22 08:54:08 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.94 2018/11/23 08:11:20 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -109,9 +109,8 @@
 #define INDEX_HTML		"index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE		"bozohttpd/20181122"
+#define SERVER_SOFTWARE		"bozohttpd/20181123"
 #endif
-
 #ifndef PUBLIC_HTML
 #define PUBLIC_HTML		"public_html"
 #endif

Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.43 src/libexec/httpd/cgi-bozo.c:1.44
--- src/libexec/httpd/cgi-bozo.c:1.43	Thu Nov 22 18:42:06 2018
+++ src/libexec/httpd/cgi-bozo.c	Fri Nov 23 08:11:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgi-bozo.c,v 1.43 2018/11/22 18:42:06 mrg Exp $	*/
+/*	$NetBSD: cgi-bozo.c,v 1.44 2018/11/23 08:11:20 mrg Exp $	*/
 
 /*	$eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -147,7 +147,7 @@ finish_cgi_output(bozohttpd_t *httpd, bo
 "%s: writing HTTP header "
 "from status %s ..", __func__, hdr_value));
 			bozo_printf(httpd, "%s %s\r\n", request->hr_proto,
-	hdr_value);
+hdr_value);
 			bozo_flush(httpd, stdout);
 			write_header = 0;
 			free(hdr_name);
@@ -174,7 +174,7 @@ finish_cgi_output(bozohttpd_t *httpd, bo
 			"%s:  writing delayed HTTP headers ..", __func__));
 		SIMPLEQ_FOREACH_SAFE(hdr, , h_next, nhdr) {
 			bozo_printf(httpd, "%s: %s\r\n", hdr->h_header,
-	hdr->h_value);
+hdr->h_value);
 			free(hdr->h_header);
 			free(hdr);
 		}
@@ -190,7 +190,7 @@ finish_cgi_output(bozohttpd_t *httpd, bo
 
 		while (rbytes) {
 			wbytes = bozo_write(httpd, STDOUT_FILENO, buf,
-		(size_t)rbytes);
+	(size_t)rbytes);
 			if (wbytes > 0) {
 rbytes -= wbytes;
 bp += wbytes;
@@ -223,9 +223,8 @@ parse_search_string(bozo_httpreq_t *requ
 	*args_len = 0;
 
 	/* URI MUST not contain any unencoded '=' - RFC3875, section 4.4 */
-	if (strchr(query, '=')) {
+	if (strchr(query, '='))
 		return NULL;
-	}
 
 	str = bozostrdup(httpd, request, query);
 
@@ -289,7 +288,7 @@ parse_search_string(bozo_httpreq_t *requ
 		/* search-word MUST have at least one schar */
 		if (*s == '\0')
 			goto parse_err;
-		while(*s) {
+		while (*s) {
 			/* check if it's unreserved */
 			if (isalpha((int)*s) || isdigit((int)*s) ||
 			strchr(UNRESERVED_CHAR, *s)) {
@@ -348,7 +347,7 @@ bozo_cgi_setbin(bozohttpd_t *httpd, cons
 {
 	httpd->cgibin = bozostrdup(httpd, NULL, path);
 	debug((httpd, DEBUG_OBESE, "cgibin (cgi-bin directory) is %s",
-		httpd->cgibin));
+	   httpd->cgibin));
 }
 
 /* help build up the environ pointer */
@@ -444,7 +443,7 @@ bozo_process_cgi(bozo_httpreq_t *request
 	} else if (len - 1 == CGIBIN_PREFIX_LEN)	/* url is "/cgi-bin/" */
 		append_index_html(httpd, );
 
-	/* RFC3875  sect. 4.4. - search-string support */
+	/* RFC3875 sect. 4.4. - search-string support */
 	if (query != NULL) {
 		search_string_argv = parse_search_string(request, query,
 		_string_argc);

Index: src/libexec/httpd/content-bozo.c
diff -u src/libexec/httpd/content-bozo.c:1.15 src/libexec/httpd/content-bozo.c:1.16
--- src/libexec/httpd/content-bozo.c:1.15	Tue Nov 20 01:06:46 2018
+++ src/libexec/httpd/content-bozo.c	Fri Nov 23 08:11:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: content-bozo.c,v 1.15 201