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

2014-05-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May  5 08:13:31 UTC 2014

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_vcaudio.c

Log Message:
Improve locking and kcondvar usage.

The interrupt lock doesn't need to be a spin mutex as the vchi
completions we're synchronising with are done in thread context.

Don't share the interrupt lock for the msg_sync done synchronisation.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/broadcom/bcm2835_vcaudio.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/broadcom/bcm2835_vcaudio.c
diff -u src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.2 src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.3
--- src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.2	Sun Apr 14 15:11:52 2013
+++ src/sys/arch/arm/broadcom/bcm2835_vcaudio.c	Mon May  5 08:13:31 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_vcaudio.c,v 1.2 2013/04/14 15:11:52 skrll Exp $ */
+/* $NetBSD: bcm2835_vcaudio.c,v 1.3 2014/05/05 08:13:31 skrll Exp $ */
 
 /*-
  * Copyright (c) 2013 Jared D. McNeill jmcne...@invisible.ca
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm2835_vcaudio.c,v 1.2 2013/04/14 15:11:52 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm2835_vcaudio.c,v 1.3 2014/05/05 08:13:31 skrll Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -78,7 +78,9 @@ struct vcaudio_softc {
 
 	kmutex_t			sc_lock;
 	kmutex_t			sc_intr_lock;
-	kcondvar_t			sc_cv;
+
+	kmutex_t			sc_msglock;
+	kcondvar_t			sc_msgcv;
 
 	struct audio_format		sc_format;
 	struct audio_encoding_set	*sc_encodings;
@@ -93,6 +95,7 @@ struct vcaudio_softc {
 	void*sc_pend;
 	intsc_pblksize;
 
+	boolsc_msgdone;
 	intsc_success;
 
 	VCHI_INSTANCE_T			sc_instance;
@@ -180,8 +183,10 @@ vcaudio_attach(device_t parent, device_t
 
 	sc-sc_dev = self;
 	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
-	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
-	cv_init(sc-sc_cv, vcaudiocv);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_msglock, MUTEX_DEFAULT, IPL_NONE);
+	cv_init(sc-sc_msgcv, vcaudiocv);
+	sc-sc_success = -1;
 	error = workqueue_create(sc-sc_wq, vcaudiowq, vcaudio_worker,
 	sc, PRI_BIO, IPL_SCHED, WQ_MPSAFE);
 	if (error) {
@@ -330,15 +335,17 @@ vcaudio_service_callback(void *priv, con
 
 	switch (msg.type) {
 	case VC_AUDIO_MSG_TYPE_RESULT:
-		mutex_enter(sc-sc_intr_lock);
+		mutex_enter(sc-sc_msglock);
 		sc-sc_success = msg.u.result.success;
-		cv_broadcast(sc-sc_cv);
-		mutex_exit(sc-sc_intr_lock);
+		sc-sc_msgdone = true;
+		cv_broadcast(sc-sc_msgcv);
+		mutex_exit(sc-sc_msglock);
 		break;
 	case VC_AUDIO_MSG_TYPE_COMPLETE:
 		intr = msg.u.complete.callback;
 		intrarg = msg.u.complete.cookie;
 		if (intr  intrarg) {
+			mutex_enter(sc-sc_intr_lock);
 			if (msg.u.complete.count  0  msg.u.complete.count = sc-sc_pblksize) {
 sc-sc_pbytes += msg.u.complete.count;
 			} else {
@@ -348,11 +355,10 @@ vcaudio_service_callback(void *priv, con
 			}
 			if (sc-sc_pbytes = sc-sc_pblksize) {
 sc-sc_pbytes -= sc-sc_pblksize;
-mutex_enter(sc-sc_intr_lock);
 intr(intrarg);
-mutex_exit(sc-sc_intr_lock);
 workqueue_enqueue(sc-sc_wq, (struct work *)sc-sc_work, NULL);
 			}
+			mutex_exit(sc-sc_intr_lock);
 		}
 		break;
 	default:
@@ -373,10 +379,11 @@ vcaudio_worker(struct work *wk, void *pr
 	mutex_enter(sc-sc_intr_lock);
 	intr = sc-sc_pint;
 	intrarg = sc-sc_pintarg;
-	mutex_exit(sc-sc_intr_lock);
 
-	if (intr == NULL || intrarg == NULL)
+	if (intr == NULL || intrarg == NULL) {
+		mutex_exit(sc-sc_intr_lock);
 		return;
+	}
 
 	vchi_service_use(sc-sc_service);
 
@@ -423,7 +430,6 @@ vcaudio_worker(struct work *wk, void *pr
 		VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
 		if (error) {
 			printf(%s: failed to write (%d)\n, __func__, error);
-			mutex_exit(sc-sc_intr_lock);
 			goto done;
 		}
 	} else {
@@ -442,7 +448,6 @@ vcaudio_worker(struct work *wk, void *pr
 	VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
 	if (error) {
 		printf(%s: failed to write (%d)\n, __func__, error);
-		mutex_exit(sc-sc_intr_lock);
 		goto done;
 	}
 
@@ -467,6 +472,7 @@ vcaudio_worker(struct work *wk, void *pr
 		sc-sc_ppos = 0;
 
 done:
+	mutex_exit(sc-sc_intr_lock);
 	vchi_service_release(sc-sc_service);
 }
 
@@ -475,24 +481,27 @@ vcaudio_msg_sync(struct vcaudio_softc *s
 {
 	int error = 0;
 
-	mutex_enter(sc-sc_intr_lock);
+	mutex_enter(sc-sc_msglock);
+
 	sc-sc_success = -1;
+	sc-sc_msgdone = false;
+
 	error = vchi_msg_queue(sc-sc_service, msg, msglen,
 	VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
 	if (error) {
 		printf(%s: failed to queue message (%d)\n, __func__, error);
 		goto done;
 	}
-	while (sc-sc_success == -1) {
-		error = cv_wait_sig(sc-sc_cv, sc-sc_intr_lock);
+
+	while (!sc-sc_msgdone) {
+		error = cv_wait_sig(sc-sc_msgcv, sc-sc_msglock);
 		if (error)
 			break;
 	}
-	if (sc-sc_success  0)
+	if 

CVS commit: src/sys/kern

2014-05-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May  5 15:45:32 UTC 2014

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

Log Message:
Free pid for linux processes. Reported by Mark Davies, fix by dsl@
XXX: pullup 6


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/sys/kern/kern_exit.c

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

Modified files:

Index: src/sys/kern/kern_exit.c
diff -u src/sys/kern/kern_exit.c:1.243 src/sys/kern/kern_exit.c:1.244
--- src/sys/kern/kern_exit.c:1.243	Sat Jun  8 21:13:47 2013
+++ src/sys/kern/kern_exit.c	Mon May  5 11:45:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exit.c,v 1.243 2013/06/09 01:13:47 riz Exp $	*/
+/*	$NetBSD: kern_exit.c,v 1.244 2014/05/05 15:45:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_exit.c,v 1.243 2013/06/09 01:13:47 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_exit.c,v 1.244 2014/05/05 15:45:32 christos Exp $);
 
 #include opt_ktrace.h
 #include opt_perfctrs.h
@@ -541,12 +541,10 @@ exit1(struct lwp *l, int rv)
 	 */
 	pcu_discard_all(l);
 
