CVS commit: src

2015-05-29 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Fri May 29 07:37:32 UTC 2015

Modified Files:
src/include: limits.h
src/lib/libpthread: pthread.c pthread_int.h pthread_key_create.3
pthread_tsd.c
src/lib/libpthread_dbg: pthread_dbg.c

Log Message:
Make PTHREAD_KEYS_MAX dynamically adjustable

NetBSD's PTHREAD_KEYS_MAX is set to 256, which is low compared to
other systems like Linux (1024) or MacOS X (512). As a result some
setups tested on Linux will exhibit problems on NetBSD because of
pthread_keys usage beyond the limit. This happens for instance on
Apache with various module loaded, and in this case no particular
developper can be blamed for going beyond the limit, since several
modules from different sources contribute to the problem.

This patch makes the limit conigurable through the PTHREAD_KEYS_MAX
environement variable. If undefined, the default remains unchanged
(256). In any case, the value cannot be lowered below POSIX-mandated
_POSIX_THREAD_KEYS_MAX (128).

While there:
- use EXIT_FAILURE instead of 1 when calling err(3) in libpthread.
- Reset _POSIX_THREAD_KEYS_MAX to POSIX mandated 128, instead of 256.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/include/limits.h
cvs rdiff -u -r1.145 -r1.146 src/lib/libpthread/pthread.c
cvs rdiff -u -r1.90 -r1.91 src/lib/libpthread/pthread_int.h
cvs rdiff -u -r1.6 -r1.7 src/lib/libpthread/pthread_key_create.3
cvs rdiff -u -r1.11 -r1.12 src/lib/libpthread/pthread_tsd.c
cvs rdiff -u -r1.42 -r1.43 src/lib/libpthread_dbg/pthread_dbg.c

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

Modified files:

Index: src/include/limits.h
diff -u src/include/limits.h:1.33 src/include/limits.h:1.34
--- src/include/limits.h:1.33	Sun Nov 18 17:41:53 2012
+++ src/include/limits.h	Fri May 29 07:37:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: limits.h,v 1.33 2012/11/18 17:41:53 manu Exp $	*/
+/*	$NetBSD: limits.h,v 1.34 2015/05/29 07:37:31 manu Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -75,18 +75,20 @@
  */
 
 /*
- * The following 3 are not part of the standard
- * but left here for compatibility
+ * The following 3 are defined in 
+ * Open Group Base Specifications Issue 7
  */
 #define	_POSIX_THREAD_DESTRUCTOR_ITERATIONS	4
-#define	_POSIX_THREAD_KEYS_MAX			256
+#define	_POSIX_THREAD_KEYS_MAX			128
 #define	_POSIX_THREAD_THREADS_MAX		64
 
 /*
  * These are the correct names, defined in terms of the above
+ * except for PTHREAD_KEYS_MAX which is bigger than standard 
+ * mandated minimum value _POSIX_THREAD_KEYS_MAX.
  */
 #define	PTHREAD_DESTRUCTOR_ITERATIONS 	_POSIX_THREAD_DESTRUCTOR_ITERATIONS
-#define	PTHREAD_KEYS_MAX		_POSIX_THREAD_KEYS_MAX
+#define	PTHREAD_KEYS_MAX		256
 /* Not yet: PTHREAD_STACK_MIN */
 #define	PTHREAD_THREADS_MAX		_POSIX_THREAD_THREADS_MAX
 

Index: src/lib/libpthread/pthread.c
diff -u src/lib/libpthread/pthread.c:1.145 src/lib/libpthread/pthread.c:1.146
--- src/lib/libpthread/pthread.c:1.145	Tue Dec 16 20:05:54 2014
+++ src/lib/libpthread/pthread.c	Fri May 29 07:37:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.145 2014/12/16 20:05:54 pooka Exp $	*/
+/*	$NetBSD: pthread.c,v 1.146 2015/05/29 07:37:31 manu Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: pthread.c,v 1.145 2014/12/16 20:05:54 pooka Exp $);
+__RCSID($NetBSD: pthread.c,v 1.146 2015/05/29 07:37:31 manu Exp $);
 
 #define	__EXPOSE_STACK	1
 
@@ -116,7 +116,8 @@ int pthread__dbg;	/* set by libpthread_d
  */
 size_t	pthread__stacksize;
 size_t	pthread__pagesize;
-static struct __pthread_st pthread__main;
+static struct __pthread_st *pthread__main;
+static size_t __pthread_st_size;
 
 int _sys___sigprocmask14(int, const sigset_t *, sigset_t *);
 
@@ -165,6 +166,22 @@ pthread__init(void)
 	int i;
 	extern int __isthreaded;
 
+	/*
+	 * Allocate pthread_keys descriptors before
+	 * reseting __uselibcstub because otherwise 
+	 * malloc() will call pthread_keys_create()
+	 * while pthread_keys descriptors are not 
+	 * yet allocated.
+	 */
+	if (pthread_tsd_init() != 0)
+		err(EXIT_FAILURE, Cannot allocate pthread_keys descriptors);
+
+	__pthread_st_size = sizeof(*pthread__main)
+		 + pthread_keys_max * sizeof(pthread__main-pt_specific[0]);
+
+	if ((pthread__main = calloc(1, __pthread_st_size)) == NULL)
+		err(EXIT_FAILURE, Cannot allocate pthread__specific);
+
 	__uselibcstub = 0;
 
 	pthread__pagesize = (size_t)sysconf(_SC_PAGESIZE);
@@ -179,7 +196,7 @@ pthread__init(void)
 	/* Fetch parameters. */
 	i = (int)_lwp_unpark_all(NULL, 0, NULL);
 	if (i == -1)
-		err(1, _lwp_unpark_all);
+		err(EXIT_FAILURE, _lwp_unpark_all);
 	if (i  pthread__unpark_max)
 		pthread__unpark_max = i;
 
