CVS commit: src/crypto/external/bsd/netpgp/dist/src/netpgpverify

2020-05-03 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon May  4 00:18:34 UTC 2020

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/netpgpverify: Makefile.bsd
b64.c b64.h bignum.c bn.h bzlib.c bzlib.h bzlib_private.h
libverify.c rsa.c rsa.h verify.h zlib.c zlib.h

Log Message:
Bring over changes from source of truth in pkgsrc - bump version to 20200503

Update netpgpverify and libnetpgpverify to version 20200503

ensure all exported functions use a unique prfix, so that they don't
conflict with symbols (both data and text) in libcrypto. this works for
statically linked binaries and libraries, rather then the version map 
which
only works for dynalically-linked.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile.bsd
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.c \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.h \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/bzlib.h \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/zlib.h
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/bignum.c
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/bn.h \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/bzlib_private.h \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.c
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/bzlib.c
cvs rdiff -u -r1.14 -r1.15 \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/libverify.c
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.h \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/zlib.c
cvs rdiff -u -r1.10 -r1.11 \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.h

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile.bsd
diff -u src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile.bsd:1.7 src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile.bsd:1.8
--- src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile.bsd:1.7	Mon Apr 17 19:50:28 2017
+++ src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile.bsd	Mon May  4 00:18:34 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.bsd,v 1.7 2017/04/17 19:50:28 agc Exp $
+# $NetBSD: Makefile.bsd,v 1.8 2020/05/04 00:18:34 agc Exp $
 
 PROG=netpgpverify
 
@@ -12,6 +12,11 @@ SRCS+= md5c.c rmd160.c sha1.c sha2.c
 
 CPPFLAGS+=-I.
 
+CPPFLAGS.bzlib.c+=	-Wno-error=implicit-fallthrough
+CPPFLAGS.zlib.c+=	-Wno-error=implicit-fallthrough
+
+LDFLAGS+=-Wl,--version-script=${.CURDIR}/verify.map
+
 .ifndef PRODUCTION
 CPPFLAGS+=-g -O0
 LDFLAGS+=-g -O0