-	/*
-	 * Remaining lwp resources will be freed in lwp_exit2() once we've
-	 * switch to idle context; at that point, we will be marked as a
-	 * full blown zombie.
-	 */
 	mutex_enter(p-p_lock);
+	/* Free the linux lwp id */
+	if ((l-l_pflag  LP_PIDLID) != 0  l-l_lid != p-p_pid)
+		proc_free_pid(l-l_lid);
 	lwp_drainrefs(l);
 	lwp_lock(l);
 	l-l_prflag = ~LPR_DETACHED;



CVS commit: src/sys/external/bsd/common/include/linux

2014-05-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May  5 15:59:11 UTC 2014

Modified Files:
src/sys/external/bsd/common/include/linux: completion.h

Log Message:
Use a spinlock for completions. Makes vchiq pass LOCKDEBUG where other
spinlocks where held when trying to use the completion API.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/common/include/linux/completion.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/external/bsd/common/include/linux/completion.h
diff -u src/sys/external/bsd/common/include/linux/completion.h:1.2 src/sys/external/bsd/common/include/linux/completion.h:1.3
--- src/sys/external/bsd/common/include/linux/completion.h:1.2	Tue Apr  1 15:19:37 2014
+++ src/sys/external/bsd/common/include/linux/completion.h	Mon May  5 15:59:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: completion.h,v 1.2 2014/04/01 15:19:37 riastradh Exp $	*/
+/*	$NetBSD: completion.h,v 1.3 2014/05/05 15:59:11 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@ static inline void
 init_completion(struct completion *completion)
 {
 
-	mutex_init(completion-c_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(completion-c_lock, MUTEX_DEFAULT, IPL_VM);
 	cv_init(completion-c_cv, lnxcmplt);
 	completion-c_done = 0;
 }



CVS commit: src/usr.bin/sed

2014-05-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May  5 17:12:11 UTC 2014

Modified Files:
src/usr.bin/sed: compile.c

Log Message:
Handle a closing brace at the end of a command without a preceding semi-colon:
/foo/ {p;d}


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/sed/compile.c

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

Modified files:

Index: src/usr.bin/sed/compile.c
diff -u src/usr.bin/sed/compile.c:1.39 src/usr.bin/sed/compile.c:1.40
--- src/usr.bin/sed/compile.c:1.39	Fri Jun 28 11:04:35 2013
+++ src/usr.bin/sed/compile.c	Mon May  5 13:12:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: compile.c,v 1.39 2013/06/28 15:04:35 joerg Exp $	*/
+/*	$NetBSD: compile.c,v 1.40 2014/05/05 17:12:11 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -76,7 +76,7 @@
 #if 0
 static char sccsid[] = @(#)compile.c	8.2 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: compile.c,v 1.39 2013/06/28 15:04:35 joerg Exp $);
+__RCSID($NetBSD: compile.c,v 1.40 2014/05/05 17:12:11 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -281,14 +281,19 @@ nonsel:		/* Now parse the command */
 		case EMPTY:		/* d D g G h H l n N p P q x = \0 */
 			p++;
 			EATSPACE();
-			if (*p == ';') {
+			switch (*p) {
+			case ';':
 p++;
 link = cmd-next;
 goto semicolon;
-			}
-			if (*p)
+			case '}':
+goto semicolon;
+			case '\0':
+break;
+			default:
 err(COMPILE,
 extra characters at the end of %c command, cmd-code);
+			}
 			break;
 		case TEXT:			/* a c i */
 			p++;
@@ -365,14 +370,19 @@ nonsel:		/* Now parse the command */
 			p++;
 			p = compile_tr(p, (char **)(void *)cmd-u.y);
 			EATSPACE();
-			if (*p == ';') {
+			switch (*p) {
+			case ';':
 p++;
 link = cmd-next;
 goto semicolon;
-			}
-			if (*p)
+			case '}':
+goto semicolon;
+			case '\0':
+break;
+			default:
 err(COMPILE,
 extra text at the end of a transform command);
+			}
 			break;
 		}
 	}



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

2014-05-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May  5 17:45:24 UTC 2014

Modified Files:
src/sys/arch/arm/arm32: netbsd32_machdep.c

Log Message:
Fill in netbsd32_vm_default_addr, and provide

- compat_13_netbsd32_sigreturn, and
- compat_16_netbsd32___sigreturn14


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/arm32/netbsd32_machdep.c

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

Modified files:

Index: src/sys/arch/arm/arm32/netbsd32_machdep.c
diff -u src/sys/arch/arm/arm32/netbsd32_machdep.c:1.5 src/sys/arch/arm/arm32/netbsd32_machdep.c:1.6
--- src/sys/arch/arm/arm32/netbsd32_machdep.c:1.5	Tue Jan 28 18:56:46 2014
+++ src/sys/arch/arm/arm32/netbsd32_machdep.c	Mon May  5 17:45:24 2014
@@ -29,7 +29,9 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: netbsd32_machdep.c,v 1.5 2014/01/28 18:56:46 martin Exp $);
+__KERNEL_RCSID(1, $NetBSD: netbsd32_machdep.c,v 1.6 2014/05/05 17:45:24 skrll Exp $);
+
+#include opt_compat_netbsd.h
 
 #include sys/param.h
 #include sys/core.h