@@ -200,7 +217,7 @@ pthread__init(void)
 	(void)rb_tree_insert_node(pthread__alltree, first);
 
 	if (_lwp_ctl(LWPCTL_FEATURE_CURCPU, first-pt_lwpctl) != 0) {
-		err(1, _lwp_ctl);
+		

CVS commit: src/distrib/common

2015-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri May 29 06:28:50 UTC 2015

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
Put a full init /dev on the CD, not just all. The install environment
relies on it currently. (XXX fix that and revert this)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/distrib/common/Makefile.bootcd

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

Modified files:

Index: src/distrib/common/Makefile.bootcd
diff -u src/distrib/common/Makefile.bootcd:1.31 src/distrib/common/Makefile.bootcd:1.32
--- src/distrib/common/Makefile.bootcd:1.31	Wed May 27 15:17:59 2015
+++ src/distrib/common/Makefile.bootcd	Fri May 29 06:28:50 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.31 2015/05/27 15:17:59 martin Exp $
+#	$NetBSD: Makefile.bootcd,v 1.32 2015/05/29 06:28:50 martin Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -265,7 +265,7 @@ image:
 		 -e '/^\.\/etc\/gettytab/d'  ${WORKSPEC};	\
 	fi
 	if [ -r cdrom/dev/MAKEDEV ]; then			\
-		${HOST_SH} cdrom/dev/MAKEDEV -s all |		\
+		${HOST_SH} cdrom/dev/MAKEDEV -s init |		\
 		${TOOL_SED} -e '/^\. type=dir/d' 		\
 			-e 's,^\.,./dev,'  ${WORKSPEC};	\
 	fi



CVS commit: src/lib/libintl

2015-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 29 12:26:28 UTC 2015

Modified Files:
src/lib/libintl: gettext.c libintl.h textdomain.c

Log Message:
Patch from William Orr in tech-userlevel:

- Added most *p*gettext functions
- Added basic function to concat msgctxt and msgid
- Simplify free handling

Need to write tests.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libintl/gettext.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libintl/libintl.h
cvs rdiff -u -r1.13 -r1.14 src/lib/libintl/textdomain.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/libintl/gettext.c
diff -u src/lib/libintl/gettext.c:1.28 src/lib/libintl/gettext.c:1.29
--- src/lib/libintl/gettext.c:1.28	Mon Jul 30 19:04:42 2012
+++ src/lib/libintl/gettext.c	Fri May 29 08:26:28 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: gettext.c,v 1.28 2012/07/30 23:04:42 yamt Exp $	*/
+/*	$NetBSD: gettext.c,v 1.29 2015/05/29 12:26:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 Citrus Project,
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: gettext.c,v 1.28 2012/07/30 23:04:42 yamt Exp $);
+__RCSID($NetBSD: gettext.c,v 1.29 2015/05/29 12:26:28 christos Exp $);
 
 #include sys/param.h
 #include sys/stat.h
@@ -51,6 +51,16 @@ __RCSID($NetBSD: gettext.c,v 1.28 2012/
 #include plural_parser.h
 #include pathnames.h
 
+/* GNU gettext added a hack to add some context to messages. If a message is
+ * used in multiple locations, it needs some amount of context to make the
+ * translation clear to translators. GNU gettext, rather than modifying the
+ * message format, concatenates the context, \004 and the message id.
+ */
+#define	MSGCTXT_ID_SEPARATOR	'\004'
+
+static const char *pgettext_impl(const char *, const char *, const char *,
+const char *, unsigned long int, int);
+static char *concatenate_ctxt_id(const char *, const char *);
 static const char *lookup_category(int);
 static const char *split_locale(const char *);
 static const char *lookup_mofile(char *, size_t, const char *, const char *,
@@ -105,6 +115,73 @@ dngettext(const char *domainname, const 
 	return dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES);
 }
 
+const char *
+pgettext(const char *msgctxt, const char *msgid)
+{
+
+	return pgettext_impl(NULL, msgctxt, msgid, NULL, 1UL, LC_MESSAGES);
+}
+
+const char *
+dpgettext(const char *domainname, const char *msgctxt, const char *msgid)
+{
+
+	return pgettext_impl(domainname, msgctxt, msgid, NULL, 1UL, LC_MESSAGES);
+}
+
+const char *
+dcpgettext(const char *domainname, const char *msgctxt, const char *msgid,
+	int category)
+{
+
+	return pgettext_impl(domainname, msgctxt, msgid, NULL, 1UL, category);
+}
+
+const char *
+npgettext(const char *msgctxt, const char *msgid1, const char *msgid2,
+	unsigned long int n)
+{
+
+	return pgettext_impl(NULL, msgctxt, msgid1, msgid2, n, LC_MESSAGES);
+}
+
+const char *
+dnpgettext(const char *domainname, const char *msgctxt, const char *msgid1,
+	const char *msgid2, unsigned long int n)
+{
+
+	return pgettext_impl(domainname, msgctxt, msgid1, msgid2, n, LC_MESSAGES);
+}
+
+const char *
+dcnpgettext(const char *domainname, const char *msgctxt, const char *msgid1,
+	const char *msgid2, unsigned long int n, int category)
+{
+
+	return pgettext_impl(domainname, msgctxt, msgid1, msgid2, n, category);
+}
+
+static const char *
+pgettext_impl(const char *domainname, const char *msgctxt, const char *msgid1,
+	const char *msgid2, unsigned long int n, int category)
+{
+	char *msgctxt_id;
+	char *translation;
+	char *p;
+
+	if ((msgctxt_id = concatenate_ctxt_id(msgctxt, msgid1)) == NULL)
+		return msgid1;
+
+	translation = dcngettext(domainname, msgctxt_id,
+		msgid2, n, category);
+	free(msgctxt_id);
+
+	p = strchr(translation, '\004');
+	if (p)
+		return p + 1;
+	return translation;
+}
+
 /*
  * dcngettext() -
  * lookup internationalized message on database locale/category/domainname
@@ -126,6 +203,17 @@ dngettext(const char *domainname, const 
  * /usr/share/locale! (or we should move those files into /usr/libdata)
  */
 
+static char *
+concatenate_ctxt_id(const char *msgctxt, const char *msgid)
+{
+	char *ret;
+
+	if (asprintf(ret, %s%c%s, msgctxt, MSGCTXT_ID_SEPARATOR, msgid) == -1)
+		return NULL;
+
+	return ret;
+}
+
 static const char *
 lookup_category(int category)
 {
@@ -659,12 +747,13 @@ fail:
 static void
 free_sysdep_table(struct mosysdepstr_h **table, uint32_t nstring)
 {
-	uint32_t i;
 
-	for (i=0; instring; i++) {
+	if (! table)
+		return;
+
+	for (uint32_t i = 0; i  nstring; i++) {
 		if (table[i]) {
-			if (table[i]-expanded)
-free(table[i]-expanded);
+			free(table[i]-expanded);
 			free(table[i]);
 		}
 	}
@@ -680,26 +769,16 @@ unmapit(struct domainbinding *db)
 	if (mohandle-addr  mohandle-addr != MAP_FAILED)
 		munmap(mohandle-addr, mohandle-len);
 	mohandle-addr = NULL;
-	if (mohandle-mo.mo_otable)
-		

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

2015-05-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri May 29 12:41:14 UTC 2015

Modified Files:
src/sys/arch/arm/amlogic: amlogic_crureg.h amlogic_gpio.c

Log Message:
Fix pin group mappings and non-DIAGNOSTIC kernel builds, from anon ymous.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/amlogic/amlogic_crureg.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/amlogic/amlogic_gpio.c

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

Modified files:

Index: src/sys/arch/arm/amlogic/amlogic_crureg.h
diff -u src/sys/arch/arm/amlogic/amlogic_crureg.h:1.10 src/sys/arch/arm/amlogic/amlogic_crureg.h:1.11
--- src/sys/arch/arm/amlogic/amlogic_crureg.h:1.10	Sat Apr 25 14:41:33 2015
+++ src/sys/arch/arm/amlogic/amlogic_crureg.h	Fri May 29 12:41:14 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_crureg.h,v 1.10 2015/04/25 14:41:33 jmcneill Exp $ */
+/* $NetBSD: amlogic_crureg.h,v 1.11 2015/05/29 12:41:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill jmcne...@invisible.ca
@@ -85,26 +85,22 @@
 #define PREG_PAD_GPIO0_EN_N_REG		CBUS_REG(0x200c)
 #define PREG_PAD_GPIO0_OUT_REG		CBUS_REG(0x200d)
 #define PREG_PAD_GPIO0_IN_REG		CBUS_REG(0x200e)
-#define PREG_PAD_GPIO0_PUPD_EN_REG	CBUS_REG(0x204c)
-#define PREG_PAD_GPIO0_PUPD_REG		CBUS_REG(0x203e)
 
 #define PREG_PAD_GPIO1_EN_N_REG		CBUS_REG(0x200f)
 #define PREG_PAD_GPIO1_OUT_REG		CBUS_REG(0x2010)
 #define PREG_PAD_GPIO1_IN_REG		CBUS_REG(0x2011)
-#define PREG_PAD_GPIO1_PUPD_EN_REG	CBUS_REG(0x204b)
-#define PREG_PAD_GPIO1_PUPD_REG		CBUS_REG(0x203d)
 
 #define PREG_PAD_GPIO2_EN_N_REG		CBUS_REG(0x2012)
 #define PREG_PAD_GPIO2_OUT_REG		CBUS_REG(0x2013)
 #define PREG_PAD_GPIO2_IN_REG		CBUS_REG(0x2014)
-#define PREG_PAD_GPIO2_PUPD_EN_REG	CBUS_REG(0x2048)
-#define PREG_PAD_GPIO2_PUPD_REG		CBUS_REG(0x203a)
 
 #define PREG_PAD_GPIO3_EN_N_REG		CBUS_REG(0x2015)
 #define PREG_PAD_GPIO3_OUT_REG		CBUS_REG(0x2016)
 #define PREG_PAD_GPIO3_IN_REG		CBUS_REG(0x2017)
-#define PREG_PAD_GPIO3_PUPD_EN_REG	CBUS_REG(0x204a)
-#define PREG_PAD_GPIO3_PUPD_REG		CBUS_REG(0x203c)
+
+#define PREG_PAD_GPIO4_EN_N_REG		CBUS_REG(0x2018)
+#define PREG_PAD_GPIO4_OUT_REG		CBUS_REG(0x2019)
+#define PREG_PAD_GPIO4_IN_REG		CBUS_REG(0x201a)
 
 #define PREG_PAD_GPIO5_EN_N_REG		CBUS_REG(0x201b)
 #define PREG_PAD_GPIO5_OUT_REG		CBUS_REG(0x201c)

Index: src/sys/arch/arm/amlogic/amlogic_gpio.c
diff -u src/sys/arch/arm/amlogic/amlogic_gpio.c:1.1 src/sys/arch/arm/amlogic/amlogic_gpio.c:1.2
--- src/sys/arch/arm/amlogic/amlogic_gpio.c:1.1	Sat Apr 25 14:41:33 2015
+++ src/sys/arch/arm/amlogic/amlogic_gpio.c	Fri May 29 12:41:14 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_gpio.c,v 1.1 2015/04/25 14:41:33 jmcneill Exp $ */
+/* $NetBSD: amlogic_gpio.c,v 1.2 2015/05/29 12:41:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill jmcne...@invisible.ca
@@ -29,7 +29,7 @@
 #include locators.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: amlogic_gpio.c,v 1.1 2015/04/25 14:41:33 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: amlogic_gpio.c,v 1.2 2015/05/29 12:41:14 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -66,26 +66,26 @@ const struct amlogic_gpio_pingrp {
 	  _C(PREG_PAD_GPIO0_EN_N_REG), 0,
 	  _C(PREG_PAD_GPIO0_OUT_REG), 0,
 	  _C(PREG_PAD_GPIO0_IN_REG), 0,
-	  _C(PREG_PAD_GPIO0_PUPD_EN_REG), 0,
-	  _C(PREG_PAD_GPIO0_PUPD_REG), 0 },
+	  _C(PAD_PULL_UP_EN_4_REG), 0,
+	  _C(PAD_PULL_UP_4_REG), 0 },
 	{ GPIOY, 0x7fff,
 	  _C(PREG_PAD_GPIO1_EN_N_REG), 0,
 	  _C(PREG_PAD_GPIO1_OUT_REG), 0,
 	  _C(PREG_PAD_GPIO1_IN_REG), 0,
-	  _C(PREG_PAD_GPIO1_PUPD_EN_REG), 0,
-	  _C(PREG_PAD_GPIO1_PUPD_REG), 0 },
+	  _C(PAD_PULL_UP_EN_3_REG), 0,
+	  _C(PAD_PULL_UP_3_REG), 0 },
 	{ GPIODV, 0x3f000200,
-	  _C(PREG_PAD_GPIO1_EN_N_REG), 0,
-	  _C(PREG_PAD_GPIO1_OUT_REG), 0,
-	  _C(PREG_PAD_GPIO1_IN_REG), 0,
-	  _C(PREG_PAD_GPIO1_PUPD_EN_REG), 0,
-	  _C(PREG_PAD_GPIO1_PUPD_REG), 0 },
+	  _C(PREG_PAD_GPIO2_EN_N_REG), 0,
+	  _C(PREG_PAD_GPIO2_OUT_REG), 0,
+	  _C(PREG_PAD_GPIO2_IN_REG), 0,
+	  _C(PAD_PULL_UP_EN_0_REG), 0,
+	  _C(PAD_PULL_UP_0_REG), 0 },
 	{ GPIOH, 0x3f,
 	  _C(PREG_PAD_GPIO3_EN_N_REG), 19,
 	  _C(PREG_PAD_GPIO3_OUT_REG), 19,
 	  _C(PREG_PAD_GPIO3_IN_REG), 19,
-	  _C(PREG_PAD_GPIO3_PUPD_EN_REG), 16,
-	  _C(PREG_PAD_GPIO3_PUPD_REG), 16 },
+	  _C(PAD_PULL_UP_EN_1_REG), 16,
+	  _C(PAD_PULL_UP_1_REG), 16 },
 	{ GPIOAO, 0x3fff,
 	  _AO(AMLOGIC_GPIOAO_EN_N_REG), 0,
 	  _AO(AMLOGIC_GPIOAO_OUT_REG), 16,
@@ -96,14 +96,14 @@ const struct amlogic_gpio_pingrp {
 	  _C(PREG_PAD_GPIO3_EN_N_REG), 0,
 	  _C(PREG_PAD_GPIO3_OUT_REG), 0,
 	  _C(PREG_PAD_GPIO3_IN_REG), 0,
-	  _C(PREG_PAD_GPIO3_PUPD_EN_REG), 0,
-	  _C(PREG_PAD_GPIO3_PUPD_REG), 0 },
+	  _C(PAD_PULL_UP_EN_2_REG), 0,
+	  _C(PAD_PULL_UP_2_REG), 0 },
 	{ CARD, 0x7f,
 	  _C(PREG_PAD_GPIO0_EN_N_REG), 22,
 	  _C(PREG_PAD_GPIO0_OUT_REG), 22,
 	  _C(PREG_PAD_GPIO0_IN_REG), 22,
-	  _C(PREG_PAD_GPIO0_PUPD_EN_REG), 20,
-	  _C(PREG_PAD_GPIO0_PUPD_REG), 20 }

CVS commit: src/sys/rump/net

2015-05-29 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri May 29 12:32:23 UTC 2015

Modified Files:
src/sys/rump/net: Makefile.rumpnetcomp
Added Files:
src/sys/rump/net/lib/libtap: Makefile tap_component.c

Log Message:
Add a rump kernel component for the tap device.

from Wei Liu wei.l...@citrix.com via private email


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/rump/net/Makefile.rumpnetcomp
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libtap/Makefile \
src/sys/rump/net/lib/libtap/tap_component.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/rump/net/Makefile.rumpnetcomp
diff -u src/sys/rump/net/Makefile.rumpnetcomp:1.10 src/sys/rump/net/Makefile.rumpnetcomp:1.11
--- src/sys/rump/net/Makefile.rumpnetcomp:1.10	Sat Nov 16 14:00:57 2013
+++ src/sys/rump/net/Makefile.rumpnetcomp	Fri May 29 12:32:23 2015
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile.rumpnetcomp,v 1.10 2013/11/16 14:00:57 rmind Exp $
+#	$NetBSD: Makefile.rumpnetcomp,v 1.11 2015/05/29 12:32:23 pooka Exp $
 #
 
 .include bsd.own.mk
 
 RUMPNETCOMP=	agr bridge net net80211 netbt netinet netinet6
-RUMPNETCOMP+=	netmpls npf local shmif
+RUMPNETCOMP+=	netmpls npf local shmif tap
 
 .if ${MKSLJIT} != no
 RUMPNETCOMP+=	bpfjit

Added files:

Index: src/sys/rump/net/lib/libtap/Makefile
diff -u /dev/null src/sys/rump/net/lib/libtap/Makefile:1.1
--- /dev/null	Fri May 29 12:32:23 2015
+++ src/sys/rump/net/lib/libtap/Makefile	Fri May 29 12:32:23 2015
@@ -0,0 +1,15 @@
+#	$NetBSD: Makefile,v 1.1 2015/05/29 12:32:23 pooka Exp $
+#
+
+.PATH:	${.CURDIR}/../../../../net
+
+LIB=	rumpnet_tap
+
+SRCS=	if_tap.c
+
+SRCS+=	tap_component.c
+
+CPPFLAGS+=	-I${.CURDIR}/../libnet/opt -I${.CURDIR}/../../../librump/rumpvfs
+
+.include bsd.lib.mk
+.include bsd.klinks.mk
Index: src/sys/rump/net/lib/libtap/tap_component.c
diff -u /dev/null src/sys/rump/net/lib/libtap/tap_component.c:1.1
--- /dev/null	Fri May 29 12:32:23 2015
+++ src/sys/rump/net/lib/libtap/tap_component.c	Fri May 29 12:32:23 2015
@@ -0,0 +1,64 @@
+/*	$NetBSD: tap_component.c,v 1.1 2015/05/29 12:32:23 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2015 Wei Liu.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: tap_component.c,v 1.1 2015/05/29 12:32:23 pooka Exp $);
+
+#include sys/param.h
+#include sys/device.h
+#include sys/stat.h
+
+#include rump_private.h
+#include rump_net_private.h
+#include rump_vfs_private.h
+
+CFDRIVER_DECL(tap, DV_IFNET, NULL);
+
+void tapattach(int);
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
+{
+	extern const struct cdevsw tap_cdevsw;
+	devmajor_t bmaj, cmaj;
+	int error;
+
+	config_cfdriver_attach(tap_cd);
+	tapattach(0);
+
+	bmaj = cmaj = NODEVMAJOR;
+	error = devsw_attach(tap, NULL, bmaj, tap_cdevsw, cmaj);
+	if (error != 0)
+		panic(tap devsw attach failed: %d, error);
+
+	error = rump_vfs_makeonedevnode(S_IFCHR, /dev/tap, cmaj, 0xf);
+	if (error != 0)
+		panic(cannot create tap device node: %d, error);
+
+	error = rump_vfs_makedevnodes(S_IFCHR, /dev/tap, '0', cmaj, 0, 4);
+	if (error != 0)
+		panic(cannot create tap[0-4] device node: %d, error);
+}



CVS commit: src/distrib/sets/lists

2015-05-29 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri May 29 12:38:18 UTC 2015

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/comp: mi shl.mi
src/distrib/sets/lists/debug: mi shl.mi

Log Message:
game of setlists for rumpnet_tap


To generate a diff of this commit:
cvs rdiff -u -r1.737 -r1.738 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.1961 -r1.1962 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.273 -r1.274 src/distrib/sets/lists/comp/shl.mi
cvs rdiff -u -r1.115 -r1.116 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.98 -r1.99 src/distrib/sets/lists/debug/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.737 src/distrib/sets/lists/base/shl.mi:1.738
--- src/distrib/sets/lists/base/shl.mi:1.737	Fri May 29 12:28:08 2015
+++ src/distrib/sets/lists/base/shl.mi	Fri May 29 12:38:18 2015
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.737 2015/05/29 12:28:08 christos Exp $
+# $NetBSD: shl.mi,v 1.738 2015/05/29 12:38:18 pooka Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -721,6 +721,9 @@
 ./usr/lib/librumpnet_sockin.so			base-rump-shlib	rump
 ./usr/lib/librumpnet_sockin.so.0		base-rump-shlib	rump
 ./usr/lib/librumpnet_sockin.so.0.0		base-rump-shlib	rump
+./usr/lib/librumpnet_tap.so			base-rump-shlib	rump
+./usr/lib/librumpnet_tap.so.0		base-rump-shlib	rump
+./usr/lib/librumpnet_tap.so.0.0		base-rump-shlib	rump
 ./usr/lib/librumpnet_virtif.so			base-rump-shlib	rump
 ./usr/lib/librumpnet_virtif.so.0		base-rump-shlib	rump
 ./usr/lib/librumpnet_virtif.so.0.0		base-rump-shlib	rump

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1961 src/distrib/sets/lists/comp/mi:1.1962
--- src/distrib/sets/lists/comp/mi:1.1961	Sun May 24 22:23:01 2015
+++ src/distrib/sets/lists/comp/mi	Fri May 29 12:38:18 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1961 2015/05/24 22:23:01 christos Exp $
+#	$NetBSD: mi,v 1.1962 2015/05/29 12:38:18 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -3914,6 +3914,8 @@
 ./usr/lib/librumpnet_shmif_p.a			comp-c-proflib		profile,rump
 ./usr/lib/librumpnet_sockin.a			comp-c-lib		rump
 ./usr/lib/librumpnet_sockin_p.a			comp-c-proflib		profile,rump
+./usr/lib/librumpnet_tap.a			comp-c-lib		rump
+./usr/lib/librumpnet_tap_p.a			comp-c-proflib		profile,rump
 ./usr/lib/librumpnet_virtif.a			comp-c-lib		rump
 ./usr/lib/librumpnet_virtif_p.a			comp-c-proflib		profile,rump
 ./usr/lib/librumpuser.acomp-c-lib		rump

Index: src/distrib/sets/lists/comp/shl.mi
diff -u src/distrib/sets/lists/comp/shl.mi:1.273 src/distrib/sets/lists/comp/shl.mi:1.274
--- src/distrib/sets/lists/comp/shl.mi:1.273	Sun Jan 25 15:50:30 2015
+++ src/distrib/sets/lists/comp/shl.mi	Fri May 29 12:38:18 2015
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.273 2015/01/25 15:50:30 christos Exp $
+# $NetBSD: shl.mi,v 1.274 2015/05/29 12:38:18 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -229,6 +229,7 @@
 ./usr/lib/librumpnet_pic.a			comp-c-piclib		rump,picinstall
 ./usr/lib/librumpnet_shmif_pic.a		comp-c-piclib		rump,picinstall
 ./usr/lib/librumpnet_sockin_pic.a		comp-c-piclib		rump,picinstall
+./usr/lib/librumpnet_tap_pic.a		comp-c-piclib		rump,picinstall
 ./usr/lib/librumpnet_virtif_pic.a		comp-c-piclib		rump,picinstall
 ./usr/lib/librumpuser_pic.a			comp-c-piclib		rump,picinstall
 ./usr/lib/librumpvfs_aio_pic.a		comp-c-piclib		rump,picinstall

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.115 src/distrib/sets/lists/debug/mi:1.116
--- src/distrib/sets/lists/debug/mi:1.115	Tue May 26 22:04:32 2015
+++ src/distrib/sets/lists/debug/mi	Fri May 29 12:38:18 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.115 2015/05/26 22:04:32 htodd Exp $
+# $NetBSD: mi,v 1.116 2015/05/29 12:38:18 pooka Exp $
 
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib
@@ -217,6 +217,7 @@
 ./usr/lib/librumpnet_npf_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpnet_shmif_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpnet_sockin_g.a			comp-c-debuglib		debuglib,rump
+./usr/lib/librumpnet_tap_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpnet_virtif_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpuser_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpvfs_aio_g.a			comp-c-debuglib		debuglib,rump

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.98 src/distrib/sets/lists/debug/shl.mi:1.99
--- src/distrib/sets/lists/debug/shl.mi:1.98	Fri May 29 12:28:08 2015
+++ src/distrib/sets/lists/debug/shl.mi	Fri May 29 12:38:18 2015
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.98 2015/05/29 12:28:08 christos Exp $
+# 

CVS commit: src/distrib/sets/lists/debug

2015-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri May 29 13:41:39 UTC 2015

Modified Files:
src/distrib/sets/lists/debug: ad.arm

Log Message:
Fix compat debug lists for ARM


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/distrib/sets/lists/debug/ad.arm

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

Modified files:

Index: src/distrib/sets/lists/debug/ad.arm
diff -u src/distrib/sets/lists/debug/ad.arm:1.63 src/distrib/sets/lists/debug/ad.arm:1.64
--- src/distrib/sets/lists/debug/ad.arm:1.63	Fri May 29 12:28:08 2015
+++ src/distrib/sets/lists/debug/ad.arm	Fri May 29 13:41:39 2015
@@ -1,18 +1,158 @@
-# $NetBSD: ad.arm,v 1.63 2015/05/29 12:28:08 christos Exp $
+# $NetBSD: ad.arm,v 1.64 2015/05/29 13:41:39 martin Exp $
 ./usr/lib/libarm_g.acomp-c-debuglib		debuglib
 ./usr/lib/libc_vfp_g.acomp-c-debuglib		debuglib,softfloat
 ./usr/lib/libpmc_g.acomp-c-debuglib		debuglib
+./usr/lib/oabi/i18n/libBIG5_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libDECHanyu_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libEUCTW_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libEUC_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libGBK2K_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libHZ_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libISO2022_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libJOHAB_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libMSKanji_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libUES_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libUTF1632_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libUTF7_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libUTF8_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libVIQR_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libZW_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libiconv_none_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libiconv_std_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libmapper_646_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libmapper_none_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libmapper_parallel_g.a	comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libmapper_serial_g.a	comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libmapper_std_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/i18n/libmapper_zone_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libamu_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libarchive_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libarm_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libasan_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libasn1_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libatf-c++_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libatf-c_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libbfd_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libbind9_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libblacklist_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libbluetooth_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libbsdmalloc_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libbz2_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libc_g.acomp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libc_vfp_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libcom_err_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libcompat_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libcrypt_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libcrypto_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libcurses_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libdes_g.a			comp-c-debuglib		compat,debuglib
 ./usr/lib/oabi/libdevmapper_g.a			comp-c-debuglib		compat,debuglib,lvm
 ./usr/lib/oabi/libdm_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libdns_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libdns_sd_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libdwarf_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libedit_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libelf_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libevent_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libevent_openssl_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libevent_pthreads_g.a		comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libexecinfo_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libexpat_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libfetch_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libfl_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libform_g.a			comp-c-debuglib		compat,debuglib
+./usr/lib/oabi/libgcc_eh_g.a			comp-c-debuglib		

CVS commit: src/share/mk

2015-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri May 29 14:15:14 UTC 2015

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Enable MKCOMPAT for earm*, now that it works. Ok: matt@


To generate a diff of this commit:
cvs rdiff -u -r1.851 -r1.852 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.851 src/share/mk/bsd.own.mk:1.852
--- src/share/mk/bsd.own.mk:1.851	Thu May 28 14:36:45 2015
+++ src/share/mk/bsd.own.mk	Fri May 29 14:15:14 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.851 2015/05/28 14:36:45 rjs Exp $
+#	$NetBSD: bsd.own.mk,v 1.852 2015/05/29 14:15:14 martin Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -899,7 +899,7 @@ MK${var}:=	yes
 || ${MACHINE_ARCH} == riscv64
 MKCOMPAT?=	yes
 .elif !empty(MACHINE_ARCH:Mearm*)
-MKCOMPAT?=	no
+MKCOMPAT?=	yes
 .else
 # Don't let this build where it really isn't supported.
 MKCOMPAT:=	no



CVS commit: src/distrib/sets/lists/xdebug

2015-05-29 Thread Hisashi T Fujinaka
Module Name:src
Committed By:   htodd
Date:   Fri May 29 13:55:54 UTC 2015

Modified Files:
src/distrib/sets/lists/xdebug: md.i386

Log Message:
Fix debug build - something isn't right in the radeon build.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/distrib/sets/lists/xdebug/md.i386

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

Modified files:

Index: src/distrib/sets/lists/xdebug/md.i386
diff -u src/distrib/sets/lists/xdebug/md.i386:1.14 src/distrib/sets/lists/xdebug/md.i386:1.15
--- src/distrib/sets/lists/xdebug/md.i386:1.14	Thu May 28 14:36:45 2015
+++ src/distrib/sets/lists/xdebug/md.i386	Fri May 29 13:55:54 2015
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.14 2015/05/28 14:36:45 rjs Exp $
+# $NetBSD: md.i386,v 1.15 2015/05/29 13:55:54 htodd Exp $
 ./usr/X11R6/lib/modules/extensions/libGLcore_g.a	-unknown-	debuglib,x11
 ./usr/X11R6/lib/modules/extensions/libdbe_g.a		-unknown-	debuglib,x11
 ./usr/X11R6/lib/modules/extensions/libextmod_g.a	-unknown-	debuglib,x11
@@ -197,7 +197,7 @@
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/nv_drv.so.2.debug	-unknown-		xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/openchrome_drv.so.0.debug	-unknown-		xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/r128_drv.so.6.debug	-unknown-		xorg,debug
-./usr/libdata/debug/usr/X11R7/lib/modules/drivers/radeon_drv.so.6.debug	-unknown-		xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/radeon_drv_old.so.6.debug	-unknown-		xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/radeon_drv.so.7.debug	-unknown-		xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/radeonhd_drv.so.1.debug	-unknown-		xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/s3_drv.so.0.debug	-unknown-		xorg,debug



CVS commit: src/sys/dev

2015-05-29 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri May 29 16:26:45 UTC 2015

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

Log Message:
for some reason the previous commit causes ARCS firmware on sgimips64 to
spew an endless stream of white ( or rather, blue ) spaces. So revert to
the old code for sgimips only until I can figure out why.
Now sgimips64 n32 kernels boot again.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/cons.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/cons.c
diff -u src/sys/dev/cons.c:1.74 src/sys/dev/cons.c:1.75
--- src/sys/dev/cons.c:1.74	Thu Mar  5 14:02:55 2015
+++ src/sys/dev/cons.c	Fri May 29 16:26:45 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cons.c,v 1.74 2015/03/05 14:02:55 nakayama Exp $	*/
+/*	$NetBSD: cons.c,v 1.75 2015/05/29 16:26:45 macallan Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cons.c,v 1.74 2015/03/05 14:02:55 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: cons.c,v 1.75 2015/05/29 16:26:45 macallan Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -321,6 +321,13 @@ cnputc(int c)
 	if (cn_tab == NULL)
 		return;
 
+/*
+ * XXX
+ * for some reason this causes ARCS firmware to output an endless stream of
+ * whitespaces with n32 kernels, so use the pre-1.74 code for now until I can
+ * figure out why this happens
+ */
+#ifndef sgimips
 	if (c) {
 		if (c == '\n') {
 			(*cn_tab-cn_putc)(cn_tab-cn_dev, '\r');
@@ -328,6 +335,15 @@ cnputc(int c)
 		}
 		(*cn_tab-cn_putc)(cn_tab-cn_dev, c);
 	}
+#else
+	if (c) {
+		(*cn_tab-cn_putc)(cn_tab-cn_dev, c);
+		if (c == '\n') {
+			docritpollhooks();
+			(*cn_tab-cn_putc)(cn_tab-cn_dev, '\r');
+		}
+	}
+#endif
 }
 
 void



CVS commit: src/lib/libpthread

2015-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 29 16:05:13 UTC 2015

Modified Files:
src/lib/libpthread: pthread.c pthread_int.h pthread_tsd.c

Log Message:
Fix previous: Can't use calloc/malloc before we complete initialization
of the thread library, because malloc uses pthread_foo_specific, and it will
end up initializing itself incorrectly.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/lib/libpthread/pthread.c
cvs rdiff -u -r1.91 -r1.92 src/lib/libpthread/pthread_int.h
cvs rdiff -u -r1.12 -r1.13 src/lib/libpthread/pthread_tsd.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/libpthread/pthread.c
diff -u src/lib/libpthread/pthread.c:1.146 src/lib/libpthread/pthread.c:1.147
--- src/lib/libpthread/pthread.c:1.146	Fri May 29 03:37:31 2015
+++ src/lib/libpthread/pthread.c	Fri May 29 12:05:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.146 2015/05/29 07:37:31 manu Exp $	*/
+/*	$NetBSD: pthread.c,v 1.147 2015/05/29 16:05:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: pthread.c,v 1.146 2015/05/29 07:37:31 manu Exp $);
+__RCSID($NetBSD: pthread.c,v 1.147 2015/05/29 16:05:13 christos Exp $);
 
 #define	__EXPOSE_STACK	1
 
@@ -173,14 +173,9 @@ pthread__init(void)
 	 * while pthread_keys descriptors are not 
 	 * yet allocated.
 	 */
-	if (pthread_tsd_init() != 0)
-		err(EXIT_FAILURE, Cannot allocate pthread_keys descriptors);
-
-	__pthread_st_size = sizeof(*pthread__main)
-		 + pthread_keys_max * sizeof(pthread__main-pt_specific[0]);
-
-	if ((pthread__main = calloc(1, __pthread_st_size)) == NULL)
-		err(EXIT_FAILURE, Cannot allocate pthread__specific);
+	pthread__main = pthread_tsd_init(__pthread_st_size);
+	if (pthread__main == NULL)
+		err(EXIT_FAILURE, Cannot allocate pthread storage);
 
 	__uselibcstub = 0;
 

Index: src/lib/libpthread/pthread_int.h
diff -u src/lib/libpthread/pthread_int.h:1.91 src/lib/libpthread/pthread_int.h:1.92
--- src/lib/libpthread/pthread_int.h:1.91	Fri May 29 03:37:31 2015
+++ src/lib/libpthread/pthread_int.h	Fri May 29 12:05:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_int.h,v 1.91 2015/05/29 07:37:31 manu Exp $	*/
+/*	$NetBSD: pthread_int.h,v 1.92 2015/05/29 16:05:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -292,7 +292,7 @@ pthread__self(void)
 	} \
 } while (/*CONSTCOND*/0)
 
-int	pthread_tsd_init(void) PTHREAD_HIDE;
+void 	*pthread_tsd_init(size_t *) PTHREAD_HIDE;
 void	pthread__destroy_tsd(pthread_t) PTHREAD_HIDE;
 __dead void	pthread__assertfunc(const char *, int, const char *, const char *)
 			PTHREAD_HIDE;

Index: src/lib/libpthread/pthread_tsd.c
diff -u src/lib/libpthread/pthread_tsd.c:1.12 src/lib/libpthread/pthread_tsd.c:1.13
--- src/lib/libpthread/pthread_tsd.c:1.12	Fri May 29 03:37:31 2015
+++ src/lib/libpthread/pthread_tsd.c	Fri May 29 12:05:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_tsd.c,v 1.12 2015/05/29 07:37:31 manu Exp $	*/
+/*	$NetBSD: pthread_tsd.c,v 1.13 2015/05/29 16:05:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -30,10 +30,11 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: pthread_tsd.c,v 1.12 2015/05/29 07:37:31 manu Exp $);
+__RCSID($NetBSD: pthread_tsd.c,v 1.13 2015/05/29 16:05:13 christos Exp $);
 
 /* Functions and structures dealing with thread-specific data */
 #include errno.h
+#include sys/mman.h
 
 #include pthread.h
 #include pthread_int.h
@@ -59,13 +60,14 @@ null_destructor(void *p)
 #include stdlib.h
 #include stdio.h
 
-int
-pthread_tsd_init(void)
+void *
+pthread_tsd_init(size_t *tlen)
 {
 	char *pkm;
-	size_t len;
+	size_t alen;
+	char *arena;
 
-	if ((pkm = getenv(PTHREAD_KEYS_MAX)) != NULL) {
+	if ((pkm = pthread__getenv(PTHREAD_KEYS_MAX)) != NULL) {
 		pthread_keys_max = (int)strtol(pkm, NULL, 0);
 		if (pthread_keys_max  _POSIX_THREAD_KEYS_MAX)
 			pthread_keys_max = _POSIX_THREAD_KEYS_MAX;
@@ -73,22 +75,27 @@ pthread_tsd_init(void)
 		pthread_keys_max = PTHREAD_KEYS_MAX;
 	}
 
-	len = sizeof(*pthread__tsd_list);
-	if ((pthread__tsd_list = calloc(pthread_keys_max, len)) == NULL)
-		goto out1;
-
-	len = sizeof(*pthread__tsd_destructors);
-	if ((pthread__tsd_destructors = calloc(pthread_keys_max, len)) == NULL) 
-		goto out2;
-
-	return 0;
-
-out2:
-	free(pthread__tsd_list);
-out1:
-	pthread_keys_max = 0;
+	/*
+	 * Can't use malloc here yet, because malloc will use the fake
+	 * libc thread functions to initialize itself, so mmap the space.
+	 */
+	*tlen = sizeof(struct __pthread_st)
+	+ pthread_keys_max * sizeof(struct pt_specific);
+	alen = *tlen
+	+ sizeof(*pthread__tsd_list) * pthread_keys_max
+	+ sizeof(*pthread__tsd_destructors) * pthread_keys_max;
+
+	arena = mmap(NULL, alen, PROT_READ|PROT_WRITE, MAP_ANON, -1, 

CVS commit: src

2015-05-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri May 29 17:40:41 UTC 2015

Modified Files:
src/distrib/sets/lists/comp: mi
src/external/bsd/llvm/include: Makefile

Log Message:
Until we have a solution for stdatomic.h for GCC 4.8, install Clang's
version under /usr/include/clang-3.6 to match the C11 default.


To generate a diff of this commit:
cvs rdiff -u -r1.1962 -r1.1963 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.36 -r1.37 src/external/bsd/llvm/include/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/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1962 src/distrib/sets/lists/comp/mi:1.1963
--- src/distrib/sets/lists/comp/mi:1.1962	Fri May 29 12:38:18 2015
+++ src/distrib/sets/lists/comp/mi	Fri May 29 17:40:41 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1962 2015/05/29 12:38:18 pooka Exp $
+#	$NetBSD: mi,v 1.1963 2015/05/29 17:40:41 joerg Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -350,6 +350,7 @@
 ./usr/include/cdk/swindow.h			comp-obsolete		obsolete
 ./usr/include/cdk/template.h			comp-obsolete		obsolete
 ./usr/include/cdk/viewer.h			comp-obsolete		obsolete
+./usr/include/clang-3.6/stdatomic.h	comp-c-include		llvm
 ./usr/include/complex.hcomp-c-include
 ./usr/include/cpio.hcomp-c-include
 ./usr/include/crypto/cryptodev.h		comp-c-include

Index: src/external/bsd/llvm/include/Makefile
diff -u src/external/bsd/llvm/include/Makefile:1.36 src/external/bsd/llvm/include/Makefile:1.37
--- src/external/bsd/llvm/include/Makefile:1.36	Thu Jan 29 20:41:34 2015
+++ src/external/bsd/llvm/include/Makefile	Fri May 29 17:40:41 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.36 2015/01/29 20:41:34 joerg Exp $
+#	$NetBSD: Makefile,v 1.37 2015/05/29 17:40:41 joerg Exp $
 
 .include bsd.init.mk
 
@@ -49,6 +49,7 @@ INCS=	altivec.h
 INCS=	arm_acle.h \
 	arm_neon.h
 .endif
+INCS+=	stdatomic.h
 INCSDIR=	/usr/include/clang-${CLANG_VERSION:R}
 
 .PATH:	${LLVM_SRCDIR}/include/llvm/IR \



CVS commit: [LLVM] src/external/bsd/llvm/dist/llvm/test/CodeGen

2015-05-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri May 29 17:32:05 UTC 2015

Removed Files:
src/external/bsd/llvm/dist/llvm/test/CodeGen/R600 [LLVM]: fdiv64.ll
llvm.SI.fs.interp.constant.ll
src/external/bsd/llvm/dist/llvm/test/CodeGen/X86 [LLVM]:
fastmath-optnone.ll

Log Message:
Mark files not present in llvm-237755 as dead.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r0 \
src/external/bsd/llvm/dist/llvm/test/CodeGen/R600/fdiv64.ll \

src/external/bsd/llvm/dist/llvm/test/CodeGen/R600/llvm.SI.fs.interp.constant.ll
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/llvm/dist/llvm/test/CodeGen/X86/fastmath-optnone.ll

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



CVS commit: src/external/bsd/llvm

2015-05-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri May 29 17:37:50 UTC 2015

Modified Files:
src/external/bsd/llvm: Makefile.inc
src/external/bsd/llvm/config/clang/Config: config.h
src/external/bsd/llvm/config/llvm/Config: config.h.in llvm-config.h.in

Log Message:
Update build glue for LLVM/Clang 3.6.1. This brings in a number of
bugfixes for various platforms and corrects the mcount symbol on
NetBSD/ARM.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/external/bsd/llvm/Makefile.inc
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/llvm/config/clang/Config/config.h
cvs rdiff -u -r1.15 -r1.16 \
src/external/bsd/llvm/config/llvm/Config/config.h.in
cvs rdiff -u -r1.8 -r1.9 \
src/external/bsd/llvm/config/llvm/Config/llvm-config.h.in

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/llvm/Makefile.inc
diff -u src/external/bsd/llvm/Makefile.inc:1.78 src/external/bsd/llvm/Makefile.inc:1.79
--- src/external/bsd/llvm/Makefile.inc:1.78	Wed Mar 18 17:43:20 2015
+++ src/external/bsd/llvm/Makefile.inc	Fri May 29 17:37:50 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.78 2015/03/18 17:43:20 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.79 2015/05/29 17:37:50 joerg Exp $
 
 .if !defined(LLVM_TOPLEVEL_MK)
 LLVM_TOPLEVEL_MK=
@@ -8,7 +8,7 @@ LLVM_TOPLEVEL_MK=
 SVN_ROOT=		http://llvm.org/svn/llvm-project
 SVN_BRANCH=		branches/release_36
 
-COMMON_REVISION=	232565
+COMMON_REVISION=	237755
 CLANG_REVISION=		${COMMON_REVISION}
 LLD_REVISION=		${COMMON_REVISION}
 LLDB_REVISION=		${COMMON_REVISION}
@@ -17,9 +17,9 @@ LLVM_REVISION=		${COMMON_REVISION}
 MCLINKER_REVISION=	deeb2a77b4165827316f88e0a7ba4ba6b743a080
 MCLINKER_ROOT=		https://code.google.com/p/mclinker/
 
-LLVM_VERSION=		3.6.0
-CLANG_VERSION=		3.6.0
-LLD_VERSION=		3.6.0
+LLVM_VERSION=		3.6.1
+CLANG_VERSION=		3.6.1
+LLD_VERSION=		3.6.1
 
 CLANG_SRCDIR:=	${.PARSEDIR}/dist/clang
 LLD_SRCDIR:=	${.PARSEDIR}/dist/lld

Index: src/external/bsd/llvm/config/clang/Config/config.h
diff -u src/external/bsd/llvm/config/clang/Config/config.h:1.12 src/external/bsd/llvm/config/clang/Config/config.h:1.13
--- src/external/bsd/llvm/config/clang/Config/config.h:1.12	Thu Jan 29 20:41:34 2015
+++ src/external/bsd/llvm/config/clang/Config/config.h	Fri May 29 17:37:50 2015
@@ -27,7 +27,7 @@
 /* Define if we have libxml2 */
 /* #undef CLANG_HAVE_LIBXML */
 
-#define PACKAGE_STRING LLVM 3.6.0svn
+#define PACKAGE_STRING LLVM 3.6.1
 
 /* The LLVM product name and version */
 #define BACKEND_PACKAGE_STRING PACKAGE_STRING

Index: src/external/bsd/llvm/config/llvm/Config/config.h.in
diff -u src/external/bsd/llvm/config/llvm/Config/config.h.in:1.15 src/external/bsd/llvm/config/llvm/Config/config.h.in:1.16
--- src/external/bsd/llvm/config/llvm/Config/config.h.in:1.15	Thu Jan 29 20:41:34 2015
+++ src/external/bsd/llvm/config/llvm/Config/config.h.in	Fri May 29 17:37:50 2015
@@ -97,7 +97,7 @@
 #define HAVE_FCNTL_H 1
 
 /* Define to 1 if you have the fenv.h header file. */
-  #ifndef __powerpc__
+  #ifndef __powerpc
 #define HAVE_FENV_H 1
   #endif
 
@@ -423,6 +423,9 @@
 /* Have host's __chkstk */
 /* #undef HAVE___CHKSTK */
 
+/* Have host's __chkstk_ms */
+/* #undef HAVE___CHKSTK_MS */
+
 /* Have host's __cmpdi2 */
 /* #undef HAVE___CMPDI2 */
 
@@ -459,6 +462,9 @@
 /* Have host's ___chkstk */
 /* #undef HAVECHKSTK */
 
+/* Have host's ___chkstk_ms */
+/* #undef HAVECHKSTK_MS */
+
 /* Linker version detected at compile time. */
 #define HOST_LINK_VERSION 1
 
@@ -547,10 +553,10 @@
 #define LLVM_VERSION_MINOR 6
 
 /* Patch version of the LLVM API */
-#define LLVM_VERSION_PATCH 0
+#define LLVM_VERSION_PATCH 1
 
 /* LLVM version string */
-#define LLVM_VERSION_STRING 3.6.0svn
+#define LLVM_VERSION_STRING 3.6.1
 
 /* The shared library extension */
 #define LTDL_SHLIB_EXT .so
@@ -566,13 +572,13 @@
 #define PACKAGE_NAME LLVM
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING LLVM 3.6.0svn
+#define PACKAGE_STRING LLVM 3.6.1
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME llvm
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION 3.6.0svn
+#define PACKAGE_VERSION 3.6.1
 
 /* Define as the return type of signal handlers (`int' or `void'). */
 #define RETSIGTYPE void

Index: src/external/bsd/llvm/config/llvm/Config/llvm-config.h.in
diff -u src/external/bsd/llvm/config/llvm/Config/llvm-config.h.in:1.8 src/external/bsd/llvm/config/llvm/Config/llvm-config.h.in:1.9
--- src/external/bsd/llvm/config/llvm/Config/llvm-config.h.in:1.8	Thu Jan 29 20:41:34 2015
+++ src/external/bsd/llvm/config/llvm/Config/llvm-config.h.in	Fri May 29 17:37:50 2015
@@ -93,7 +93,10 @@
 /* Minor version of the LLVM API */
 #define LLVM_VERSION_MINOR 6
 
+/* Patch version of the LLVM API */
+#define LLVM_VERSION_PATCH 1
+
 /* LLVM version string */
-#define LLVM_VERSION_STRING 3.6.0svn

CVS commit: src/lib/libpthread

2015-05-29 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri May 29 18:00:51 UTC 2015

Modified Files:
src/lib/libpthread: pthread_key_create.3

Log Message:
Bump date for previous.
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libpthread/pthread_key_create.3

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

Modified files:

Index: src/lib/libpthread/pthread_key_create.3
diff -u src/lib/libpthread/pthread_key_create.3:1.7 src/lib/libpthread/pthread_key_create.3:1.8
--- src/lib/libpthread/pthread_key_create.3:1.7	Fri May 29 07:37:31 2015
+++ src/lib/libpthread/pthread_key_create.3	Fri May 29 18:00:51 2015
@@ -1,4 +1,4 @@
-.\ $NetBSD: pthread_key_create.3,v 1.7 2015/05/29 07:37:31 manu Exp $
+.\ $NetBSD: pthread_key_create.3,v 1.8 2015/05/29 18:00:51 wiz Exp $
 .\
 .\ Copyright (c) 2002, 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -55,7 +55,7 @@
 .\
 .\ $FreeBSD: src/lib/libpthread/man/pthread_key_create.3,v 1.12 2002/09/16 19:29:28 mini Exp $
 .\
-.Dd July 9, 2010
+.Dd May 29, 2015
 .Dt PTHREAD_KEY_CREATE 3
 .Os
 .Sh NAME
@@ -154,8 +154,8 @@ Upon failure both functions return an er
 .Sh ENVIRONMENT
 .Bl -tag -width PTHREAD_KEYS_MAX
 .It Ev PTHREAD_KEYS_MAX
-Maximum per process thread-specific data keys. This cannot be set
-below 
+Maximum per-process thread-specific data keys.
+This cannot be set below
 .Dv _POSIX_THREAD_KEYS_MAX .
 .El
 .Sh ERRORS
@@ -165,7 +165,7 @@ may fail if:
 .Bl -tag -width Er
 .It Bq Er EAGAIN
 The system lacked the necessary resources to create another thread-specific
-data key, or the system-imposed limit on the total number of keys per process
+data key, or the system-imposed limit on the total number of keys per-process
 .Dv PTHREAD_KEYS_MAX
 would be exceeded.
 .It Bq Er ENOMEM



CVS commit: src/sys/dev/ic

2015-05-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat May 30 00:56:42 UTC 2015

Modified Files:
src/sys/dev/ic: arn5008.c

Log Message:
disable interrupts when we get an rfsilent event, and make sure to clear intr 
sync cause register


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/arn5008.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/ic/arn5008.c
diff -u src/sys/dev/ic/arn5008.c:1.8 src/sys/dev/ic/arn5008.c:1.9
--- src/sys/dev/ic/arn5008.c:1.8	Sun May 24 17:19:29 2015
+++ src/sys/dev/ic/arn5008.c	Sat May 30 00:56:42 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: arn5008.c,v 1.8 2015/05/24 17:19:29 matt Exp $	*/
+/*	$NetBSD: arn5008.c,v 1.9 2015/05/30 00:56:42 jmcneill Exp $	*/
 /*	$OpenBSD: ar5008.c,v 1.21 2012/08/25 12:14:31 kettenis Exp $	*/
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: arn5008.c,v 1.8 2015/05/24 17:19:29 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: arn5008.c,v 1.9 2015/05/30 00:56:42 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/sockio.h
@@ -1257,8 +1257,9 @@ ar5008_intr(struct athn_softc *sc)
 
 		if ((sc-sc_flags  ATHN_FLAG_RFSILENT) 
 		(sync  AR_INTR_SYNC_GPIO_PIN(sc-sc_rfsilent_pin))) {
+			AR_WRITE(sc, AR_INTR_SYNC_ENABLE, 0);
+			(void)AR_READ(sc, AR_INTR_SYNC_ENABLE);
 			pmf_event_inject(sc-sc_dev, PMFE_RADIO_OFF);
-			return 1;
 		}
 
 		AR_WRITE(sc, AR_INTR_SYNC_CAUSE, sync);



CVS commit: src/external/gpl3/binutils/dist/gas/config

2015-05-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri May 29 22:18:51 UTC 2015

Modified Files:
src/external/gpl3/binutils/dist/gas/config: tc-mips.c

Log Message:
Fix a bug where the octeon+ saa/saad instructions think they are using the AT
register when they actually aren't.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/binutils/dist/gas/config/tc-mips.c

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

Modified files:

Index: src/external/gpl3/binutils/dist/gas/config/tc-mips.c
diff -u src/external/gpl3/binutils/dist/gas/config/tc-mips.c:1.14 src/external/gpl3/binutils/dist/gas/config/tc-mips.c:1.15
--- src/external/gpl3/binutils/dist/gas/config/tc-mips.c:1.14	Tue Dec 10 18:15:43 2013
+++ src/external/gpl3/binutils/dist/gas/config/tc-mips.c	Fri May 29 22:18:51 2015
@@ -9235,18 +9235,28 @@ macro (struct mips_cl_insn *ip)
 
 	
 case M_SAA_AB:
-  ab = 1;
+  ab = (offset_expr.X_op != O_constant || offset_expr.X_add_number != 0);
 case M_SAA_OB:
   s = saa;
   off0 = 1;
   fmt = t,(b);
+  if (!ab)
+	{
+	  tempreg = AT;
+	  goto ld_noat;
+	}
   goto ld_st;
 case M_SAAD_AB:
-  ab = 1;
+  ab = (offset_expr.X_op != O_constant || offset_expr.X_add_number != 0);
 case M_SAAD_OB:
   s = saad;
   off0 = 1;
   fmt = t,(b);
+  if (!ab)
+	{
+	  tempreg = AT;
+	  goto ld_noat;
+	}
   goto ld_st;
 
/* New code added to support COPZ instructions.



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

2015-05-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri May 29 23:18:30 UTC 2015

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

Log Message:
Replace ath with athn, and attach gpiorfkill to GPIO X7


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/conf/JETSONTK1

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

Modified files:

Index: src/sys/arch/evbarm/conf/JETSONTK1
diff -u src/sys/arch/evbarm/conf/JETSONTK1:1.22 src/sys/arch/evbarm/conf/JETSONTK1:1.23
--- src/sys/arch/evbarm/conf/JETSONTK1:1.22	Mon May 18 20:36:42 2015
+++ src/sys/arch/evbarm/conf/JETSONTK1	Fri May 29 23:18:30 2015
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: JETSONTK1,v 1.22 2015/05/18 20:36:42 jmcneill Exp $
+#	$NetBSD: JETSONTK1,v 1.23 2015/05/29 23:18:30 jmcneill Exp $
 #
 #	NVIDIA Jetson TK1 - Tegra K1 development kit
 #	https://developer.nvidia.com/jetson-tk1
@@ -49,6 +49,7 @@ tegracar0	at tegraio?		# CAR
 # GPIO controller
 tegragpio0	at tegraio?		# GPIO
 gpio*		at gpiobus?
+gpiorfkill0	at gpio23 offset 7 mask 1	# WF_EN
 
 # MPIO / Pinmux
 tegrampio0	at tegraio?		# MPIO
@@ -68,8 +69,7 @@ rgephy*		at mii? phy ?
 ukphy*		at mii? phy ?
 
 # Mini-PCIe Wireless
-ath*		at pci? dev ? function ?	# Atheros IEEE 802.11
-include external/isc/atheros_hal/conf/std.ath_hal
+athn*		at pci? dev ? function ?	# Atheros IEEE 802.11
 
 # UART
 com3		at tegraio? port 3	# UART-D



CVS commit: src/sys/dev/gpio

2015-05-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri May 29 23:17:13 UTC 2015

Modified Files:
src/sys/dev/gpio: files.gpio
Added Files:
src/sys/dev/gpio: gpiorfkill.c

Log Message:
Simple driver for gpio control of rf enable/disable pins.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/gpio/files.gpio
cvs rdiff -u -r0 -r1.1 src/sys/dev/gpio/gpiorfkill.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/gpio/files.gpio
diff -u src/sys/dev/gpio/files.gpio:1.10 src/sys/dev/gpio/files.gpio:1.11
--- src/sys/dev/gpio/files.gpio:1.10	Sun Nov 13 12:33:00 2011
+++ src/sys/dev/gpio/files.gpio	Fri May 29 23:17:13 2015
@@ -1,4 +1,4 @@
-# $NetBSD: files.gpio,v 1.10 2011/11/13 12:33:00 mbalmer Exp $
+# $NetBSD: files.gpio,v 1.11 2015/05/29 23:17:13 jmcneill Exp $
 
 define	gpio {[offset = -1], [mask = 0], [flag = 0]}
 
@@ -29,3 +29,8 @@ file	dev/gpio/gpiolock.c			gpiolock
 device	gpiopwm: gpiobus
 attach	gpiopwm at gpio
 file	dev/gpio/gpiopwm.c			gpiopwm
+
+# RF kill
+device	gpiorfkill: gpiobus
+attach	gpiorfkill at gpio
+file	dev/gpio/gpiorfkill.c			gpiorfkill

Added files:

Index: src/sys/dev/gpio/gpiorfkill.c
diff -u /dev/null src/sys/dev/gpio/gpiorfkill.c:1.1
--- /dev/null	Fri May 29 23:17:13 2015
+++ src/sys/dev/gpio/gpiorfkill.c	Fri May 29 23:17:13 2015
@@ -0,0 +1,166 @@
+/* $NetBSD: gpiorfkill.c,v 1.1 2015/05/29 23:17:13 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2015 Jared D. McNeill jmcne...@invisible.ca
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include locators.h
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: gpiorfkill.c,v 1.1 2015/05/29 23:17:13 jmcneill Exp $);
+
+#include sys/param.h
+#include sys/bus.h
+#include sys/device.h
+#include sys/intr.h
+#include sys/systm.h
+#include sys/kernel.h
+#include sys/sysctl.h
+#include sys/gpio.h
+
+#include dev/gpio/gpiovar.h
+
+static int	gpiorfkill_match(device_t, cfdata_t, void *);
+static void	gpiorfkill_attach(device_t, device_t, void *);
+
+struct gpiorfkill_softc {
+	device_t		sc_dev;
+	void			*sc_gpio;
+	struct gpio_pinmap	sc_map;
+	int			sc_pinmap[1];
+
+	int			sc_state;
+
+	struct sysctllog	*sc_sysctllog;
+	int			sc_sysctlnode;
+};
+
+static void	gpiorfkill_enable(struct gpiorfkill_softc *, int);
+static void	gpiorfkill_sysctl_init(struct gpiorfkill_softc *);
+static int	gpiorfkill_enable_helper(SYSCTLFN_PROTO);
+
+CFATTACH_DECL_NEW(gpiorfkill, sizeof(struct gpiorfkill_softc),
+	gpiorfkill_match, gpiorfkill_attach, NULL, NULL);
+
+static int
+gpiorfkill_match(device_t parent, cfdata_t cf, void *aux)
+{
+	struct gpio_attach_args * const ga = aux;
+
+	if (strcmp(ga-ga_dvname, cf-cf_name) != 0)
+		return 0;
+
+	if (ga-ga_offset == -1 || gpio_npins(ga-ga_mask) != 1)
+		return 0;
+
+	return 1;
+}
+
+static void
+gpiorfkill_attach(device_t parent, device_t self, void *aux)
+{
+	struct gpiorfkill_softc * const sc = device_private(self);
+	struct gpio_attach_args * const ga = aux;
+	int caps;
+
+	sc-sc_dev = self;
+	sc-sc_gpio = ga-ga_gpio;
+	sc-sc_map.pm_map = sc-sc_pinmap;
+	if (gpio_pin_map(sc-sc_gpio, ga-ga_offset, ga-ga_mask,
+	sc-sc_map)) {
+		aprint_error(: couldn't map pins\n);
+		return;
+	}
+
+	caps = gpio_pin_caps(sc-sc_gpio, sc-sc_map, 0);
+	if ((caps  GPIO_PIN_OUTPUT) == 0) {
+		aprint_error(: pin is not an output pin\n);
+		return;
+	}
+
+	gpio_pin_ctl(sc-sc_gpio, sc-sc_map, 0, GPIO_PIN_OUTPUT);
+
+	aprint_naive(\n);
+	aprint_normal(\n);
+
+	gpiorfkill_enable(sc, 1);
+	gpiorfkill_sysctl_init(sc);
+}
+
+static void
+gpiorfkill_enable(struct gpiorfkill_softc *sc, int enable)
+{
+	sc-sc_state = enable;
+	gpio_pin_write(sc-sc_gpio, sc-sc_map, 0, 

CVS commit: src/common/lib/libc/string

2015-05-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri May 29 19:39:41 UTC 2015

Modified Files:
src/common/lib/libc/string: popcount32.c popcount64.c

Log Message:
Don't compile if there is a macro of the same name.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/string/popcount32.c
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/string/popcount64.c

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

Modified files:

Index: src/common/lib/libc/string/popcount32.c
diff -u src/common/lib/libc/string/popcount32.c:1.4 src/common/lib/libc/string/popcount32.c:1.5
--- src/common/lib/libc/string/popcount32.c:1.4	Sun Aug 21 21:25:04 2011
+++ src/common/lib/libc/string/popcount32.c	Fri May 29 19:39:41 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: popcount32.c,v 1.4 2011/08/21 21:25:04 dholland Exp $	*/
+/*	$NetBSD: popcount32.c,v 1.5 2015/05/29 19:39:41 matt Exp $	*/
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: popcount32.c,v 1.4 2011/08/21 21:25:04 dholland Exp $);
+__RCSID($NetBSD: popcount32.c,v 1.5 2015/05/29 19:39:41 matt Exp $);
 
 #if !defined(_KERNEL)  !defined(_STANDALONE)
 #include limits.h
@@ -43,6 +43,8 @@ __RCSID($NetBSD: popcount32.c,v 1.4 201
 #include machine/limits.h
 #endif
 
+#ifndef popcount32	// might be a builtin
+
 /*
  * This a hybrid algorithm for bit counting between parallel counting and
  * using multiplication.  The idea is to sum up the bits in each Byte, so
@@ -76,3 +78,5 @@ __strong_alias(popcount, popcount32)
 #if ULONG_MAX == 0xU
 __strong_alias(popcountl, popcount32)
 #endif
+
+#endif	/* !popcount32 */

Index: src/common/lib/libc/string/popcount64.c
diff -u src/common/lib/libc/string/popcount64.c:1.7 src/common/lib/libc/string/popcount64.c:1.8
--- src/common/lib/libc/string/popcount64.c:1.7	Fri Mar  9 15:41:16 2012
+++ src/common/lib/libc/string/popcount64.c	Fri May 29 19:39:41 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: popcount64.c,v 1.7 2012/03/09 15:41:16 christos Exp $	*/
+/*	$NetBSD: popcount64.c,v 1.8 2015/05/29 19:39:41 matt Exp $	*/
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: popcount64.c,v 1.7 2012/03/09 15:41:16 christos Exp $);
+__RCSID($NetBSD: popcount64.c,v 1.8 2015/05/29 19:39:41 matt Exp $);
 
 #if !defined(_KERNEL)  !defined(_STANDALONE)
 #include limits.h
@@ -43,9 +43,11 @@ __RCSID($NetBSD: popcount64.c,v 1.7 201
 #include machine/limits.h
 #endif
 
+#ifndef popcount64	// might be defined to use a __builtin
+
 /*
  * If uint64_t is larger than size_t, the follow assumes that
- * splitting into 32bit halfes is faster.
+ * splitting into 32bit halves is faster.
  *
  * The native pocount64 version is based on the same ideas as popcount32(3),
  * see popcount32.c for comments.
@@ -83,3 +85,4 @@ __strong_alias(popcountl, popcount64)
 __strong_alias(popcountll, popcount64)
 #endif
 
+#endif /* !popcount64 */



CVS commit: src/sys/lib/libkern

2015-05-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri May 29 19:38:59 UTC 2015

Modified Files:
src/sys/lib/libkern: libkern.h

Log Message:
If the platform support popcount as a __builtin, use that in preference
to the libc versions.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/lib/libkern/libkern.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/lib/libkern/libkern.h
diff -u src/sys/lib/libkern/libkern.h:1.119 src/sys/lib/libkern/libkern.h:1.120
--- src/sys/lib/libkern/libkern.h:1.119	Sat May  9 18:49:36 2015
+++ src/sys/lib/libkern/libkern.h	Fri May 29 19:38:59 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: libkern.h,v 1.119 2015/05/09 18:49:36 christos Exp $	*/
+/*	$NetBSD: libkern.h,v 1.120 2015/05/29 19:38:59 matt Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -443,11 +443,20 @@ int	 snprintb_m(char *, size_t, const ch
 int	 kheapsort(void *, size_t, size_t, int (*)(const void *, const void *),
 		   void *);
 uint32_t crc32(uint32_t, const uint8_t *, size_t);
+#if __GNUC_PREREQ__(4, 5) \
+ (defined(__alpha_cix__) || defined(__mips_popcount))
+#define	popcount	__builtin_popcount
+#define	popcountl	__builtin_popcountl
+#define	popcountll	__builtin_popcountll
+#define	popcount32	__builtin_popcount
+#define	popcount64	__builtin_popcountll
+#else
 unsigned int	popcount(unsigned int) __constfunc;
 unsigned int	popcountl(unsigned long) __constfunc;
 unsigned int	popcountll(unsigned long long) __constfunc;
 unsigned int	popcount32(uint32_t) __constfunc;
 unsigned int	popcount64(uint64_t) __constfunc;
+#endif
 
 void	*explicit_memset(void *, int, size_t);
 int	consttime_memequal(const void *, const void *, size_t);



CVS commit: src/external/gpl3/gcc/dist/gcc/config/mips

2015-05-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri May 29 19:37:27 UTC 2015

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/mips: netbsd.h

Log Message:
Add the historical __OCTEON__ builtin_define along with __mips_popcount which
is defined if the platform has the dpop/pop instructions.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.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/gpl3/gcc/dist/gcc/config/mips/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.h:1.5 src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.h:1.6
--- src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.h:1.5	Thu Aug 14 15:16:20 2014
+++ src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.h	Fri May 29 19:37:27 2015
@@ -163,6 +163,11 @@ along with GCC; see the file COPYING3.  
   else			\
 	builtin_define (__MIPSEL__);\
 \
+  if (TARGET_OCTEON)	\
+	builtin_define (__OCTEON__);\
+\
+  if (ISA_HAS_POP)		\
+	builtin_define (__mips_popcount);			\
   /* No language dialect defines.  */			\
 \
   /* ABIs handled in TARGET_OS_CPP_BUILTINS.  */		\



CVS commit: src/sys/arch/mips/ingenic

2015-05-29 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri May 29 18:47:13 UTC 2015

Modified Files:
src/sys/arch/mips/ingenic: ingenic_regs.h

Log Message:
fix pasto


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mips/ingenic/ingenic_regs.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/mips/ingenic/ingenic_regs.h
diff -u src/sys/arch/mips/ingenic/ingenic_regs.h:1.18 src/sys/arch/mips/ingenic/ingenic_regs.h:1.19
--- src/sys/arch/mips/ingenic/ingenic_regs.h:1.18	Mon May 18 15:03:16 2015
+++ src/sys/arch/mips/ingenic/ingenic_regs.h	Fri May 29 18:47:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ingenic_regs.h,v 1.18 2015/05/18 15:03:16 macallan Exp $ */
+/*	$NetBSD: ingenic_regs.h,v 1.19 2015/05/29 18:47:13 macallan Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -706,7 +706,7 @@ gpio_as_input(uint32_t g, int pin)
 #define JZ_MSC_RESTO	0x10 /* 16bit response timeout in MSC_CLK */
 #define JZ_MSC_RDTO RW	0x14 /* 32bit read timeout in MSC_CLK */
 #define JZ_MSC_BLKLEN	0x18 /* 16bit block length */
-#define JZ_MSC_NOB RW	0x1c /* 16bit block counter */
+#define JZ_MSC_NOB	0x1c /* 16bit block counter */
 #define JZ_MSC_SNOB	0x20 /* 16bit successful block counter */
 #define JZ_MSC_IMASK	0x24 /* interrupt mask */
 	#define JZ_INT_AUTO_CMD23_DONE	0x4000