Index: src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.c
diff -u src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.c:1.1 src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.c:1.2
--- src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.c:1.1	Sun Mar  9 00:15:45 2014
+++ src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.c	Mon May  4 00:18:34 2020
@@ -235,7 +235,7 @@ encodeblock(uint8_t *wordin, uint8_t *wo
 ** base64 encode a stream adding padding and line breaks as per spec.
 */
 int 
-b64encode(const char *in, const size_t insize, void *vp, size_t outsize, int linesize)
+netpgpv_b64encode(const char *in, const size_t insize, void *vp, size_t outsize, int linesize)
 {
 	const char	*inp;
 	unsigned	 i;
@@ -299,7 +299,7 @@ decodeblock(uint8_t wordin[4], uint8_t w
 ** decode a base64 encoded stream discarding padding, line breaks and noise
 */
 int
-b64decode(const char *in, const size_t insize, void *vp, size_t outsize)
+netpgpv_b64decode(const char *in, const size_t insize, void *vp, size_t outsize)
 {
 	const char	*inp;
 	unsigned	 wordlen;
@@ -349,7 +349,7 @@ b64decode(const char *in, const size_t i
 
 /* return the encoded size for n bytes input */
 int
-b64_encsize(unsigned n)
+netpgpv_b64_encsize(unsigned n)
 {
 	return ((4 * n) / 3) + 4;
 }
Index: src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.h
diff -u src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.h:1.1 src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.h:1.2
--- src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.h:1.1	Sun Mar  9 00:15:45 2014
+++ src/crypto/external/bsd/netpgp/dist/src/netpgpverify/b64.h	Mon May  4 00:18:34 2020
@@ -25,8 +25,8 @@
 #ifndef B64_H_
 #define B64_H_	20091223
 
-int b64encode(const char */*in*/, const size_t /*insize*/, void */*vp*/, size_t /*outsize*/, int /*linesize*/);
-int b64decode(const char */*in*/, const size_t /*insize*/, void */*vp*/, size_t /*outsize*/);
-int b64_encsize(unsigned /*n*/);
+int netpgpv_b64encode(const char */*in*/, const size_t /*insize*/, void */*vp

CVS commit: src/crypto/external/bsd/netpgp/lib/verify

2020-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May  3 21:46:37 UTC 2020

Modified Files:
src/crypto/external/bsd/netpgp/lib/verify: Makefile
Added Files:
src/crypto/external/bsd/netpgp/lib/verify: verify.map

Log Message:
Add a linker map to hide all the symbols the this library accidentally
exported. In particular the following symbols:

DSA_SIG_free
DSA_SIG_new
DSA_do_sign
DSA_do_verify
DSA_free
DSA_new
DSA_size
RSA_check_key
RSA_free
RSA_generate_key
RSA_new
RSA_private_decrypt
RSA_private_encrypt
RSA_public_decrypt
RSA_public_encrypt

conflict with libcrypto and break pkg_add which links against both
libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/crypto/external/bsd/netpgp/lib/verify/Makefile
cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/netpgp/lib/verify/verify.map

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

Modified files:

Index: src/crypto/external/bsd/netpgp/lib/verify/Makefile
diff -u src/crypto/external/bsd/netpgp/lib/verify/Makefile:1.12 src/crypto/external/bsd/netpgp/lib/verify/Makefile:1.13
--- src/crypto/external/bsd/netpgp/lib/verify/Makefile:1.12	Sun Oct 13 03:28:05 2019
+++ src/crypto/external/bsd/netpgp/lib/verify/Makefile	Sun May  3 17:46:37 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2019/10/13 07:28:05 mrg Exp $
+# $NetBSD: Makefile,v 1.13 2020/05/03 21:46:37 christos Exp $
 
 LIB=netpgpverify
 SRCS+=b64.c
@@ -30,4 +30,6 @@ INCSDIR=/usr/include/netpgp
 COPTS+=			${${ACTIVE_CC} == "gcc":? -Wno-implicit-fallthrough :}
 COPTS.libverify.c+=	${GCC_NO_FORMAT_TRUNCATION}
 
+LDFLAGS+=-Wl,--version-script=${.CURDIR}/verify.map
+
 .include 

Added files:

Index: src/crypto/external/bsd/netpgp/lib/verify/verify.map
diff -u /dev/null src/crypto/external/bsd/netpgp/lib/verify/verify.map:1.1
--- /dev/null	Sun May  3 17:46:37 2020
+++ src/crypto/external/bsd/netpgp/lib/verify/verify.map	Sun May  3 17:46:37 2020
@@ -0,0 +1,17 @@
+NETPGPVERIFY_5_0 {
+global:
+	pgpv_new;
+	pgpv_new_cursor;
+	pgpv_read_pubring;
+	pgpv_read_ssh_pubkeys;
+	pgpv_verify;
+	pgpv_get_verified;
+	pgpv_dump;
+	pgpv_get_entry;
+	pgpv_get_cursor_num;
+	pgpv_get_cursor_str;
+	pgpv_get_cursor_element;
+	pgpv_close;
+	pgpv_cursor_close;
+local: *;
+};



CVS commit: src/sys/arch/zaurus/stand/zboot

2020-05-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun May  3 21:02:24 UTC 2020

Modified Files:
src/sys/arch/zaurus/stand/zboot: boot.h

Log Message:
Avoid common symbol declarations.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/zaurus/stand/zboot/boot.h

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

Modified files:

Index: src/sys/arch/zaurus/stand/zboot/boot.h
diff -u src/sys/arch/zaurus/stand/zboot/boot.h:1.3 src/sys/arch/zaurus/stand/zboot/boot.h:1.4
--- src/sys/arch/zaurus/stand/zboot/boot.h:1.3	Sat Jun 28 09:16:18 2014
+++ src/sys/arch/zaurus/stand/zboot/boot.h	Sun May  3 21:02:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.h,v 1.3 2014/06/28 09:16:18 rtr Exp $	*/
+/*	$NetBSD: boot.h,v 1.4 2020/05/03 21:02:24 joerg Exp $	*/
 
 /*
  * Copyright (c) 2009 NONAKA Kimihiro
@@ -37,9 +37,9 @@
 extern int debug;
 
 /* boot.c */
-char *default_devname;
-uint default_unit, default_partition;
-const char *default_filename;
+extern char *default_devname;
+extern uint default_unit, default_partition;
+extern const char *default_filename;
 extern int default_timeout;
 
 void boot(dev_t);



CVS commit: src/sys/arch/xen/xen

2020-05-03 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun May  3 17:56:19 UTC 2020

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
add support for scatter-gather also for frontend Rx path (backend -> frontend)

enable ETHERCAP_JUMBO_MTU and feature-sg


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.102 src/sys/arch/xen/xen/xennetback_xenbus.c:1.103
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.102	Sat May  2 11:28:02 2020
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Sun May  3 17:56:19 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.102 2020/05/02 11:28:02 jdolecek Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.103 2020/05/03 17:56:19 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.102 2020/05/02 11:28:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.103 2020/05/03 17:56:19 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -60,8 +60,6 @@ __KERNEL_RCSID(0, "$NetBSD: xennetback_x
 
 #include 
 
-/* #define notyet 1 */
-
 /*
  * Backend network device driver for Xen.
  */
@@ -263,11 +261,7 @@ xennetback_xenbus_create(struct xenbus_d
 	/* create pseudo-interface */
 	aprint_verbose_ifnet(ifp, "Ethernet address %s\n",
 	ether_sprintf(xneti->xni_enaddr));
-	xneti->xni_ec.ec_capabilities |= ETHERCAP_VLAN_MTU
-#ifdef notyet
-		| ETHERCAP_JUMBO_MTU
-#endif
-	;
+	xneti->xni_ec.ec_capabilities |= ETHERCAP_VLAN_MTU | ETHERCAP_JUMBO_MTU;
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_snd.ifq_maxlen =
 	uimax(ifqmaxlen, NET_TX_RING_SIZE * 2);
@@ -327,7 +321,6 @@ xennetback_xenbus_create(struct xenbus_d
 			xbusd->xbusd_path, err);
 			goto abort_xbt;
 		}
-#if notyet
 		err = xenbus_printf(xbt, xbusd->xbusd_path,
 		"feature-sg", "%d", 1);
 		if (err) {
@@ -336,7 +329,6 @@ xennetback_xenbus_create(struct xenbus_d
 			xbusd->xbusd_path, err);
 			goto abort_xbt;
 		}
-#endif
 	} while ((err = xenbus_transaction_end(xbt, 0)) == EAGAIN);
 	if (err) {
 		aprint_error_ifnet(ifp,
@@ -678,21 +670,22 @@ xennetback_tx_check_packet(const netif_t
 }
 
 static int
-xennetback_copy(struct ifnet *ifp, gnttab_copy_t *gop, int copycnt)
+xennetback_copy(struct ifnet *ifp, gnttab_copy_t *gop, int copycnt,
+const char *dir)
 {
 	/*
 	 * Copy the data and ack it. Delaying it until the mbuf is
 	 * freed will stall transmit.
 	 */
 	if (HYPERVISOR_grant_table_op(GNTTABOP_copy, gop, copycnt) != 0) {
-		printf("%s: GNTTABOP_copy Tx failed", ifp->if_xname);
+		printf("%s: GNTTABOP_copy %s failed", ifp->if_xname, dir);
 		return EINVAL;
 	}
 
 	for (int i = 0; i < copycnt; i++) {
 		if (gop->status != GNTST_okay) {
-			printf("%s GNTTABOP_copy[%d] Tx %d\n",
-			ifp->if_xname, i, gop->status);
+			printf("%s GNTTABOP_copy[%d] %s %d\n",
+			ifp->if_xname, i, dir, gop->status);
 			return EINVAL;
 		}
 	}
@@ -758,7 +751,7 @@ xennetback_tx_copy_process(struct ifnet 
 			KASSERT(copycnt <= NB_XMIT_PAGES_BATCH);
 			if (copycnt == NB_XMIT_PAGES_BATCH) {
 if (xennetback_copy(ifp, xneti->xni_gop_copy,
-copycnt) != 0)
+copycnt, "Tx") != 0)
 	goto abort;
 copycnt = 0;
 			}
@@ -791,7 +784,7 @@ xennetback_tx_copy_process(struct ifnet 
 		KASSERT(goff == xst->xs_tx_size);
 	}
 	if (copycnt > 0) {
-		if (xennetback_copy(ifp, xneti->xni_gop_copy, copycnt) != 0)
+		if (xennetback_copy(ifp, xneti->xni_gop_copy, copycnt, "Tx"))
 			goto abort;
 		copycnt = 0;
 	}
@@ -1058,19 +1051,151 @@ xennetback_ifstart(struct ifnet *ifp)
 }
 
 static void
+xennetback_rx_copy_process(struct ifnet *ifp, struct xnetback_instance *xneti,
+	int queued, int copycnt)
+{
+	int notify;
+	struct xnetback_xstate *xst;
+
+	if (xennetback_copy(ifp, xneti->xni_gop_copy, copycnt, "Rx") != 0) {
+		/* message already displayed */
+		goto free_mbufs;
+	}
+
+	/* update pointer */
+	xen_rmb();
+	xneti->xni_rxring.req_cons += queued;
+	xneti->xni_rxring.rsp_prod_pvt += queued;
+	RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(>xni_rxring, notify);
+
+	/* send event */
+	if (notify) {
+		xen_rmb();
+		XENPRINTF(("%s receive event\n",
+		xneti->xni_if.if_xname));
+		hypervisor_notify_via_evtchn(xneti->xni_evtchn);
+	}
+
+free_mbufs:
+	/* now that data was copied we can free the mbufs */
+	for (int j = 0; j < queued; j++) {
+		xst = >xni_xstate[j];
+		if (xst->xs_loaded) {
+			bus_dmamap_unload(xneti->xni_xbusd->xbusd_dmat,
+			xst->xs_dmamap);
+			xst->xs_loaded = false;
+		}
+		if (xst->xs_m != NULL) {
+			m_freem(xst->xs_m);
+			xst->xs_m = NULL;
+		}
+	}
+}
+
+static void
+xennetback_rx_copy_queue(struct xnetback_instance *xneti,
+

CVS commit: src/sys/arch/xen/xen

2020-05-03 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun May  3 17:54:28 UTC 2020

Modified Files:
src/sys/arch/xen/xen: xbd_xenbus.c

Log Message:
reduce buffer size for format_number() so that xbd(4) would show the size
in KB/GB/TB instead of bytes again; the '9' matches what xbd(4) used before,
and also e.g. wd(4)


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/xen/xen/xbd_xenbus.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/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.123 src/sys/arch/xen/xen/xbd_xenbus.c:1.124
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.123	Sat Apr 25 15:26:18 2020
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Sun May  3 17:54:28 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.123 2020/04/25 15:26:18 bouyer Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.124 2020/05/03 17:54:28 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.123 2020/04/25 15:26:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.124 2020/05/03 17:54:28 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -676,7 +676,8 @@ xbd_backend_changed(void *arg, XenbusSta
 		sc->sc_backend_status = BLKIF_STATE_CONNECTED;
 		hypervisor_unmask_event(sc->sc_evtchn);
 
-		format_bytes(buf, sizeof(buf), sc->sc_sectors * sc->sc_secsize);
+		format_bytes(buf, uimin(9, sizeof(buf)),
+		sc->sc_sectors * sc->sc_secsize);
 		aprint_normal_dev(sc->sc_dksc.sc_dev,
 "%s, %d bytes/sect x %" PRIu64 " sectors\n",
 buf, (int)dg->dg_secsize, sc->sc_xbdsize);



CVS commit: src/sys

2020-05-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun May  3 17:36:33 UTC 2020

Modified Files:
src/sys/kern: kern_condvar.c subr_time.c
src/sys/sys: timevar.h

Log Message:
Move timedwaitclock_begin() and timedwaitclock_end() to subr_time.c
so they can be used by other things.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/kern/kern_condvar.c
cvs rdiff -u -r1.21 -r1.22 src/sys/kern/subr_time.c
cvs rdiff -u -r1.41 -r1.42 src/sys/sys/timevar.h

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

Modified files:

Index: src/sys/kern/kern_condvar.c
diff -u src/sys/kern/kern_condvar.c:1.49 src/sys/kern/kern_condvar.c:1.50
--- src/sys/kern/kern_condvar.c:1.49	Sun May  3 01:24:37 2020
+++ src/sys/kern/kern_condvar.c	Sun May  3 17:36:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_condvar.c,v 1.49 2020/05/03 01:24:37 riastradh Exp $	*/
+/*	$NetBSD: kern_condvar.c,v 1.50 2020/05/03 17:36:33 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.49 2020/05/03 01:24:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.50 2020/05/03 17:36:33 thorpej Exp $");
 
 #include 
 #include 
@@ -244,112 +244,6 @@ cv_timedwait_sig(kcondvar_t *cv, kmutex_
 	return error;
 }
 
-struct timedwaitclock {
-	struct timespec		*timeout;
-	clockid_t		clockid;
-	int			flags;
-	const struct bintime	*epsilon;
-	struct timespec		starttime;
-};
-
-static int
-cv_timedwaitclock_begin(struct timedwaitclock *T, int *timo)
-{
-	struct timespec delta;
-	const struct timespec *deltap;
-	int error;
-
-	/* Sanity-check timeout -- may have come from userland.  */
-	if (T->timeout->tv_nsec < 0 || T->timeout->tv_nsec >= 10L)
-		return EINVAL;
-
-	/*
-	 * Compute the time delta.
-	 */
-	if ((T->flags & TIMER_ABSTIME) == TIMER_ABSTIME) {
-		/* Check our watch.  */
-		error = clock_gettime1(T->clockid, >starttime);
-		if (error)
-			return error;
-
-		/* If the deadline has passed, we're done.  */
-		if (timespeccmp(T->timeout, >starttime, <=))
-			return ETIMEDOUT;
-
-		/* Count how much time is left.  */
-		timespecsub(T->timeout, >starttime, );
-		deltap = 
-	} else {
-		/* The user specified how much time is left.  */
-		deltap = T->timeout;
-
-		/* If there's none left, we've timed out.  */
-		if (deltap->tv_sec == 0 && deltap->tv_nsec == 0)
-			return ETIMEDOUT;
-	}
-
-	/*
-	 * Convert to ticks, but clamp to be >=1.
-	 *
-	 * XXX In the tickless future, use a high-resolution timer if
-	 * timo would round to zero.
-	 */
-	*timo = tstohz(deltap);
-	KASSERTMSG(*timo >= 0, "negative ticks: %d", *timo);
-	if (*timo == 0)
-		*timo = 1;
-
-	/* Success!  */
-	return 0;
-}
-
-static void
-cv_timedwaitclock_end(struct timedwaitclock *T)
-{
-	struct timespec endtime, delta;
-
-	/* If the timeout is absolute, nothing to do.  */
-	if ((T->flags & TIMER_ABSTIME) == TIMER_ABSTIME)
-		return;
-
-	/*
-	 * Check our watch.  If anything goes wrong with it, make sure
-	 * that the next time we immediately time out rather than fail
-	 * to deduct the time elapsed.
-	 */
-	if (clock_gettime1(T->clockid, )) {
-		T->timeout->tv_sec = 0;
-		T->timeout->tv_nsec = 0;
-		return;
-	}
-
-	/* Find how much time elapsed while we waited.  */
-	timespecsub(, >starttime, );
-
-	/*
-	 * Paranoia: If the clock went backwards, treat it as if no
-	 * time elapsed at all rather than adding anything.
-	 */
-	if (delta.tv_sec < 0 ||
-	(delta.tv_sec == 0 && delta.tv_nsec < 0)) {
-		delta.tv_sec = 0;
-		delta.tv_nsec = 0;
-	}
-
-	/*
-	 * Set it to the time left, or zero, whichever is larger.  We
-	 * do not fail with EWOULDBLOCK here because this may have been
-	 * an explicit wakeup, so the caller needs to check before they
-	 * give up or else cv_signal would be lost.
-	 */
-	if (timespeccmp(T->timeout, , <=)) {
-		T->timeout->tv_sec = 0;
-		T->timeout->tv_nsec = 0;
-	} else {
-		timespecsub(T->timeout, , T->timeout);
-	}
-}
-
 /*
  * cv_timedwaitclock:
  *
@@ -381,11 +275,11 @@ cv_timedwaitclock(kcondvar_t *cv, kmutex
 		return 0;
 	}
 
-	error = cv_timedwaitclock_begin(, );
+	error = timedwaitclock_begin(, );
 	if (error)
 		return error;
 	error = cv_timedwait(cv, mtx, timo);
-	cv_timedwaitclock_end();
+	timedwaitclock_end();
 	return error;
 }
 
@@ -419,11 +313,11 @@ cv_timedwaitclock_sig(kcondvar_t *cv, km
 	if (timeout == NULL)
 		return cv_wait_sig(cv, mtx);
 
-	error = cv_timedwaitclock_begin(, );
+	error = timedwaitclock_begin(, );
 	if (error)
 		return error;
 	error = cv_timedwait_sig(cv, mtx, timo);
-	cv_timedwaitclock_end();
+	timedwaitclock_end();
 	return error;
 }
 

Index: src/sys/kern/subr_time.c
diff -u src/sys/kern/subr_time.c:1.21 src/sys/kern/subr_time.c:1.22
--- src/sys/kern/subr_time.c:1.21	Fri Oct  4 14:17:07 2019
+++ src/sys/kern/subr_time.c	Sun May  3 17:36:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: 

CVS commit: src/sys/arch/xen/xen

2020-05-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun May  3 17:24:11 UTC 2020

Modified Files:
src/sys/arch/xen/xen: hypervisor.c

Log Message:
For PVH and HVM, copy hvm_start_info.flags to xen_start_info.flags


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/xen/xen/hypervisor.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/xen/xen/hypervisor.c
diff -u src/sys/arch/xen/xen/hypervisor.c:1.79 src/sys/arch/xen/xen/hypervisor.c:1.80
--- src/sys/arch/xen/xen/hypervisor.c:1.79	Sat May  2 16:44:36 2020
+++ src/sys/arch/xen/xen/hypervisor.c	Sun May  3 17:24:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.79 2020/05/02 16:44:36 bouyer Exp $ */
+/* $NetBSD: hypervisor.c,v 1.80 2020/05/03 17:24:11 bouyer Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.79 2020/05/02 16:44:36 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.80 2020/05/03 17:24:11 bouyer Exp $");
 
 #include 
 #include 
@@ -265,6 +265,7 @@ init_xen_early(void)
 	(void *)((uintptr_t)hvm_start_info->cmdline_paddr + KERNBASE);
 	strlcpy(xen_start_info.cmd_line, cmd_line,
 	sizeof(xen_start_info.cmd_line));
+	xen_start_info.flags = hvm_start_info->flags;
 }
 
 



CVS commit: src/sys/arch/xen/x86

2020-05-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun May  3 17:23:14 UTC 2020

Modified Files:
src/sys/arch/xen/x86: pvh_consinit.c

Log Message:
Hanble dom0 console. This one doesn't need a ring to be mapped, and
can be used earlier.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/xen/x86/pvh_consinit.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/xen/x86/pvh_consinit.c
diff -u src/sys/arch/xen/x86/pvh_consinit.c:1.1 src/sys/arch/xen/x86/pvh_consinit.c:1.2
--- src/sys/arch/xen/x86/pvh_consinit.c:1.1	Sat May  2 16:44:36 2020
+++ src/sys/arch/xen/x86/pvh_consinit.c	Sun May  3 17:23:14 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pvh_consinit.c,v 1.1 2020/05/02 16:44:36 bouyer Exp $ */
+/* $NetBSD: pvh_consinit.c,v 1.2 2020/05/03 17:23:14 bouyer Exp $ */
 
 /*
  * Copyright (c) 2020 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pvh_consinit.c,v 1.1 2020/05/02 16:44:36 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pvh_consinit.c,v 1.2 2020/05/03 17:23:14 bouyer Exp $");
 
 #include "xencons.h"
 #include 
@@ -59,7 +59,7 @@ xen_pvh_consinit(void)
 	 * boot stage.
 	 */
 	static int initted = 0;
-	if (initted == 0) {
+	if (initted == 0 && !xendomain_is_dom0()) {
 		/* pmap not up yet, fall back to printk() */
 		cn_tab = _xencons;
 		initted++;
@@ -68,6 +68,12 @@ xen_pvh_consinit(void)
 		return;
 	}
 	initted++;
+	if (xendomain_is_dom0()) {
+		xenconscn_attach(); /* no ring in this case */
+		initted++; /* don't init console twice */
+		return;
+	}
+		
 #if NXENCONS > 0
 	/* we can now map the xencons rings. */
 	struct xen_hvm_param xen_hvm_param;



CVS commit: src/sys/arch/x86/x86

2020-05-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun May  3 17:22:03 UTC 2020

Modified Files:
src/sys/arch/x86/x86: x86_machdep.c

Log Message:
If hvm_start_info has no memmap_entries, fall back to XENMEM_memory_map
hypercall.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/arch/x86/x86/x86_machdep.c

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

Modified files:

Index: src/sys/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.141 src/sys/arch/x86/x86/x86_machdep.c:1.142
--- src/sys/arch/x86/x86/x86_machdep.c:1.141	Sat May  2 16:44:36 2020
+++ src/sys/arch/x86/x86/x86_machdep.c	Sun May  3 17:22:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_machdep.c,v 1.141 2020/05/02 16:44:36 bouyer Exp $	*/
+/*	$NetBSD: x86_machdep.c,v 1.142 2020/05/03 17:22:03 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.141 2020/05/02 16:44:36 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.142 2020/05/03 17:22:03 bouyer Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -846,22 +846,11 @@ x86_load_region(uint64_t seg_start, uint
 	}
 }
 
-/*
- * init_x86_clusters: retrieve the memory clusters provided by the BIOS, and
- * initialize mem_clusters.
- */
-void
-init_x86_clusters(void)
-{
-	struct btinfo_memmap *bim;
-	struct btinfo_efimemmap *biem;
-
-	/*
-	 * Check to see if we have a memory map from the BIOS (passed to us by
-	 * the boot program).
-	 */
 #ifdef XEN
-	if (vm_guest == VM_GUEST_XENPVH) {
+static void
+x86_add_xen_clusters(void)
+{
+	if (hvm_start_info->memmap_entries > 0) {
 		struct hvm_memmap_table_entry *map_entry;
 		map_entry = (void *)((uintptr_t)hvm_start_info->memmap_paddr + KERNBASE);
 		for (int i = 0; i < hvm_start_info->memmap_entries; i++) {
@@ -878,6 +867,41 @@ init_x86_clusters(void)
 break;
 			}
 		}
+	} else {
+		struct xen_memory_map memmap;
+		static struct _xen_mmap {
+			struct btinfo_memmap bim;
+			struct bi_memmap_entry map[128]; /* same as FreeBSD */
+		} __packed xen_mmap;
+		int err;
+
+		memmap.nr_entries = 128;
+		set_xen_guest_handle(memmap.buffer, _mmap.bim.entry[0]);
+		if ((err = HYPERVISOR_memory_op(XENMEM_memory_map, ))
+		< 0)
+			panic("XENMEM_memory_map %d", err);
+		xen_mmap.bim.num = memmap.nr_entries;
+		x86_parse_clusters(_mmap.bim);
+	}
+}
+#endif /* XEN */
+/*
+ * init_x86_clusters: retrieve the memory clusters provided by the BIOS, and
+ * initialize mem_clusters.
+ */
+void
+init_x86_clusters(void)
+{
+	struct btinfo_memmap *bim;
+	struct btinfo_efimemmap *biem;
+
+	/*
+	 * Check to see if we have a memory map from the BIOS (passed to us by
+	 * the boot program).
+	 */
+#ifdef XEN
+	if (vm_guest == VM_GUEST_XENPVH) {
+		x86_add_xen_clusters();
 	}
 #endif /* XEN */
 



CVS commit: src/usr.bin/rlogin

2020-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May  3 16:32:16 UTC 2020

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

Log Message:
PR/54435: Adjust for new kernel behavior of soreceive(9) clearing MSG_OOB
when receiving the oob message. This made SIOCATMARK return always 0 since
the oob message was cleared. Instead, use recvmsg(2) to determine if
the message was oob or not. This works with both the old and new kernel
and it is not racy.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/rlogin/rlogin.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/rlogin/rlogin.c
diff -u src/usr.bin/rlogin/rlogin.c:1.46 src/usr.bin/rlogin/rlogin.c:1.47
--- src/usr.bin/rlogin/rlogin.c:1.46	Sun May  3 12:11:06 2020
+++ src/usr.bin/rlogin/rlogin.c	Sun May  3 12:32:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rlogin.c,v 1.46 2020/05/03 16:11:06 christos Exp $	*/
+/*	$NetBSD: rlogin.c,v 1.47 2020/05/03 16:32:16 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1990, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)rlogin.c	8.4 (Berkeley) 4/29/95";
 #else
-__RCSID("$NetBSD: rlogin.c,v 1.46 2020/05/03 16:11:06 christos Exp $");
+__RCSID("$NetBSD: rlogin.c,v 1.47 2020/05/03 16:32:16 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -577,16 +577,34 @@ static pid_t ppid;
 static ssize_t rcvcnt, rcvstate;
 static char rcvbuf[8 * 1024];
 
+static int
+recvx(int fd, void *buf, size_t len, int flags, int *msgflags)
+{
+	struct msghdr msg;
+	struct iovec iov;
+	int error;
+
+	memset(, 0, sizeof(msg));
+	msg.msg_iov = 
+	iov.iov_base = buf;
+	iov.iov_len = len;
+	error = recvmsg(fd, , flags);
+	if (error)
+		return error;
+	*msgflags = msg.msg_flags;
+	return 0;
+}
+
 static void
 oob(int signo)
 {
 	struct termios tty;
-	int atmark;
+	int atmark = 0;
 	ssize_t n, rcvd;
 	char waste[BUFSIZ], mark;
 
 	rcvd = 0;
-	while (recv(rem, , 1, MSG_OOB) == -1) {
+	while (recvx(rem, , 1, MSG_OOB, ) == -1) {
 		switch (errno) {
 		case EWOULDBLOCK:
 			/*
@@ -610,6 +628,7 @@ oob(int signo)
 			return;
 		}
 	}
+	atmark &= MSG_OOB;
 	if (mark & TIOCPKT_WINDOW) {
 		/* Let server know about window size changes */
 		(void)kill(ppid, SIGUSR1);
@@ -626,17 +645,8 @@ oob(int signo)
 	}
 	if (mark & TIOCPKT_FLUSHWRITE) {
 		(void)tcflush(1, TCIOFLUSH);
-		for (;;) {
-			if (ioctl(rem, SIOCATMARK, ) < 0) {
-warn("ioctl SIOCATMARK (ignored)");
-break;
-			}
-			if (atmark)
-break;
+		if (!atmark)
 			n = read(rem, waste, sizeof (waste));
-			if (n <= 0)
-break;
-		}
 		/*
 		 * Don't want any pending data to be output, so clear the recv
 		 * buffer.  If we were hanging on a write when interrupted,



CVS commit: src/usr.bin/rlogin

2020-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May  3 16:11:06 UTC 2020

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

Log Message:
(foo *) 0 -> NULL
int -> ssize_t/size_t


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/rlogin/rlogin.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/rlogin/rlogin.c
diff -u src/usr.bin/rlogin/rlogin.c:1.45 src/usr.bin/rlogin/rlogin.c:1.46
--- src/usr.bin/rlogin/rlogin.c:1.45	Fri Oct  4 05:02:00 2019
+++ src/usr.bin/rlogin/rlogin.c	Sun May  3 12:11:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rlogin.c,v 1.45 2019/10/04 09:02:00 mrg Exp $	*/
+/*	$NetBSD: rlogin.c,v 1.46 2020/05/03 16:11:06 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1990, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)rlogin.c	8.4 (Berkeley) 4/29/95";
 #else
-__RCSID("$NetBSD: rlogin.c,v 1.45 2019/10/04 09:02:00 mrg Exp $");
+__RCSID("$NetBSD: rlogin.c,v 1.46 2020/05/03 16:11:06 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -245,7 +245,7 @@ main(int argc, char *argv[])
 	sigemptyset(_mask);
 	sa.sa_flags = SA_RESTART;
 	sa.sa_handler = lostpeer;
-	(void)sigaction(SIGPIPE, , (struct sigaction *)0);
+	(void)sigaction(SIGPIPE, , NULL);
 	/* will use SIGUSR1 for window size hack, so hold it off */
 	sigemptyset();
 	sigaddset(, SIGURG);
@@ -258,9 +258,9 @@ main(int argc, char *argv[])
 	 * a signal by the time that they are unblocked below.
 	 */
 	sa.sa_handler = copytochild;
-	(void)sigaction(SIGURG, , (struct sigaction *) 0);
+	(void)sigaction(SIGURG, , NULL);
 	sa.sa_handler = writeroob;
-	(void)sigaction(SIGUSR1, , (struct sigaction *) 0);
+	(void)sigaction(SIGUSR1, , NULL);
 
 	/* don't dump core */
 	rlim.rlim_cur = rlim.rlim_max = 0;
@@ -306,7 +306,7 @@ doit(sigset_t *smask)
 	sigemptyset(_mask);
 	sa.sa_flags = SA_RESTART;
 	sa.sa_handler = SIG_IGN;
-	(void)sigaction(SIGINT, , (struct sigaction *) 0);
+	(void)sigaction(SIGINT, , NULL);
 	setsignal(SIGHUP);
 	setsignal(SIGQUIT);
 	mode(1);
@@ -333,9 +333,9 @@ doit(sigset_t *smask)
 	 * signals to the child. We can now unblock SIGURG and SIGUSR1
 	 * that were set above.
 	 */
-	(void)sigprocmask(SIG_SETMASK, smask, (sigset_t *) 0);
+	(void)sigprocmask(SIG_SETMASK, smask, NULL);
 	sa.sa_handler = catch_child;
-	(void)sigaction(SIGCHLD, , (struct sigaction *) 0);
+	(void)sigaction(SIGCHLD, , NULL);
 	writer();
 	msg("closed connection.");
 	done(0);
@@ -357,9 +357,9 @@ setsignal(int sig)
 	isa.sa_flags = SA_RESTART;
 	(void)sigaction(sig, , );
 	if (osa.sa_handler == SIG_IGN)
-		(void)sigaction(sig, , (struct sigaction *) 0);
+		(void)sigaction(sig, , NULL);
 
-	(void)sigprocmask(SIG_SETMASK, , (sigset_t *) 0);
+	(void)sigprocmask(SIG_SETMASK, , NULL);
 }
 
 static void
@@ -375,7 +375,7 @@ done(int status)
 		sigemptyset(_mask);
 		sa.sa_handler = SIG_DFL;
 		sa.sa_flags = 0;
-		(void)sigaction(SIGCHLD, , (struct sigaction *) 0);
+		(void)sigaction(SIGCHLD, , NULL);
 		if (kill(child, SIGKILL) >= 0)
 			while ((w = wait()) > 0 && w != child)
 continue;
@@ -399,7 +399,7 @@ writeroob(int signo)
 		sigemptyset(_mask);
 		sa.sa_handler = sigwinch;
 		sa.sa_flags = SA_RESTART;
-		(void)sigaction(SIGWINCH, , (struct sigaction *) 0);
+		(void)sigaction(SIGWINCH, , NULL);
 	}
 	dosigwinch = 1;
 }
@@ -430,7 +430,8 @@ catch_child(int signo)
 static void
 writer(void)
 {
-	int bol, local, n;
+	int bol, local;
+	ssize_t n;
 	char c;
 
 	bol = 1;			/* beginning of line */
@@ -523,10 +524,10 @@ stop(int all)
 	sigemptyset(_mask);
 	sa.sa_handler = SIG_IGN;
 	sa.sa_flags = SA_RESTART;
-	(void)sigaction(SIGCHLD, , (struct sigaction *) 0);
+	(void)sigaction(SIGCHLD, , NULL);
 	(void)kill(all ? 0 : getpid(), SIGTSTP);
 	sa.sa_handler = catch_child;
-	(void)sigaction(SIGCHLD, , (struct sigaction *) 0);
+	(void)sigaction(SIGCHLD, , NULL);
 	mode(1);
 	sigwinch(0);			/* check for size changes */
 }
@@ -573,18 +574,19 @@ sendwindow(void)
 
 static jmp_buf rcvtop;
 static pid_t ppid;
-static int rcvcnt, rcvstate;
+static ssize_t rcvcnt, rcvstate;
 static char rcvbuf[8 * 1024];
 
 static void
 oob(int signo)
 {
 	struct termios tty;
-	int atmark, n, rcvd;
+	int atmark;
+	ssize_t n, rcvd;
 	char waste[BUFSIZ], mark;
 
 	rcvd = 0;
-	while (recv(rem, , 1, MSG_OOB) < 0) {
+	while (recv(rem, , 1, MSG_OOB) == -1) {
 		switch (errno) {
 		case EWOULDBLOCK:
 			/*
@@ -592,7 +594,7 @@ oob(int signo)
 			 * to send it yet if we are blocked for output and
 			 * our input buffer is full.
 			 */
-			if (rcvcnt < (int)sizeof(rcvbuf)) {
+			if (rcvcnt < (ssize_t)sizeof(rcvbuf)) {
 n = read(rem, rcvbuf + rcvcnt,
 sizeof(rcvbuf) - rcvcnt);
 if (n <= 0)
@@ -661,7 +663,7 @@ static int
 reader(sigset_t *smask)
 {
 	pid_t pid;
-	int n, remaining;
+	ssize_t n, remaining;
 	char *bufp;
 	struct sigaction sa;
 
@@ -669,13 +671,13 @@ reader(sigset_t *smask)
 	

CVS commit: src/sys/arch/xen/xen

2020-05-03 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun May  3 16:10:26 UTC 2020

Modified Files:
src/sys/arch/xen/xen: xennet_checksum.c

Log Message:
return EOPNOTSUPP for unknown IP protocol (same as unknown ethernet type),
so that EINVAL is returned only when the packet is too short


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/xen/xennet_checksum.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/xen/xen/xennet_checksum.c
diff -u src/sys/arch/xen/xen/xennet_checksum.c:1.12 src/sys/arch/xen/xen/xennet_checksum.c:1.13
--- src/sys/arch/xen/xen/xennet_checksum.c:1.12	Fri May  1 19:53:17 2020
+++ src/sys/arch/xen/xen/xennet_checksum.c	Sun May  3 16:10:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xennet_checksum.c,v 1.12 2020/05/01 19:53:17 jdolecek Exp $	*/
+/*	$NetBSD: xennet_checksum.c,v 1.13 2020/05/03 16:10:26 jdolecek Exp $	*/
 
 /*-
  * Copyright (c)2006 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennet_checksum.c,v 1.12 2020/05/01 19:53:17 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennet_checksum.c,v 1.13 2020/05/03 16:10:26 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -186,7 +186,7 @@ xennet_checksum_fill(struct ifnet *ifp, 
 			printf("%s: unknown proto %d passed no checksum\n",
 			ifp->if_xname, nxt);
 #endif /* XENNET_DEBUG */
-		error = EINVAL;
+		error = EOPNOTSUPP;
 		goto out;
 	}
 	}



CVS commit: src/lib/libc/arch/hppa

2020-05-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun May  3 15:29:22 UTC 2020

Modified Files:
src/lib/libc/arch/hppa/gen: __setjmp14.S
src/lib/libc/arch/hppa/string: bzero.S ffs.S strlcpy.S
src/lib/libc/arch/hppa/sys: brk.S

Log Message:
Even more trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/hppa/gen/__setjmp14.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/hppa/string/bzero.S
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/hppa/string/ffs.S \
src/lib/libc/arch/hppa/string/strlcpy.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/hppa/sys/brk.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/hppa/gen/__setjmp14.S
diff -u src/lib/libc/arch/hppa/gen/__setjmp14.S:1.6 src/lib/libc/arch/hppa/gen/__setjmp14.S:1.7
--- src/lib/libc/arch/hppa/gen/__setjmp14.S:1.6	Sat Jul 16 09:51:13 2016
+++ src/lib/libc/arch/hppa/gen/__setjmp14.S	Sun May  3 15:29:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __setjmp14.S,v 1.6 2016/07/16 09:51:13 skrll Exp $	*/
+/*	$NetBSD: __setjmp14.S,v 1.7 2020/05/03 15:29:22 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #include 
 
 #if defined(LIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: __setjmp14.S,v 1.6 2016/07/16 09:51:13 skrll Exp $")
+	RCSID("$NetBSD: __setjmp14.S,v 1.7 2020/05/03 15:29:22 skrll Exp $")
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -112,9 +112,9 @@ ENTRY(__setjmp14,0)
 	ldi	1, %r20			; SS_ONSTACK
 	and	%r1, %r20, %r1
 	stw	%r1, 0(%arg0)		; sc.sc_onstack
-	
+
 	/* Get the signal mask. */
-	ldo	40(%arg0), %arg2	; oset = _mask	
+	ldo	40(%arg0), %arg2	; oset = _mask
 	copy	%r0, %arg1		; set = NULL
 	bl	__sigprocmask14, %rp
 	copy	%r0, %arg0		; action = 0 

Index: src/lib/libc/arch/hppa/string/bzero.S
diff -u src/lib/libc/arch/hppa/string/bzero.S:1.2 src/lib/libc/arch/hppa/string/bzero.S:1.3
--- src/lib/libc/arch/hppa/string/bzero.S:1.2	Mon Oct  6 05:30:21 2003
+++ src/lib/libc/arch/hppa/string/bzero.S	Sun May  3 15:29:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bzero.S,v 1.2 2003/10/06 05:30:21 matt Exp $	*/
+/*	$NetBSD: bzero.S,v 1.3 2020/05/03 15:29:22 skrll Exp $	*/
 
 /*	$OpenBSD: bzero.S,v 1.3 2001/06/04 23:14:02 mickey Exp $	*/
 
@@ -40,7 +40,7 @@
 #endif
 
 /*
- * void 
+ * void
  * bzero(dst, count)
  *	void *dst;
  *	size_t count;
@@ -55,7 +55,7 @@ LEAF_ENTRY(bzero)
 	comib,>>,n 4,%arg1,$bzero_bytes
 
 	/*
-	 * Since we are only clearing memory the alignment restrictions 
+	 * Since we are only clearing memory the alignment restrictions
 	 * are simplified. Figure out how many "extra" bytes we need to
 	 * store with stbys.
 	 */
@@ -64,7 +64,7 @@ LEAF_ENTRY(bzero)
 add %arg1,%t1,%arg1
 
 	/*
-	 * We will zero the destination in blocks of 16 bytes as long as we 
+	 * We will zero the destination in blocks of 16 bytes as long as we
 	 * can and then we'll go to the 4 byte moves.
 	 */
 
@@ -80,8 +80,8 @@ $bzero_loop_16:
 	addi		-16, %arg1, %arg1
 
 	/*
-	 * see if there is anything left that needs to be zeroed in a word 
-	 * move. Since the count was decremented by 16, add 12 to test if 
+	 * see if there is anything left that needs to be zeroed in a word
+	 * move. Since the count was decremented by 16, add 12 to test if
 	 * there are any full word moves left to do.
 	 */
 
@@ -110,7 +110,7 @@ $bzero_cleanup:
 
 $bzero_bytes:
 addib,> -1,%arg1,$bzero_bytes
-stbs,ma %r0,1(%arg0) 
+stbs,ma %r0,1(%arg0)
 
 $bzero_exit:
 	bv,n	%r0(%rp)

Index: src/lib/libc/arch/hppa/string/ffs.S
diff -u src/lib/libc/arch/hppa/string/ffs.S:1.3 src/lib/libc/arch/hppa/string/ffs.S:1.4
--- src/lib/libc/arch/hppa/string/ffs.S:1.3	Sun Jul 18 20:30:04 2004
+++ src/lib/libc/arch/hppa/string/ffs.S	Sun May  3 15:29:22 2020
@@ -1,8 +1,8 @@
-/*	$NetBSD: ffs.S,v 1.3 2004/07/18 20:30:04 chs Exp $	*/
+/*	$NetBSD: ffs.S,v 1.4 2020/05/03 15:29:22 skrll Exp $	*/
 
 /*	$OpenBSD: ffs.S,v 1.3 2001/06/04 23:14:02 mickey Exp $	*/
 
-/* 
+/*
  * Copyright (c) 1990, 1991, 1992, 1994, The University of Utah and
  * the Computer Systems Laboratory at the University of Utah (CSL).
  * All rights reserved.
Index: src/lib/libc/arch/hppa/string/strlcpy.S
diff -u src/lib/libc/arch/hppa/string/strlcpy.S:1.3 src/lib/libc/arch/hppa/string/strlcpy.S:1.4
--- src/lib/libc/arch/hppa/string/strlcpy.S:1.3	Mon Apr 28 20:22:56 2008
+++ src/lib/libc/arch/hppa/string/strlcpy.S	Sun May  3 15:29:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: strlcpy.S,v 1.3 2008/04/28 20:22:56 martin Exp $	*/
+/*	$NetBSD: strlcpy.S,v 1.4 2020/05/03 15:29:22 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,9 +30,9 @@
  */
 
 #include 
- 
-#if defined(LIBC_SCCS) && !defined(lint) 
-RCSID("$NetBSD: strlcpy.S,v 1.3 2008/04/28 20:22:56 martin Exp $")
+
+#if defined(LIBC_SCCS) && !defined(lint)
+RCSID("$NetBSD: strlcpy.S,v 1.4 2020/05/03 15:29:22 skrll Exp $")
 

CVS commit: src/lib/libc/compat/arch/hppa/sys

2020-05-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun May  3 15:27:06 UTC 2020

Modified Files:
src/lib/libc/compat/arch/hppa/sys: compat_sigpending.S
compat_sigreturn.S

Log Message:
More trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/lib/libc/compat/arch/hppa/sys/compat_sigpending.S \
src/lib/libc/compat/arch/hppa/sys/compat_sigreturn.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/compat/arch/hppa/sys/compat_sigpending.S
diff -u src/lib/libc/compat/arch/hppa/sys/compat_sigpending.S:1.2 src/lib/libc/compat/arch/hppa/sys/compat_sigpending.S:1.3
--- src/lib/libc/compat/arch/hppa/sys/compat_sigpending.S:1.2	Mon Apr 28 20:22:58 2008
+++ src/lib/libc/compat/arch/hppa/sys/compat_sigpending.S	Sun May  3 15:27:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_sigpending.S,v 1.2 2008/04/28 20:22:58 martin Exp $	*/
+/*	$NetBSD: compat_sigpending.S,v 1.3 2020/05/03 15:27:06 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@ WARN_REFERENCES(sigpending, \
 
 ENTRY(sigpending, 0)
 	/*
-	 * AFAICT, since the hppa port came after __sigpending14, 
+	 * AFAICT, since the hppa port came after __sigpending14,
 	 * we shouldn't have to supply the compatability sigpending.
 	 */
 	ldi	EINVAL, %t1
Index: src/lib/libc/compat/arch/hppa/sys/compat_sigreturn.S
diff -u src/lib/libc/compat/arch/hppa/sys/compat_sigreturn.S:1.2 src/lib/libc/compat/arch/hppa/sys/compat_sigreturn.S:1.3
--- src/lib/libc/compat/arch/hppa/sys/compat_sigreturn.S:1.2	Mon Apr 28 20:22:58 2008
+++ src/lib/libc/compat/arch/hppa/sys/compat_sigreturn.S	Sun May  3 15:27:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_sigreturn.S,v 1.2 2008/04/28 20:22:58 martin Exp $	*/
+/*	$NetBSD: compat_sigreturn.S,v 1.3 2020/05/03 15:27:06 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@ WARN_REFERENCES(sigreturn, \
 
 ENTRY(sigreturn, 0)
 	/*
-	 * AFAICT, since the hppa port came after __sigreturn14, 
+	 * AFAICT, since the hppa port came after __sigreturn14,
 	 * we shouldn't have to supply the compatability sigreturn.
 	 */
 	ldi	EINVAL, %t1



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2020-05-03 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun May  3 13:34:38 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_i2c.c

Log Message:
drm/i915: There's no real reason the user should care that we're about to
fall back to bitbanging, so let's change the message from DRM_INFO to
DRM_DEBUG_KMS.

https://lists.freedesktop.org/archives/intel-gfx/2016-March/089133.html


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.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/external/bsd/drm2/dist/drm/i915/intel_i2c.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.19 src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.20
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.19	Fri Feb 14 14:34:58 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c	Sun May  3 13:34:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_i2c.c,v 1.19 2020/02/14 14:34:58 maya Exp $	*/
+/*	$NetBSD: intel_i2c.c,v 1.20 2020/05/03 13:34:38 nia Exp $	*/
 
 /*
  * Copyright (c) 2006 Dave Airlie 
@@ -29,7 +29,7 @@
  *	Chris Wilson 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_i2c.c,v 1.19 2020/02/14 14:34:58 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_i2c.c,v 1.20 2020/05/03 13:34:38 nia Exp $");
 
 #include 
 #include 
@@ -643,8 +643,8 @@ clear_err:
 	goto out;
 
 timeout:
-	DRM_INFO("GMBUS [%s] timed out, falling back to bit banging on pin %d\n",
-		 bus->adapter.name, bus->reg0 & 0xff);
+	DRM_DEBUG_KMS("GMBUS [%s] timed out, falling back to bit banging on pin %d\n",
+		 bus->adapter.name, bus->reg0 & 0xff);
 	I915_WRITE(GMBUS0, 0);
 
 	/* Hardware may not support GMBUS over these pins? Try GPIO bitbanging instead. */



CVS commit: src/distrib/i386/installimage

2020-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May  3 13:29:04 UTC 2020

Modified Files:
src/distrib/i386/installimage: Makefile

Log Message:
bump caused by the module debug sets


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/i386/installimage/Makefile

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

Modified files:

Index: src/distrib/i386/installimage/Makefile
diff -u src/distrib/i386/installimage/Makefile:1.16 src/distrib/i386/installimage/Makefile:1.17
--- src/distrib/i386/installimage/Makefile:1.16	Sat Jan 25 14:09:38 2020
+++ src/distrib/i386/installimage/Makefile	Sun May  3 09:29:04 2020
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.16 2020/01/25 19:09:38 christos Exp $
+#	$NetBSD: Makefile,v 1.17 2020/05/03 13:29:04 christos Exp $
 
 .include 
 
 INSTIMGBASE=	NetBSD-${DISTRIBVER}-i386-install	# gives ${IMGBASE}.img
 
-INSTIMAGEMB?=	1790			# for all installation binaries
+INSTIMAGEMB?=	1870			# for all installation binaries
 
 PRIMARY_BOOT=		bootxx_ffsv1
 SECONDARY_BOOT=		boot



CVS commit: src/usr.bin/make

2020-05-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May  3 12:10:28 UTC 2020

Modified Files:
src/usr.bin/make: str.c

Log Message:
usr.bin/make: refactor brk_string

The variables are renamed to reflect to which memory region each pointer
belongs.

The variable "curlen" was always zero.

The type of "ch" has changed to char, and its scope is now limited to
its actual use.

Comparisons of pointers are now consistently written as p != NULL
instead of !p, like character comparisons are written as ch != '\0'.

The "store_words_buf" is updated when the function returns, not before.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/make/str.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/make/str.c
diff -u src/usr.bin/make/str.c:1.40 src/usr.bin/make/str.c:1.41
--- src/usr.bin/make/str.c:1.40	Sat Apr 25 18:20:57 2020
+++ src/usr.bin/make/str.c	Sun May  3 12:10:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.c,v 1.40 2020/04/25 18:20:57 christos Exp $	*/
+/*	$NetBSD: str.c,v 1.41 2020/05/03 12:10:28 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.40 2020/04/25 18:20:57 christos Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.41 2020/05/03 12:10:28 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)str.c	5.8 (Berkeley) 6/1/90";
 #else
-__RCSID("$NetBSD: str.c,v 1.40 2020/04/25 18:20:57 christos Exp $");
+__RCSID("$NetBSD: str.c,v 1.41 2020/05/03 12:10:28 rillig Exp $");
 #endif
 #endif/* not lint */
 #endif
@@ -133,42 +133,43 @@ str_concat(const char *s1, const char *s
  *
  * returns --
  *	Pointer to the array of pointers to the words.
- *  Memory containing the actual words in *buffer.
+ *  Memory containing the actual words in *store_words_buf.
  *		Both of these must be free'd by the caller.
- *  Number of words in *store_argc.
+ *  Number of words in *store_words_len.
  */
 char **
-brk_string(const char *str, int *store_argc, Boolean expand, char **buffer)
+brk_string(const char *str, int *store_words_len, Boolean expand,
+	char **store_words_buf)
 {
-	int argc, ch;
-	char inquote, *start, *t;
-	const char *p;
-	int len;
-	int argmax = 50, curlen = 0;
-	char **argv;
+	char inquote;
+	const char *str_p;
+	size_t str_len;
+	char **words;
+	int words_len;
+	int words_cap = 50;
+	char *words_buf, *word_start, *word_end;
 
 	/* skip leading space chars. */
 	for (; *str == ' ' || *str == '\t'; ++str)
 		continue;
 
-	/* allocate room for a copy of the string */
-	if ((len = strlen(str) + 1) > curlen)
-		*buffer = bmake_malloc(curlen = len);
+	/* words_buf holds the words, separated by '\0'. */
+	str_len = strlen(str);
+	words_buf = bmake_malloc(strlen(str) + 1);
 
-	/*
-	 * initial argmax based on len
-	 */
-	argmax = MAX((len / 5), 50);
-	argv = bmake_malloc((argmax + 1) * sizeof(char *));
+	words_cap = MAX((str_len / 5), 50);
+	words = bmake_malloc((words_cap + 1) * sizeof(char *));
 
 	/*
 	 * copy the string; at the same time, parse backslashes,
-	 * quotes and build the argument list.
+	 * quotes and build the word list.
 	 */
-	argc = 0;
+	words_len = 0;
 	inquote = '\0';
-	for (p = str, start = t = *buffer;; ++p) {
-		switch(ch = *p) {
+	word_start = word_end = words_buf;
+	for (str_p = str;; ++str_p) {
+		char ch = *str_p;
+		switch(ch) {
 		case '"':
 		case '\'':
 			if (inquote) {
@@ -180,21 +181,21 @@ brk_string(const char *str, int *store_a
 			else {
 inquote = (char) ch;
 /* Don't miss "" or '' */
-if (start == NULL && p[1] == inquote) {
+if (word_start == NULL && str_p[1] == inquote) {
 	if (!expand) {
-		start = t;
-		*t++ = ch;
+		word_start = word_end;
+		*word_end++ = ch;
 	} else
-		start = t + 1;
-	p++;
+		word_start = word_end + 1;
+	str_p++;
 	inquote = '\0';
 	break;
 }
 			}
 			if (!expand) {
-if (!start)
-	start = t;
-*t++ = ch;
+if (word_start == NULL)
+	word_start = word_end;
+*word_end++ = ch;
 			}
 			continue;
 		case ' ':
@@ -202,30 +203,30 @@ brk_string(const char *str, int *store_a
 		case '\n':
 			if (inquote)
 break;
-			if (!start)
+			if (word_start == NULL)
 continue;
 			/* FALLTHROUGH */
 		case '\0':
 			/*
-			 * end of a token -- make sure there's enough argv
+			 * end of a token -- make sure there's enough words
 			 * space and save off a pointer.
 			 */
-			if (!start)
+			if (word_start == NULL)
 			goto done;
 
-			*t++ = '\0';
-			if (argc == argmax) {
-argmax *= 2;		/* ramp up fast */
-argv = (char **)bmake_realloc(argv,
-(argmax + 1) * sizeof(char *));
+			*word_end++ = '\0';
+			if (words_len == words_cap) {
+words_cap *= 2;		/* ramp up fast */
+words = (char **)bmake_realloc(words,
+(words_cap + 1) * 

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

2020-05-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun May  3 10:06:29 UTC 2020

Modified Files:
src/sys/arch/amiga/conf: DRACO GENERIC INSTALL

Log Message:
Regen to disable amiga/efa(4) in GENERIC, accidentally enabled in the
previous revision.

efa_probe() seems broken and misdetected even if absent on A1200.


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/sys/arch/amiga/conf/DRACO
cvs rdiff -u -r1.326 -r1.327 src/sys/arch/amiga/conf/GENERIC
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/amiga/conf/INSTALL

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/DRACO
diff -u src/sys/arch/amiga/conf/DRACO:1.191 src/sys/arch/amiga/conf/DRACO:1.192
--- src/sys/arch/amiga/conf/DRACO:1.191	Wed Mar 25 17:06:18 2020
+++ src/sys/arch/amiga/conf/DRACO	Sun May  3 10:06:29 2020
@@ -1,9 +1,9 @@
-# $NetBSD: DRACO,v 1.191 2020/03/25 17:06:18 jdolecek Exp $
+# $NetBSD: DRACO,v 1.192 2020/05/03 10:06:29 rin Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.142 2019/05/26 23:00:57 sevan Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.143 2020/03/25 17:06:18 jdolecek Exp $
 #
 ##
 # GENERIC machine description file
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.191 $"
+#ident 		"GENERIC-$Revision: 1.192 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 

Index: src/sys/arch/amiga/conf/GENERIC
diff -u src/sys/arch/amiga/conf/GENERIC:1.326 src/sys/arch/amiga/conf/GENERIC:1.327
--- src/sys/arch/amiga/conf/GENERIC:1.326	Wed Mar 25 17:06:18 2020
+++ src/sys/arch/amiga/conf/GENERIC	Sun May  3 10:06:29 2020
@@ -1,9 +1,9 @@
-# $NetBSD: GENERIC,v 1.326 2020/03/25 17:06:18 jdolecek Exp $
+# $NetBSD: GENERIC,v 1.327 2020/05/03 10:06:29 rin Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.142 2019/05/26 23:00:57 sevan Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.143 2020/03/25 17:06:18 jdolecek Exp $
 #
 ##
 # GENERIC machine description file
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.326 $"
+#ident 		"GENERIC-$Revision: 1.327 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -426,10 +426,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/arch/amiga/conf/INSTALL
diff -u src/sys/arch/amiga/conf/INSTALL:1.132 src/sys/arch/amiga/conf/INSTALL:1.133
--- src/sys/arch/amiga/conf/INSTALL:1.132	Sun May 26 23:03:31 2019
+++ src/sys/arch/amiga/conf/INSTALL	Sun May  3 10:06:29 2020
@@ -1,9 +1,9 @@
-# $NetBSD: INSTALL,v 1.132 2019/05/26 23:03:31 sevan Exp $
+# $NetBSD: INSTALL,v 1.133 2020/05/03 10:06:29 rin Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.142 2019/05/26 23:00:57 sevan Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.143 2020/03/25 17:06:18 jdolecek Exp $
 #
 ##
 # GENERIC machine description file
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.132 $"
+#ident 		"GENERIC-$Revision: 1.133 $"
 
 makeoptions	COPTS="-Os"
 



CVS commit: src/lib/libc

2020-05-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun May  3 08:36:09 UTC 2020

Modified Files:
src/lib/libc/arch/hppa/sys: __vfork14.S
src/lib/libc/compat/arch/hppa/sys: compat_sigprocmask.S
compat_sigsuspend.S

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/hppa/sys/__vfork14.S
cvs rdiff -u -r1.2 -r1.3 \
src/lib/libc/compat/arch/hppa/sys/compat_sigprocmask.S \
src/lib/libc/compat/arch/hppa/sys/compat_sigsuspend.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/hppa/sys/__vfork14.S
diff -u src/lib/libc/arch/hppa/sys/__vfork14.S:1.6 src/lib/libc/arch/hppa/sys/__vfork14.S:1.7
--- src/lib/libc/arch/hppa/sys/__vfork14.S:1.6	Thu Mar  6 19:02:58 2014
+++ src/lib/libc/arch/hppa/sys/__vfork14.S	Sun May  3 08:36:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __vfork14.S,v 1.6 2014/03/06 19:02:58 skrll Exp $	*/
+/*	$NetBSD: __vfork14.S,v 1.7 2020/05/03 08:36:09 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 ENTRY(__vfork14, 0)
 	/*
 	 * NB: __vfork14 is a tricky syscall.  We can't save
-	 * any values on the stack, because the stack will be 
+	 * any values on the stack, because the stack will be
 	 * trashed by the child, leaving garbage for when the
 	 * parent returns.
 	 *
@@ -48,8 +48,8 @@ ENTRY(__vfork14, 0)
 	 * because *our* caller is counting on us to do so.
 	 *
 	 * What we need is a normally caller-saved register,
-	 * that the kernel is willing to save for us.  The 
-	 * syscall entry code in locore.S has been modified 
+	 * that the kernel is willing to save for us.  The
+	 * syscall entry code in locore.S has been modified
 	 * to do just this for the t4 register.
 	 */
 	.import	__cerror, code

Index: src/lib/libc/compat/arch/hppa/sys/compat_sigprocmask.S
diff -u src/lib/libc/compat/arch/hppa/sys/compat_sigprocmask.S:1.2 src/lib/libc/compat/arch/hppa/sys/compat_sigprocmask.S:1.3
--- src/lib/libc/compat/arch/hppa/sys/compat_sigprocmask.S:1.2	Mon Apr 28 20:22:58 2008
+++ src/lib/libc/compat/arch/hppa/sys/compat_sigprocmask.S	Sun May  3 08:36:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_sigprocmask.S,v 1.2 2008/04/28 20:22:58 martin Exp $	*/
+/*	$NetBSD: compat_sigprocmask.S,v 1.3 2020/05/03 08:36:09 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@ WARN_REFERENCES(sigprocmask, \
 
 ENTRY(sigprocmask, 0)
 	/*
-	 * AFAICT, since the hppa port came after __sigprocmask14, 
+	 * AFAICT, since the hppa port came after __sigprocmask14,
 	 * we shouldn't have to supply the compatability sigprocmask.
 	 */
 	ldi	EINVAL, %t1
Index: src/lib/libc/compat/arch/hppa/sys/compat_sigsuspend.S
diff -u src/lib/libc/compat/arch/hppa/sys/compat_sigsuspend.S:1.2 src/lib/libc/compat/arch/hppa/sys/compat_sigsuspend.S:1.3
--- src/lib/libc/compat/arch/hppa/sys/compat_sigsuspend.S:1.2	Mon Apr 28 20:22:58 2008
+++ src/lib/libc/compat/arch/hppa/sys/compat_sigsuspend.S	Sun May  3 08:36:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_sigsuspend.S,v 1.2 2008/04/28 20:22:58 martin Exp $	*/
+/*	$NetBSD: compat_sigsuspend.S,v 1.3 2020/05/03 08:36:09 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@ WARN_REFERENCES(sigsuspend, \
 
 ENTRY(sigsuspend, 0)
 	/*
-	 * AFAICT, since the hppa port came after __sigsuspend14, 
+	 * AFAICT, since the hppa port came after __sigsuspend14,
 	 * we shouldn't have to supply the compatability sigsuspend.
 	 */
 	ldi	EINVAL, %t1



CVS commit: src/lib/libc/stdlib

2020-05-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun May  3 07:32:54 UTC 2020

Modified Files:
src/lib/libc/stdlib: jemalloc.c

Log Message:
turn off TLS for mips on old jemalloc.  it doesn't work.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/lib/libc/stdlib/jemalloc.c

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

Modified files:

Index: src/lib/libc/stdlib/jemalloc.c
diff -u src/lib/libc/stdlib/jemalloc.c:1.51 src/lib/libc/stdlib/jemalloc.c:1.52
--- src/lib/libc/stdlib/jemalloc.c:1.51	Wed Apr 22 08:48:12 2020
+++ src/lib/libc/stdlib/jemalloc.c	Sun May  3 07:32:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: jemalloc.c,v 1.51 2020/04/22 08:48:12 rin Exp $	*/
+/*	$NetBSD: jemalloc.c,v 1.52 2020/05/03 07:32:54 mrg Exp $	*/
 
 /*-
  * Copyright (C) 2006,2007 Jason Evans .
@@ -117,7 +117,7 @@
 
 #include 
 /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */ 
-__RCSID("$NetBSD: jemalloc.c,v 1.51 2020/04/22 08:48:12 rin Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.52 2020/05/03 07:32:54 mrg Exp $");
 
 #ifdef __FreeBSD__
 #include "libc_private.h"
@@ -284,6 +284,9 @@ __RCSID("$NetBSD: jemalloc.c,v 1.51 2020
 #  endif
 #  define QUANTUM_2POW_MIN	4
 #  define USE_BRK
+#  if defined(__mips__)
+#define NO_TLS
+#  endif
 #endif
 #ifdef __hppa__ 
 #  define QUANTUM_2POW_MIN	4



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

2020-05-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun May  3 07:10:27 UTC 2020

Modified Files:
src/external/gpl3/gdb/lib/libgdb: Makefile

Log Message:
Remove hack for amiga introduced for 68060:
http://cvsweb.netbsd.org/bsdweb.cgi/src/gnu/usr.bin/gdb6/libgdb/Attic/Makefile#rev1.9

Now, gdb works fine even if compiled with -march=68060 and -mtune=68060.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/gpl3/gdb/lib/libgdb/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/gdb/lib/libgdb/Makefile
diff -u src/external/gpl3/gdb/lib/libgdb/Makefile:1.22 src/external/gpl3/gdb/lib/libgdb/Makefile:1.23
--- src/external/gpl3/gdb/lib/libgdb/Makefile:1.22	Wed Apr 29 11:04:58 2020
+++ src/external/gpl3/gdb/lib/libgdb/Makefile	Sun May  3 07:10:27 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.22 2020/04/29 11:04:58 rin Exp $
+#	$NetBSD: Makefile,v 1.23 2020/05/03 07:10:27 rin Exp $
 
 NOCTF=
 HOSTPROG_CXX=   1
@@ -54,10 +54,6 @@ CFLAGS:=		${CXXFLAGS} -std=gnu++11 -Wno-
 
 ada-exp.c: ada-lex.c
 
-.if ${MACHINE} == "amiga"
-COPTS.dwarf2-frame.c+=-O1
-.endif
-
 .if defined(HAVE_GCC) && ${HAVE_GCC} >= 8 && ${ACTIVE_CC} == "gcc"
 .if !empty(MACHINE_ARCH:Mearmv7hf*)
 # GCC 8.4 miscompiles this with -O2 or -O1 for earmv7hf{,eb}.



CVS commit: src/sys/kern

2020-05-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May  3 06:33:59 UTC 2020

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

Log Message:
Initialize struct krndsource::total to zero.

Avoids bogus counts reported by `rndctl -l' in the event that the
caller neglected to zero the rndsource ahead of time.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/kern/kern_entropy.c

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

Modified files:

Index: src/sys/kern/kern_entropy.c
diff -u src/sys/kern/kern_entropy.c:1.8 src/sys/kern/kern_entropy.c:1.9
--- src/sys/kern/kern_entropy.c:1.8	Fri May  1 01:31:17 2020
+++ src/sys/kern/kern_entropy.c	Sun May  3 06:33:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_entropy.c,v 1.8 2020/05/01 01:31:17 riastradh Exp $	*/
+/*	$NetBSD: kern_entropy.c,v 1.9 2020/05/03 06:33:59 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.8 2020/05/01 01:31:17 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.9 2020/05/03 06:33:59 riastradh Exp $");
 
 #include 
 #include 
@@ -1467,6 +1467,7 @@ rnd_attach_source(struct krndsource *rs,
 	/* Initialize the random source.  */
 	memset(rs->name, 0, sizeof(rs->name)); /* paranoia */
 	strlcpy(rs->name, name, sizeof(rs->name));
+	rs->total = 0;
 	rs->type = type;
 	rs->flags = flags;
 	if (E->stage >= ENTROPY_WARM)



CVS commit: src/sys/dev/sun

2020-05-03 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Sun May  3 06:31:02 UTC 2020

Modified Files:
src/sys/dev/sun: disksubr.c

Log Message:
If the sector size is 0, return early in readdisklabel().
Prevents a panic trying to use a 0-sized buffer, which can happen if we run
(e.g.) `scsictl /dev/cd0c identify` with no medium in the CD drive.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/sun/disksubr.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/sun/disksubr.c
diff -u src/sys/dev/sun/disksubr.c:1.16 src/sys/dev/sun/disksubr.c:1.17
--- src/sys/dev/sun/disksubr.c:1.16	Wed Apr  3 22:10:52 2019
+++ src/sys/dev/sun/disksubr.c	Sun May  3 06:31:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: disksubr.c,v 1.16 2019/04/03 22:10:52 christos Exp $ */
+/*	$NetBSD: disksubr.c,v 1.17 2020/05/03 06:31:02 jdc Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -55,7 +55,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.16 2019/04/03 22:10:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.17 2020/05/03 06:31:02 jdc Exp $");
 
 #include 
 #include 
@@ -104,6 +104,8 @@ readdisklabel(dev_t dev, void (*strat)(s
 			lp->d_partitions[RAW_PART].p_size = 0x1fff;
 		lp->d_partitions[RAW_PART].p_offset = 0;
 	}
+	if (lp->d_secsize == 0)
+		return ("sector size 0");
 
 	/* obtain buffer to probe drive with */
 	bp = geteblk((int)lp->d_secsize);



CVS commit: src/sys/dev/dkwedge

2020-05-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun May  3 06:30:45 UTC 2020

Modified Files:
src/sys/dev/dkwedge: dkwedge_rdb.c

Log Message:
Fix fallout of migration from malloc to geteblk.

- Use bp->b_data instead of bp itself.
- When buffer is not large enough, start all over; brelse + geteblk does not
  apparently behave like realloc.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/dkwedge/dkwedge_rdb.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/dkwedge/dkwedge_rdb.c
diff -u src/sys/dev/dkwedge/dkwedge_rdb.c:1.6 src/sys/dev/dkwedge/dkwedge_rdb.c:1.7
--- src/sys/dev/dkwedge/dkwedge_rdb.c:1.6	Sat Apr 11 16:00:34 2020
+++ src/sys/dev/dkwedge/dkwedge_rdb.c	Sun May  3 06:30:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dkwedge_rdb.c,v 1.6 2020/04/11 16:00:34 jdolecek Exp $	*/
+/*	$NetBSD: dkwedge_rdb.c,v 1.7 2020/05/03 06:30:45 rin Exp $	*/
 
 /*
  * Adapted from arch/amiga/amiga/disksubr.c:
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dkwedge_rdb.c,v 1.6 2020/04/11 16:00:34 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dkwedge_rdb.c,v 1.7 2020/05/03 06:30:45 rin Exp $");
 
 #include 
 #include 
@@ -116,19 +116,21 @@ dkwedge_discover_rdb(struct disk *pdk, s
 	secsize);
 	bp = geteblk(bufsize);
 
+retry:
 	/*
 	 * find the RDB block
 	 * XXX bsdlabel should be detected by the other method
 	 */
 	for (nextb = 0; nextb < RDB_MAXBLOCKS; nextb++) {
-		error = dkwedge_read(pdk, vp, ADJUST_NR(nextb), bp, bufsize);
+		error = dkwedge_read(pdk, vp, ADJUST_NR(nextb), bp->b_data,
+		bufsize);
 		if (error) {
 			aprint_error("%s: unable to read RDB @ %u, "
 			"error = %d\n", pdk->dk_name, nextb, error);
 			error = ESRCH;
 			goto done;
 		}
-		rbp = (struct rdblock *)bp;
+		rbp = (struct rdblock *)bp->b_data;
 		if (be32toh(rbp->id) == RDBLOCK_ID) {
 			if (rdbchksum(rbp) == 0)
 break;
@@ -152,6 +154,7 @@ dkwedge_discover_rdb(struct disk *pdk, s
 		sizeof(struct rdblock)), secsize);
 		brelse(bp, 0);
 		bp = geteblk(bufsize);
+		goto retry;
 	}
 
 	memset(, 0, sizeof(dkw));
@@ -164,14 +167,15 @@ dkwedge_discover_rdb(struct disk *pdk, s
 	 */
 	for (nextb = be32toh(rbp->partbhead); nextb != RDBNULL;
 	 nextb = be32toh(pbp->next)) {
-		error = dkwedge_read(pdk, vp, ADJUST_NR(nextb), bp, bufsize);
+		error = dkwedge_read(pdk, vp, ADJUST_NR(nextb), bp->b_data,
+		bufsize);
 		if (error) {
 			aprint_error("%s: unable to read RDB partition block @ "
 			"%u, error = %d\n", pdk->dk_name, nextb, error);
 			error = ESRCH;
 			goto done;
 		}
-		pbp = (struct partblock *)bp;
+		pbp = (struct partblock *)bp->b_data;
 		
 		if (be32toh(pbp->id) != PARTBLOCK_ID) {
 			aprint_error(