@@ -91,7 +93,39 @@ netbsd32_sysarch(struct lwp *l, const st
 }
 
 vaddr_t
-netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t size)
+netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t sz)
+{
+	if (p-p_vmspace-vm_map.flags  VM_MAP_TOPDOWN)
+		return VM_DEFAULT_ADDRESS_TOPDOWN(base, sz);
+	else
+		return VM_DEFAULT_ADDRESS_BOTTOMUP(base, sz);
+}
+
+
+#ifdef COMPAT_13
+int
+compat_13_netbsd32_sigreturn(struct lwp *l,
+	const struct compat_13_netbsd32_sigreturn_args *uap,
+	register_t *retval)
+{
+	struct compat_13_sys_sigreturn_args ua;
+
+	NETBSD32TOP_UAP(sigcntxp, struct sigcontext13 *);
+
+	return compat_13_sys_sigreturn(l, ua, retval);
+}
+#endif
+
+#ifdef COMPAT_16
+int
+compat_16_netbsd32___sigreturn14(struct lwp *l,
+	const struct compat_16_netbsd32___sigreturn14_args *uap,
+	register_t *retval)
 {
-	return round_page((vaddr_t)(base) + (vsize_t)MAXDSIZ32);
+	struct compat_16_sys___sigreturn14_args ua;
+
+	NETBSD32TOP_UAP(sigcntxp, struct sigcontext *);
+
+	return compat_16_sys___sigreturn14(l, ua, retval);
 }
+#endif



CVS commit: src

2014-05-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May  5 18:08:33 UTC 2014

Modified Files:
src/lib/libm: Makefile
src/tests/lib/libm: Makefile

Log Message:
Comment out the ieee fp flags for alpha for now - something (tm) is not
working right, see PR port-alpha/48782.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/lib/libm/Makefile
cvs rdiff -u -r1.22 -r1.23 src/tests/lib/libm/Makefile

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.157 src/lib/libm/Makefile:1.158
--- src/lib/libm/Makefile:1.157	Mon Apr 28 08:47:43 2014
+++ src/lib/libm/Makefile	Mon May  5 18:08:32 2014
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.157 2014/04/28 08:47:43 martin Exp $
+#  $NetBSD: Makefile,v 1.158 2014/05/05 18:08:32 martin Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -53,7 +53,7 @@ LINTFLAGS += -g
 .if (${MACHINE_ARCH} == alpha)
 .PATH: ${.CURDIR}/arch/alpha
 ARCH_SRCS = s_copysign.S s_copysignf.S lrint.S
-COPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
+# COPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
 .elif (${MACHINE_CPU} == arm)
 .PATH: ${.CURDIR}/arch/arm
 COMMON_SRCS+= fenv.c s_nexttowardf.c \

Index: src/tests/lib/libm/Makefile
diff -u src/tests/lib/libm/Makefile:1.22 src/tests/lib/libm/Makefile:1.23
--- src/tests/lib/libm/Makefile:1.22	Mon Apr 28 08:46:35 2014
+++ src/tests/lib/libm/Makefile	Mon May  5 18:08:33 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2014/04/28 08:46:35 martin Exp $
+# $NetBSD: Makefile,v 1.23 2014/05/05 18:08:33 martin Exp $
 
 .include bsd.own.mk
 
@@ -11,7 +11,7 @@ CPPFLAGS+=	-DHAVE_FENV_H
 .endif
 
 .if ${MACHINE} == alpha
-COPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
+# COPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
 .endif
 
 TESTS_C+=	t_acos



CVS commit: src/sys/arch/sparc64/sparc64

2014-05-05 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon May  5 19:04:47 UTC 2014

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
sun4v: the trap base address should be assigned to %l1 so %tba is properly 
setup later in the code - now the kernel gets as far as printing the copyright 
disclaimer, kernel version and total and available memory before crashing


To generate a diff of this commit:
cvs rdiff -u -r1.357 -r1.358 src/sys/arch/sparc64/sparc64/locore.s

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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.357 src/sys/arch/sparc64/sparc64/locore.s:1.358
--- src/sys/arch/sparc64/sparc64/locore.s:1.357	Mon Apr 21 17:34:38 2014
+++ src/sys/arch/sparc64/sparc64/locore.s	Mon May  5 19:04:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.357 2014/04/21 17:34:38 palle Exp $	*/
+/*	$NetBSD: locore.s,v 1.358 2014/05/05 19:04:47 palle Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -4372,10 +4372,10 @@ ENTRY_NOPROFILE(cpu_initialize)	/* for c
 	bne,pt	%icc, 6f
 	 nop
 	/* sun4v */
-	set	_C_LABEL(trapbase_sun4v), %o0
+	set	_C_LABEL(trapbase_sun4v), %l1
 	GET_MMFSA %o1
 	call	_C_LABEL(prom_set_trap_table_sun4v)	! Now we should be running 100% from our handlers
-	 nop
+	 mov	%l1, %o0
 	
 	ba	7f
 	 nop



CVS commit: src

2014-05-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May  5 19:06:29 UTC 2014

Modified Files:
src/share/mk: bsd.README
src/sys/conf: Makefile.kern.inc

Log Message:
As discussed on tech-toolchain, offer a new make variable MKKDEBUG - if
set to yes, kernel builds will gain debug info and a netbsd.gdb will
be created (same as adding makeoptions DEBUG=-g to the config file).


To generate a diff of this commit:
cvs rdiff -u -r1.330 -r1.331 src/share/mk/bsd.README
cvs rdiff -u -r1.167 -r1.168 src/sys/conf/Makefile.kern.inc

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.README
diff -u src/share/mk/bsd.README:1.330 src/share/mk/bsd.README:1.331
--- src/share/mk/bsd.README:1.330	Fri Apr 18 00:37:46 2014
+++ src/share/mk/bsd.README	Mon May  5 19:06:29 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.330 2014/04/18 00:37:46 christos Exp $
+#	$NetBSD: bsd.README,v 1.331 2014/05/05 19:06:29 martin Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make include files for the NetBSD
@@ -234,6 +234,10 @@ MKISCSI		If no, don't build or install
 		(depends on libpthread.)
 		Default: yes
 
