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

2016-03-04 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar  5 07:33:59 UTC 2016

Modified Files:
src/sys/arch/evbarm/evbarm: autoconf.c

Log Message:
Don't modify command line buffer but create a copy of the root argument.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/evbarm/autoconf.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/evbarm/evbarm/autoconf.c
diff -u src/sys/arch/evbarm/evbarm/autoconf.c:1.18 src/sys/arch/evbarm/evbarm/autoconf.c:1.19
--- src/sys/arch/evbarm/evbarm/autoconf.c:1.18	Sat Nov 22 11:10:22 2014
+++ src/sys/arch/evbarm/evbarm/autoconf.c	Sat Mar  5 07:33:58 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.18 2014/11/22 11:10:22 mlelstv Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.19 2016/03/05 07:33:58 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.18 2014/11/22 11:10:22 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.19 2016/03/05 07:33:58 mlelstv Exp $");
 
 #include "opt_md.h"
 
@@ -41,7 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
@@ -95,10 +95,14 @@ get_device(char *name, device_t *dvp, in
 
 /* Set the rootdev variable from the root specifier in the boot args */
 
+static char *bootspec_buf = NULL;
+static size_t bootspec_buflen = 0;
+
 static void
 set_root_device(void)
 {
-	char *ptr, *end;
+	char *ptr, *end, *buf;
+	size_t len;
 
 	if (boot_args == NULL)
 		return;
@@ -112,12 +116,26 @@ set_root_device(void)
 	/* NUL-terminate string, get_bootconf_option doesn't */
 	for (end=ptr; *end != '\0'; ++end) {
 		if (*end == ' ' || *end == '\t') {
-			*end = '\0';
 			break;
 		}
 	}
 
-	bootspec = ptr;
+	if (end == ptr)
+		return;
+
+	len = end - ptr;
+
+	buf = kmem_alloc(len + 1, KM_SLEEP);
+	memcpy(buf, ptr, len);
+	buf[len] = '\0';
+
+	if (bootspec_buf != NULL)
+		kmem_free(bootspec_buf, bootspec_buflen + 1);
+
+	bootspec_buf = buf;
+	bootspec_buflen = len;
+
+	bootspec = bootspec_buf;
 }
 #endif
 



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

2016-03-04 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar  5 06:48:31 UTC 2016

Modified Files:
src/sys/external/bsd/drm2/drm: drm_memory.c

Log Message:
Make agp_i810 also depend on agp so that a 'no agp' build is possible.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/drm/drm_memory.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/drm/drm_memory.c
diff -u src/sys/external/bsd/drm2/drm/drm_memory.c:1.8 src/sys/external/bsd/drm2/drm/drm_memory.c:1.9
--- src/sys/external/bsd/drm2/drm/drm_memory.c:1.8	Sat Oct 17 15:13:39 2015
+++ src/sys/external/bsd/drm2/drm/drm_memory.c	Sat Mar  5 06:48:31 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_memory.c,v 1.8 2015/10/17 15:13:39 jmcneill Exp $	*/
+/*	$NetBSD: drm_memory.c,v 1.9 2016/03/05 06:48:31 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_memory.c,v 1.8 2015/10/17 15:13:39 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_memory.c,v 1.9 2016/03/05 06:48:31 mlelstv Exp $");
 
 #if defined(__i386__) || defined(__x86_64__)
 #define HAS_AGP_I810	1
@@ -39,7 +39,10 @@ __KERNEL_RCSID(0, "$NetBSD: drm_memory.c
 #endif
 
 #ifdef _KERNEL_OPT
-# if HAS_AGP_I810 > 0
+# include "agp.h"
+# if NAGP == 0
+#  define NAGP_I810	0
+# elif HAS_AGP_I810 > 0
 #  include "agp_i810.h"
 # else
 #  define NAGP_I810	0



CVS commit: src/sys/dev/sbus

2016-03-04 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Mar  4 22:08:09 UTC 2016

Modified Files:
src/sys/dev/sbus: mgx.c

Log Message:
allow mmap()ing blitter registers


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/sbus/mgx.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/sbus/mgx.c
diff -u src/sys/dev/sbus/mgx.c:1.7 src/sys/dev/sbus/mgx.c:1.8
--- src/sys/dev/sbus/mgx.c:1.7	Thu Feb 25 17:09:39 2016
+++ src/sys/dev/sbus/mgx.c	Fri Mar  4 22:08:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mgx.c,v 1.7 2016/02/25 17:09:39 joerg Exp $ */
+/*	$NetBSD: mgx.c,v 1.8 2016/03/04 22:08:09 macallan Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -29,7 +29,7 @@
 /* a console driver for the SSB 4096V-MGX graphics card */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mgx.c,v 1.7 2016/02/25 17:09:39 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mgx.c,v 1.8 2016/03/04 22:08:09 macallan Exp $");
 
 #include 
 #include 
@@ -38,6 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: mgx.c,v 1.7 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -65,7 +66,7 @@ struct mgx_softc {
 	bus_space_tag_t sc_tag;
 	bus_space_handle_t sc_blith;
 	bus_space_handle_t sc_vgah;
-	bus_addr_t	sc_paddr;
+	bus_addr_t	sc_paddr, sc_rpaddr;
 	void		*sc_fbaddr;
 	uint8_t		*sc_cursor;
 	int		sc_width;
@@ -159,6 +160,14 @@ mgx_read_1(struct mgx_softc *sc, uint32_
 	return bus_space_read_1(sc->sc_tag, sc->sc_blith, reg ^ 3);
 }
 
+#if 0
+static inline uint32_t
+mgx_read_4(struct mgx_softc *sc, uint32_t reg)
+{
+	return bus_space_read_4(sc->sc_tag, sc->sc_blith, reg);
+}
+#endif
+
 static inline void
 mgx_write_2(struct mgx_softc *sc, uint32_t reg, uint16_t val)
 {
@@ -202,6 +211,8 @@ mgx_attach(device_t parent, device_t sel
 
 	sc->sc_paddr = sbus_bus_addr(sa->sa_bustag, sa->sa_slot,
 	sa->sa_reg[8].oa_base);
+	sc->sc_rpaddr = sbus_bus_addr(sa->sa_bustag, sa->sa_slot,
+	sa->sa_reg[5].oa_base + MGX_REG_ATREG_OFFSET);
 
 	/* read geometry information from the device tree */
 	sc->sc_width = prom_getpropint(sa->sa_node, "width", 1152);
@@ -311,17 +322,14 @@ mgx_attach(device_t parent, device_t sel
 	config_found(self, , wsemuldisplaydevprint);
 
 #if 0
-	uint32_t *fb = sc->sc_fbaddr;
-	int i, j;
-	for (i = 0; i < 256; i += 16) {
-		printf("%04x:", i);
-		for (j = 0; j < 16; j += 4) {
-			printf(" %08x", fb[(i + j) >> 2]);
-		}
-		printf("\n");
+	{
+		uint32_t ap;
+		/* reads 0xfd21 */
+		mgx_write_4(sc, ATR_APERTURE, 0x); 
+		ap = mgx_read_4(sc, ATR_APERTURE);
+		printf("aperture: %08x\n", ap);
 	}
 #endif
-
 }
 
 static void
@@ -659,6 +667,10 @@ mgx_putchar(void *cookie, int row, int c
 		mgx_wait_engine(sc);
 		sc->sc_putchar(cookie, row, col, c, attr & ~1);
 		if (rv == GC_ADD) {
+			/*
+			 * try to make sure the glyph made it all the way to
+			 * video memory before trying to blit it into the cache
+			 */ 
 			junk = *(uint32_t *)sc->sc_fbaddr;
 			__USE(junk);
 			glyphcache_add(>sc_gc, c, x, y);
@@ -922,7 +934,7 @@ mgx_ioctl(void *v, void *vs, u_long cmd,
 		case WSDISPLAYIO_GET_FBINFO:
 			{
 struct wsdisplayio_fbinfo *fbi = data;
-
+	
 fbi->fbi_fbsize = sc->sc_fbsize - 1024;
 fbi->fbi_width = sc->sc_width;
 fbi->fbi_height = sc->sc_height;
@@ -955,6 +967,23 @@ mgx_mmap(void *v, void *vs, off_t offset
 		offset, prot, BUS_SPACE_MAP_LINEAR);
 	}
 
+	/*
+	 * Blitter registers at 0x8000, only in mapped mode.
+	 * Restrict to root, even though I'm fairly sure the DMA engine lives
+	 * elsewhere ( and isn't documented anyway )
+	 */
+	if (kauth_authorize_machdep(kauth_cred_get(),
+	KAUTH_MACHDEP_UNMANAGEDMEM,
+	NULL, NULL, NULL, NULL) != 0) {
+		aprint_normal("%s: mmap() rejected.\n",
+		device_xname(sc->sc_dev));
+		return -1;
+	}
+	if ((sc->sc_mode == WSDISPLAYIO_MODE_MAPPED) &&
+	(offset >= 0x8000) && (offset < 0x80001000)) {
+		return bus_space_mmap(sc->sc_tag, sc->sc_rpaddr,
+		offset, prot, BUS_SPACE_MAP_LINEAR);
+	}
 	return -1;
 }
 



CVS commit: [netbsd-7-0] src/bin/mv

2016-03-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar  4 21:26:49 UTC 2016

Modified Files:
src/bin/mv [netbsd-7-0]: mv.c

Log Message:
Missing file in pullup #1096: Don't truncate at sub-microsecond while
preserving timestamps.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.43.24.1 src/bin/mv/mv.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/mv/mv.c
diff -u src/bin/mv/mv.c:1.43 src/bin/mv/mv.c:1.43.24.1
--- src/bin/mv/mv.c:1.43	Mon Aug 29 14:46:54 2011
+++ src/bin/mv/mv.c	Fri Mar  4 21:26:49 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: mv.c,v 1.43 2011/08/29 14:46:54 joerg Exp $ */
+/* $NetBSD: mv.c,v 1.43.24.1 2016/03/04 21:26:49 martin Exp $ */
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)mv.c	8.2 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: mv.c,v 1.43 2011/08/29 14:46:54 joerg Exp $");
+__RCSID("$NetBSD: mv.c,v 1.43.24.1 2016/03/04 21:26:49 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -255,7 +255,11 @@ do_move(char *from, char *to)
 static int
 fastcopy(char *from, char *to, struct stat *sbp)
 {
+#if defined(__NetBSD__)
+	struct timespec ts[2];
+#else
 	struct timeval tval[2];
+#endif
 	static blksize_t blen;
 	static char *bp;
 	int nread, from_fd, to_fd;
@@ -296,8 +300,13 @@ err:		if (unlink(to))
 
 	(void)close(from_fd);
 #ifdef BSD4_4
+#if defined(__NetBSD__)
+	ts[0] = sbp->st_atimespec;
+	ts[1] = sbp->st_mtimespec;
+#else
 	TIMESPEC_TO_TIMEVAL([0], >st_atimespec);
 	TIMESPEC_TO_TIMEVAL([1], >st_mtimespec);
+#endif
 #else
 	tval[0].tv_sec = sbp->st_atime;
 	tval[1].tv_sec = sbp->st_mtime;
@@ -307,8 +316,12 @@ err:		if (unlink(to))
 #ifdef __SVR4
 	if (utimes(to, tval))
 #else
+#if defined(__NetBSD__)
+	if (futimens(to_fd, ts))
+#else
 	if (futimes(to_fd, tval))
 #endif
+#endif
 		warn("%s: set times", to);
 	if (fchown(to_fd, sbp->st_uid, sbp->st_gid)) {
 		if (errno != EPERM)



CVS commit: [netbsd-7] src/bin/mv

2016-03-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar  4 21:25:36 UTC 2016

Modified Files:
src/bin/mv [netbsd-7]: mv.c

Log Message:
Missing file in pullup #1096: Don't truncate at sub-microsecond while
preserving timestamps.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.43.22.1 src/bin/mv/mv.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/mv/mv.c
diff -u src/bin/mv/mv.c:1.43 src/bin/mv/mv.c:1.43.22.1
--- src/bin/mv/mv.c:1.43	Mon Aug 29 14:46:54 2011
+++ src/bin/mv/mv.c	Fri Mar  4 21:25:36 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: mv.c,v 1.43 2011/08/29 14:46:54 joerg Exp $ */
+/* $NetBSD: mv.c,v 1.43.22.1 2016/03/04 21:25:36 martin Exp $ */
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)mv.c	8.2 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: mv.c,v 1.43 2011/08/29 14:46:54 joerg Exp $");
+__RCSID("$NetBSD: mv.c,v 1.43.22.1 2016/03/04 21:25:36 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -255,7 +255,11 @@ do_move(char *from, char *to)
 static int
 fastcopy(char *from, char *to, struct stat *sbp)
 {
+#if defined(__NetBSD__)
+	struct timespec ts[2];
+#else
 	struct timeval tval[2];
+#endif
 	static blksize_t blen;
 	static char *bp;
 	int nread, from_fd, to_fd;
@@ -296,8 +300,13 @@ err:		if (unlink(to))
 
 	(void)close(from_fd);
 #ifdef BSD4_4
+#if defined(__NetBSD__)
+	ts[0] = sbp->st_atimespec;
+	ts[1] = sbp->st_mtimespec;
+#else
 	TIMESPEC_TO_TIMEVAL([0], >st_atimespec);
 	TIMESPEC_TO_TIMEVAL([1], >st_mtimespec);
+#endif
 #else
 	tval[0].tv_sec = sbp->st_atime;
 	tval[1].tv_sec = sbp->st_mtime;
@@ -307,8 +316,12 @@ err:		if (unlink(to))
 #ifdef __SVR4
 	if (utimes(to, tval))
 #else
+#if defined(__NetBSD__)
+	if (futimens(to_fd, ts))
+#else
 	if (futimes(to_fd, tval))
 #endif
+#endif
 		warn("%s: set times", to);
 	if (fchown(to_fd, sbp->st_uid, sbp->st_gid)) {
 		if (errno != EPERM)



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

2016-03-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar  4 19:09:26 UTC 2016

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.7

Log Message:
Ticket #1371


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

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

Modified files:

Index: src/doc/CHANGES-6.0.7
diff -u src/doc/CHANGES-6.0.7:1.1.2.56 src/doc/CHANGES-6.0.7:1.1.2.57
--- src/doc/CHANGES-6.0.7:1.1.2.56	Fri Jan  8 21:24:58 2016
+++ src/doc/CHANGES-6.0.7	Fri Mar  4 19:09:25 2016
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.7,v 1.1.2.56 2016/01/08 21:24:58 snj Exp $
+# $NetBSD: CHANGES-6.0.7,v 1.1.2.57 2016/03/04 19:09:25 martin Exp $
 
 A complete list of changes from the NetBSD 6.0.6 release to the NetBSD 6.0.7
 release:
@@ -7115,3 +7115,9 @@ sys/arch/xen/xen/xennetback_xenbus.c		1.
 	possibly leading to arbitrary code execution in backend.
 	[bouyer, ticket #1358]
 
+
+external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h	(patch)
+	Auto-adjust configuration to 32bit/64bit systems.
+	[christos, ticket #1371]
+
+



CVS commit: [netbsd-6-0] src/external/bsd/ntp/dist/sntp/libevent/include/event2

2016-03-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar  4 19:08:31 UTC 2016

Modified Files:
src/external/bsd/ntp/dist/sntp/libevent/include/event2 [netbsd-6-0]:
event-config.h

Log Message:
Hack to adjust config automatically to 32bit and 64bit systems.
Requested by christos in #1371.


To generate a diff of this commit:
cvs rdiff -u -r1.1.6.2 -r1.1.6.3 \
src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h

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

Modified files:

Index: src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h
diff -u src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h:1.1.6.2 src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h:1.1.6.3
--- src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h:1.1.6.2	Sun Nov  8 00:16:05 2015
+++ src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h	Fri Mar  4 19:08:31 2016
@@ -438,25 +438,29 @@
 #define EVENT__SIZEOF_INT 4
 
 /* The size of `long', as computed by sizeof. */
+#ifdef _LP64
 #define EVENT__SIZEOF_LONG 8
+#else
+#define EVENT__SIZEOF_LONG 4
+#endif
 
 /* The size of `long long', as computed by sizeof. */
-#define EVENT__SIZEOF_LONG_LONG 8
+#define EVENT__SIZEOF_LONG_LONG EVENT__SIZEOF_LONG
 
 /* The size of `off_t', as computed by sizeof. */
-#define EVENT__SIZEOF_OFF_T 8
+#define EVENT__SIZEOF_OFF_T EVENT__SIZEOF_LONG
 
 /* The size of `pthread_t', as computed by sizeof. */
-#define EVENT__SIZEOF_PTHREAD_T 8
+#define EVENT__SIZEOF_PTHREAD_T EVENT__SIZEOF_LONG
 
 /* The size of `short', as computed by sizeof. */
 #define EVENT__SIZEOF_SHORT 2
 
 /* The size of `size_t', as computed by sizeof. */
-#define EVENT__SIZEOF_SIZE_T 8
+#define EVENT__SIZEOF_SIZE_T EVENT__SIZEOF_LONG
 
 /* The size of `void *', as computed by sizeof. */
-#define EVENT__SIZEOF_VOID_P 8
+#define EVENT__SIZEOF_VOID_P EVENT__SIZEOF_LONG
 
 /* Define to 1 if you have the ANSI C header files. */
 #define EVENT__STDC_HEADERS 1



CVS commit: [netbsd-6-1] src/doc

2016-03-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar  4 19:07:39 UTC 2016

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.6

Log Message:
Ticket #1371


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

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

Modified files:

Index: src/doc/CHANGES-6.1.6
diff -u src/doc/CHANGES-6.1.6:1.1.2.55 src/doc/CHANGES-6.1.6:1.1.2.56
--- src/doc/CHANGES-6.1.6:1.1.2.55	Fri Jan  8 21:25:54 2016
+++ src/doc/CHANGES-6.1.6	Fri Mar  4 19:07:39 2016
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.6,v 1.1.2.55 2016/01/08 21:25:54 snj Exp $
+# $NetBSD: CHANGES-6.1.6,v 1.1.2.56 2016/03/04 19:07:39 martin Exp $
 
 A complete list of changes from the NetBSD 6.1.5 release to the NetBSD 6.1.6
 release:
@@ -6835,3 +6835,9 @@ sys/arch/xen/xen/xennetback_xenbus.c		1.
 	possibly leading to arbitrary code execution in backend.
 	[bouyer, ticket #1358]
 
+
+external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h	(patch)
+	Auto-adjust configuration to 32bit/64bit systems.
+	[christos, ticket #1371]
+
+



CVS commit: [netbsd-6] src/doc

2016-03-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar  4 19:06:32 UTC 2016

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Fix path in previous


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.238 -r1.1.2.239 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.238 src/doc/CHANGES-6.2:1.1.2.239
--- src/doc/CHANGES-6.2:1.1.2.238	Fri Mar  4 19:04:09 2016
+++ src/doc/CHANGES-6.2	Fri Mar  4 19:06:32 2016
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.238 2016/03/04 19:04:09 martin Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.239 2016/03/04 19:06:32 martin Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -12753,7 +12753,7 @@ sys/arch/xen/xen/xennetback_xenbus.c		1.
 	possibly leading to arbitrary code execution in backend.
 	[bouyer, ticket #1358]
 
-external/bsd/ntp/dist/sntp/libevent/include/event-config.h	(patch)
+external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h	(patch)
 	Auto-adjust configuration to 32bit/64bit systems.
 	[christos, ticket #1371]
 



CVS commit: [netbsd-6-1] src/external/bsd/ntp/dist/sntp/libevent/include/event2

2016-03-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar  4 19:05:40 UTC 2016

Modified Files:
src/external/bsd/ntp/dist/sntp/libevent/include/event2 [netbsd-6-1]:
event-config.h

Log Message:
Hack to adjust config automatically to 32bit and 64bit systems.
Requested by christos in #1371.


To generate a diff of this commit:
cvs rdiff -u -r1.1.4.2 -r1.1.4.3 \
src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h

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

Modified files:

Index: src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h
diff -u src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h:1.1.4.2 src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h:1.1.4.3
--- src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h:1.1.4.2	Sat Nov  7 22:49:40 2015
+++ src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h	Fri Mar  4 19:05:40 2016
@@ -438,25 +438,29 @@
 #define EVENT__SIZEOF_INT 4
 
 /* The size of `long', as computed by sizeof. */
+#ifdef _LP64
 #define EVENT__SIZEOF_LONG 8
+#else
+#define EVENT__SIZEOF_LONG 4
+#endif
 
 /* The size of `long long', as computed by sizeof. */
-#define EVENT__SIZEOF_LONG_LONG 8
+#define EVENT__SIZEOF_LONG_LONG EVENT__SIZEOF_LONG
 
 /* The size of `off_t', as computed by sizeof. */
-#define EVENT__SIZEOF_OFF_T 8
+#define EVENT__SIZEOF_OFF_T EVENT__SIZEOF_LONG
 
 /* The size of `pthread_t', as computed by sizeof. */
-#define EVENT__SIZEOF_PTHREAD_T 8
+#define EVENT__SIZEOF_PTHREAD_T EVENT__SIZEOF_LONG
 
 /* The size of `short', as computed by sizeof. */
 #define EVENT__SIZEOF_SHORT 2
 
 /* The size of `size_t', as computed by sizeof. */
-#define EVENT__SIZEOF_SIZE_T 8
+#define EVENT__SIZEOF_SIZE_T EVENT__SIZEOF_LONG
 
 /* The size of `void *', as computed by sizeof. */
-#define EVENT__SIZEOF_VOID_P 8
+#define EVENT__SIZEOF_VOID_P EVENT__SIZEOF_LONG
 
 /* Define to 1 if you have the ANSI C header files. */
 #define EVENT__STDC_HEADERS 1



CVS commit: [netbsd-6] src/doc

2016-03-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar  4 19:04:09 UTC 2016

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Ticket #1371


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.237 -r1.1.2.238 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.237 src/doc/CHANGES-6.2:1.1.2.238
--- src/doc/CHANGES-6.2:1.1.2.237	Fri Jan  8 21:26:40 2016
+++ src/doc/CHANGES-6.2	Fri Mar  4 19:04:09 2016
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.237 2016/01/08 21:26:40 snj Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.238 2016/03/04 19:04:09 martin Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -12753,3 +12753,7 @@ sys/arch/xen/xen/xennetback_xenbus.c		1.
 	possibly leading to arbitrary code execution in backend.
 	[bouyer, ticket #1358]
 
+external/bsd/ntp/dist/sntp/libevent/include/event-config.h	(patch)
+	Auto-adjust configuration to 32bit/64bit systems.
+	[christos, ticket #1371]
+



CVS commit: [netbsd-6] src/external/bsd/ntp/dist/sntp/libevent/include/event2

2016-03-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar  4 19:01:20 UTC 2016

Modified Files:
src/external/bsd/ntp/dist/sntp/libevent/include/event2 [netbsd-6]:
event-config.h

Log Message:
Hack to adjust config automatically to 32bit and 64bit systems.
Requested by christos in #1371.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h

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

Modified files:

Index: src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h
diff -u src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h:1.1.2.1 src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h:1.1.2.2
--- src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h:1.1.2.1	Sat Nov  7 22:26:42 2015
+++ src/external/bsd/ntp/dist/sntp/libevent/include/event2/event-config.h	Fri Mar  4 19:01:20 2016
@@ -438,25 +438,29 @@
 #define EVENT__SIZEOF_INT 4
 
 /* The size of `long', as computed by sizeof. */
+#ifdef _LP64
 #define EVENT__SIZEOF_LONG 8
+#else
+#define EVENT__SIZEOF_LONG 4
+#endif
 
 /* The size of `long long', as computed by sizeof. */
-#define EVENT__SIZEOF_LONG_LONG 8
+#define EVENT__SIZEOF_LONG_LONG EVENT__SIZEOF_LONG
 
 /* The size of `off_t', as computed by sizeof. */
-#define EVENT__SIZEOF_OFF_T 8
+#define EVENT__SIZEOF_OFF_T EVENT__SIZEOF_LONG
 
 /* The size of `pthread_t', as computed by sizeof. */
-#define EVENT__SIZEOF_PTHREAD_T 8
+#define EVENT__SIZEOF_PTHREAD_T EVENT__SIZEOF_LONG
 
 /* The size of `short', as computed by sizeof. */
 #define EVENT__SIZEOF_SHORT 2
 
 /* The size of `size_t', as computed by sizeof. */
-#define EVENT__SIZEOF_SIZE_T 8
+#define EVENT__SIZEOF_SIZE_T EVENT__SIZEOF_LONG
 
 /* The size of `void *', as computed by sizeof. */
-#define EVENT__SIZEOF_VOID_P 8
+#define EVENT__SIZEOF_VOID_P EVENT__SIZEOF_LONG
 
 /* Define to 1 if you have the ANSI C header files. */
 #define EVENT__STDC_HEADERS 1



CVS commit: src/tests/net/net

2016-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar  4 18:52:01 UTC 2016

Modified Files:
src/tests/net/net: t_tcp.c

Log Message:
make it work on linux, be pickier about errors, and correct variable type.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/net/net/t_tcp.c

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

Modified files:

Index: src/tests/net/net/t_tcp.c
diff -u src/tests/net/net/t_tcp.c:1.3 src/tests/net/net/t_tcp.c:1.4
--- src/tests/net/net/t_tcp.c:1.3	Thu Oct 17 08:53:28 2013
+++ src/tests/net/net/t_tcp.c	Fri Mar  4 13:52:01 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_tcp.c,v 1.3 2013/10/17 12:53:28 christos Exp $	*/
+/*	$NetBSD: t_tcp.c,v 1.4 2016/03/04 18:52:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$Id: t_tcp.c,v 1.3 2013/10/17 12:53:28 christos Exp $");
+__RCSID("$Id: t_tcp.c,v 1.4 2016/03/04 18:52:01 christos Exp $");
 #endif
 
 /* Example code. Should block; does with accept not paccept. */
@@ -61,6 +61,10 @@ __RCSID("$Id: t_tcp.c,v 1.3 2013/10/17 1
 #define FAIL(msg, ...)  ATF_CHECK_MSG(0, msg, ## __VA_ARGS__); goto fail
 #endif
 
+#ifdef __linux__
+#define paccept(a, b, c, d, e) accept4((a), (b), (c), (e))
+#endif
+
 static void
 ding(int al)
 {
@@ -70,7 +74,8 @@ static void 
 paccept_block(bool pacceptblock, bool fcntlblock)
 {
 	int srvr = -1, clnt = -1, as = -1;
-	int ok, fl, n;
+	int ok, fl;
+	ssize_t n;
 	char buf[10];
 	struct sockaddr_in sin, ba;
 	struct sigaction sa;
@@ -105,10 +110,12 @@ paccept_block(bool pacceptblock, bool fc
 
 	/* may not connect first time */
 	ok = connect(clnt, (struct sockaddr *) , addrlen);
+	if (ok != -1 || errno != EINPROGRESS)
+		FAIL("expected connect to fail");
 	as = paccept(srvr, NULL, NULL, NULL, pacceptblock ? 0 : SOCK_NONBLOCK);
 	ok = connect(clnt, (struct sockaddr *) , addrlen);
 	if (ok == -1 && errno != EISCONN)
-		FAIL("both connects failed");
+		FAIL("connect failed");
 
 #if 0
 	fl = fcntl(srvr, F_GETFL, 0);



CVS commit: src/sys/external/bsd/compiler_rt/dist/lib/builtins

2016-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar  4 17:49:07 UTC 2016

Modified Files:
src/sys/external/bsd/compiler_rt/dist/lib/builtins: clzdi2.c ctzdi2.c

Log Message:
Fix infinite recursion caused by gcc lossage.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/compiler_rt/dist/lib/builtins/clzdi2.c \
src/sys/external/bsd/compiler_rt/dist/lib/builtins/ctzdi2.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/compiler_rt/dist/lib/builtins/clzdi2.c
diff -u src/sys/external/bsd/compiler_rt/dist/lib/builtins/clzdi2.c:1.1.1.1 src/sys/external/bsd/compiler_rt/dist/lib/builtins/clzdi2.c:1.2
--- src/sys/external/bsd/compiler_rt/dist/lib/builtins/clzdi2.c:1.1.1.1	Wed Feb 26 17:31:29 2014
+++ src/sys/external/bsd/compiler_rt/dist/lib/builtins/clzdi2.c	Fri Mar  4 12:49:06 2016
@@ -16,6 +16,12 @@
 
 /* Returns: the number of leading 0-bits */
 
+#if !defined(__clang__) && (defined(__sparc64__) || defined(__mips64))
+/* gcc resolves __builtin_clz -> __clzdi2 leading to infinite recursion */
+#define __builtin_clz(a) __clzsi2(a)
+extern si_int __clzsi2(si_int);
+#endif
+
 /* Precondition: a != 0 */
 
 COMPILER_RT_ABI si_int
Index: src/sys/external/bsd/compiler_rt/dist/lib/builtins/ctzdi2.c
diff -u src/sys/external/bsd/compiler_rt/dist/lib/builtins/ctzdi2.c:1.1.1.1 src/sys/external/bsd/compiler_rt/dist/lib/builtins/ctzdi2.c:1.2
--- src/sys/external/bsd/compiler_rt/dist/lib/builtins/ctzdi2.c:1.1.1.1	Wed Feb 26 17:31:29 2014
+++ src/sys/external/bsd/compiler_rt/dist/lib/builtins/ctzdi2.c	Fri Mar  4 12:49:06 2016
@@ -16,6 +16,12 @@
 
 /* Returns: the number of trailing 0-bits  */
 
+#if !defined(__clang__) && (defined(__sparc64__) || defined(__mips64))
+/* gcc resolves __builtin_ctz -> __ctzdi2 leading to infinite recursion */
+#define __builtin_ctz(a) __ctzsi2(a)
+extern si_int __ctzsi2(si_int);
+#endif
+
 /* Precondition: a != 0 */
 
 COMPILER_RT_ABI si_int



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2016-03-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Mar  4 15:30:17 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c

Log Message:
Appease KASSERTs


To generate a diff of this commit:
cvs rdiff -u -r1.32.2.20 -r1.32.2.21 src/sys/external/bsd/dwc2/dwc2.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/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.20 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.21
--- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.20	Tue Mar  1 14:45:10 2016
+++ src/sys/external/bsd/dwc2/dwc2.c	Fri Mar  4 15:30:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.32.2.20 2016/03/01 14:45:10 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.32.2.21 2016/03/04 15:30:17 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.20 2016/03/01 14:45:10 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.21 2016/03/04 15:30:17 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -700,7 +700,10 @@ dwc2_root_intr_close(struct usbd_pipe *p
 Static void
 dwc2_root_intr_done(struct usbd_xfer *xfer)
 {
+	struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
 
+	KASSERT(sc->sc_intrxfer != NULL);
+	sc->sc_intrxfer = NULL;
 	DPRINTF("\n");
 }