+MKKDEBUG	If yes, force building of kernel symbol info and creation
+		of netbsd.gdb in all kernel builds, independently of the
+		settings for makeoptions DEBUG in the kernel config file.
+
 MKKERBEROS	If no, disables building of Kerberos v5
 		infrastructure (libraries and support programs).
 		Default: yes

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.167 src/sys/conf/Makefile.kern.inc:1.168
--- src/sys/conf/Makefile.kern.inc:1.167	Mon Mar 10 02:36:50 2014
+++ src/sys/conf/Makefile.kern.inc	Mon May  5 19:06:29 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.167 2014/03/10 02:36:50 ozaki-r Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.168 2014/05/05 19:06:29 martin Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -17,6 +17,11 @@
 #
 # all ports are expected to include bsd.own.mk for toolchain settings
 
+# Default DEBUG to -g if kernel debug info is requested by MKKDEBUG=yes
+.if defined(MKKDEBUG)  ${MKKDEBUG} == yes
+DEBUG?=-g
+.endif
+
 ##
 ## (0) toolchain settings for things that aren't part of the standard
 ## toolchain



CVS commit: src/etc

2014-05-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May  5 19:10:01 UTC 2014

Modified Files:
src/etc: Makefile

Log Message:
Use the new -U option for config to avoid generating kernel debug info
during release builds. This should save quite some space in the evbarm
build, where makeoptions DEBUG is heavily used.


To generate a diff of this commit:
cvs rdiff -u -r1.412 -r1.413 src/etc/Makefile

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

Modified files:

Index: src/etc/Makefile
diff -u src/etc/Makefile:1.412 src/etc/Makefile:1.413
--- src/etc/Makefile:1.412	Mon Jan 27 21:37:17 2014
+++ src/etc/Makefile	Mon May  5 19:10:00 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.412 2014/01/27 21:37:17 apb Exp $
+#	$NetBSD: Makefile,v 1.413 2014/05/05 19:10:00 martin Exp $
 #	from: @(#)Makefile	8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -558,7 +558,7 @@ build_kernels: .PHONY
 build_kernels: kern-${configfile}
 kern-${configfile}: .PHONY .MAKE
 	cd ${KERNCONFDIR}  ${TOOL_CONFIG} -s ${KERNSRCDIR} \
-	-b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile}
+	-U DEBUG -b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile}
 .if ${MKUPDATE} == no
 	cd ${KERNOBJDIR}/${configfile:C/.*\///}  ${MAKE} distclean
 .endif



CVS commit: src

2014-05-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May  5 19:12:19 UTC 2014

Modified Files:
src: build.sh

Log Message:
Add a new action kernel.gdb=MYCONF to build a kernel with debuginfo
(and generate netbsd.gdb)


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.280 src/build.sh:1.281
--- src/build.sh:1.280	Tue Apr 29 11:52:51 2014
+++ src/build.sh	Mon May  5 19:12:19 2014
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.280 2014/04/29 11:52:51 uebayasi Exp $
+#	$NetBSD: build.sh,v 1.281 2014/05/05 19:12:19 martin Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -922,6 +922,8 @@ Usage: ${progname} [-EhnorUuxy] [-a arch
 install=idirRun make installworld to \`idir' to install all sets
 except \`etc'.  Useful after distribution or release
 kernel=conf Build kernel with config file \`conf'
+kernel.gdb=conf Build kernel (including netbsd.gdb) with config
+			file \`conf'
 releasekernel=conf  Install kernel built by kernel=conf to RELEASEDIR.
 installmodules=idir Run make installmodules to \`idir' to install all
 kernel modules.
@@ -1220,7 +1222,7 @@ parseoptions()
 			op=install_image # used as part of a variable name
 			;;
 
-		kernel=*|releasekernel=*)
+		kernel=*|releasekernel=*|kernel.gdb=*)
 			arg=${op#*=}
 			op=${op%%=*}
 			[ -n ${arg} ] ||
@@ -1746,7 +1748,7 @@ createmakewrapper()
 	eval cat EOF ${makewrapout}
 #! ${HOST_SH}
 # Set proper variables to allow easy make building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.280 2014/04/29 11:52:51 uebayasi Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.281 2014/05/05 19:12:19 martin Exp $
 # with these arguments: ${_args}
 #
 
@@ -1861,7 +1863,7 @@ buildkernel()
 	[ -x ${TOOLDIR}/bin/${toolprefix}config ] \
 	|| bomb ${TOOLDIR}/bin/${toolprefix}config does not exist. You need to \$0 tools\ first.
 	${runcmd} ${TOOLDIR}/bin/${toolprefix}config -b ${kernelbuildpath} \
-		-s ${TOP}/sys ${kernelconfpath} ||
+		${ksymopts} -s ${TOP}/sys ${kernelconfpath} ||
 	bomb ${toolprefix}config failed for ${kernelconf}
 	make_in_dir ${kernelbuildpath} depend
 	make_in_dir ${kernelbuildpath} all
@@ -2100,7 +2102,11 @@ main()
 			arg=${op#*=}
 			buildkernel ${arg}
 			;;
-
+		kernel.gdb=*)
+			arg=${op#*=}
+			ksymopts=-D DEBUG=-g
+			buildkernel ${arg}
+			;;
 		releasekernel=*)
 			arg=${op#*=}
 			releasekernel ${arg}



CVS commit: src/usr.bin/config

2014-05-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May  5 19:08:13 UTC 2014

Modified Files:
src/usr.bin/config: config.1 defs.h main.c

Log Message:
Add two new options, -U and -D, that can be used to define makeoptions
on the config command line. While there, rename the undocumented (internal)
parser debug option from -D to -d.
Discussed on tech-toolchain.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/config/config.1
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/config/defs.h
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/config/main.c

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

Modified files:

Index: src/usr.bin/config/config.1
diff -u src/usr.bin/config/config.1:1.13 src/usr.bin/config/config.1:1.14
--- src/usr.bin/config/config.1:1.13	Thu Aug 30 12:42:41 2012
+++ src/usr.bin/config/config.1	Mon May  5 19:08:13 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: config.1,v 1.13 2012/08/30 12:42:41 wiz Exp $
+.\	$NetBSD: config.1,v 1.14 2014/05/05 19:08:13 martin Exp $
 .\
 .\ Copyright (c) 1980, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -40,6 +40,8 @@
 .Op Fl Ppv
 .Op Fl b Ar builddir
 .Op Fl s Ar srcdir
+.Op Fl D Ar var=value
+.Op Fl U Ar value
 .Op Ar config-file
 .Nm
 .Fl x
@@ -109,6 +111,11 @@ Use
 .Ar builddir
 as the kernel build directory, instead of computing and creating one
 automatically.
+.It Fl D Ar var=value
+Define a makeoptions variable to the given value.
+This is equivalent to appending a 
+.Li makeoptions var=value
+line to the config file.
 .It Fl L
 Generate a lint configuration.
 See section
@@ -131,6 +138,12 @@ is used to prepare a kernel build direct
 when it is used in combination with the
 .Fl L
 flag.
+.It Fl U Ar var
+Undefine the makeoption
+.Ar var .
+This is equivalent to appending the line
+.Li no makeoptions var
+to the config file.
 .It Fl v
 Increase verbosity by enabling some more warnings.
 .It Fl x

Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.44 src/usr.bin/config/defs.h:1.45
--- src/usr.bin/config/defs.h:1.44	Fri Jun  8 08:56:45 2012
+++ src/usr.bin/config/defs.h	Mon May  5 19:08:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.44 2012/06/08 08:56:45 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.45 2014/05/05 19:08:13 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -107,7 +107,7 @@ extern const char *progname;
  * The next two lines define the current version of the config(1) binary,
  * and the minimum version of the configuration files it supports.
  */
-#define CONFIG_VERSION		20100430
+#define CONFIG_VERSION		20140502
 #define CONFIG_MINVERSION	0
 
 /*

Index: src/usr.bin/config/main.c
diff -u src/usr.bin/config/main.c:1.51 src/usr.bin/config/main.c:1.52
--- src/usr.bin/config/main.c:1.51	Fri Nov  1 21:39:13 2013
+++ src/usr.bin/config/main.c	Mon May  5 19:08:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.51 2013/11/01 21:39:13 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.52 2014/05/05 19:08:13 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -86,6 +86,7 @@ COPYRIGHT(@(#) Copyright (c) 1992, 1993
 int	vflag;/* verbose output */
 int	Pflag;/* pack locators */
 int	Lflag;/* lint config generation */
+int	handling_cmdlineopts;		/* currently processing -D/-U options */
 
 int	yyparse(void);
 
@@ -100,6 +101,7 @@ static struct nvlist **nextmkopt;
 static struct nvlist **nextappmkopt;
 static struct nvlist **nextcndmkopt;
 static struct nvlist **nextfsopt;
+static struct nvlist *cmdlinedefs, *cmdlineundefs;
 
 static	void	usage(void) __dead;
 static	void	dependopts(void);
@@ -119,6 +121,9 @@ static	int	mkident(void);
 static	int	devbase_has_dead_instances(const char *, void *, void *);
 static	int	devbase_has_any_instance(struct devbase *, int, int, int);
 static	int	check_dead_devi(const char *, void *, void *);
+static	void	add_makeopt(const char *);
+static	void	remove_makeopt(const char *);
+static	void	handle_cmdline_makeoptions(void);
 static	void	kill_orphans(void);
 static	void	do_kill_orphans(struct devbase *, struct attr *,
 struct devbase *, int);
@@ -155,11 +160,11 @@ main(int argc, char **argv)
 
 	pflag = 0;
 	xflag = 0;
-	while ((ch = getopt(argc, argv, DLPgpvb:s:x)) != -1) {
+	while ((ch = getopt(argc, argv, D:LPU:dgpvb:s:x)) != -1) {
 		switch (ch) {
 
 #ifndef MAKE_BOOTSTRAP
-		case 'D':
+		case 'd':
 			yydebug = 1;
 			break;
 #endif
@@ -179,7 +184,7 @@ main(int argc, char **argv)
 			 * do that for you, but you really should just
 			 * put them in the config file.
 			 */
-			warnx(-g is obsolete (use makeoptions DEBUG=\-g\));
+			warnx(-g is obsolete (use -D DEBUG=\-g\));
 			usage();
 			/*NOTREACHED*/
 
@@ -213,6 +218,14 @@ main(int argc, char **argv)
 			xflag = 1;
 			break;
 
+		case 'D':
+			add_makeopt(optarg);
+			break;
+
+		case 'U':
+			remove_makeopt(optarg);
+			break;
+
 		case '?':
 		default:
 			usage();
@@ -386,6 +399,11 @@ main(int argc, char **argv)
 		

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

2014-05-05 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Mon May  5 20:24:35 UTC 2014

Modified Files:
src/sys/arch/arm/samsung: exynos_usb.c

Log Message:
Add TDB lines


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/samsung/exynos_usb.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/samsung/exynos_usb.c
diff -u src/sys/arch/arm/samsung/exynos_usb.c:1.1 src/sys/arch/arm/samsung/exynos_usb.c:1.2
--- src/sys/arch/arm/samsung/exynos_usb.c:1.1	Tue Apr 29 16:47:10 2014
+++ src/sys/arch/arm/samsung/exynos_usb.c	Mon May  5 20:24:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_usb.c,v 1.1 2014/04/29 16:47:10 reinoud Exp $	*/
+/*	$NetBSD: exynos_usb.c,v 1.2 2014/05/05 20:24:35 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: exynos_usb.c,v 1.1 2014/04/29 16:47:10 reinoud Exp $);
+__KERNEL_RCSID(1, $NetBSD: exynos_usb.c,v 1.2 2014/05/05 20:24:35 reinoud Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -131,6 +131,7 @@ exynos_usb_attach(device_t parent, devic
 	/* get our bushandles */
 	sc-sc_bst  = exyoaa-exyo_core_bst;
 	sc-sc_dmat = exyoaa-exyo_dmat;
+//	sc-sc_dmat = exyoaa-exyo_coherent_dmat;
 
 	bus_space_subregion(sc-sc_bst, exyoaa-exyo_core_bsh,
 		exyoaa-exyo_loc.loc_offset, exyoaa-exyo_loc.loc_size,
@@ -157,8 +158,9 @@ exynos_usb_attach(device_t parent, devic
 	caplength + EHCI_USBINTR, 0);
 #endif
 
-	/* TBD enable USB phy  */
+	/* TBD Init USB subsystem */
 	/* TBD program USB hub */
+	/* TBD power cycle USB ethernet chip */
 
 	/* claim shared interrupt for OHCI/EHCI */
 	sc-sc_intrh = intr_establish(sc-sc_irq, IPL_USB, IST_LEVEL,



CVS commit: src/sys/arch

2014-05-05 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Mon May  5 20:31:03 UTC 2014

Modified Files:
src/sys/arch/arm/samsung: exynos4_loc.c exynos5_loc.c files.exynos
src/sys/arch/evbarm/conf: ODROID ODROID-U

Log Message:
exywdt - exyowdt


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/samsung/exynos4_loc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/samsung/exynos5_loc.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/samsung/files.exynos
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/ODROID
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/ODROID-U

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/samsung/exynos4_loc.c
diff -u src/sys/arch/arm/samsung/exynos4_loc.c:1.3 src/sys/arch/arm/samsung/exynos4_loc.c:1.4
--- src/sys/arch/arm/samsung/exynos4_loc.c:1.3	Tue Apr 29 16:47:10 2014
+++ src/sys/arch/arm/samsung/exynos4_loc.c	Mon May  5 20:31:03 2014
@@ -265,7 +265,7 @@
 
 static const struct exyo_locators exynos4_locators[] = {
 	{ mct, OFFANDSIZE(,MCT), NOPORT, IRQ_G0_IRQ, 0 },
-	{ exywdt, OFFANDSIZE(,WDT), NOPORT, IRQ_WDT, 0 },
+	{ exyowdt, OFFANDSIZE(,WDT), NOPORT, IRQ_WDT, 0 },
 	{ sscom, OFFANDSIZE(,UART0), 0, IRQ_UART0, 0 },
 	{ sscom, OFFANDSIZE(,UART1), 1, IRQ_UART1, 0 },
 	{ sscom, OFFANDSIZE(,UART2), 2, IRQ_UART2, 0 },

Index: src/sys/arch/arm/samsung/exynos5_loc.c
diff -u src/sys/arch/arm/samsung/exynos5_loc.c:1.2 src/sys/arch/arm/samsung/exynos5_loc.c:1.3
--- src/sys/arch/arm/samsung/exynos5_loc.c:1.2	Tue Apr 29 16:47:10 2014
+++ src/sys/arch/arm/samsung/exynos5_loc.c	Mon May  5 20:31:03 2014
@@ -213,7 +213,7 @@
 	EXYNOS5##p##_##n##_OFFSET, 0x1
 
 static const struct exyo_locators exynos5_locators[] = {
-	{ exywdt, OFFANDSIZE(,WDT), NOPORT, IRQ_WDT, 0 },
+	{ exyowdt, OFFANDSIZE(,WDT), NOPORT, IRQ_WDT, 0 },
 	{ sscom, OFFANDSIZE(,UART0), 0, IRQ_UART0, 0 },
 	{ sscom, OFFANDSIZE(,UART1), 1, IRQ_UART1, 0 },
 	{ sscom, OFFANDSIZE(,UART2), 2, IRQ_UART2, 0 },

Index: src/sys/arch/arm/samsung/files.exynos
diff -u src/sys/arch/arm/samsung/files.exynos:1.4 src/sys/arch/arm/samsung/files.exynos:1.5
--- src/sys/arch/arm/samsung/files.exynos:1.4	Tue Apr 29 16:47:10 2014
+++ src/sys/arch/arm/samsung/files.exynos	Mon May  5 20:31:03 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.exynos,v 1.4 2014/04/29 16:47:10 reinoud Exp $
+#	$NetBSD: files.exynos,v 1.5 2014/05/05 20:31:03 reinoud Exp $
 #
 # Configuration info for Samsung Exynos SoC ARM Peripherals
 #
@@ -57,8 +57,8 @@ attach	mct at exyo with exyo_mct
 file	arch/arm/samsung/mct.c		exyo_mct
 
 # Watchdog
-device	exywdt : sysmon_wdog
-attach	exywdt at exyo with exynos_wdt
+device	exyowdt : sysmon_wdog
+attach	exyowdt at exyo with exynos_wdt
 file	arch/arm/samsung/exynos_wdt.c	exynos_wdt | exyo_io needs-flag
 
 # UARTs

Index: src/sys/arch/evbarm/conf/ODROID
diff -u src/sys/arch/evbarm/conf/ODROID:1.1 src/sys/arch/evbarm/conf/ODROID:1.2
--- src/sys/arch/evbarm/conf/ODROID:1.1	Sun Apr 13 02:26:26 2014
+++ src/sys/arch/evbarm/conf/ODROID	Mon May  5 20:31:03 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: ODROID,v 1.1 2014/04/13 02:26:26 matt Exp $
+#	$NetBSD: ODROID,v 1.2 2014/05/05 20:31:03 reinoud Exp $
 #
 #	ODROID -- ODROID series Exynos Kernel
 #
@@ -202,7 +202,7 @@ endif
 sscom2		at exyo0  port 2		# UART2
 
 # Exynos Watchdog Timer
-#exywdt0 	at exyo0			# watchdog
+#exyowdt0 	at exyo0			# watchdog
 
 # Odroid-U connectivity
 

Index: src/sys/arch/evbarm/conf/ODROID-U
diff -u src/sys/arch/evbarm/conf/ODROID-U:1.3 src/sys/arch/evbarm/conf/ODROID-U:1.4
--- src/sys/arch/evbarm/conf/ODROID-U:1.3	Tue Apr 29 16:47:10 2014
+++ src/sys/arch/evbarm/conf/ODROID-U	Mon May  5 20:31:03 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: ODROID-U,v 1.3 2014/04/29 16:47:10 reinoud Exp $
+#	$NetBSD: ODROID-U,v 1.4 2014/05/05 20:31:03 reinoud Exp $
 #
 #	ODROID-U -- ODROID-U series Exynos Kernel
 #
@@ -190,7 +190,7 @@ sscom0		at exyo0  port 0		# UART0
 sscom1		at exyo0  port 1		# UART1
 
 # Exynos Watchdog Timer
-exywdt0 	at exyo0 flags 1		# watchdog
+exyowdt0 	at exyo0 flags 1		# watchdog
 
 # On-board USB
 exyousb*	at exyo0



CVS commit: src/usr.bin/config

2014-05-05 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon May  5 20:52:45 UTC 2014

Modified Files:
src/usr.bin/config: config.1

Log Message:
Sort SYNOPSIS. Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/config/config.1

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

Modified files:

Index: src/usr.bin/config/config.1
diff -u src/usr.bin/config/config.1:1.14 src/usr.bin/config/config.1:1.15
--- src/usr.bin/config/config.1:1.14	Mon May  5 19:08:13 2014
+++ src/usr.bin/config/config.1	Mon May  5 20:52:45 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: config.1,v 1.14 2014/05/05 19:08:13 martin Exp $
+.\	$NetBSD: config.1,v 1.15 2014/05/05 20:52:45 wiz Exp $
 .\
 .\ Copyright (c) 1980, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ from: @(#)config.8	8.2 (Berkeley) 4/19/94
 .\
-.Dd August 30, 2012
+.Dd May 5, 2014
 .Dt CONFIG 1
 .Os
 .Sh NAME
@@ -39,8 +39,8 @@
 .Nm
 .Op Fl Ppv
 .Op Fl b Ar builddir
-.Op Fl s Ar srcdir
 .Op Fl D Ar var=value
+.Op Fl s Ar srcdir
 .Op Fl U Ar value
 .Op Ar config-file
 .Nm
@@ -113,7 +113,7 @@ as the kernel build directory, instead o
 automatically.
 .It Fl D Ar var=value
 Define a makeoptions variable to the given value.
-This is equivalent to appending a 
+This is equivalent to appending a
 .Li makeoptions var=value
 line to the config file.
 .It Fl L



CVS commit: src/sys/dev/usb

2014-05-05 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May  5 20:56:15 UTC 2014

Modified Files:
src/sys/dev/usb: umcs.c

Log Message:
Remove unused umcs7840_reg_dcr0.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/usb/umcs.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/usb/umcs.c
diff -u src/sys/dev/usb/umcs.c:1.6 src/sys/dev/usb/umcs.c:1.7
--- src/sys/dev/usb/umcs.c:1.6	Sun Mar 23 20:20:38 2014
+++ src/sys/dev/usb/umcs.c	Mon May  5 20:56:15 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: umcs.c,v 1.6 2014/03/23 20:20:38 riastradh Exp $ */
+/* $NetBSD: umcs.c,v 1.7 2014/05/05 20:56:15 joerg Exp $ */
 /* $FreeBSD: head/sys/dev/usb/serial/umcs.c 260559 2014-01-12 11:44:28Z hselasky $ */
 
 /*-
@@ -41,7 +41,7 @@
  *
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: umcs.c,v 1.6 2014/03/23 20:20:38 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: umcs.c,v 1.7 2014/05/05 20:56:15 joerg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -169,19 +169,6 @@ umcs7840_reg_ctrl(int phyport)
 	}
 }
 
-static inline int
-umcs7840_reg_dcr0(int phyport)
-{
-	KASSERT(phyport = 0  phyport  4);
-	switch (phyport) {
-	default:
-	case 0:	return MCS7840_DEV_REG_DCR0_1;
-	case 1:	return MCS7840_DEV_REG_DCR0_2;
-	case 2:	return MCS7840_DEV_REG_DCR0_3;
-	case 3:	return MCS7840_DEV_REG_DCR0_4;
-	}
-}
-
 static int
 umcs7840_match(device_t dev, cfdata_t match, void *aux)
 {



CVS commit: src/usr.bin/config

2014-05-05 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon May  5 21:04:09 UTC 2014

Modified Files:
src/usr.bin/config: main.c

Log Message:
Sort options in usage.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/config/main.c

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

Modified files:

Index: src/usr.bin/config/main.c
diff -u src/usr.bin/config/main.c:1.52 src/usr.bin/config/main.c:1.53
--- src/usr.bin/config/main.c:1.52	Mon May  5 19:08:13 2014
+++ src/usr.bin/config/main.c	Mon May  5 21:04:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.52 2014/05/05 19:08:13 martin Exp $	*/
+/*	$NetBSD: main.c,v 1.53 2014/05/05 21:04:09 wiz Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -486,8 +486,8 @@ main(int argc, char **argv)
 static void
 usage(void)
 {
-	(void)fprintf(stderr, Usage: %s [-Ppv] [-s srcdir] [-b builddir] 
-	[-D var=value] [-U var] 
+	(void)fprintf(stderr, Usage: %s [-Ppv] [-b builddir] [-D var=value] 
+	[-s srcdir] [-U var] 
 	[config-file]\n\t%s -x [kernel-file]\n
 	\t%s -L [-v] [-s srcdir] [config-file]\n, 
 	getprogname(), getprogname(), getprogname());



CVS commit: src/tests/lib/libc/locale

2014-05-05 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Tue May  6 00:41:26 UTC 2014

Modified Files:
src/tests/lib/libc/locale: t_mbsnrtowcs.c

Log Message:
include string.h for memset


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/locale/t_mbsnrtowcs.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/lib/libc/locale/t_mbsnrtowcs.c
diff -u src/tests/lib/libc/locale/t_mbsnrtowcs.c:1.1 src/tests/lib/libc/locale/t_mbsnrtowcs.c:1.2
--- src/tests/lib/libc/locale/t_mbsnrtowcs.c:1.1	Tue May 28 16:57:56 2013
+++ src/tests/lib/libc/locale/t_mbsnrtowcs.c	Tue May  6 00:41:26 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mbsnrtowcs.c,v 1.1 2013/05/28 16:57:56 joerg Exp $ */
+/* $NetBSD: t_mbsnrtowcs.c,v 1.2 2014/05/06 00:41:26 yamt Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,9 +30,10 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: t_mbsnrtowcs.c,v 1.1 2013/05/28 16:57:56 joerg Exp $);
+__RCSID($NetBSD: t_mbsnrtowcs.c,v 1.2 2014/05/06 00:41:26 yamt Exp $);
 
 #include locale.h
+#include string.h
 #include wchar.h
 
 #include atf-c.h



CVS commit: src/sys/arch

2014-05-05 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Tue May  6 04:26:24 UTC 2014

Modified Files:
src/sys/arch/x86/x86: pmap.c
src/sys/arch/xen/include: xenpmap.h
src/sys/arch/xen/x86: x86_xpmap.c

Log Message:
Use the hypervisor to copy/zero pages. This saves us the extra overheads
of setting up temporary kernel mapping/unmapping.

riz@ reports savings of about 2s on a 120s kernel build.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/xen/include/xenpmap.h
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/xen/x86/x86_xpmap.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.181 src/sys/arch/x86/x86/pmap.c:1.182
--- src/sys/arch/x86/x86/pmap.c:1.181	Wed Nov  6 20:19:03 2013
+++ src/sys/arch/x86/x86/pmap.c	Tue May  6 04:26:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.181 2013/11/06 20:19:03 mrg Exp $	*/
+/*	$NetBSD: pmap.c,v 1.182 2014/05/06 04:26:23 cherry Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.181 2013/11/06 20:19:03 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.182 2014/05/06 04:26:23 cherry Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -3011,8 +3011,10 @@ pmap_virtual_space(vaddr_t *startp, vadd
 void
 pmap_zero_page(paddr_t pa)
 {
-#ifdef __HAVE_DIRECT_MAP
+#if defined(__HAVE_DIRECT_MAP)
 	pagezero(PMAP_DIRECT_MAP(pa));
+#elif defined(XEN)
+	xen_pagezero(pa);
 #else
 	pt_entry_t *zpte;
 	void *zerova;
@@ -3089,11 +3091,13 @@ pmap_pageidlezero(paddr_t pa)
 void
 pmap_copy_page(paddr_t srcpa, paddr_t dstpa)
 {
-#ifdef __HAVE_DIRECT_MAP
+#if defined(__HAVE_DIRECT_MAP)
 	vaddr_t srcva = PMAP_DIRECT_MAP(srcpa);
 	vaddr_t dstva = PMAP_DIRECT_MAP(dstpa);
 
 	memcpy((void *)dstva, (void *)srcva, PAGE_SIZE);
+#elif defined(XEN)
+	xen_copy_page(srcpa, dstpa);
 #else
 	pt_entry_t *spte;
 	pt_entry_t *dpte;
@@ -4103,6 +4107,8 @@ pmap_get_physpage(vaddr_t va, int level,
 			panic(pmap_get_physpage: out of memory);
 #ifdef __HAVE_DIRECT_MAP
 		pagezero(PMAP_DIRECT_MAP(*paddrp));
+#elif defined(XEN)
+		xen_pagezero(*paddrp);
 #else
 		kpreempt_disable();
 		pmap_pte_set(early_zero_pte,
@@ -4110,7 +4116,7 @@ pmap_get_physpage(vaddr_t va, int level,
 		pmap_pte_flush();
 		pmap_update_pg((vaddr_t)early_zerop);
 		memset(early_zerop, 0, PAGE_SIZE);
-#if defined(DIAGNOSTIC) || defined (XEN)
+#if defined(DIAGNOSTIC)
 		pmap_pte_set(early_zero_pte, 0);
 		pmap_pte_flush();
 #endif /* defined(DIAGNOSTIC) */

Index: src/sys/arch/xen/include/xenpmap.h
diff -u src/sys/arch/xen/include/xenpmap.h:1.37 src/sys/arch/xen/include/xenpmap.h:1.38
--- src/sys/arch/xen/include/xenpmap.h:1.37	Sat Jun 30 22:50:36 2012
+++ src/sys/arch/xen/include/xenpmap.h	Tue May  6 04:26:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenpmap.h,v 1.37 2012/06/30 22:50:36 jym Exp $	*/
+/*	$NetBSD: xenpmap.h,v 1.38 2014/05/06 04:26:24 cherry Exp $	*/
 
 /*
  *
@@ -55,6 +55,8 @@ void xen_mcast_tlbflush(kcpuset_t *);
 void xen_bcast_tlbflush(void);
 void xen_mcast_invlpg(vaddr_t, kcpuset_t *);
 void xen_bcast_invlpg(vaddr_t);
+void xen_copy_page(paddr_t, paddr_t);
+void xen_pagezero(paddr_t);
 
 void pmap_xen_resume(void);
 void pmap_xen_suspend(void);

Index: src/sys/arch/xen/x86/x86_xpmap.c
diff -u src/sys/arch/xen/x86/x86_xpmap.c:1.52 src/sys/arch/xen/x86/x86_xpmap.c:1.53
--- src/sys/arch/xen/x86/x86_xpmap.c:1.52	Sun Nov 10 01:19:13 2013
+++ src/sys/arch/xen/x86/x86_xpmap.c	Tue May  6 04:26:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_xpmap.c,v 1.52 2013/11/10 01:19:13 jnemeth Exp $	*/
+/*	$NetBSD: x86_xpmap.c,v 1.53 2014/05/06 04:26:24 cherry Exp $	*/
 
 /*
  * Copyright (c) 2006 Mathieu Ropert m...@adviseo.fr
@@ -69,7 +69,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: x86_xpmap.c,v 1.52 2013/11/10 01:19:13 jnemeth Exp $);
+__KERNEL_RCSID(0, $NetBSD: x86_xpmap.c,v 1.53 2014/05/06 04:26:24 cherry Exp $);
 
 #include opt_xen.h
 #include opt_ddb.h
@@ -490,6 +490,35 @@ xen_vcpu_bcast_invlpg(vaddr_t sva, vaddr
 	return;
 }
 
+/* Copy a page */
+void
+xen_copy_page(paddr_t srcpa, paddr_t dstpa)
+{
+	mmuext_op_t op;
+
+	op.cmd = MMUEXT_COPY_PAGE;
+	op.arg1.mfn = xpmap_ptom(dstpa)  PAGE_SHIFT;
+	op.arg2.src_mfn = xpmap_ptom(srcpa)  PAGE_SHIFT;
+
+	if (HYPERVISOR_mmuext_op(op, 1, NULL, DOMID_SELF)  0) {
+		panic(__func__);
+	}
+}
+
+/* Zero a physical page */
+void
+xen_pagezero(paddr_t pa)
+{
+	mmuext_op_t op;
+
+	op.cmd = MMUEXT_CLEAR_PAGE;
+	op.arg1.mfn = xpmap_ptom(pa)  PAGE_SHIFT;
+
+	if (HYPERVISOR_mmuext_op(op, 1, NULL, DOMID_SELF)  0) {
+		panic(__func__);
+	}
+}
+
 int
 xpq_update_foreign(paddr_t ptr, pt_entry_t val, int dom)
 {