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

2014-10-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 12 06:00:14 UTC 2014

Modified Files:
src/sys/arch/arm/include: mutex.h

Log Message:
Typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/include/mutex.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/arm/include/mutex.h
diff -u src/sys/arch/arm/include/mutex.h:1.17 src/sys/arch/arm/include/mutex.h:1.18
--- src/sys/arch/arm/include/mutex.h:1.17	Fri Aug  8 07:34:02 2014
+++ src/sys/arch/arm/include/mutex.h	Sun Oct 12 06:00:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mutex.h,v 1.17 2014/08/08 07:34:02 skrll Exp $	*/
+/*	$NetBSD: mutex.h,v 1.18 2014/10/12 06:00:14 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@ struct kmutex {
 		/* Spin mutex */
 		struct {
 			/*
-			 * Since the low bit of mtax_owner is used to flag this
+			 * Since the low bit of mtxa_owner is used to flag this
 			 * mutex as a spin mutex, we can't use the first byte
 			 * or the last byte to store the ipl or lock values.
 			 */



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

2014-10-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 12 05:40:56 UTC 2014

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

Log Message:
Typo. s/NC/NS/


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/arm32/db_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/db_machdep.c
diff -u src/sys/arch/arm/arm32/db_machdep.c:1.21 src/sys/arch/arm/arm32/db_machdep.c:1.22
--- src/sys/arch/arm/arm32/db_machdep.c:1.21	Sun Mar 30 08:00:34 2014
+++ src/sys/arch/arm/arm32/db_machdep.c	Sun Oct 12 05:40:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_machdep.c,v 1.21 2014/03/30 08:00:34 skrll Exp $	*/
+/*	$NetBSD: db_machdep.c,v 1.22 2014/10/12 05:40:56 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.21 2014/03/30 08:00:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.22 2014/10/12 05:40:56 skrll Exp $");
 
 #include 
 #include 
@@ -337,7 +337,7 @@ tlb_print_cortex_a7_entry(size_t way, si
 	const u_int sh = __SHIFTOUT(d2, ARM_A7_TLBDATA2_SH);
 	static const char is_types[3][3] = { "NC", "WB", "WT" };
 	static const char os_types[4][6] = { "NC", "WB+WA", "WT", "WB" };
-	static const char sh_types[4][3] = { "NC", "na", "OS", "IS" };
+	static const char sh_types[4][3] = { "NS", "na", "OS", "IS" };
 	db_printf(" %2s %5s %2s\n", is_types[is], os_types[os], sh_types[sh]);
 }
 



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

2014-10-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 12 05:41:24 UTC 2014

Modified Files:
src/sys/arch/arm/include: armreg.h

Log Message:
Minor amendment/corrections.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/arm/include/armreg.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/arm/include/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.98 src/sys/arch/arm/include/armreg.h:1.99
--- src/sys/arch/arm/include/armreg.h:1.98	Tue Sep 16 21:59:40 2014
+++ src/sys/arch/arm/include/armreg.h	Sun Oct 12 05:41:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.98 2014/09/16 21:59:40 matt Exp $	*/
+/*	$NetBSD: armreg.h,v 1.99 2014/10/12 05:41:24 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -712,13 +712,13 @@
 #define ARM_A7_TLBDATA2_S2_LEVEL	__BITS(85-64,84-64)
 #define ARM_A7_TLBDATA2_S1_SIZE		__BITS(83-64,82-64)
 #define ARM_A7_TLBDATA2_S1_SIZE_4KB	0
-#define ARM_A7_TLBDATA2_S1_SIZE_64KB	0
-#define ARM_A7_TLBDATA2_S1_SIZE_1MB	0
-#define ARM_A7_TLBDATA2_S1_SIZE_16MB	0
+#define ARM_A7_TLBDATA2_S1_SIZE_64KB	1
+#define ARM_A7_TLBDATA2_S1_SIZE_1MB	2
+#define ARM_A7_TLBDATA2_S1_SIZE_16MB	3
 #define ARM_A7_TLBDATA2_DOM		__BITS(81-64,78-64)
 #define ARM_A7_TLBDATA2_IS		__BITS(77-64,76-64)
 #define ARM_A7_TLBDATA2_IS_NC		0
-#define ARM_A7_TLBDATA2_IS_WB		1
+#define ARM_A7_TLBDATA2_IS_WB_WA	1
 #define ARM_A7_TLBDATA2_IS_WT		2
 #define ARM_A7_TLBDATA2_IS_DSO		3
 #define ARM_A7_TLBDATA2_S2OVR		__BIT(75-64)



CVS commit: src/usr.bin/config

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Oct 12 05:25:21 UTC 2014

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

Log Message:
Fix typos in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/config/hash.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/hash.c
diff -u src/usr.bin/config/hash.c:1.9 src/usr.bin/config/hash.c:1.10
--- src/usr.bin/config/hash.c:1.9	Sun Oct 12 05:20:54 2014
+++ src/usr.bin/config/hash.c	Sun Oct 12 05:25:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.c,v 1.9 2014/10/12 05:20:54 uebayasi Exp $	*/
+/*	$NetBSD: hash.c,v 1.10 2014/10/12 05:25:21 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -265,7 +265,7 @@ ht_insrep2(struct hashtab *ht, const cha
 	struct hashenthead *hpp;
 	u_int h;
 
-	h = hash2(0, nam1, NULL);
+	h = hash2(0, nam1, nam2);
 	hpp = &ht->ht_tab[h & ht->ht_mask];
 	TAILQ_FOREACH(hp, hpp, h_next) {
 		if (hp->h_name1 == nam1 &&
@@ -327,7 +327,7 @@ ht_lookup2(struct hashtab *ht, const cha
 	struct hashenthead *hpp;
 	u_int h;
 
-	h = hash2(0, nam1, NULL);
+	h = hash2(0, nam1, nam2);
 	hpp = &ht->ht_tab[h & ht->ht_mask];
 	TAILQ_FOREACH(hp, hpp, h_next)
 		if (hp->h_name == nam1)



CVS commit: src/usr.bin/config

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Oct 12 05:20:54 UTC 2014

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

Log Message:
Make hash capable of taking two key strings.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/config/defs.h
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/config/hash.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/defs.h
diff -u src/usr.bin/config/defs.h:1.56 src/usr.bin/config/defs.h:1.57
--- src/usr.bin/config/defs.h:1.56	Sat Oct 11 03:17:40 2014
+++ src/usr.bin/config/defs.h	Sun Oct 12 05:20:54 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.56 2014/10/11 03:17:40 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.57 2014/10/12 05:20:54 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -536,14 +536,20 @@ int	expr_eval(struct condexpr *, int (*)
 /* hash.c */
 struct	hashtab *ht_new(void);
 void	ht_free(struct hashtab *);
+int	ht_insrep2(struct hashtab *, const char *, const char *, void *, int);
 int	ht_insrep(struct hashtab *, const char *, void *, int);
+#define	ht_insert2(ht, nam1, nam2, val) ht_insrep2(ht, nam1, nam2, val, 0)
 #define	ht_insert(ht, nam, val) ht_insrep(ht, nam, val, 0)
 #define	ht_replace(ht, nam, val) ht_insrep(ht, nam, val, 1)
+int	ht_remove2(struct hashtab *, const char *, const char *);
 int	ht_remove(struct hashtab *, const char *);
+void	*ht_lookup2(struct hashtab *, const char *, const char *);
 void	*ht_lookup(struct hashtab *, const char *);
 void	initintern(void);
 const char *intern(const char *);
+typedef int (*ht_callback2)(const char *, const char *, void *, void *);
 typedef int (*ht_callback)(const char *, void *, void *);
+int	ht_enumerate2(struct hashtab *, ht_callback2, void *);
 int	ht_enumerate(struct hashtab *, ht_callback, void *);
 
 /* typed hash, named struct HT, whose type is string -> struct VT */

Index: src/usr.bin/config/hash.c
diff -u src/usr.bin/config/hash.c:1.8 src/usr.bin/config/hash.c:1.9
--- src/usr.bin/config/hash.c:1.8	Mon Mar 12 02:58:55 2012
+++ src/usr.bin/config/hash.c	Sun Oct 12 05:20:54 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.c,v 1.8 2012/03/12 02:58:55 dholland Exp $	*/
+/*	$NetBSD: hash.c,v 1.9 2014/10/12 05:20:54 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -58,7 +58,10 @@
 struct hashent {
 	// XXXLUKEM: a SIMPLEQ might be more appropriate
 	TAILQ_ENTRY(hashent) h_next;
-	const char *h_name;		/* the string */
+	const char *h_names[2];		/* the string */
+#define	h_name1	h_names[0]
+#define	h_name2	h_names[1]
+#define	h_name	h_name1
 	u_int	h_hash;			/* its hash value */
 	void	*h_value;		/* other values (for name=value) */
 };
@@ -81,7 +84,8 @@ static struct hashtab strings;
 
 static void			ht_expand(struct hashtab *);
 static void			ht_init(struct hashtab *, size_t);
-static inline u_int		hash(const char *);
+static inline u_int		hash(u_int, const char *);
+static inline u_int		hash2(u_int, const char *, const char *);
 static inline struct hashent   *newhashent(const char *, u_int);
 
 /*
@@ -137,27 +141,51 @@ ht_expand(struct hashtab *ht)
  * otherwise allocate a new entry.
  */
 static inline struct hashent *
-newhashent(const char *name, u_int h)
+newhashent2(const char *name1, const char *name2, u_int h)
 {
 	struct hashent *hp;
 
 	hp = ecalloc(1, sizeof(*hp));
 
-	hp->h_name = name;
+	hp->h_name1 = name1;
+	hp->h_name2 = name2;
 	hp->h_hash = h;
 	return (hp);
 }
 
+static inline struct hashent *
+newhashent(const char *name, u_int h)
+{
+	return newhashent2(name, NULL, h);
+}
+
+static inline u_int
+hv(u_int h, char c)
+{
+	return (h << 5) + h + c;
+}
+
 /*
  * Hash a string.
  */
 static inline u_int
-hash(const char *str)
+hash(u_int h, const char *str)
 {
-	u_int h;
 
-	for (h = 0; *str;)
-		h = (h << 5) + h + *str++;
+	while (str && *str)
+		h = hv(h, *str++);
+	return (h);
+}
+
+#define	HASH2DELIM	' '
+
+static inline u_int
+hash2(u_int h, const char *str1, const char *str2)
+{
+
+	h = hash(h, str1);
+	h = hv(h, HASH2DELIM);
+	h = hash(h, str2);
 	return (h);
 }
 
@@ -182,7 +210,7 @@ intern(const char *s)
 	char *p;
 
 	ht = &strings;
-	h = hash(s);
+	h = hash2(0, s, NULL);
 	hpp = &ht->ht_tab[h & ht->ht_mask];
 	TAILQ_FOREACH(hp, hpp, h_next) {
 		if (hp->h_hash == h && strcmp(hp->h_name, s) == 0)
@@ -231,22 +259,23 @@ ht_free(struct hashtab *ht)
  * Insert and/or replace.
  */
 int
-ht_insrep(struct hashtab *ht, const char *nam, void *val, int replace)
+ht_insrep2(struct hashtab *ht, const char *nam1, const char *nam2, void *val, int replace)
 {
 	struct hashent *hp;
 	struct hashenthead *hpp;
 	u_int h;
 
-	h = hash(nam);
+	h = hash2(0, nam1, NULL);
 	hpp = &ht->ht_tab[h & ht->ht_mask];
 	TAILQ_FOREACH(hp, hpp, h_next) {
-		if (hp->h_name == nam) {
+		if (hp->h_name1 == nam1 &&
+		hp->h_name2 == nam2) {
 			if (replace)
 hp->h_value = val;
 			return (1);
 		}
 	}
-	hp = newhashent(nam, h);
+	hp = newhashent2(nam1, nam2,

CVS commit: src/sys/kern

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Oct 12 04:38:28 UTC 2014

Modified Files:
src/sys/kern: files.kern

Log Message:
Mark some stray files as kern for now.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/kern/files.kern

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/files.kern
diff -u src/sys/kern/files.kern:1.1 src/sys/kern/files.kern:1.2
--- src/sys/kern/files.kern:1.1	Sun Oct 12 04:30:42 2014
+++ src/sys/kern/files.kern	Sun Oct 12 04:38:28 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.kern,v 1.1 2014/10/12 04:30:42 uebayasi Exp $
+#	$NetBSD: files.kern,v 1.2 2014/10/12 04:38:28 uebayasi Exp $
 
 #
 # kernel sources
@@ -6,15 +6,15 @@
 define	kern:	machdep, uvm
 defflag	opt_kern.h			KERN
 file	compat/common/compat_mod.c	compat_netbsd | compat_netbsd32
-file	conf/debugsyms.c
+file	conf/debugsyms.c		kern
 file	dev/bio.c			bio			needs-flag
 file	dev/ccd.c			ccd
 file	dev/cgd.c			cgd
 file	dev/cgd_crypto.c		cgd
-file	dev/clock_subr.c
+file	dev/clock_subr.c		kern	# XXX
 file	dev/clockctl.c			clockctl
 file	dev/dksubr.c			cgd | xbd | ccd | raid | dm
-file	dev/dkwedge/dk.c
+file	dev/dkwedge/dk.c		kern	# XXX
 file	dev/dkwedge/dkwedge_apple.c	dkwedge_method_apple
 file	dev/dkwedge/dkwedge_bsdlabel.c	dkwedge_method_bsdlabel
 file	dev/dkwedge/dkwedge_gpt.c	dkwedge_method_gpt
@@ -24,7 +24,7 @@ file	dev/fss.c			fss
 file	dev/keylock.c			keylock
 file	dev/lockstat.c			lockstat		needs-flag
 file	dev/md.c			md
-file	dev/mm.c
+file	dev/mm.c			kern	# XXX
 file	dev/nullcons_subr.c		nullcons		needs-flag
 file	dev/radio.c			radio			needs-flag
 file	dev/rndpseudo.c			rnd			needs-flag
@@ -184,7 +184,7 @@ file	kern/uipc_accf.c		kern
 file	kern/uipc_domain.c		kern
 file	kern/uipc_mbuf.c		kern
 file	kern/uipc_mbuf2.c		kern
-file	net/link_proto.c
+file	net/link_proto.c		kern	# XXX
 file	kern/uipc_proto.c		kern
 file	kern/uipc_sem.c			kern
 file	kern/uipc_socket.c		kern



CVS commit: src/sys

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Oct 12 04:30:42 UTC 2014

Modified Files:
src/sys/conf: files
Added Files:
src/sys/kern: files.kern

Log Message:
Move kern definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.1119 -r1.1120 src/sys/conf/files
cvs rdiff -u -r0 -r1.1 src/sys/kern/files.kern

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1119 src/sys/conf/files:1.1120
--- src/sys/conf/files:1.1119	Sun Oct 12 03:56:18 2014
+++ src/sys/conf/files	Sun Oct 12 04:30:42 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1119 2014/10/12 03:56:18 uebayasi Exp $
+#	$NetBSD: files,v 1.1120 2014/10/12 04:30:42 uebayasi Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20141010
@@ -1471,234 +1471,7 @@ include "uvm/files.uvm"
 #
 include "secmodel/files.secmodel"
 
-#
-# kernel sources
-#
-define	kern:	machdep, uvm
-defflag	opt_kern.h			KERN
-file	compat/common/compat_mod.c	compat_netbsd | compat_netbsd32
-file	conf/debugsyms.c
-file	dev/bio.c			bio			needs-flag
-file	dev/ccd.c			ccd
-file	dev/cgd.c			cgd
-file	dev/cgd_crypto.c		cgd
-file	dev/clock_subr.c
-file	dev/clockctl.c			clockctl
-file	dev/dksubr.c			cgd | xbd | ccd | raid | dm
-file	dev/dkwedge/dk.c
-file	dev/dkwedge/dkwedge_apple.c	dkwedge_method_apple
-file	dev/dkwedge/dkwedge_bsdlabel.c	dkwedge_method_bsdlabel
-file	dev/dkwedge/dkwedge_gpt.c	dkwedge_method_gpt
-file	dev/dkwedge/dkwedge_mbr.c	dkwedge_method_mbr
-file	dev/firmload.c			firmload
-file	dev/fss.c			fss
-file	dev/keylock.c			keylock
-file	dev/lockstat.c			lockstat		needs-flag
-file	dev/md.c			md
-file	dev/mm.c
-file	dev/nullcons_subr.c		nullcons		needs-flag
-file	dev/radio.c			radio			needs-flag
-file	dev/rndpseudo.c			rnd			needs-flag
-file	dev/sequencer.c			sequencer		needs-flag
-file	dev/video.c			video			needs-flag
-file	dev/vnd.c			vnd
-file	kern/bufq_disksort.c		bufq_disksort
-file	kern/bufq_fcfs.c		bufq_fcfs
-file	kern/bufq_priocscan.c		bufq_priocscan
-file	kern/bufq_readprio.c		bufq_readprio | new_bufq_strategy
-file	kern/core_elf32.c		exec_elf32
-file	kern/core_elf64.c		exec_elf64
-file	kern/core_netbsd.c		exec_aout | exec_coff | exec_ecoff
-file	kern/cnmagic.c			kern
-file	kern/exec_aout.c		exec_aout
-file	kern/exec_ecoff.c		exec_ecoff
-file	kern/exec_elf32.c		exec_elf32
-file	kern/exec_elf64.c		exec_elf64
-file	kern/exec_script.c		exec_script
-file	kern/exec_subr.c		kern
-file	kern/init_main.c		kern
-file	kern/init_sysctl.c		kern
-file	kern/init_sysctl_base.c		kern
-file	kern/init_sysent.c		kern
-file	kern/kern_acct.c		kern
-file	kern/kern_auth.c		kern
-file	kern/kern_cfglock.c		kern
-file	kern/kern_clock.c		kern
-file	kern/kern_condvar.c		kern
-file	kern/kern_core.c		coredump
-file	kern/kern_cpu.c			kern
-file	kern/kern_ctf.c			kdtrace_hooks
-file	kern/kern_descrip.c		kern
-file	kern/kern_event.c		kern
-file	kern/kern_exec.c		kern
-file	kern/kern_exit.c		kern
-file	kern/kern_fork.c		kern
-file	kern/kern_idle.c		kern
-file	kern/kern_hook.c		kern
-file	kern/kern_kthread.c		kern
-file	kern/kern_ktrace.c		ktrace
-file	kern/kern_ktrace_vfs.c		ktrace
-file	kern/kern_ksyms.c		ksyms | ddb | modular needs-flag
-file	kern/kern_lock.c		kern
-file	kern/kern_lwp.c			kern
-file	kern/kern_malloc.c		kern
-file	kern/kern_module.c		kern
-file	kern/kern_module_vfs.c		kern
-file	kern/kern_mutex.c		kern
-file	kern/kern_mutex_obj.c		kern
-file	kern/kern_fileassoc.c		fileassoc
-file	kern/kern_ntptime.c		kern
-file	kern/kern_pax.c			pax_mprotect | pax_segvguard | pax_aslr
-file	kern/kern_physio.c		kern
-file	kern/kern_pmf.c			kern
-file	kern/kern_proc.c		kern
-file	kern/kern_prot.c		kern
-file	kern/kern_ras.c			kern
-file	kern/kern_rate.c		kern
-file	kern/kern_resource.c		kern
-file	kern/kern_rndpool.c		kern
-file	kern/kern_rndq.c		kern
-file	kern/kern_rndsink.c		kern
-file	kern/kern_runq.c		kern
-file	kern/kern_rwlock.c		kern
-file	kern/kern_rwlock_obj.c		kern
-file	kern/kern_sdt.c			kdtrace_hooks
-file	kern/kern_sig.c			kern
-file	kern/kern_sleepq.c		kern
-file	kern/kern_softint.c		kern
-file	kern/kern_ssp.c			kern
-file	kern/kern_stub.c		kern
-file	kern/kern_subr.c		kern
-file	kern/kern_synch.c		kern
-file	kern/kern_syscall.c		kern
-file	kern/kern_sysctl.c		kern
-file	kern/kern_tc.c			kern
-file	kern/kern_time.c		kern
-file	kern/kern_timeout.c		kern
-file	kern/kern_turnstile.c		kern
-file	kern/kern_todr.c		kern
-file	kern/kern_uidinfo.c		kern
-file	kern/kern_uuid.c		kern
-file	kern/kern_xxx.c			kern
-file	kern/kgdb_stub.c		kgdb
-file	kern/sched_4bsd.c		sched_4bsd
-file	kern/sched_m2.c			sched_m2
-file	kern/subr_autoconf.c		kern
-file	kern/subr_blist.c		vmswap
-file	kern/subr_bufq.c		kern
-file	kern/subr_callback.c		kern
-file	kern/subr_cprng.c		kern
-file	kern/subr_cpufreq.c		kern
-file	kern/subr_copy.c		kern
-file	kern/subr_debug.c		debug
-file	kern/subr_device.c		kern
-file	kern/subr_devsw.c		kern
-file	kern

CVS commit: src/usr.bin/config

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Oct 12 04:23:47 UTC 2014

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

Log Message:
More TODOs.


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

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/TODO
diff -u src/usr.bin/config/TODO:1.1 src/usr.bin/config/TODO:1.2
--- src/usr.bin/config/TODO:1.1	Fri Oct 10 11:38:42 2014
+++ src/usr.bin/config/TODO	Sun Oct 12 04:23:46 2014
@@ -33,3 +33,32 @@ o Sort objects in more reasonable order.
 	  :
 
   Kill linker definitions in sys/conf/Makefile.inc.kern.
+
+o Differenciate "options" and "flags"/"params".
+
+  "options" enables featurs by adding *.c files (via attributes).
+
+  "flags" and "params" are to change contents of *.c files.  These don't add
+  *.c files to the result kernek, or don't build attributes (modules).
+
+o Make flags/params per attributes (modules).
+
+  Basically flags and params are cpp(1) #define's generated in opt_*.h.  Make
+  them local to one attributes (modules).  Flags/params which affects files
+  across attributes (modules) are possible, but should be discouraged.
+
+o Generate things only by definitions.
+
+  In the ideal dynamically modular world, "selection" will be done not at
+  compile time but at runtime.  Users select their wanted modules, by
+  dynamically loading them.
+
+  This means that the system provides all choices; that is, build all modules
+  in the source tree.  Necessary information is defined in the "definition"
+  part.
+
+o Split cfdata.
+
+  cfdata is pattern matching rules to enable devices at runtime device
+  auto-configuration.  It is pure data and can (should) be generated separatedly
+  from the code.



CVS commit: src/sys

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Oct 12 03:56:18 UTC 2014

Modified Files:
src/sys/conf: files
Added Files:
src/sys/net: files.net

Log Message:
Move net definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.1118 -r1.1119 src/sys/conf/files
cvs rdiff -u -r0 -r1.1 src/sys/net/files.net

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1118 src/sys/conf/files:1.1119
--- src/sys/conf/files:1.1118	Sun Oct 12 03:52:30 2014
+++ src/sys/conf/files	Sun Oct 12 03:56:18 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1118 2014/10/12 03:52:30 uebayasi Exp $
+#	$NetBSD: files,v 1.1119 2014/10/12 03:56:18 uebayasi Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20141010
@@ -1700,70 +1700,7 @@ file	miscfs/specfs/spec_vnops.c	vfs
 file	miscfs/syncfs/sync_subr.c	vfs
 file	miscfs/syncfs/sync_vnops.c	vfs
 
-# XXX CLEANUP
-define	net
-file	net/bpf.c			bpfilter
-file	net/bpf_filter.c		bpf_filter
-file	net/bpf_stub.c			net
-file	net/bsd-comp.c			ppp & ppp_bsdcomp
-file	net/if.c			net
-file	net/if_arcsubr.c		arcnet			needs-flag
-file	net/if_atmsubr.c		atm
-file	net/if_bridge.c			bridge			needs-flag
-file	net/bridgestp.c			bridge
-file	net/if_ecosubr.c		eco
-file	net/if_etherip.c		etherip			needs-flag
-file	net/if_ethersubr.c		ether | fddi | netatalk | token |
-	wlan		needs-flag
-file	net/if_faith.c			faith & (inet | inet6)	needs-flag
-file	net/if_fddisubr.c		fddi			needs-flag
-file	net/if_gif.c			gif			needs-flag
-file	net/if_gre.c			gre			needs-flag
-file	net/if_hippisubr.c		hippi			needs-flag
-file	net/if_ieee1394subr.c		ieee1394
-file	net/if_loop.c			loop
-file	net/if_media.c			net
-file	net/if_mpls.c			ifmpls			needs-flag
-file	net/if_ppp.c			ppp			needs-flag
-file	net/if_srt.c			srt
-file	net/if_stf.c			stf & inet & inet6	needs-flag
-file	net/if_sl.c			sl			needs-flag
-file	net/if_spppsubr.c		sppp
-file	net/if_strip.c			strip			needs-flag
-file	net/if_tokensubr.c		token			needs-flag
-file	net/if_tap.c			tap
-file	net/if_tun.c			tun
-file	net/if_vlan.c			vlan			needs-flag
-file	net/if_pppoe.c			pppoe			needs-flag
-file	net/pfil.c			net
-file	net/ppp-deflate.c		ppp & ppp_deflate
-file	net/ppp_tty.c			ppp
-file	net/pktqueue.c			net
-file	net/net_stats.c			net
-file	net/radix.c			net
-file	net/raw_cb.c			net
-file	net/raw_usrreq.c		net
-file	net/route.c			net
-file	net/rtbl.c			net
-file	net/rtsock.c			net
-file	net/slcompress.c		sl | ppp | strip | (irip & irip_vj)
-file	net/zlib.c			(ppp & ppp_deflate) | opencrypto | vnd_compression | kdtrace_hooks
-file	netinet/accf_data.c		accf_data
-file	netinet/accf_http.c		accf_http
-file	netinet/cpu_in_cksum.c		(inet | inet6) & !cpu_in_cksum
-file	netinet/if_arp.c		arp | netatalk		needs-flag
-file	netinet/if_atm.c		atm
-file	netinet/in4_cksum.c		inet
-file	netinet/in_cksum.c		inet
-file	netinet/in_gif.c		gif & inet
-file	netinet/ip_carp.c		carp & (inet | inet6)	needs-flag
-file	netinet/ip_ecn.c		ipsec | gif | stf
-file	netinet/ip_encap.c		inet | inet6
-file	netinet/ip_etherip.c		etherip & inet
-file	netinet6/ip6_etherip.c		etherip & inet6
-file	netinet6/in6_gif.c		gif & inet6
-
-include "netisdn/files.i4b"
+include "net/files.net"
 
 # Game adapter (joystick)
 device	joy
@@ -1775,8 +1712,6 @@ defpseudo filemon
 file	dev/filemon/filemon.c		filemon
 file	dev/filemon/filemon_wrapper.c	filemon
 
-include	"net/agr/files.agr"
-
 #
 # General Purpose Input/Output framework
 #

Added files:

Index: src/sys/net/files.net
diff -u /dev/null src/sys/net/files.net:1.1
--- /dev/null	Sun Oct 12 03:56:18 2014
+++ src/sys/net/files.net	Sun Oct 12 03:56:18 2014
@@ -0,0 +1,68 @@
+#	$NetBSD: files.net,v 1.1 2014/10/12 03:56:18 uebayasi Exp $
+
+# XXX CLEANUP
+define	net
+file	net/bpf.c			bpfilter
+file	net/bpf_filter.c		bpf_filter
+file	net/bpf_stub.c			net
+file	net/bsd-comp.c			ppp & ppp_bsdcomp
+file	net/if.c			net
+file	net/if_arcsubr.c		arcnet			needs-flag
+file	net/if_atmsubr.c		atm
+file	net/if_bridge.c			bridge			needs-flag
+file	net/bridgestp.c			bridge
+file	net/if_ecosubr.c		eco
+file	net/if_etherip.c		etherip			needs-flag
+file	net/if_ethersubr.c		ether | fddi | netatalk | token |
+	wlan		needs-flag
+file	net/if_faith.c			faith & (inet | inet6)	needs-flag
+file	net/if_fddisubr.c		fddi			needs-flag
+file	net/if_gif.c			gif			needs-flag
+file	net/if_gre.c			gre			needs-flag
+file	net/if_hippisubr.c		hippi			needs-flag
+file	net/if_ieee1394subr.c		ieee1394
+file	net/if_loop.c			loop
+file	net/if_media.c			net
+file	net/if_mpls.c			ifmpls			needs-flag
+file	net/if_ppp.c			ppp			needs-flag
+file	net/if_srt.c			srt
+file	net/if_stf.c			stf & inet & inet6	needs-flag
+file	net/if_sl.c			sl			needs-flag
+file	net/if_spppsubr.c		sppp
+file	net/if_strip.c			strip			needs-flag
+file	net/if_tokensubr.c		token			needs-flag
+file	net/if_tap.c			tap
+file	net/if_tun.c			tun
+file	net/if_vlan.c

CVS commit: src/sys

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Oct 12 03:52:30 UTC 2014

Modified Files:
src/sys/conf: files
src/sys/miscfs/nullfs: files.nullfs
src/sys/miscfs/overlay: files.overlay
src/sys/miscfs/umapfs: files.umapfs

Log Message:
Define layerfs as an attribute.


To generate a diff of this commit:
cvs rdiff -u -r1.1117 -r1.1118 src/sys/conf/files
cvs rdiff -u -r1.4 -r1.5 src/sys/miscfs/nullfs/files.nullfs
cvs rdiff -u -r1.2 -r1.3 src/sys/miscfs/overlay/files.overlay
cvs rdiff -u -r1.2 -r1.3 src/sys/miscfs/umapfs/files.umapfs

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1117 src/sys/conf/files:1.1118
--- src/sys/conf/files:1.1117	Fri Oct 10 17:21:20 2014
+++ src/sys/conf/files	Sun Oct 12 03:52:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1117 2014/10/10 17:21:20 uebayasi Exp $
+#	$NetBSD: files,v 1.1118 2014/10/12 03:52:30 uebayasi Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20141010
@@ -1690,9 +1690,12 @@ file	miscfs/genfs/genfs_io.c		vfs
 file	miscfs/genfs/genfs_rename.c	vfs
 file	miscfs/genfs/genfs_vfsops.c	vfs
 file	miscfs/genfs/genfs_vnops.c	vfs
-file	miscfs/genfs/layer_subr.c	nullfs | overlay | umapfs
-file	miscfs/genfs/layer_vfsops.c	nullfs | overlay | umapfs
-file	miscfs/genfs/layer_vnops.c	nullfs | overlay | umapfs
+
+define	layerfs
+file	miscfs/genfs/layer_subr.c	layerfs
+file	miscfs/genfs/layer_vfsops.c	layerfs
+file	miscfs/genfs/layer_vnops.c	layerfs
+
 file	miscfs/specfs/spec_vnops.c	vfs
 file	miscfs/syncfs/sync_subr.c	vfs
 file	miscfs/syncfs/sync_vnops.c	vfs

Index: src/sys/miscfs/nullfs/files.nullfs
diff -u src/sys/miscfs/nullfs/files.nullfs:1.4 src/sys/miscfs/nullfs/files.nullfs:1.5
--- src/sys/miscfs/nullfs/files.nullfs:1.4	Sat Oct 11 06:42:20 2014
+++ src/sys/miscfs/nullfs/files.nullfs	Sun Oct 12 03:52:30 2014
@@ -1,7 +1,7 @@
-#	$NetBSD: files.nullfs,v 1.4 2014/10/11 06:42:20 uebayasi Exp $
+#	$NetBSD: files.nullfs,v 1.5 2014/10/12 03:52:30 uebayasi Exp $
 
 deffs	NULLFS
 
-define	nullfs: vfs
+define	nullfs: vfs, layerfs
 file	miscfs/nullfs/null_vfsops.c	nullfs
 file	miscfs/nullfs/null_vnops.c	nullfs

Index: src/sys/miscfs/overlay/files.overlay
diff -u src/sys/miscfs/overlay/files.overlay:1.2 src/sys/miscfs/overlay/files.overlay:1.3
--- src/sys/miscfs/overlay/files.overlay:1.2	Sat Oct 11 06:42:20 2014
+++ src/sys/miscfs/overlay/files.overlay	Sun Oct 12 03:52:30 2014
@@ -1,7 +1,7 @@
-#	$NetBSD: files.overlay,v 1.2 2014/10/11 06:42:20 uebayasi Exp $
+#	$NetBSD: files.overlay,v 1.3 2014/10/12 03:52:30 uebayasi Exp $
 
 deffs	OVERLAY
 
-define	overlay: vfs
+define	overlay: vfs, layerfs
 file	miscfs/overlay/overlay_vfsops.c	overlay
 file	miscfs/overlay/overlay_vnops.c	overlay

Index: src/sys/miscfs/umapfs/files.umapfs
diff -u src/sys/miscfs/umapfs/files.umapfs:1.2 src/sys/miscfs/umapfs/files.umapfs:1.3
--- src/sys/miscfs/umapfs/files.umapfs:1.2	Sat Oct 11 06:42:20 2014
+++ src/sys/miscfs/umapfs/files.umapfs	Sun Oct 12 03:52:30 2014
@@ -1,8 +1,8 @@
-#	$NetBSD: files.umapfs,v 1.2 2014/10/11 06:42:20 uebayasi Exp $
+#	$NetBSD: files.umapfs,v 1.3 2014/10/12 03:52:30 uebayasi Exp $
 
 deffs	UMAPFS
 
-define	umapfs: vfs
+define	umapfs: vfs, layerfs
 file	miscfs/umapfs/umap_subr.c	umapfs
 file	miscfs/umapfs/umap_vfsops.c	umapfs
 file	miscfs/umapfs/umap_vnops.c	umapfs



CVS commit: src/sys/dev/i2c

2014-10-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sun Oct 12 01:23:23 UTC 2014

Modified Files:
src/sys/dev/i2c: ds1307.c ds1307reg.h

Log Message:
- support DS3231 ( more or less a DS3232 without NVRAM it seems )
- support the DS3231's temperature sensor


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/i2c/ds1307.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/ds1307reg.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/dev/i2c/ds1307.c
diff -u src/sys/dev/i2c/ds1307.c:1.18 src/sys/dev/i2c/ds1307.c:1.19
--- src/sys/dev/i2c/ds1307.c:1.18	Fri Jul 25 08:10:37 2014
+++ src/sys/dev/i2c/ds1307.c	Sun Oct 12 01:23:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ds1307.c,v 1.18 2014/07/25 08:10:37 dholland Exp $	*/
+/*	$NetBSD: ds1307.c,v 1.19 2014/10/12 01:23:23 macallan Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.18 2014/07/25 08:10:37 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.19 2014/10/12 01:23:23 macallan Exp $");
 
 #include 
 #include 
@@ -51,6 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1
 
 #include 
 #include 
+#include 
 
 struct dsrtc_model {
 	uint16_t dm_model;
@@ -63,6 +64,7 @@ struct dsrtc_model {
 	uint8_t dm_flags;
 #define	DSRTC_FLAG_CLOCK_HOLD	1
 #define	DSRTC_FLAG_BCD		2	
+#define	DSRTC_FLAG_TEMP		4	
 };
 
 static const struct dsrtc_model dsrtc_models[] = {
@@ -86,6 +88,16 @@ static const struct dsrtc_model dsrtc_mo
 		.dm_rtc_size = DS1672_RTC_SIZE,
 		.dm_flags = 0,
 	}, {
+		.dm_model = 3231,
+		.dm_rtc_start = DS3232_RTC_START,
+		.dm_rtc_size = DS3232_RTC_SIZE,
+		/*
+		 * XXX
+		 * the DS3232 likely has the temperature sensor too but I can't
+		 * easily verify or test that right now
+		 */
+		.dm_flags = DSRTC_FLAG_BCD | DSRTC_FLAG_TEMP,
+	}, {
 		.dm_model = 3232,
 		.dm_rtc_start = DS3232_RTC_START,
 		.dm_rtc_size = DS3232_RTC_SIZE,
@@ -102,6 +114,8 @@ struct dsrtc_softc {
 	bool sc_open;
 	struct dsrtc_model sc_model;
 	struct todr_chip_handle sc_todr;
+	struct sysmon_envsys *sc_sme;
+	envsys_data_t sc_sensor;
 };
 
 static void	dsrtc_attach(device_t, device_t, void *);
@@ -141,6 +155,9 @@ static int dsrtc_settime_timeval(struct 
 static int dsrtc_clock_read_timeval(struct dsrtc_softc *, time_t *);
 static int dsrtc_clock_write_timeval(struct dsrtc_softc *, time_t);
 
+static int dsrtc_read_temp(struct dsrtc_softc *, uint32_t *);
+static void dsrtc_refresh(struct sysmon_envsys *, envsys_data_t *);
+
 static const struct dsrtc_model *
 dsrtc_model(u_int model)
 {
@@ -202,6 +219,35 @@ dsrtc_attach(device_t parent, device_t s
 	sc->sc_todr.todr_setwen = NULL;
 
 	todr_attach(&sc->sc_todr);
+	if ((sc->sc_model.dm_flags & DSRTC_FLAG_TEMP) != 0) {
+		int error;
+
+		sc->sc_sme = sysmon_envsys_create();
+		sc->sc_sme->sme_name = device_xname(self);
+		sc->sc_sme->sme_cookie = sc;
+		sc->sc_sme->sme_refresh = dsrtc_refresh;
+
+		sc->sc_sensor.units =  ENVSYS_STEMP;
+		sc->sc_sensor.state = ENVSYS_SINVALID;
+		sc->sc_sensor.flags = 0;
+		(void)strlcpy(sc->sc_sensor.desc, "temperature",
+		sizeof(sc->sc_sensor.desc));
+
+		if (sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor)) {
+			aprint_error_dev(self, "unable to attach sensor\n");
+			goto bad;
+		}
+
+		error = sysmon_envsys_register(sc->sc_sme);
+		if (error) {
+			aprint_error_dev(self, 
+			"error %d registering with sysmon\n", error);
+			goto bad;
+		}
+	}
+	return;
+bad:
+	sysmon_envsys_destroy(sc->sc_sme);
 }
 
 /*ARGSUSED*/
@@ -624,3 +670,56 @@ dsrtc_clock_write_timeval(struct dsrtc_s
 
 	return 1;
 }
+
+static int
+dsrtc_read_temp(struct dsrtc_softc *sc, uint32_t *temp)
+{
+	int error, tc;
+	uint8_t reg = DS3232_TEMP_MSB;
+	uint8_t buf[2];
+
+	if ((sc->sc_model.dm_flags & DSRTC_FLAG_TEMP) == 0)
+		return ENOTSUP;
+
+	if ((error = iic_acquire_bus(sc->sc_tag, I2C_F_POLL)) != 0) {
+		aprint_error_dev(sc->sc_dev,
+		"%s: failed to acquire I2C bus: %d\n",
+		__func__, error);
+		return 0;
+	}
+
+	/* read temperature registers: */
+	error = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_address,
+	 ®, 1, buf, 2, I2C_F_POLL);
+
+	/* Done with I2C */
+	iic_release_bus(sc->sc_tag, I2C_F_POLL);
+
+	if (error != 0) {
+		aprint_error_dev(sc->sc_dev,
+		"%s: failed to read temperature: %d\n",
+		__func__, error);
+		return 0;
+	}
+
+	/* convert to microkelvin */
+	tc = buf[0] * 100 + (buf[1] >> 6) * 25;
+	*temp = tc + 27315;
+	return 1;
+}
+
+static void
+dsrtc_refresh(struct sysmon_envsys *sme, envsys_data_t *edata)
+{
+	struct dsrtc_softc *sc = sme->sme_cookie;
+	uint32_t temp;
+
+	if (dsrtc_read_temp(sc, &temp) == 0) {
+		edata->state = ENVSYS_SINVALID;
+		return;
+	}
+
+	edata->value_cur = temp;
+
+	edata->state = ENVSYS_SVALID;
+}

Index: src/sys/dev/i2c/ds1307reg.h
diff -u src/sys/dev/i2c/ds1307reg.h:1.4 src/sys/dev/i2c/ds1307reg.h:1.5
--- src/sys/de

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

2014-10-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 11 23:10:44 UTC 2014

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
add multicast tests


To generate a diff of this commit:
cvs rdiff -u -r1.591 -r1.592 src/distrib/sets/lists/tests/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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.591 src/distrib/sets/lists/tests/mi:1.592
--- src/distrib/sets/lists/tests/mi:1.591	Thu Sep 18 11:25:10 2014
+++ src/distrib/sets/lists/tests/mi	Sat Oct 11 19:10:44 2014
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.591 2014/09/18 15:25:10 ozaki-r Exp $
+# $NetBSD: mi,v 1.592 2014/10/11 23:10:44 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -148,6 +148,7 @@
 ./usr/libdata/debug/usr/tests/net/icmp	tests-net-debug
 ./usr/libdata/debug/usr/tests/net/if	tests-net-debug
 ./usr/libdata/debug/usr/tests/net/if_loop	tests-net-debug
+./usr/libdata/debug/usr/tests/net/mcast	tests-net-debug
 ./usr/libdata/debug/usr/tests/net/net	tests-net-debug
 ./usr/libdata/debug/usr/tests/net/sys	tests-net-debug
 ./usr/libdata/debug/usr/tests/rump	tests-syscall-debug,rump
@@ -3134,6 +3135,10 @@
 ./usr/tests/net/mpls/t_ldp_static		tests-net-tests		obsolete
 ./usr/tests/net/mpls/t_mpls_fw			tests-net-tests		atf,rump
 ./usr/tests/net/mpls/t_rfc4182			tests-net-tests		atf,rump
+./usr/tests/net/mcasttests-net-tests
+./usr/tests/net/mcast/Atffile			tests-net-tests		atf,rump
+./usr/tests/net/mcast/Kyuafile			tests-net-tests		atf,rump,kyua
+./usr/tests/net/mcast/t_mcast			tests-net-tests		atf,rump
 ./usr/tests/net/nettests-net-tests
 ./usr/tests/net/net/Atffile			tests-net-tests		atf
 ./usr/tests/net/net/Kyuafile			tests-net-tests		atf,kyua



CVS commit: src/sys/netinet6

2014-10-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 11 23:07:39 UTC 2014

Modified Files:
src/sys/netinet6: in6_pcb.c

Log Message:
Succeed binding to multicast address for now: Open questions:
Open questions:

http://mail-index.netbsd.org/tech-net/2014/07/23/msg004714.html


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/netinet6/in6_pcb.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/netinet6/in6_pcb.c
diff -u src/sys/netinet6/in6_pcb.c:1.130 src/sys/netinet6/in6_pcb.c:1.131
--- src/sys/netinet6/in6_pcb.c:1.130	Sat Oct 11 16:53:16 2014
+++ src/sys/netinet6/in6_pcb.c	Sat Oct 11 19:07:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_pcb.c,v 1.130 2014/10/11 20:53:16 christos Exp $	*/
+/*	$NetBSD: in6_pcb.c,v 1.131 2014/10/11 23:07:39 christos Exp $	*/
 /*	$KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.130 2014/10/11 20:53:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.131 2014/10/11 23:07:39 christos Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -233,6 +233,8 @@ in6_pcbbind_addr(struct in6pcb *in6p, st
 			ifa_ifwithaddr((struct sockaddr *)&sin) == 0)
 return EADDRNOTAVAIL;
 		}
+	} else if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {
+		// succeed
 	} else if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
 		struct ifaddr *ia = NULL;
 



CVS commit: src/tests/net

2014-10-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 11 23:04:42 UTC 2014

Modified Files:
src/tests/net: Makefile
Added Files:
src/tests/net/mcast: Makefile t_mcast.c

Log Message:
add a multicast test (what to do with v6?)


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/tests/net/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/mcast/Makefile \
src/tests/net/mcast/t_mcast.c

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

Modified files:

Index: src/tests/net/Makefile
diff -u src/tests/net/Makefile:1.18 src/tests/net/Makefile:1.19
--- src/tests/net/Makefile:1.18	Thu Sep 18 11:13:27 2014
+++ src/tests/net/Makefile	Sat Oct 11 19:04:42 2014
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.18 2014/09/18 15:13:27 ozaki-r Exp $
+# $NetBSD: Makefile,v 1.19 2014/10/11 23:04:42 christos Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/net
 
-TESTS_SUBDIRS=		fdpass net route sys
+TESTS_SUBDIRS=		fdpass mcast net route sys
 .if (${MKRUMP} != "no")
 TESTS_SUBDIRS+=		bpf bpfilter carp icmp if if_bridge if_loop mpls npf
 .if (${MKSLJIT} != "no")

Added files:

Index: src/tests/net/mcast/Makefile
diff -u /dev/null src/tests/net/mcast/Makefile:1.1
--- /dev/null	Sat Oct 11 19:04:42 2014
+++ src/tests/net/mcast/Makefile	Sat Oct 11 19:04:42 2014
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile,v 1.1 2014/10/11 23:04:42 christos Exp $
+#
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/net/mcast
+
+TESTS_C=	t_mcast
+
+.include 
Index: src/tests/net/mcast/t_mcast.c
diff -u /dev/null src/tests/net/mcast/t_mcast.c:1.1
--- /dev/null	Sat Oct 11 19:04:42 2014
+++ src/tests/net/mcast/t_mcast.c	Sat Oct 11 19:04:42 2014
@@ -0,0 +1,319 @@
+/*	$NetBSD: t_mcast.c,v 1.1 2014/10/11 23:04:42 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION 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 
+__RCSID("$NetBSD: t_mcast.c,v 1.1 2014/10/11 23:04:42 christos Exp $");
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifndef TEST
+#include 
+
+#define ERRX(ev, msg, ...)	ATF_REQUIRE_MSG(0, msg, __VA_ARGS__)
+
+#define SKIPX(ev, msg, ...)	do {			\
+	atf_tc_skip(msg, __VA_ARGS__);			\
+	return;		\
+} while(/*CONSTCOND*/0)
+
+#else
+#define ERRX(ev, msg, ...)	errx(ev, msg, __VA_ARGS__)
+#define SKIPX(ev, msg, ...)	errx(ev, msg, __VA_ARGS__)
+#endif
+
+static int debug;
+
+#define TOTAL 10
+#define PORT_V4MAPPED ""
+#define HOST_V4MAPPED ":::239.1.1.1"
+#define PORT_V4 ""
+#define HOST_V4 "239.1.1.1"
+#define PORT_V6 ""
+#define HOST_V6 "FF05:0:0:0:0:0:0:1"
+
+static int
+addmc(int s, struct addrinfo *ai)
+{
+	struct ip_mreq 	m4;
+	struct ipv6_mreq m6;
+	struct sockaddr_in *s4;
+	struct sockaddr_in6 *s6;
+	
+	switch (ai->ai_family) {
+	case AF_INET:
+		s4 = (void *)ai->ai_addr;
+		assert(sizeof(*s4) == ai->ai_addrlen);
+		m4.imr_multiaddr = s4->sin_addr;
+		m4.imr_interface.s_addr = htonl(INADDR_ANY);
+		return setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP,
+		&m4, sizeof(m4));
+	case AF_INET6:
+		s6 = (void *)ai->ai_addr;
+		// XXX: Both linux and we do this thing wrong...
+		if (IN6_IS_ADDR_V4MAPPED(&s6->sin6_addr)) {
+			memcpy(&m4.imr_multiaddr, &s6->sin6_addr.s6_addr[12],
+			sizeof(m4.imr_multiaddr));
+			m4.imr_interface.s_addr = htonl(INADDR_ANY);
+			return setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP,
+			&m4, sizeof(m4));
+		}
+		assert(sizeof(*s6) == ai->ai_addrlen);
+		memset(&m6, 0, sizeof(m6));
+		m6.ip

CVS commit: src/external/gpl3/gcc/lib/libstdc++-v3/arch

2014-10-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 11 21:28:43 UTC 2014

Modified Files:
src/external/gpl3/gcc/lib/libstdc++-v3/arch/riscv32: c++config.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/riscv64: c++config.h

Log Message:
more regen for complex and more.  only sun2 and ia64 missing now.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/riscv32/c++config.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/riscv64/c++config.h

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

Modified files:

Index: src/external/gpl3/gcc/lib/libstdc++-v3/arch/riscv32/c++config.h
diff -u src/external/gpl3/gcc/lib/libstdc++-v3/arch/riscv32/c++config.h:1.1 src/external/gpl3/gcc/lib/libstdc++-v3/arch/riscv32/c++config.h:1.2
--- src/external/gpl3/gcc/lib/libstdc++-v3/arch/riscv32/c++config.h:1.1	Fri Sep 19 17:23:24 2014
+++ src/external/gpl3/gcc/lib/libstdc++-v3/arch/riscv32/c++config.h	Sat Oct 11 21:28:43 2014
@@ -471,31 +471,31 @@ namespace std
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Define to 1 if you have the `acosf' function. */
-/* #undef _GLIBCXX_HAVE_ACOSF */
+#define _GLIBCXX_HAVE_ACOSF 1
 
 /* Define to 1 if you have the `acosl' function. */
-/* #undef _GLIBCXX_HAVE_ACOSL */
+#define _GLIBCXX_HAVE_ACOSL 1
 
 /* Define to 1 if you have the `asinf' function. */
-/* #undef _GLIBCXX_HAVE_ASINF */
+#define _GLIBCXX_HAVE_ASINF 1
 
 /* Define to 1 if you have the `asinl' function. */
-/* #undef _GLIBCXX_HAVE_ASINL */
+#define _GLIBCXX_HAVE_ASINL 1
 
 /* Define to 1 if the target assembler supports .symver directive. */
 #define _GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE 1
 
 /* Define to 1 if you have the `atan2f' function. */
-/* #undef _GLIBCXX_HAVE_ATAN2F */
+#define _GLIBCXX_HAVE_ATAN2F 1
 
 /* Define to 1 if you have the `atan2l' function. */
-/* #undef _GLIBCXX_HAVE_ATAN2L */
+#define _GLIBCXX_HAVE_ATAN2L 1
 
 /* Define to 1 if you have the `atanf' function. */
-/* #undef _GLIBCXX_HAVE_ATANF */
+#define _GLIBCXX_HAVE_ATANF 1
 
 /* Define to 1 if you have the `atanl' function. */
-/* #undef _GLIBCXX_HAVE_ATANL */
+#define _GLIBCXX_HAVE_ATANL 1
 
 /* Define to 1 if you have the `at_quick_exit' function. */
 #define _GLIBCXX_HAVE_AT_QUICK_EXIT 1
@@ -504,25 +504,25 @@ namespace std
 /* #undef _GLIBCXX_HAVE_CC_TLS */
 
 /* Define to 1 if you have the `ceilf' function. */
-/* #undef _GLIBCXX_HAVE_CEILF */
+#define _GLIBCXX_HAVE_CEILF 1
 
 /* Define to 1 if you have the `ceill' function. */
-/* #undef _GLIBCXX_HAVE_CEILL */
+#define _GLIBCXX_HAVE_CEILL 1
 
 /* Define to 1 if you have the  header file. */
 #define _GLIBCXX_HAVE_COMPLEX_H 1
 
 /* Define to 1 if you have the `cosf' function. */
-/* #undef _GLIBCXX_HAVE_COSF */
+#define _GLIBCXX_HAVE_COSF 1
 
 /* Define to 1 if you have the `coshf' function. */
-/* #undef _GLIBCXX_HAVE_COSHF */
+#define _GLIBCXX_HAVE_COSHF 1
 
 /* Define to 1 if you have the `coshl' function. */
-/* #undef _GLIBCXX_HAVE_COSHL */
+#define _GLIBCXX_HAVE_COSHL 1
 
 /* Define to 1 if you have the `cosl' function. */
-/* #undef _GLIBCXX_HAVE_COSL */
+#define _GLIBCXX_HAVE_COSL 1
 
 /* Define to 1 if you have the  header file. */
 #define _GLIBCXX_HAVE_DLFCN_H 1
@@ -591,13 +591,13 @@ namespace std
 #define _GLIBCXX_HAVE_EXECINFO_H 1
 
 /* Define to 1 if you have the `expf' function. */
-/* #undef _GLIBCXX_HAVE_EXPF */
+#define _GLIBCXX_HAVE_EXPF 1
 
 /* Define to 1 if you have the `expl' function. */
-/* #undef _GLIBCXX_HAVE_EXPL */
+#define _GLIBCXX_HAVE_EXPL 1
 
 /* Define to 1 if you have the `fabsf' function. */
-/* #undef _GLIBCXX_HAVE_FABSF */
+#define _GLIBCXX_HAVE_FABSF 1
 
 /* Define to 1 if you have the `fabsl' function. */
 #define _GLIBCXX_HAVE_FABSL 1
@@ -606,10 +606,10 @@ namespace std
 #define _GLIBCXX_HAVE_FENV_H 1
 
 /* Define to 1 if you have the `finite' function. */
-/* #undef _GLIBCXX_HAVE_FINITE */
+#define _GLIBCXX_HAVE_FINITE 1
 
 /* Define to 1 if you have the `finitef' function. */
-/* #undef _GLIBCXX_HAVE_FINITEF */
+#define _GLIBCXX_HAVE_FINITEF 1
 
 /* Define to 1 if you have the `finitel' function. */
 /* #undef _GLIBCXX_HAVE_FINITEL */
@@ -618,16 +618,16 @@ namespace std
 #define _GLIBCXX_HAVE_FLOAT_H 1
 
 /* Define to 1 if you have the `floorf' function. */
-/* #undef _GLIBCXX_HAVE_FLOORF */
+#define _GLIBCXX_HAVE_FLOORF 1
 
 /* Define to 1 if you have the `floorl' function. */
-/* #undef _GLIBCXX_HAVE_FLOORL */
+#define _GLIBCXX_HAVE_FLOORL 1
 
 /* Define to 1 if you have the `fmodf' function. */
-/* #undef _GLIBCXX_HAVE_FMODF */
+#define _GLIBCXX_HAVE_FMODF 1
 
 /* Define to 1 if you have the `fmodl' function. */
-/* #undef _GLIBCXX_HAVE_FMODL */
+#define _GLIBCXX_HAVE_FMODL 1
 
 /* Define to 1 if you have the `fpclass' function. */
 /* #undef _GLIBCXX_HAVE_FPCLASS */
@@ -636,7 +636,7 @@ namespace std
 /* #undef _GLIBCXX_HAVE_FP_H */
 
 /* Define to 1 if you have 

CVS commit: src/sys/netinet

2014-10-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 11 21:12:51 UTC 2014

Modified Files:
src/sys/netinet: ip_output.c ip_var.h

Log Message:
exposet multicast option functions which are used by the v6 code now.


To generate a diff of this commit:
cvs rdiff -u -r1.230 -r1.231 src/sys/netinet/ip_output.c
cvs rdiff -u -r1.106 -r1.107 src/sys/netinet/ip_var.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/netinet/ip_output.c
diff -u src/sys/netinet/ip_output.c:1.230 src/sys/netinet/ip_output.c:1.231
--- src/sys/netinet/ip_output.c:1.230	Thu Jun  5 20:11:19 2014
+++ src/sys/netinet/ip_output.c	Sat Oct 11 17:12:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_output.c,v 1.230 2014/06/06 00:11:19 rmind Exp $	*/
+/*	$NetBSD: ip_output.c,v 1.231 2014/10/11 21:12:51 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.230 2014/06/06 00:11:19 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.231 2014/10/11 21:12:51 christos Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -136,8 +136,6 @@ static struct mbuf *ip_insertoptions(str
 static struct ifnet *ip_multicast_if(struct in_addr *, int *);
 static void ip_mloopback(struct ifnet *, struct mbuf *,
 const struct sockaddr_in *);
-static int ip_setmoptions(struct inpcb *, const struct sockopt *);
-static int ip_getmoptions(struct inpcb *, struct sockopt *);
 
 extern pfil_head_t *inet_pfil_hook;			/* XXX */
 
@@ -1003,7 +1001,7 @@ ip_ctloutput(int op, struct socket *so, 
 		case IP_MULTICAST_LOOP:
 		case IP_ADD_MEMBERSHIP:
 		case IP_DROP_MEMBERSHIP:
-			error = ip_setmoptions(inp, sopt);
+			error = ip_setmoptions(&inp->inp_moptions, sopt);
 			break;
 
 		case IP_PORTRANGE:
@@ -1151,7 +1149,7 @@ ip_ctloutput(int op, struct socket *so, 
 		case IP_MULTICAST_LOOP:
 		case IP_ADD_MEMBERSHIP:
 		case IP_DROP_MEMBERSHIP:
-			error = ip_getmoptions(inp, sopt);
+			error = ip_getmoptions(inp->inp_moptions, sopt);
 			break;
 
 		case IP_PORTRANGE:
@@ -1364,10 +1362,10 @@ ip_getoptval(const struct sockopt *sopt,
 /*
  * Set the IP multicast options in response to user setsockopt().
  */
-static int
-ip_setmoptions(struct inpcb *inp, const struct sockopt *sopt)
+int
+ip_setmoptions(struct ip_moptions **pimo, const struct sockopt *sopt)
 {
-	struct ip_moptions *imo = inp->inp_moptions;
+	struct ip_moptions *imo = *pimo;
 	struct in_addr addr;
 	struct ip_mreq lmreq, *mreq;
 	struct ifnet *ifp;
@@ -1387,7 +1385,7 @@ ip_setmoptions(struct inpcb *inp, const 
 		imo->imo_multicast_ttl = IP_DEFAULT_MULTICAST_TTL;
 		imo->imo_multicast_loop = IP_DEFAULT_MULTICAST_LOOP;
 		imo->imo_num_memberships = 0;
-		inp->inp_moptions = imo;
+		*pimo = imo;
 	}
 
 	switch (sopt->sopt_name) {
@@ -1583,7 +1581,7 @@ ip_setmoptions(struct inpcb *inp, const 
 	imo->imo_multicast_loop == IP_DEFAULT_MULTICAST_LOOP &&
 	imo->imo_num_memberships == 0) {
 		kmem_free(imo, sizeof(*imo));
-		inp->inp_moptions = NULL;
+		*pimo = NULL;
 	}
 
 	return error;
@@ -1592,10 +1590,9 @@ ip_setmoptions(struct inpcb *inp, const 
 /*
  * Return the IP multicast options in response to user getsockopt().
  */
-static int
-ip_getmoptions(struct inpcb *inp, struct sockopt *sopt)
+int
+ip_getmoptions(struct ip_moptions *imo, struct sockopt *sopt)
 {
-	struct ip_moptions *imo = inp->inp_moptions;
 	struct in_addr addr;
 	struct in_ifaddr *ia;
 	uint8_t optval;

Index: src/sys/netinet/ip_var.h
diff -u src/sys/netinet/ip_var.h:1.106 src/sys/netinet/ip_var.h:1.107
--- src/sys/netinet/ip_var.h:1.106	Thu Jun  5 19:48:16 2014
+++ src/sys/netinet/ip_var.h	Sat Oct 11 17:12:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_var.h,v 1.106 2014/06/05 23:48:16 rmind Exp $	*/
+/*	$NetBSD: ip_var.h,v 1.107 2014/10/11 21:12:51 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -234,6 +234,9 @@ int	 rip_output(struct mbuf *, ...);
 int	 rip_usrreq(struct socket *,
 	int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *);
 
+int	ip_setmoptions(struct ip_moptions **, const struct sockopt *sopt);
+int	ip_getmoptions(struct ip_moptions *, struct sockopt *sopt);
+
 /* IP Flow interface. */
 void	ipflow_init(void);
 void	ipflow_poolinit(void);



CVS commit: src/sys/netinet6

2014-10-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 11 20:53:16 UTC 2014

Modified Files:
src/sys/netinet6: in6_pcb.c in6_pcb.h ip6_output.c udp6_output.c

Log Message:
Make IPV4 mapped addresses able to do IPV4 multicast. Fixes needed:

- allow binding to mapped v4 multicast addresses
- define v4moptions, allow setting it via ioctl, pass it to ip_output,
  free it when killing the pcb.

Ideally we would allow the IPV6 multicast setsockopts work on mapped addresses
too, but this is a lot more work and linux does not do it either.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/netinet6/in6_pcb.c
cvs rdiff -u -r1.39 -r1.40 src/sys/netinet6/in6_pcb.h
cvs rdiff -u -r1.158 -r1.159 src/sys/netinet6/ip6_output.c
cvs rdiff -u -r1.44 -r1.45 src/sys/netinet6/udp6_output.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/netinet6/in6_pcb.c
diff -u src/sys/netinet6/in6_pcb.c:1.129 src/sys/netinet6/in6_pcb.c:1.130
--- src/sys/netinet6/in6_pcb.c:1.129	Sat Sep  6 20:50:56 2014
+++ src/sys/netinet6/in6_pcb.c	Sat Oct 11 16:53:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_pcb.c,v 1.129 2014/09/07 00:50:56 rmind Exp $	*/
+/*	$NetBSD: in6_pcb.c,v 1.130 2014/10/11 20:53:16 christos Exp $	*/
 /*	$KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.129 2014/09/07 00:50:56 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.130 2014/10/11 20:53:16 christos Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -229,7 +229,8 @@ in6_pcbbind_addr(struct in6pcb *in6p, st
 			sin.sin_family = AF_INET;
 			bcopy(&sin6->sin6_addr.s6_addr32[3],
 			&sin.sin_addr, sizeof(sin.sin_addr));
-			if (ifa_ifwithaddr((struct sockaddr *)&sin) == 0)
+			if (!IN_MULTICAST(sin.sin_addr.s_addr) &&
+			ifa_ifwithaddr((struct sockaddr *)&sin) == 0)
 return EADDRNOTAVAIL;
 		}
 	} else if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
@@ -618,6 +619,7 @@ in6_pcbdetach(struct in6pcb *in6p)
 	}
 	rtcache_free(&in6p->in6p_route);
 	ip6_freemoptions(in6p->in6p_moptions);
+	ip_freemoptions(in6p->in6p_v4moptions);
 	sofree(so);/* drops the socket's lock */
 
 	pool_put(&in6pcb_pool, in6p);

Index: src/sys/netinet6/in6_pcb.h
diff -u src/sys/netinet6/in6_pcb.h:1.39 src/sys/netinet6/in6_pcb.h:1.40
--- src/sys/netinet6/in6_pcb.h:1.39	Tue Aug  5 01:24:27 2014
+++ src/sys/netinet6/in6_pcb.h	Sat Oct 11 16:53:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_pcb.h,v 1.39 2014/08/05 05:24:27 rtr Exp $	*/
+/*	$NetBSD: in6_pcb.h,v 1.40 2014/10/11 20:53:16 christos Exp $	*/
 /*	$KAME: in6_pcb.h,v 1.45 2001/02/09 05:59:46 itojun Exp $	*/
 
 /*
@@ -100,6 +100,7 @@ struct	in6pcb {
 	struct icmp6_filter *in6p_icmp6filt;
 	int	in6p_cksum;		/* IPV6_CHECKSUM setsockopt */
 	boolin6p_bindportonsend;
+	struct ip_moptions *in6p_v4moptions;/* IP4 multicast options */
 };
 
 #define in6p_faddr	in6p_ip6.ip6_dst

Index: src/sys/netinet6/ip6_output.c
diff -u src/sys/netinet6/ip6_output.c:1.158 src/sys/netinet6/ip6_output.c:1.159
--- src/sys/netinet6/ip6_output.c:1.158	Sat Aug 16 13:27:09 2014
+++ src/sys/netinet6/ip6_output.c	Sat Oct 11 16:53:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.158 2014/08/16 17:27:09 maxv Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.159 2014/10/11 20:53:16 christos Exp $	*/
 /*	$KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.158 2014/08/16 17:27:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.159 2014/10/11 20:53:16 christos Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -86,6 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: ip6_output.c
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1264,6 +1265,7 @@ ip6_ctloutput(int op, struct socket *so,
 	int optdatalen, uproto;
 	void *optdata;
 	struct in6pcb *in6p = sotoin6pcb(so);
+	struct ip_moptions **mopts;
 	int error, optval;
 	int level, optname;
 
@@ -1275,7 +1277,29 @@ ip6_ctloutput(int op, struct socket *so,
 	error = optval = 0;
 	uproto = (int)so->so_proto->pr_protocol;
 
-	if (level != IPPROTO_IPV6) {
+	switch (level) {
+	case IPPROTO_IP:
+		switch (optname) {
+		case IP_ADD_MEMBERSHIP:
+		case IP_DROP_MEMBERSHIP:
+		case IP_MULTICAST_IF:
+		case IP_MULTICAST_LOOP:
+		case IP_MULTICAST_TTL:
+			mopts = &in6p->in6p_v4moptions;
+			switch (op) {
+			case PRCO_GETOPT:
+return ip_getmoptions(*mopts, sopt);
+			case PRCO_SETOPT:
+return ip_setmoptions(mopts, sopt);
+			default:
+return EINVAL;
+			}
+		default:
+			return ENOPROTOOPT;
+		}
+	case IPPROTO_IPV6:
+		break;
+	default:
 		return ENOPROTOOPT;
 	}
 	switch (op) {

Index: src/sys/netinet6/udp6_output.c
diff -u src/sys/netinet6/udp6_output.c:1.44 src/sys/netinet6/udp6_output.c:1.45
--- src/sys/netinet6/udp6_ou

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

2014-10-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 11 20:50:59 UTC 2014

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

Log Message:
this doesn't need , which doesn't exist on older hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/dist/gas/config/tc-riscv.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-riscv.c
diff -u src/external/gpl3/binutils/dist/gas/config/tc-riscv.c:1.1 src/external/gpl3/binutils/dist/gas/config/tc-riscv.c:1.2
--- src/external/gpl3/binutils/dist/gas/config/tc-riscv.c:1.1	Fri Sep 19 17:19:53 2014
+++ src/external/gpl3/binutils/dist/gas/config/tc-riscv.c	Sat Oct 11 20:50:59 2014
@@ -30,7 +30,6 @@
 #include "dwarf2dbg.h"
 #include "dw2gencfi.h"
 
-#include 
 #include 
 
 #ifdef DEBUG



CVS commit: src/external/gpl3/gcc/lib/libstdc++-v3/arch/vax

2014-10-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 11 19:55:59 UTC 2014

Modified Files:
src/external/gpl3/gcc/lib/libstdc++-v3/arch/vax: c++config.h

Log Message:
more regen for complex and more.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/vax/c++config.h

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

Modified files:

Index: src/external/gpl3/gcc/lib/libstdc++-v3/arch/vax/c++config.h
diff -u src/external/gpl3/gcc/lib/libstdc++-v3/arch/vax/c++config.h:1.13 src/external/gpl3/gcc/lib/libstdc++-v3/arch/vax/c++config.h:1.14
--- src/external/gpl3/gcc/lib/libstdc++-v3/arch/vax/c++config.h:1.13	Fri Aug 22 05:39:21 2014
+++ src/external/gpl3/gcc/lib/libstdc++-v3/arch/vax/c++config.h	Sat Oct 11 19:55:59 2014
@@ -654,7 +654,7 @@ namespace std
 #define _GLIBCXX_HAVE_HYPOTF 1
 
 /* Define to 1 if you have the `hypotl' function. */
-/* #undef _GLIBCXX_HAVE_HYPOTL */
+#define _GLIBCXX_HAVE_HYPOTL 1
 
 /* Define if you have the iconv() function. */
 #define _GLIBCXX_HAVE_ICONV 1
@@ -771,7 +771,7 @@ namespace std
 #define _GLIBCXX_HAVE_POWF 1
 
 /* Define to 1 if you have the `powl' function. */
-#define _GLIBCXX_HAVE_POWL 1
+/* #undef _GLIBCXX_HAVE_POWL */
 
 /* Define to 1 if you have the `qfpclass' function. */
 /* #undef _GLIBCXX_HAVE_QFPCLASS */
@@ -804,7 +804,7 @@ namespace std
 /* #undef _GLIBCXX_HAVE_SINL */
 
 /* Defined if sleep exists. */
-#define _GLIBCXX_HAVE_SLEEP 1
+/* #undef _GLIBCXX_HAVE_SLEEP */
 
 /* Define to 1 if you have the `sqrtf' function. */
 #define _GLIBCXX_HAVE_SQRTF 1
@@ -919,7 +919,7 @@ namespace std
 #define _GLIBCXX_HAVE_UNISTD_H 1
 
 /* Defined if usleep exists. */
-#define _GLIBCXX_HAVE_USLEEP 1
+/* #undef _GLIBCXX_HAVE_USLEEP */
 
 /* Defined if vfwscanf exists. */
 #define _GLIBCXX_HAVE_VFWSCANF 1
@@ -1239,12 +1239,12 @@ namespace std
 
 /* Define if C99 functions or macros from , , ,
, and  can be used or exposed. */
-/* #undef _GLIBCXX_USE_C99 */
+#define _GLIBCXX_USE_C99 1
 
 /* Define if C99 functions in  should be used in . Using
compiler builtins for these functions requires corresponding C99 library
functions to be present. */
-/* #undef _GLIBCXX_USE_C99_COMPLEX */
+#define _GLIBCXX_USE_C99_COMPLEX 1
 
 /* Define if C99 functions in  should be used in .
Using compiler builtins for these functions requires corresponding C99
@@ -1280,13 +1280,13 @@ namespace std
 #define _GLIBCXX_USE_C99_STDINT_TR1 1
 
 /* Defined if clock_gettime has monotonic clock support. */
-/* #undef _GLIBCXX_USE_CLOCK_MONOTONIC */
+#define _GLIBCXX_USE_CLOCK_MONOTONIC 1
 
 /* Defined if clock_gettime syscall has monotonic and realtime clock support. */
 /* #undef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL */
 
 /* Defined if clock_gettime has realtime clock support. */
-/* #undef _GLIBCXX_USE_CLOCK_REALTIME */
+#define _GLIBCXX_USE_CLOCK_REALTIME 1
 
 /* Define if ISO/IEC TR 24733 decimal floating point types are supported on
this host. */
@@ -1311,7 +1311,7 @@ namespace std
 #define _GLIBCXX_USE_LONG_LONG 1
 
 /* Defined if nanosleep is available. */
-/* #undef _GLIBCXX_USE_NANOSLEEP */
+#define _GLIBCXX_USE_NANOSLEEP 1
 
 /* Define if NLS translations are to be used. */
 /* #undef _GLIBCXX_USE_NLS */
@@ -1324,7 +1324,7 @@ namespace std
 #define _GLIBCXX_USE_RANDOM_TR1 1
 
 /* Defined if sched_yield is available. */
-/* #undef _GLIBCXX_USE_SCHED_YIELD */
+#define _GLIBCXX_USE_SCHED_YIELD 1
 
 /* Define if _SC_NPROCESSORS_ONLN is available in . */
 #define _GLIBCXX_USE_SC_NPROCESSORS_ONLN 1



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

2014-10-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 11 17:46:58 UTC 2014

Modified Files:
src/tests/lib/libc/sync: cpp_atomic_ops_linkable.cc

Log Message:
If not __HAVE_ATOMIC64_OPS, do not force the test for 64bit types.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sync/cpp_atomic_ops_linkable.cc

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/sync/cpp_atomic_ops_linkable.cc
diff -u src/tests/lib/libc/sync/cpp_atomic_ops_linkable.cc:1.1 src/tests/lib/libc/sync/cpp_atomic_ops_linkable.cc:1.2
--- src/tests/lib/libc/sync/cpp_atomic_ops_linkable.cc:1.1	Sat Oct 11 14:52:15 2014
+++ src/tests/lib/libc/sync/cpp_atomic_ops_linkable.cc	Sat Oct 11 17:46:58 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: cpp_atomic_ops_linkable.cc,v 1.1 2014/10/11 14:52:15 martin Exp $ */
+/* $NetBSD: cpp_atomic_ops_linkable.cc,v 1.2 2014/10/11 17:46:58 martin Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -35,6 +35,7 @@
  */
 
 #include 
+#include 	// for __HAVE_ATOMIC64_OPS
 
 template 
 class ATest {
@@ -79,16 +80,20 @@ int main(int argc, char **argv)
   ATest();
   ATest();
   ATest();
+#ifdef __HAVE_ATOMIC64_OPS
   ATest();
   ATest();
+#endif
   ATest();
   ATest();
   ATest();
   ATest();
   ATest();
   ATest();
+#ifdef __HAVE_ATOMIC64_OPS
   ATest();
   ATest();
+#endif
   ATest();
   ATest();
   ATest();



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

2014-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 11 17:35:06 UTC 2014

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

Log Message:
disable MULTIPROCESSOR for now


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/HUMMINGBIRD_A31

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/HUMMINGBIRD_A31
diff -u src/sys/arch/evbarm/conf/HUMMINGBIRD_A31:1.3 src/sys/arch/evbarm/conf/HUMMINGBIRD_A31:1.4
--- src/sys/arch/evbarm/conf/HUMMINGBIRD_A31:1.3	Sat Oct 11 00:52:44 2014
+++ src/sys/arch/evbarm/conf/HUMMINGBIRD_A31	Sat Oct 11 17:35:06 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: HUMMINGBIRD_A31,v 1.3 2014/10/11 00:52:44 jmcneill Exp $
+#	$NetBSD: HUMMINGBIRD_A31,v 1.4 2014/10/11 17:35:06 jmcneill Exp $
 #
 #	HUMMINGBIRD_A31 - Merrii Hummingbird A31
 #
@@ -171,7 +171,7 @@ config		netbsd		root on ? type ?
 mainbus0	at root
 
 # CPU
-options 	MULTIPROCESSOR
+#options 	MULTIPROCESSOR
 cpu*		at mainbus?
 
 # Specify the memory size in megabytes.



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

2014-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 11 17:29:59 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_mmc.c

Log Message:
fix AWIN_MMC_FTRGLEVEL for A31


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/allwinner/awin_mmc.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/allwinner/awin_mmc.c
diff -u src/sys/arch/arm/allwinner/awin_mmc.c:1.13 src/sys/arch/arm/allwinner/awin_mmc.c:1.14
--- src/sys/arch/arm/allwinner/awin_mmc.c:1.13	Fri Oct 10 17:49:55 2014
+++ src/sys/arch/arm/allwinner/awin_mmc.c	Sat Oct 11 17:29:59 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_mmc.c,v 1.13 2014/10/10 17:49:55 jmcneill Exp $ */
+/* $NetBSD: awin_mmc.c,v 1.14 2014/10/11 17:29:59 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: awin_mmc.c,v 1.13 2014/10/10 17:49:55 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_mmc.c,v 1.14 2014/10/11 17:29:59 jmcneill Exp $");
 
 #include 
 #include 
@@ -46,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: awin_mmc.c,v
 #include 
 
 #define AWIN_MMC_NDESC		16
+#define AWIN_MMC_DMA_FTRGLEVEL	0x20070008
 
 static int	awin_mmc_match(device_t, cfdata_t, void *);
 static void	awin_mmc_attach(device_t, device_t, void *);
@@ -104,7 +105,6 @@ struct awin_mmc_softc {
 	unsigned int sc_pll_freq;
 	unsigned int sc_mod_clk;
 
-	uint32_t sc_dma_ftrgl;
 	uint32_t sc_fifo_reg;
 
 	uint32_t sc_idma_xferlen;
@@ -290,10 +290,8 @@ awin_mmc_attach(device_t parent, device_
 	}
 
 	if (awin_chip_id() == AWIN_CHIP_ID_A31) {
-		sc->sc_dma_ftrgl = 0x2007000f;
 		sc->sc_fifo_reg = AWIN_A31_MMC_FIFO;
 	} else {
-		sc->sc_dma_ftrgl = 0x20070008;
 		sc->sc_fifo_reg = AWIN_MMC_FIFO;
 	}
 
@@ -727,7 +725,7 @@ awin_mmc_dma_prepare(struct awin_mmc_sof
 		val |= AWIN_MMC_IDST_TRANSMIT_INT;
 	MMC_WRITE(sc, AWIN_MMC_IDIE, val);
 	MMC_WRITE(sc, AWIN_MMC_DLBA, desc_paddr);
-	MMC_WRITE(sc, AWIN_MMC_FTRGLEVEL, sc->sc_dma_ftrgl);
+	MMC_WRITE(sc, AWIN_MMC_FTRGLEVEL, AWIN_MMC_DMA_FTRGLEVEL);
 
 	return 0;
 }



CVS commit: src/usr.bin/config

2014-10-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 11 17:27:42 UTC 2014

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

Log Message:
Remove a set but not used variable


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/config/sem.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/sem.c
diff -u src/usr.bin/config/sem.c:1.61 src/usr.bin/config/sem.c:1.62
--- src/usr.bin/config/sem.c:1.61	Sat Oct 11 15:47:38 2014
+++ src/usr.bin/config/sem.c	Sat Oct 11 17:27:42 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.61 2014/10/11 15:47:38 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.62 2014/10/11 17:27:42 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -456,7 +456,6 @@ defdev(struct devbase *dev, struct locli
 {
 	struct loclist *ll;
 	struct attrlist *al;
-	struct attr *a;
 
 	if (dev == &errdev)
 		goto bad;
@@ -515,7 +514,7 @@ defdev(struct devbase *dev, struct locli
 	/*
 	 * Implicit attribute definition for device.
 	 */
-	a = refattr(dev->d_name);
+	refattr(dev->d_name);
 
 	/*
 	 * For each interface attribute this device refers to, add this



CVS commit: [netbsd-7] src/doc

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 17:03:28 UTC 2014

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
tickets 132-135


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.48 -r1.1.2.49 src/doc/CHANGES-7.0

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

Modified files:

Index: src/doc/CHANGES-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.48 src/doc/CHANGES-7.0:1.1.2.49
--- src/doc/CHANGES-7.0:1.1.2.48	Fri Oct 10 18:17:03 2014
+++ src/doc/CHANGES-7.0	Sat Oct 11 17:03:28 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.48 2014/10/10 18:17:03 snj Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.49 2014/10/11 17:03:28 snj Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -1098,3 +1098,31 @@ sys/arch/zaurus/conf/GENERIC			patch
 	Disable DIAGNOSTIC and/or DEBUG.
 	[bouyer/martin, ticket #116]
 
+sys/kern/uipc_usrreq.c1.172
+
+	Fix a getsockname(2) compatibllity problem with UNIX domain
+	sockets.  PR kern/49247.
+	[taca, ticket #132]
+
+external/bsd/dhcp/Makefile.inc			1.12
+
+	Remove dhclient's dependency on /usr/lib.
+	[christos, ticket #133]
+
+lib/libperfuse/ops.c1.75
+
+	Do not trust the filesystem's readdir to give us nul-terminated
+	file names.
+	[manu, ticket #134]
+
+lib/libutil/parsedate.31.13-1.14
+lib/libutil/parsedate.y1.17-1.20
+tests/lib/libutil/t_parsedate.c			1.8-1.13
+
+	Fix some errors in parsedate(3)'s handling of local time
+	without an explicit time zone, make the second and third
+	arguments independent of each other (previously, if one
+	was NULL then the other was ignored), and add more test
+	cases.  Fixes PR lib/47916.
+	[apb, ticket #135]
+



CVS commit: [netbsd-7] src/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:56:21 UTC 2014

Modified Files:
src/lib/libutil [netbsd-7]: parsedate.y

Log Message:
Pull up following revision(s) (requested by apb in ticket #135):
lib/libutil/parsedate.y: revision 1.20
Improved handling of local times.
* A magic value USE_LOCAL_TIME (defined as 9) may be passed as the
  Timezone to Convert(), instructing it to use mktime() to work
  in the local time zone, instead of using mktime_z to work in UTC
  (and then adding the specified timezone offset).
* Some old code is removed now that there's no need to find the local
  timezone offset.
* Allow either one or both of the now and zone arguments to
  parsedate() to be NULL, treating them independently.  Previously,
  if either one was NULL, the other was ignored.
* If the zone argument is specified, then the current date is calculated
  in the specified zone, not in local time.
Also add some disabled debug code.
This should fix PR lib/47916.


To generate a diff of this commit:
cvs rdiff -u -r1.16.6.3 -r1.16.6.4 src/lib/libutil/parsedate.y

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

Modified files:

Index: src/lib/libutil/parsedate.y
diff -u src/lib/libutil/parsedate.y:1.16.6.3 src/lib/libutil/parsedate.y:1.16.6.4
--- src/lib/libutil/parsedate.y:1.16.6.3	Sat Oct 11 16:51:23 2014
+++ src/lib/libutil/parsedate.y	Sat Oct 11 16:56:21 2014
@@ -14,7 +14,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.16.6.3 2014/10/11 16:51:23 snj Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.16.6.4 2014/10/11 16:56:21 snj Exp $");
 #endif
 
 #include 
@@ -42,6 +42,7 @@ __RCSID("$NetBSD: parsedate.y,v 1.16.6.3
 #define HOUR(x)		((time_t)(x) * 60)
 #define SECSPERDAY	(24L * 60L * 60L)
 
+#define USE_LOCAL_TIME	9 /* special case for Convert() and yyTimezone */
 
 /*
 **  An entry in the lexical lookup table.
@@ -618,7 +619,8 @@ Convert(
 time_t	Hours,		/* Hour of day [0-24] */
 time_t	Minutes,	/* Minute of hour [0-59] */
 time_t	Seconds,	/* Second of minute [0-60] */
-time_t	Timezone,	/* Timezone as minutes east of UTC */
+time_t	Timezone,	/* Timezone as minutes east of UTC,
+ * or USE_LOCAL_TIME special case */
 MERIDIAN	Meridian,	/* Hours are am/pm/24 hour clock */
 DSTMODE	DSTmode		/* DST on/off/maybe */
 )
@@ -638,9 +640,25 @@ Convert(
 default: tm.tm_isdst = -1; break;
 }
 
-/* We rely on mktime_z(NULL, ...) working in UTC, not in local time. */
-result = mktime_z(NULL, &tm);
-result += Timezone * 60;
+if (Timezone == USE_LOCAL_TIME) {
+	result = mktime(&tm);
+} else {
+	/* We rely on mktime_z(NULL, ...) working in UTC */
+	result = mktime_z(NULL, &tm);
+	result += Timezone * 60;
+}
+
+#if PARSEDATE_DEBUG
+fprintf(stderr, "%s(M=%jd D=%jd Y=%jd H=%jd M=%jd S=%jd Z=%jd"
+		" mer=%d DST=%d)",
+	__func__,
+	(intmax_t)Month, (intmax_t)Day, (intmax_t)Year,
+	(intmax_t)Hours, (intmax_t)Minutes, (intmax_t)Seconds,
+	(intmax_t)Timezone, (int)Meridian, (int)DSTmode);
+fprintf(stderr, " -> %jd", (intmax_t)result);
+fprintf(stderr, " %s", ctime(&result));
+#endif
+
 return result;
 }
 
@@ -878,31 +896,10 @@ yylex(YYSTYPE *yylval, const char **yyIn
 
 #define TM_YEAR_ORIGIN 1900
 
-/* Yield A - B, measured in seconds.  */
-static time_t
-difftm (struct tm *a, struct tm *b)
-{
-  int ay = a->tm_year + (TM_YEAR_ORIGIN - 1);
-  int by = b->tm_year + (TM_YEAR_ORIGIN - 1);
-  int days = (
-	  /* difference in day of year */
-	  a->tm_yday - b->tm_yday
-	  /* + intervening leap days */
-	  +  ((ay >> 2) - (by >> 2))
-	  -  (ay/100 - by/100)
-	  +  ((ay/100 >> 2) - (by/100 >> 2))
-	  /* + difference in years * 365 */
-	  +  (long)(ay-by) * 365
-	  );
-  return ((time_t)60*(60*(24*days + (a->tm_hour - b->tm_hour))
-	  + (a->tm_min - b->tm_min))
-	  + (a->tm_sec - b->tm_sec));
-}
-
 time_t
 parsedate(const char *p, const time_t *now, const int *zone)
 {
-struct tm gmt, local, *gmt_ptr, *tm;
+struct tm		local, *tm;
 time_t		nowt;
 int			zonet;
 time_t		Start;
@@ -913,29 +910,24 @@ parsedate(const char *p, const time_t *n
 saved_errno = errno;
 errno = 0;
 
-if (now == NULL || zone == NULL) {
+if (now == NULL) {
 now = &nowt;
-	zone = &zonet;
 	(void)time(&nowt);
-
-	gmt_ptr = gmtime_r(now, &gmt);
+}
+if (zone == NULL) {
+	zone = &zonet;
+	zonet = USE_LOCAL_TIME;
 	if ((tm = localtime_r(now, &local)) == NULL)
 	return -1;
-
-	if (gmt_ptr != NULL)
-	zonet = difftm(&gmt, &local) / 60;
-	else
-	/* We are on a system like VMS, where the system clock is
-	   in local time and the system has no concept of timezones.
-	   Hopefully we can fake this out (for the case in which the
-	   user specifies no timezone) by just saying the timezone
-	   is zero.  */
-	zonet = 0;
-
-	if (local.tm_is

CVS commit: [netbsd-7] src/tests/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:55:32 UTC 2014

Modified Files:
src/tests/lib/libutil [netbsd-7]: t_parsedate.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #135):
tests/lib/libutil/t_parsedate.c: revision 1.13
2013-07-09 was in British Summer TIme, so use tzoff=-60, not 0.


To generate a diff of this commit:
cvs rdiff -u -r1.7.8.5 -r1.7.8.6 src/tests/lib/libutil/t_parsedate.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/libutil/t_parsedate.c
diff -u src/tests/lib/libutil/t_parsedate.c:1.7.8.5 src/tests/lib/libutil/t_parsedate.c:1.7.8.6
--- src/tests/lib/libutil/t_parsedate.c:1.7.8.5	Sat Oct 11 16:52:56 2014
+++ src/tests/lib/libutil/t_parsedate.c	Sat Oct 11 16:55:32 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.7.8.5 2014/10/11 16:52:56 snj Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.7.8.6 2014/10/11 16:55:32 snj Exp $ */
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_parsedate.c,v 1.7.8.5 2014/10/11 16:52:56 snj Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.7.8.6 2014/10/11 16:55:32 snj Exp $");
 
 #include 
 #include 
@@ -207,7 +207,7 @@ ATF_TC_BODY(dsttimes, tc)
 	ATF_CHECK(t != (time_t)-1);
 	parsecheck("14:00", &t, NULL, localtime_r,
 		2013, 7, 9, 14, 0, 0);
-	tzoff = 0;
+	tzoff = -60; /* British Summer Time */
 	parsecheck("14:00", &t, &tzoff, localtime_r,
 		2013, 7, 9, 14, 0, 0);
 }



CVS commit: [netbsd-7] src/tests/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:52:56 UTC 2014

Modified Files:
src/tests/lib/libutil [netbsd-7]: t_parsedate.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #135.10):
tests/lib/libutil/t_parsedate.c: revision 1.12
When tests fail, print all args, notjust the date string.


To generate a diff of this commit:
cvs rdiff -u -r1.7.8.4 -r1.7.8.5 src/tests/lib/libutil/t_parsedate.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/libutil/t_parsedate.c
diff -u src/tests/lib/libutil/t_parsedate.c:1.7.8.4 src/tests/lib/libutil/t_parsedate.c:1.7.8.5
--- src/tests/lib/libutil/t_parsedate.c:1.7.8.4	Sat Oct 11 16:47:00 2014
+++ src/tests/lib/libutil/t_parsedate.c	Sat Oct 11 16:52:56 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.7.8.4 2014/10/11 16:47:00 snj Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.7.8.5 2014/10/11 16:52:56 snj Exp $ */
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,10 +29,11 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_parsedate.c,v 1.7.8.4 2014/10/11 16:47:00 snj Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.7.8.5 2014/10/11 16:52:56 snj Exp $");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -59,34 +60,55 @@ parsecheck(const char *datestr, const ti
 {
 	time_t t;
 	struct tm tm;
+	char argstr[128];
+
+	/*
+	 * printable version of the args.
+	 *
+	 * Note that printf("%.*d", 0, 0)) prints nothing at all,
+	 * while printf("%.*d", 1, val) prints the value as usual.
+	 */
+	snprintf(argstr, sizeof(argstr), "%s%s%s, %s%.*jd, %s%.*d",
+		/* NULL or \"\" */
+		(datestr ? "\"" : ""),
+		(datestr ? datestr : "NULL"),
+		(datestr ? "\"" : ""),
+		/* NULL or *reftime */
+		(reftime ? "" : "NULL"),
+		(reftime ? 1 : 0), 
+		(reftime ? (intmax_t)*reftime : (intmax_t)0), 
+		/* NULL or *zoff */
+		(zoff ? "" : "NULL"),
+		(zoff ? 1 : 0), 
+		(zoff ? *zoff : 0));
 
 	ATF_CHECK_MSG((t = parsedate(datestr, reftime, zoff)) != -1,
-	"parsedate(\"%s\",,) returned -1\n", datestr);
+	"parsedate(%s) returned -1\n", argstr);
 	ATF_CHECK(time_to_tm(&t, &tm) != NULL);
 	if (year != ANY)
 		ATF_CHECK_MSG(tm.tm_year + 1900 == year,
-		"parsedate(\"%s\",,) expected year %d got %d (+1900)\n",
-		datestr, year, (int)tm.tm_year);
+		"parsedate(%s) expected year %d got %d (+1900)\n",
+		argstr, year, (int)tm.tm_year);
 	if (month != ANY)
 		ATF_CHECK_MSG(tm.tm_mon + 1 == month,
-		"parsedate(\"%s\",,) expected month %d got %d (+1)\n",
-		datestr, month, (int)tm.tm_mon);
+		"parsedate(%s) expected month %d got %d (+1)\n",
+		argstr, month, (int)tm.tm_mon);
 	if (day != ANY)
 		ATF_CHECK_MSG(tm.tm_mday == day,
-		"parsedate(\"%s\",,) expected day %d got %d\n",
-		datestr, day, (int)tm.tm_mday);
+		"parsedate(%s) expected day %d got %d\n",
+		argstr, day, (int)tm.tm_mday);
 	if (hour != ANY)
 		ATF_CHECK_MSG(tm.tm_hour == hour,
-		"parsedate(\"%s\",,) expected hour %d got %d\n",
-		datestr, hour, (int)tm.tm_hour);
+		"parsedate(%s) expected hour %d got %d\n",
+		argstr, hour, (int)tm.tm_hour);
 	if (minute != ANY)
 		ATF_CHECK_MSG(tm.tm_min == minute,
-		"parsedate(\"%s\",,) expected minute %d got %d\n",
-		datestr, minute, (int)tm.tm_min);
+		"parsedate(%s) expected minute %d got %d\n",
+		argstr, minute, (int)tm.tm_min);
 	if (second != ANY)
 		ATF_CHECK_MSG(tm.tm_sec == second,
-		"parsedate(\"%s\",,) expected second %d got %d\n",
-		datestr, second, (int)tm.tm_sec);
+		"parsedate(%s) expected second %d got %d\n",
+		argstr, second, (int)tm.tm_sec);
 }
 
 ATF_TC(dates);



CVS commit: [netbsd-7] src/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:51:23 UTC 2014

Modified Files:
src/lib/libutil [netbsd-7]: parsedate.y

Log Message:
Pull up following revision(s) (requested by apb in ticket #135):
lib/libutil/parsedate.y: revision 1.19
Previously, input of the form "HH:MM:SS +" would not have set the
yyhaveZone flag.


To generate a diff of this commit:
cvs rdiff -u -r1.16.6.2 -r1.16.6.3 src/lib/libutil/parsedate.y

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

Modified files:

Index: src/lib/libutil/parsedate.y
diff -u src/lib/libutil/parsedate.y:1.16.6.2 src/lib/libutil/parsedate.y:1.16.6.3
--- src/lib/libutil/parsedate.y:1.16.6.2	Sat Oct 11 16:47:48 2014
+++ src/lib/libutil/parsedate.y	Sat Oct 11 16:51:23 2014
@@ -14,7 +14,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.16.6.2 2014/10/11 16:47:48 snj Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.16.6.3 2014/10/11 16:51:23 snj Exp $");
 #endif
 
 #include 
@@ -118,6 +118,10 @@ spec	: /* NULL */
 item	: time {
 	param->yyHaveTime++;
 	}
+	| time_numericzone {
+	param->yyHaveTime++;
+	param->yyHaveZone++;
+	}
 	| zone {
 	param->yyHaveZone++;
 	}
@@ -197,33 +201,35 @@ time	: tUNUMBER tMERIDIAN {
 	param->yySeconds = 0;
 	param->yyMeridian = $4;
 	}
-	| tUNUMBER ':' tUNUMBER tSNUMBER {
-	param->yyHour = $1;
-	param->yyMinutes = $3;
-	param->yyMeridian = MER24;
-	param->yyDSTmode = DSToff;
-	param->yyTimezone = - ($4 % 100 + ($4 / 100) * 60);
-	}
 	| tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid {
 	param->yyHour = $1;
 	param->yyMinutes = $3;
 	param->yySeconds = $5;
 	param->yyMeridian = $6;
 	}
-	| tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER {
+	| tUNUMBER ':' tUNUMBER ':' tUNUMBER '.' tUNUMBER {
 	param->yyHour = $1;
 	param->yyMinutes = $3;
 	param->yySeconds = $5;
 	param->yyMeridian = MER24;
+/* XXX: Do nothing with millis */
+	}
+	;
+
+time_numericzone : tUNUMBER ':' tUNUMBER tSNUMBER {
+	param->yyHour = $1;
+	param->yyMinutes = $3;
+	param->yyMeridian = MER24;
 	param->yyDSTmode = DSToff;
-	param->yyTimezone = - ($6 % 100 + ($6 / 100) * 60);
+	param->yyTimezone = - ($4 % 100 + ($4 / 100) * 60);
 	}
-	| tUNUMBER ':' tUNUMBER ':' tUNUMBER '.' tUNUMBER {
+	| tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER {
 	param->yyHour = $1;
 	param->yyMinutes = $3;
 	param->yySeconds = $5;
 	param->yyMeridian = MER24;
-/* XXX: Do nothing with millis */
+	param->yyDSTmode = DSToff;
+	param->yyTimezone = - ($6 % 100 + ($6 / 100) * 60);
 	}
 	;
 



CVS commit: [netbsd-7] src/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:52:07 UTC 2014

Modified Files:
src/lib/libutil [netbsd-7]: parsedate.3

Log Message:
Pull up following revision(s) (requested by apb in ticket #135):
lib/libutil/parsedate.3: revision 1.14
The tzoff argument is in minutes (behind/west of UTC), not seconds.
While here, also say that time = NULL and tzoff = NULL are independent.
The code doesn't yet implement that, but it will soon.


To generate a diff of this commit:
cvs rdiff -u -r1.12.8.1 -r1.12.8.2 src/lib/libutil/parsedate.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/libutil/parsedate.3
diff -u src/lib/libutil/parsedate.3:1.12.8.1 src/lib/libutil/parsedate.3:1.12.8.2
--- src/lib/libutil/parsedate.3:1.12.8.1	Sat Oct 11 16:45:58 2014
+++ src/lib/libutil/parsedate.3	Sat Oct 11 16:52:07 2014
@@ -1,4 +1,4 @@
-.\" $NetBSD: parsedate.3,v 1.12.8.1 2014/10/11 16:45:58 snj Exp $
+.\" $NetBSD: parsedate.3,v 1.12.8.2 2014/10/11 16:52:07 snj Exp $
 .\"
 .\" Copyright (c) 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 7, 2014
+.Dd October 8, 2014
 .Dt PARSEDATE 3
 .Os
 .Sh NAME
@@ -46,15 +46,20 @@ function parses a datetime from
 .Ar datestr
 described in English relative to an optional
 .Ar time
-point and an optional timezone offset in seconds specified in
+point,
+and an optional timezone offset (in minutes behind/west of UTC)
+specified in
 .Ar tzoff .
-If either
+If
 .Ar time
-or
+is
+.Dv NULL 
+then the current time is used.
+If
 .Ar tzoff
-are
+is
 .Dv NULL ,
-then the current time and timezone offset are used.
+then the current time zone is used.
 .Pp
 The
 .Ar datestr



CVS commit: [netbsd-7] src/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:47:48 UTC 2014

Modified Files:
src/lib/libutil [netbsd-7]: parsedate.y

Log Message:
Pull up following revision(s) (requested by apb in ticket #135):
lib/libutil/parsedate.y: revision 1.18
A time like HH:MM:SS.sss says nothing about whether DST is on or off.


To generate a diff of this commit:
cvs rdiff -u -r1.16.6.1 -r1.16.6.2 src/lib/libutil/parsedate.y

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

Modified files:

Index: src/lib/libutil/parsedate.y
diff -u src/lib/libutil/parsedate.y:1.16.6.1 src/lib/libutil/parsedate.y:1.16.6.2
--- src/lib/libutil/parsedate.y:1.16.6.1	Sat Oct 11 16:44:31 2014
+++ src/lib/libutil/parsedate.y	Sat Oct 11 16:47:48 2014
@@ -14,7 +14,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.16.6.1 2014/10/11 16:44:31 snj Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.16.6.2 2014/10/11 16:47:48 snj Exp $");
 #endif
 
 #include 
@@ -223,9 +223,7 @@ time	: tUNUMBER tMERIDIAN {
 	param->yyMinutes = $3;
 	param->yySeconds = $5;
 	param->yyMeridian = MER24;
-	param->yyDSTmode = DSToff;
 /* XXX: Do nothing with millis */
-/*	param->yyTimezone = ($7 % 100 + ($7 / 100) * 60); */
 	}
 	;
 



CVS commit: [netbsd-7] src/tests/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:47:00 UTC 2014

Modified Files:
src/tests/lib/libutil [netbsd-7]: t_parsedate.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #135):
tests/lib/libutil/t_parsedate.c: revision 1.11
Add tests for PR lib/47916.  Some of these fail.


To generate a diff of this commit:
cvs rdiff -u -r1.7.8.3 -r1.7.8.4 src/tests/lib/libutil/t_parsedate.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/libutil/t_parsedate.c
diff -u src/tests/lib/libutil/t_parsedate.c:1.7.8.3 src/tests/lib/libutil/t_parsedate.c:1.7.8.4
--- src/tests/lib/libutil/t_parsedate.c:1.7.8.3	Sat Oct 11 16:45:24 2014
+++ src/tests/lib/libutil/t_parsedate.c	Sat Oct 11 16:47:00 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.7.8.3 2014/10/11 16:45:24 snj Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.7.8.4 2014/10/11 16:47:00 snj Exp $ */
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_parsedate.c,v 1.7.8.3 2014/10/11 16:45:24 snj Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.7.8.4 2014/10/11 16:47:00 snj Exp $");
 
 #include 
 #include 
@@ -147,6 +147,49 @@ ATF_TC_BODY(times, tc)
 		ANY, ANY, ANY, 12+5, 21, 0);
 }
 
+ATF_TC(dsttimes);
+
+ATF_TC_HEAD(dsttimes, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Test DST transition times"
+	" (PR lib/47916)");
+}
+
+ATF_TC_BODY(dsttimes, tc)
+{
+	struct tm tm;
+	time_t t;
+	int tzoff;
+
+	putenv(__UNCONST("TZ=EST"));
+	tzset();
+	parsecheck("12:0", NULL, NULL, localtime_r,
+		ANY, ANY, ANY, 12, 0, 0);
+
+	putenv(__UNCONST("TZ=Japan"));
+	tzset();
+	parsecheck("12:0", NULL, NULL, localtime_r,
+		ANY, ANY, ANY, 12, 0, 0);
+
+	/*
+	 * When the effective local time is Tue Jul  9 13:21:53 BST 2013,
+	 * check mktime("14:00")
+	 */
+	putenv(__UNCONST("TZ=Europe/London"));
+	tzset();
+	tm = (struct tm){
+		.tm_year = 2013-1900, .tm_mon = 7-1, .tm_mday = 9,
+		.tm_hour = 13, .tm_min = 21, .tm_sec = 53,
+		.tm_isdst = 0 };
+	t = mktime(&tm);
+	ATF_CHECK(t != (time_t)-1);
+	parsecheck("14:00", &t, NULL, localtime_r,
+		2013, 7, 9, 14, 0, 0);
+	tzoff = 0;
+	parsecheck("14:00", &t, &tzoff, localtime_r,
+		2013, 7, 9, 14, 0, 0);
+}
+
 ATF_TC(relative);
 
 ATF_TC_HEAD(relative, tc)
@@ -206,6 +249,7 @@ ATF_TP_ADD_TCS(tp)
 {
 	ATF_TP_ADD_TC(tp, dates);
 	ATF_TP_ADD_TC(tp, times);
+	ATF_TP_ADD_TC(tp, dsttimes);
 	ATF_TP_ADD_TC(tp, relative);
 	ATF_TP_ADD_TC(tp, atsecs);
 



CVS commit: [netbsd-7] src/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:45:58 UTC 2014

Modified Files:
src/lib/libutil [netbsd-7]: parsedate.3

Log Message:
Pull up following revision(s) (requested by apb in ticket #135):
lib/libutil/parsedate.3: revision 1.13
Document that years in ISO 8601 dates are taken literally.
"69-09-10" is in the year 69, not 2069.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.8.1 src/lib/libutil/parsedate.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/libutil/parsedate.3
diff -u src/lib/libutil/parsedate.3:1.12 src/lib/libutil/parsedate.3:1.12.8.1
--- src/lib/libutil/parsedate.3:1.12	Sat Jan 19 15:28:25 2013
+++ src/lib/libutil/parsedate.3	Sat Oct 11 16:45:58 2014
@@ -1,4 +1,4 @@
-.\" $NetBSD: parsedate.3,v 1.12 2013/01/19 15:28:25 apb Exp $
+.\" $NetBSD: parsedate.3,v 1.12.8.1 2014/10/11 16:45:58 snj Exp $
 .\"
 .\" Copyright (c) 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 19, 2013
+.Dd October 7, 2014
 .Dt PARSEDATE 3
 .Os
 .Sh NAME
@@ -198,11 +198,14 @@ Timezone names:
 .Pp
 A variety of unambiguous dates are recognized:
 .Bl -tag -compact -width "20 Jun 1994"
-.It 69-09-10
+.It 9/10/69
 For years between 69-99 we assume 1900+ and for years between 0-68
 we assume 2000+.
 .It 2006-11-17
 An ISO-8601 date.
+.It 69-09-10
+The year in an ISO-8601 date is always taken literally,
+so this is the year 69, not 2069.
 .It 10/1/2000
 October 10, 2000; the common US format.
 .It 20 Jun 1994
@@ -210,7 +213,8 @@ October 10, 2000; the common US format.
 .It 1-sep-06
 Other common abbreviations.
 .It 1/11
-the year can be omitted
+The year can be omitted.
+This is the US month/day format.
 .El
 .Pp
 As well as times:



CVS commit: [netbsd-7] src/tests/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:45:24 UTC 2014

Modified Files:
src/tests/lib/libutil [netbsd-7]: t_parsedate.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #135):
tests/lib/libutil/t_parsedate.c: revision 1.10
Adapt to a recent change in parsedate().
"9/10/69" still refers to 2069, and "9/10/70" still refers to 1970,
but "69-09-10" and "70-09-10" now refer to the years 69 and 70.


To generate a diff of this commit:
cvs rdiff -u -r1.7.8.2 -r1.7.8.3 src/tests/lib/libutil/t_parsedate.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/libutil/t_parsedate.c
diff -u src/tests/lib/libutil/t_parsedate.c:1.7.8.2 src/tests/lib/libutil/t_parsedate.c:1.7.8.3
--- src/tests/lib/libutil/t_parsedate.c:1.7.8.2	Sat Oct 11 16:43:46 2014
+++ src/tests/lib/libutil/t_parsedate.c	Sat Oct 11 16:45:24 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.7.8.2 2014/10/11 16:43:46 snj Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.7.8.3 2014/10/11 16:45:24 snj Exp $ */
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_parsedate.c,v 1.7.8.2 2014/10/11 16:43:46 snj Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.7.8.3 2014/10/11 16:45:24 snj Exp $");
 
 #include 
 #include 
@@ -100,10 +100,14 @@ ATF_TC_HEAD(dates, tc)
 ATF_TC_BODY(dates, tc)
 {
 
-	parsecheck("69-09-10", NULL, NULL, localtime_r,
+	parsecheck("9/10/69", NULL, NULL, localtime_r,
 		2069, 9, 10, 0, 0, 0); /* year < 70: add 2000 */
-	parsecheck("70-09-10", NULL, NULL, localtime_r,
+	parsecheck("9/10/70", NULL, NULL, localtime_r,
 		1970, 9, 10, 0, 0, 0); /* 70 <= year < 100: add 1900 */
+	parsecheck("69-09-10", NULL, NULL, localtime_r,
+		69, 9, 10, 0, 0, 0); /* ISO8601 year remains unchanged */
+	parsecheck("70-09-10", NULL, NULL, localtime_r,
+		70, 9, 10, 0, 0, 0); /* ISO8601 year remains unchanged */
 	parsecheck("2006-11-17", NULL, NULL, localtime_r,
 		2006, 11, 17, 0, 0, 0);
 	parsecheck("10/1/2000", NULL, NULL, localtime_r,



CVS commit: [netbsd-7] src/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:44:31 UTC 2014

Modified Files:
src/lib/libutil [netbsd-7]: parsedate.y

Log Message:
Pull up following revision(s) (requested by apb in ticket #135):
lib/libutil/parsedate.y: revision 1.17
Some years don't need the "maybe add 1900 or 2000" adjustment
that was designed for handling two-digit abbreviated years.
For example, "1/2/70" still refers to the year 1970, as before,
but "70-01-02" now refers to the year 70.
* Add a new yyHaveFullYear member to struct dateinfo, to record whether
  or not the year needs to be adjusted.
* Code that parses years sets yyHaveFullYear=1 if they know that the
  year should not be adjusted (as is the case for ISO 8601 dates), or if
  they perform their own adjustment (as is the case for CVS timestamps).
* Move the year adjustment code into a new function, AdjustYear,
  instead of inline in Convert().
* Make Convert() assume the year doesn't need to be adjusted,
  and make Convert's callers first call AdjustYear() if appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.6.1 src/lib/libutil/parsedate.y

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

Modified files:

Index: src/lib/libutil/parsedate.y
diff -u src/lib/libutil/parsedate.y:1.16 src/lib/libutil/parsedate.y:1.16.6.1
--- src/lib/libutil/parsedate.y:1.16	Wed Jun 12 01:46:07 2013
+++ src/lib/libutil/parsedate.y	Sat Oct 11 16:44:31 2014
@@ -14,7 +14,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.16 2013/06/12 01:46:07 yamt Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.16.6.1 2014/10/11 16:44:31 snj Exp $");
 #endif
 
 #include 
@@ -69,22 +69,24 @@ typedef enum _MERIDIAN {
 
 
 struct dateinfo {
-	DSTMODE	yyDSTmode;
+	DSTMODE	yyDSTmode;	/* DST on/off/maybe */
 	time_t	yyDayOrdinal;
 	time_t	yyDayNumber;
 	int	yyHaveDate;
+	int	yyHaveFullYear;	/* if true, year is not abbreviated. */
+/* if false, need to call AdjustYear(). */
 	int	yyHaveDay;
 	int	yyHaveRel;
 	int	yyHaveTime;
 	int	yyHaveZone;
-	time_t	yyTimezone;
-	time_t	yyDay;
-	time_t	yyHour;
-	time_t	yyMinutes;
-	time_t	yyMonth;
-	time_t	yySeconds;
-	time_t	yyYear;
-	MERIDIAN	yyMeridian;
+	time_t	yyTimezone;	/* Timezone as minutes ahead/east of UTC */
+	time_t	yyDay;		/* Day of month [1-31] */
+	time_t	yyHour;		/* Hour of day [0-24] or [1-12] */
+	time_t	yyMinutes;	/* Minute of hour [0-59] */
+	time_t	yyMonth;	/* Month of year [1-12] */
+	time_t	yySeconds;	/* Second of minute [0-60] */
+	time_t	yyYear;		/* Year, see also yyHaveFullYear */
+	MERIDIAN yyMeridian;	/* Interpret yyHour as AM/PM/24 hour clock */
 	time_t	yyRelMonth;
 	time_t	yyRelSeconds;
 };
@@ -144,6 +146,7 @@ item	: time {
 cvsstamp: tUNUMBER '.' tUNUMBER '.' tUNUMBER '.' tUNUMBER '.' tUNUMBER '.' tUNUMBER {
 	param->yyYear = $1;
 	if (param->yyYear < 100) param->yyYear += 1900;
+	param->yyHaveFullYear = 1;
 	param->yyMonth = $3;
 	param->yyDay = $5;
 	param->yyHour = $7;
@@ -174,6 +177,7 @@ epochdate: AT_SIGN at_number {
 		param->yyMinutes = 0;
 		param->yySeconds = 0;
 	}
+	param->yyHaveFullYear = 1;
 	param->yyDSTmode = DSToff;
 	param->yyTimezone = 0;
 	}
@@ -272,6 +276,7 @@ date	: tUNUMBER '/' tUNUMBER {
 	| tUNUMBER tSNUMBER tSNUMBER {
 	/* ISO 8601 format.  -mm-dd.  */
 	param->yyYear = $1;
+	param->yyHaveFullYear = 1;
 	param->yyMonth = -$2;
 	param->yyDay = -$3;
 	}
@@ -581,15 +586,31 @@ yyerror(struct dateinfo *param, const ch
 }
 
 
-/* Year is either
-   * A negative number, which means to use its absolute value (why?)
-   * A number from 0 to 99, which means a year from 1900 to 1999, or
-   * The actual year (>=100).  */
+/* Adjust year from a value that might be abbreviated, to a full value.
+ * e.g. convert 70 to 1970.
+ * Input Year is either:
+ *  - A negative number, which means to use its absolute value (why?)
+ *  - A number from 0 to 99, which means a year from 1900 to 1999, or
+ *  - The actual year (>=100).
+ * Returns the full year. */
+static time_t
+AdjustYear(time_t Year)
+{
+/* XXX Y2K */
+if (Year < 0)
+	Year = -Year;
+if (Year < 70)
+	Year += 2000;
+else if (Year < 100)
+	Year += 1900;
+return Year;
+}
+
 static time_t
 Convert(
 time_t	Month,		/* month of year [1-12] */
 time_t	Day,		/* day of month [1-31] */
-time_t	Year,		/* year; see above comment */
+time_t	Year,		/* year, not abbreviated in any way */
 time_t	Hours,		/* Hour of day [0-24] */
 time_t	Minutes,	/* Minute of hour [0-59] */
 time_t	Seconds,	/* Second of minute [0-60] */
@@ -601,14 +622,6 @@ Convert(
 struct tm tm = {.tm_sec = 0};
 time_t result;
 
-/* XXX Y2K */
-if (Year < 0)
-	Year = -Year;
-if (Year < 70)
-	Year += 2000;
-else if (Year < 100)
-	Year += 1900;
-
 tm.tm_sec = Seconds;
 tm.tm_min = Minutes;
 tm.tm_hour = Hours + (Meridian == MERpm ? 12 : 0);
@@ -933

CVS commit: [netbsd-7] src/tests/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:43:46 UTC 2014

Modified Files:
src/tests/lib/libutil [netbsd-7]: t_parsedate.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #135):
tests/lib/libutil/t_parsedate.c: revision 1.9
Add comments for some non-obvious cases.
Also add a test with year=70, which is documented to be treated as 1970.


To generate a diff of this commit:
cvs rdiff -u -r1.7.8.1 -r1.7.8.2 src/tests/lib/libutil/t_parsedate.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/libutil/t_parsedate.c
diff -u src/tests/lib/libutil/t_parsedate.c:1.7.8.1 src/tests/lib/libutil/t_parsedate.c:1.7.8.2
--- src/tests/lib/libutil/t_parsedate.c:1.7.8.1	Sat Oct 11 16:42:45 2014
+++ src/tests/lib/libutil/t_parsedate.c	Sat Oct 11 16:43:46 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.7.8.1 2014/10/11 16:42:45 snj Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.7.8.2 2014/10/11 16:43:46 snj Exp $ */
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_parsedate.c,v 1.7.8.1 2014/10/11 16:42:45 snj Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.7.8.2 2014/10/11 16:43:46 snj Exp $");
 
 #include 
 #include 
@@ -101,11 +101,13 @@ ATF_TC_BODY(dates, tc)
 {
 
 	parsecheck("69-09-10", NULL, NULL, localtime_r,
-		2069, 9, 10, 0, 0, 0);
+		2069, 9, 10, 0, 0, 0); /* year < 70: add 2000 */
+	parsecheck("70-09-10", NULL, NULL, localtime_r,
+		1970, 9, 10, 0, 0, 0); /* 70 <= year < 100: add 1900 */
 	parsecheck("2006-11-17", NULL, NULL, localtime_r,
 		2006, 11, 17, 0, 0, 0);
 	parsecheck("10/1/2000", NULL, NULL, localtime_r,
-		2000, 10, 1, 0, 0, 0);
+		2000, 10, 1, 0, 0, 0); /* month/day/year */
 	parsecheck("20 Jun 1994", NULL, NULL, localtime_r,
 		1994, 6, 20, 0, 0, 0);
 	parsecheck("23jun2001", NULL, NULL, localtime_r,
@@ -113,7 +115,7 @@ ATF_TC_BODY(dates, tc)
 	parsecheck("1-sep-06", NULL, NULL, localtime_r,
 		2006, 9, 1, 0, 0, 0);
 	parsecheck("1/11", NULL, NULL, localtime_r,
-		ANY, 1, 11, 0, 0, 0);
+		ANY, 1, 11, 0, 0, 0); /* month/day */
 	parsecheck("1500-01-02", NULL, NULL, localtime_r,
 		1500, 1, 2, 0, 0, 0);
 	parsecheck("-12-21", NULL, NULL, localtime_r,



CVS commit: [netbsd-7] src/tests/lib/libutil

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:42:45 UTC 2014

Modified Files:
src/tests/lib/libutil [netbsd-7]: t_parsedate.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #135):
tests/lib/libutil/t_parsedate.c: revision 1.8
Add local parsecheck() function and use it for several tests.
Instead of just checking that parsedate(3) does not return an error,
also pass the result through localtime_r(3) or gmtime_r(3) and check the
year/month/day/hour/minute/second fields in the resulting struct tm.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.8.1 src/tests/lib/libutil/t_parsedate.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/libutil/t_parsedate.c
diff -u src/tests/lib/libutil/t_parsedate.c:1.7 src/tests/lib/libutil/t_parsedate.c:1.7.8.1
--- src/tests/lib/libutil/t_parsedate.c:1.7	Sat Jan 19 15:21:43 2013
+++ src/tests/lib/libutil/t_parsedate.c	Sat Oct 11 16:42:45 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.7 2013/01/19 15:21:43 apb Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.7.8.1 2014/10/11 16:42:45 snj Exp $ */
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_parsedate.c,v 1.7 2013/01/19 15:21:43 apb Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.7.8.1 2014/10/11 16:42:45 snj Exp $");
 
 #include 
 #include 
@@ -37,6 +37,58 @@ __RCSID("$NetBSD: t_parsedate.c,v 1.7 20
 #include 
 #include 
 
+/*
+ * ANY is used as a placeholder for values that do not need to be
+ * checked.  The actual value is arbitrary.  We don't use -1
+ * because some tests might want to use -1 as a literal value.
+ */
+#define ANY -30215
+
+/* parsecheck --
+ * call parsedate(), then call time_to_tm() on the result,
+ * and check that year/month/day/hour/minute/second are as expected.
+ *
+ * time_to_tm should usually be localtime_r or gmtime_r.
+ *
+ * Don't check values specified as ANY.
+ */
+static void
+parsecheck(const char *datestr, const time_t *reftime, const int *zoff,
+	struct tm * time_to_tm(const time_t *, struct tm *),
+	int year, int month, int day, int hour, int minute, int second)
+{
+	time_t t;
+	struct tm tm;
+
+	ATF_CHECK_MSG((t = parsedate(datestr, reftime, zoff)) != -1,
+	"parsedate(\"%s\",,) returned -1\n", datestr);
+	ATF_CHECK(time_to_tm(&t, &tm) != NULL);
+	if (year != ANY)
+		ATF_CHECK_MSG(tm.tm_year + 1900 == year,
+		"parsedate(\"%s\",,) expected year %d got %d (+1900)\n",
+		datestr, year, (int)tm.tm_year);
+	if (month != ANY)
+		ATF_CHECK_MSG(tm.tm_mon + 1 == month,
+		"parsedate(\"%s\",,) expected month %d got %d (+1)\n",
+		datestr, month, (int)tm.tm_mon);
+	if (day != ANY)
+		ATF_CHECK_MSG(tm.tm_mday == day,
+		"parsedate(\"%s\",,) expected day %d got %d\n",
+		datestr, day, (int)tm.tm_mday);
+	if (hour != ANY)
+		ATF_CHECK_MSG(tm.tm_hour == hour,
+		"parsedate(\"%s\",,) expected hour %d got %d\n",
+		datestr, hour, (int)tm.tm_hour);
+	if (minute != ANY)
+		ATF_CHECK_MSG(tm.tm_min == minute,
+		"parsedate(\"%s\",,) expected minute %d got %d\n",
+		datestr, minute, (int)tm.tm_min);
+	if (second != ANY)
+		ATF_CHECK_MSG(tm.tm_sec == second,
+		"parsedate(\"%s\",,) expected second %d got %d\n",
+		datestr, second, (int)tm.tm_sec);
+}
+
 ATF_TC(dates);
 
 ATF_TC_HEAD(dates, tc)
@@ -48,15 +100,24 @@ ATF_TC_HEAD(dates, tc)
 ATF_TC_BODY(dates, tc)
 {
 
-	ATF_CHECK(parsedate("69-09-10", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("2006-11-17", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("10/1/2000", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("20 Jun 1994", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("23jun2001", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("1-sep-06", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("1/11", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("1500-01-02", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("-12-21", NULL, NULL) != -1);
+	parsecheck("69-09-10", NULL, NULL, localtime_r,
+		2069, 9, 10, 0, 0, 0);
+	parsecheck("2006-11-17", NULL, NULL, localtime_r,
+		2006, 11, 17, 0, 0, 0);
+	parsecheck("10/1/2000", NULL, NULL, localtime_r,
+		2000, 10, 1, 0, 0, 0);
+	parsecheck("20 Jun 1994", NULL, NULL, localtime_r,
+		1994, 6, 20, 0, 0, 0);
+	parsecheck("23jun2001", NULL, NULL, localtime_r,
+		2001, 6, 23, 0, 0, 0);
+	parsecheck("1-sep-06", NULL, NULL, localtime_r,
+		2006, 9, 1, 0, 0, 0);
+	parsecheck("1/11", NULL, NULL, localtime_r,
+		ANY, 1, 11, 0, 0, 0);
+	parsecheck("1500-01-02", NULL, NULL, localtime_r,
+		1500, 1, 2, 0, 0, 0);
+	parsecheck("-12-21", NULL, NULL, localtime_r,
+		, 12, 21, 0, 0, 0);
 }
 
 ATF_TC(times);
@@ -70,10 +131,14 @@ ATF_TC_HEAD(times, tc)
 ATF_TC_BODY(times, tc)
 {
 
-	ATF_CHECK(parsedate("10:01", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("10:12pm", NULL, NULL) != -1);
-	ATF_CHECK(parsedate("12:11:01.12", NULL, NULL) != -1);
-	ATF_CHECK(parseda

CVS commit: [netbsd-7] src/lib/libperfuse

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:25:19 UTC 2014

Modified Files:
src/lib/libperfuse [netbsd-7]: ops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #134):
lib/libperfuse/ops.c: revision 1.75
Do not trust the filesystem's readdir to give us nul-terminated file
names


To generate a diff of this commit:
cvs rdiff -u -r1.66.2.6 -r1.66.2.7 src/lib/libperfuse/ops.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/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.66.2.6 src/lib/libperfuse/ops.c:1.66.2.7
--- src/lib/libperfuse/ops.c:1.66.2.6	Fri Sep 12 08:13:20 2014
+++ src/lib/libperfuse/ops.c	Sat Oct 11 16:25:19 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.66.2.6 2014/09/12 08:13:20 martin Exp $ */
+/*  $NetBSD: ops.c,v 1.66.2.7 2014/10/11 16:25:19 snj Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -607,6 +607,7 @@ fuse_to_dirent(struct puffs_usermount *p
 	do {
 		char *ndp;
 		size_t reclen;
+		char name[MAXPATHLEN];
 
 		reclen = _DIRENT_RECLEN(dents, fd->namelen);
 
@@ -639,6 +640,9 @@ fuse_to_dirent(struct puffs_usermount *p
 			dents = (struct dirent *)(void *)ndp;
 		}
 		
+		strncpy(name, fd->name, fd->namelen);
+		name[fd->namelen] = '\0';
+
 		/*
 		 * Filesystem was mounted without -o use_ino
 		 * Perform a lookup to find it.
@@ -651,13 +655,17 @@ fuse_to_dirent(struct puffs_usermount *p
 			 * Avoid breaking out of fs 
 			 * by lookup to .. on root
 			 */
-			if ((strcmp(fd->name, "..") == 0) && 
+			if ((strcmp(name, "..") == 0) && 
 			(pnd->pnd_nodeid == FUSE_ROOT_ID)) {
 fd->ino = FUSE_ROOT_ID;
 			} else {
-if (node_lookup_common(pu, opc, NULL, fd->name,
-		   NULL, &pn) != 0) {
-	DWARNX("node_lookup_common failed");
+int error;
+
+error = node_lookup_common(pu, opc, NULL, 
+			   name, NULL, &pn);
+if (error != 0) {
+	DWARNX("node_lookup_common %s "
+	   "failed: %d", name, error);
 } else {
 	fd->ino = pn->pn_va.va_fileid;
 	(void)perfuse_node_reclaim(pu, pn);
@@ -669,7 +677,7 @@ fuse_to_dirent(struct puffs_usermount *p
 		dents->d_reclen = (unsigned short)reclen;
 		dents->d_namlen = fd->namelen;
 		dents->d_type = fd->type;
-		strlcpy(dents->d_name, fd->name, fd->namelen + 1);
+		strlcpy(dents->d_name, name, fd->namelen + 1);
 
 #ifdef PERFUSE_DEBUG
 		if (perfuse_diagflags & PDF_READDIR)
@@ -720,7 +728,7 @@ fuse_to_dirent(struct puffs_usermount *p
 	 */
 	if (written != -1)
 		PERFUSE_NODE_DATA(opc)->pnd_dirent_len = written;
-	
+
 	return written;
 }
 



CVS commit: [netbsd-7] src/external/bsd/dhcp

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:22:28 UTC 2014

Modified Files:
src/external/bsd/dhcp [netbsd-7]: Makefile.inc

Log Message:
Pull up following revision(s) (requested by christos in ticket #133):
external/bsd/dhcp/Makefile.inc: revision 1.12
The crypto-enabled dhclient command needs more libraries burned in so that
it does not depend on /usr/lib


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.2.1 src/external/bsd/dhcp/Makefile.inc

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/dhcp/Makefile.inc
diff -u src/external/bsd/dhcp/Makefile.inc:1.11 src/external/bsd/dhcp/Makefile.inc:1.11.2.1
--- src/external/bsd/dhcp/Makefile.inc:1.11	Sat Jul 12 12:11:22 2014
+++ src/external/bsd/dhcp/Makefile.inc	Sat Oct 11 16:22:28 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.11 2014/07/12 12:11:22 spz Exp $
+# $NetBSD: Makefile.inc,v 1.11.2.1 2014/10/11 16:22:28 snj Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -36,9 +36,6 @@ LDADD+=-Wl,-Bstatic
 .endif
 LDADD+= -lirs -lisccfg -ldns -lisc
 LDADD+=-lpthread
-.if defined(PROG) && ${PROG} == "dhclient"
-LDADD+=-Wl,-Bdynamic
-.endif
 .if (${MKCRYPTO} != "no")
 .if (${MKKERBEROS} != "no")
 LDADD+= -lgssapi -lkrb5 -lhx509 -lheimntlm -lheimbase \
@@ -46,6 +43,9 @@ LDADD+= -lgssapi -lkrb5 -lhx509 -lheimnt
 DPADD+= ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBHEIMNTLM} ${LIBHEIMBASE} \
 	${LIBCOM_ERR} ${LIBROKEN} ${LIBASN1} ${LIBWIND}
 .endif
+.if defined(PROG) && ${PROG} == "dhclient"
+LDADD+=-Wl,-Bdynamic
+.endif
 LDADD+= -lcrypto -lipsec -lcrypt
 DPADD+= ${LIBCRYPTO} ${LIBIPSEC} ${LIBCRYPT}
 .endif



CVS commit: [netbsd-7] src/sys/kern

2014-10-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 11 16:16:44 UTC 2014

Modified Files:
src/sys/kern [netbsd-7]: uipc_usrreq.c

Log Message:
Pull up following revision(s) (requested by taca in ticket #132):
sys/kern/uipc_usrreq.c: revision 1.172
Make behavior of getsockname(2) (and maybe getpeername(2)) as the same as
NetBSD 6.1_STABLE and other operating system (OS X 10.9.5).
* sa_len of sockaddr_un strucrure is always set to sizeof(sun_path).
* pathname stored in sun_path is alwasys '\0' terminated (except length
  of sun_path is sizeof(sun_path)?).
Should be fix PR kern/49247, runtime problem of lmtp service of dovecot2 on
NetBSD current and NetBSD 7.0_BETA.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.169.2.1 src/sys/kern/uipc_usrreq.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/uipc_usrreq.c
diff -u src/sys/kern/uipc_usrreq.c:1.169 src/sys/kern/uipc_usrreq.c:1.169.2.1
--- src/sys/kern/uipc_usrreq.c:1.169	Sat Aug  9 05:33:00 2014
+++ src/sys/kern/uipc_usrreq.c	Sat Oct 11 16:16:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_usrreq.c,v 1.169 2014/08/09 05:33:00 rtr Exp $	*/
+/*	$NetBSD: uipc_usrreq.c,v 1.169.2.1 2014/10/11 16:16:44 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.169 2014/08/09 05:33:00 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.169.2.1 2014/10/11 16:16:44 snj Exp $");
 
 #include 
 #include 
@@ -927,8 +927,6 @@ makeun(struct mbuf *nam, size_t *addrlen
 	sun = malloc(*addrlen, M_SONAME, M_WAITOK);
 	m_copydata(nam, 0, nam->m_len, (void *)sun);
 	*(((char *)sun) + nam->m_len) = '\0';
-	sun->sun_len = strlen(sun->sun_path) +
-	offsetof(struct sockaddr_un, sun_path);
 	return sun;
 }
 



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

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 15:55:36 UTC 2014

Modified Files:
src/sys/arch/evbarm/conf: BEAGLEBONE OVERO

Log Message:
No wsdisplay options without wsdisplay.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbarm/conf/BEAGLEBONE
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbarm/conf/OVERO

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/BEAGLEBONE
diff -u src/sys/arch/evbarm/conf/BEAGLEBONE:1.28 src/sys/arch/evbarm/conf/BEAGLEBONE:1.29
--- src/sys/arch/evbarm/conf/BEAGLEBONE:1.28	Thu Sep 18 15:00:08 2014
+++ src/sys/arch/evbarm/conf/BEAGLEBONE	Sat Oct 11 15:55:36 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BEAGLEBONE,v 1.28 2014/09/18 15:00:08 wiz Exp $
+#	$NetBSD: BEAGLEBONE,v 1.29 2014/10/11 15:55:36 uebayasi Exp $
 #
 #	BEAGLEBONE -- TI AM335x board Kernel
 #
@@ -254,17 +254,17 @@ omapwdt32k*	at obio0 addr 0x44e35000 siz
 
 # various options for wscons - we try to look as much like a standard
 # sun console as possible
-options 	WSEMUL_VT100
-options 	WSDISPLAY_COMPAT_PCVT
-options 	WSDISPLAY_COMPAT_SYSCONS
-options 	WSDISPLAY_COMPAT_USL
-options 	WSDISPLAY_SCROLLSUPPORT
-options 	WS_KERNEL_FG=WSCOL_GREEN
+#options 	WSEMUL_VT100
+#options 	WSDISPLAY_COMPAT_PCVT
+#options 	WSDISPLAY_COMPAT_SYSCONS
+#options 	WSDISPLAY_COMPAT_USL
+#options 	WSDISPLAY_SCROLLSUPPORT
+#options 	WS_KERNEL_FG=WSCOL_GREEN
 #options 	WSDISPLAY_DEFAULTSCREENS=4
-options 	FONT_GALLANT12x22
-options 	FONT_BOLD8x16
+#options 	FONT_GALLANT12x22
+#options 	FONT_BOLD8x16
 # compatibility to other console drivers
-options 	WSDISPLAY_COMPAT_RAWKBD 	# can get raw scancodes
+#options 	WSDISPLAY_COMPAT_RAWKBD 	# can get raw scancodes
 
 pseudo-device	wsmux			# mouse & keyboard multiplexor
 pseudo-device	wsfont

Index: src/sys/arch/evbarm/conf/OVERO
diff -u src/sys/arch/evbarm/conf/OVERO:1.41 src/sys/arch/evbarm/conf/OVERO:1.42
--- src/sys/arch/evbarm/conf/OVERO:1.41	Sat Aug 30 15:21:17 2014
+++ src/sys/arch/evbarm/conf/OVERO	Sat Oct 11 15:55:36 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: OVERO,v 1.41 2014/08/30 15:21:17 kiyohara Exp $
+#	$NetBSD: OVERO,v 1.42 2014/10/11 15:55:36 uebayasi Exp $
 #
 #	OVERO -- Gumstix. Inc. Overo COMS platforms kernel
 #
@@ -254,15 +254,15 @@ ukphy*		at mii? phy ?# smsh(4) inter
 
 # various options for wscons - we try to look as much like a standard
 # sun console as possible
-options 	WSEMUL_VT100			# sun terminal emulation
-options 	WS_DEFAULT_FG=WSCOL_BLACK
-options 	WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
-options 	WS_KERNEL_FG=WSCOL_GREEN
-options 	WS_KERNEL_BG=WSCOL_LIGHT_WHITE
-options 	WSDISPLAY_COMPAT_USL		# VT handling
-options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
-options 	WSDISPLAY_DEFAULTSCREENS=4
-options 	FONT_QVSS8x15
+#options 	WSEMUL_VT100			# sun terminal emulation
+#options 	WS_DEFAULT_FG=WSCOL_BLACK
+#options 	WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
+#options 	WS_KERNEL_FG=WSCOL_GREEN
+#options 	WS_KERNEL_BG=WSCOL_LIGHT_WHITE
+#options 	WSDISPLAY_COMPAT_USL		# VT handling
+#options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
+#options 	WSDISPLAY_DEFAULTSCREENS=4
+#options 	FONT_QVSS8x15
 #options 	FONT_GALLANT12x22		# the console font
 
 # USB Host



CVS commit: src/usr.bin/config

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 15:47:38 UTC 2014

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

Log Message:
More debug messages.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/config/main.c
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/config/sem.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.66 src/usr.bin/config/main.c:1.67
--- src/usr.bin/config/main.c:1.66	Sat Oct 11 09:09:19 2014
+++ src/usr.bin/config/main.c	Sat Oct 11 15:47:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.66 2014/10/11 09:09:19 uebayasi Exp $	*/
+/*	$NetBSD: main.c,v 1.67 2014/10/11 15:47:38 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -1006,6 +1006,7 @@ void
 deloption(const char *name)
 {
 
+	CFGDBG(4, "deselecting opt `%s'", name);
 	if (undo_option(opttab, &options, &nextopt, name, "options"))
 		return;
 	if (undo_option(selecttab, NULL, NULL, strtolower(name), "options"))
@@ -1054,6 +1055,7 @@ delfsoption(const char *name)
 {
 	const char *n;
 
+	CFGDBG(4, "deselecting fs `%s'", name);
 	n = strtolower(name);
 	if (undo_option(fsopttab, &fsoptions, &nextfsopt, name, "file-system"))
 		return;
@@ -1075,6 +1077,7 @@ void
 delmkoption(const char *name)
 {
 
+	CFGDBG(4, "deselecting mkopt `%s'", name);
 	(void)undo_option(mkopttab, &mkoptions, &nextmkopt, name,
 	"makeoptions");
 }
@@ -1151,8 +1154,10 @@ undo_option(struct hashtab *ht, struct n
 			cfgwarn("%s `%s' is not defined", type, name);
 		return (1);
 	}
-	if (npp == NULL)
+	if (npp == NULL) {
+		CFGDBG(2, "opt `%s' deselected", name);
 		return (0);
+	}
 
 	for ( ; *npp != NULL; npp = &(*npp)->nv_next) {
 		if ((*npp)->nv_name != name)
@@ -1160,6 +1165,7 @@ undo_option(struct hashtab *ht, struct n
 		if (next != NULL && *next == &(*npp)->nv_next)
 			*next = npp;
 		nv = (*npp)->nv_next;
+		CFGDBG(2, "opt `%s' deselected", (*npp)->nv_name);
 		nvfree(*npp);
 		*npp = nv;
 		return (0);

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.60 src/usr.bin/config/sem.c:1.61
--- src/usr.bin/config/sem.c:1.60	Sat Oct 11 15:20:36 2014
+++ src/usr.bin/config/sem.c	Sat Oct 11 15:47:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.60 2014/10/11 15:20:36 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.61 2014/10/11 15:47:38 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -1043,6 +1043,7 @@ delconf(const char *name)
 {
 	struct config *cf;
 
+	CFGDBG(5, "deselecting config `%s'", name);
 	if (ht_lookup(cfhashtab, name) == NULL) {
 		cfgerror("configuration `%s' undefined", name);
 		return;
@@ -1260,6 +1261,7 @@ deldevi(const char *name, const char *at
 	int unit;
 	char base[NAMESIZE];
 
+	CFGDBG(5, "deselecting devi `%s'", name);
 	if (split(name, strlen(name), base, sizeof base, &unit)) {
 		cfgerror("invalid device name `%s'", name);
 		return;
@@ -1464,6 +1466,7 @@ deldeva(const char *at)
 	} else {
 		int l;
 
+		CFGDBG(5, "deselecting deva `%s'", at);
 		l = strlen(at) - 1;
 		if (at[l] == '?' || isdigit((unsigned char)at[l])) {
 			char base[NAMESIZE];
@@ -1547,6 +1550,7 @@ deldev(const char *name)
 	struct devi *firsti, *i;
 	struct nvlist *nv, *stack = NULL;
 
+	CFGDBG(5, "deselecting dev `%s'", name);
 	l = strlen(name) - 1;
 	if (name[l] == '*' || isdigit((unsigned char)name[l])) {
 		/* `no mydev0' or `no mydev*' */
@@ -1697,6 +1701,7 @@ delpseudo(const char *name)
 	struct devbase *d;
 	struct devi *i;
 
+	CFGDBG(5, "deselecting pseudo `%s'", name);
 	d = ht_lookup(devbasetab, name);
 	if (d == NULL) {
 		cfgerror("undefined pseudo-device %s", name);



CVS commit: src/usr.bin/config

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 15:20:36 UTC 2014

Modified Files:
src/usr.bin/config: scan.l sem.c

Log Message:
On second thought, resolving "device" dependency in enddefs() is correct.
The problem was to select things.  So put back the code to record dependency
as attributes.

While here, sprinkle more debug messages.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/config/scan.l
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/config/sem.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/scan.l
diff -u src/usr.bin/config/scan.l:1.17 src/usr.bin/config/scan.l:1.18
--- src/usr.bin/config/scan.l:1.17	Tue Mar 20 20:34:57 2012
+++ src/usr.bin/config/scan.l	Sat Oct 11 15:20:36 2014
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: scan.l,v 1.17 2012/03/20 20:34:57 matt Exp $	*/
+/*	$NetBSD: scan.l,v 1.18 2014/10/11 15:20:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -530,6 +530,7 @@ include(const char *fname, int ateof, in
 	if (interesting)
 		logconfig_include(fp, fname);
 	incl = in;
+	CFGDBG(1, "include `%s' from `%s' line %d", fname, yyfile, yyline);
 	yy_switch_to_buffer(yy_create_buffer(fp, YY_BUF_SIZE));
 	yyfile = intern(s);
 	yyline = 1;

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.59 src/usr.bin/config/sem.c:1.60
--- src/usr.bin/config/sem.c:1.59	Sat Oct 11 09:27:51 2014
+++ src/usr.bin/config/sem.c	Sat Oct 11 15:20:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.59 2014/10/11 09:27:51 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.60 2014/10/11 15:20:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -142,12 +142,12 @@ finddep(struct attr *a, const char *name
 }
 
 static void
-mergedeps(struct devbase *dev, const char *name)
+mergedeps(const char *devname, const char *name)
 {
 	struct attr *a, *newa;
 
-	CFGDBG(4, "merging attr `%s' to devbase `%s'", name, dev->d_name);
-	a = refattr(dev->d_name);
+	CFGDBG(4, "merging attr `%s' to devbase `%s'", name, devname);
+	a = refattr(devname);
 	if (finddep(a, name) == NULL) {
 		newa = refattr(name);
 		a->a_deps = attrlist_cons(a->a_deps, newa);
@@ -169,6 +169,7 @@ fixdev(struct devbase *dev)
 	CFGDBG(4, "fixing devbase `%s'", dev->d_name);
 	for (al = dev->d_attrs; al != NULL; al = al->al_next) {
 		a = al->al_this;
+		CFGDBG(4, "fixing devbase `%s' attr `%s'", dev->d_name, a->a_name);
 		if (a->a_iattr) {
 			a->a_refs = addtoattr(a->a_refs, dev);
 			CFGDBG(3, "device `%s' has iattr `%s'", dev->d_name,
@@ -187,7 +188,7 @@ fixdev(struct devbase *dev)
 			}
 		} else {
 			if (strcmp(dev->d_name, a->a_name) != 0) {
-mergedeps(dev, a->a_name);
+mergedeps(dev->d_name, a->a_name);
 			}
 		}
 	}
@@ -208,6 +209,7 @@ enddefs(void)
 			errors++;
 			continue;
 		}
+		fixdev(dev);
 	}
 	if (errors) {
 		(void)fprintf(stderr, "*** Stop.\n");
@@ -301,6 +303,7 @@ defattr(const char *name, struct loclist
 			"attribute", name, dep->a_name);
 			return (1);
 		}
+		CFGDBG(2, "attr `%s' depends on attr `%s'", name, dep->a_name);
 	}
 
 	if (getrefattr(name, &a)) {
@@ -453,6 +456,7 @@ defdev(struct devbase *dev, struct locli
 {
 	struct loclist *ll;
 	struct attrlist *al;
+	struct attr *a;
 
 	if (dev == &errdev)
 		goto bad;
@@ -511,7 +515,7 @@ defdev(struct devbase *dev, struct locli
 	/*
 	 * Implicit attribute definition for device.
 	 */
-	refattr(dev->d_name);
+	a = refattr(dev->d_name);
 
 	/*
 	 * For each interface attribute this device refers to, add this
@@ -526,7 +530,9 @@ defdev(struct devbase *dev, struct locli
 		/*
 		 * Implicit attribute definition for device dependencies.
 		 */
-		refattr(dev->d_name);
+		refattr(al->al_this->a_name);
+		CFGDBG(2, "device `%s' depends on attr `%s'", dev->d_name,
+		al->al_this->a_name);
 	}
 	return;
  bad:
@@ -1235,6 +1241,7 @@ adddev(const char *name, const char *at,
 	i->i_pspec = p;
 	i->i_atdeva = iba;
 	i->i_cfflags = flags;
+	CFGDBG(3, "devi `%s' added", i->i_name);
 
 	*iba->d_ipp = i;
 	iba->d_ipp = &i->i_asame;
@@ -1759,7 +1766,8 @@ fixdevis(void)
 	struct devi *i;
 	int error = 0;
 
-	TAILQ_FOREACH(i, &alldevi, i_next)
+	TAILQ_FOREACH(i, &alldevi, i_next) {
+		CFGDBG(3, "fixing devis `%s'", i->i_name);
 		if (i->i_active == DEVI_ACTIVE)
 			selectbase(i->i_base, i->i_atdeva);
 		else if (i->i_active == DEVI_ORPHAN) {
@@ -1776,6 +1784,7 @@ fixdevis(void)
 			cfgxwarn(i->i_srcfile, i->i_lineno, "ignoring "
 			"explicitly orphaned instance `%s at %s'",
 			i->i_name, i->i_at);
+	}
 
 	if (error)
 		return error;



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

2014-10-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 11 14:52:16 UTC 2014

Modified Files:
src/tests/lib/libc/sync: Makefile
Added Files:
src/tests/lib/libc/sync: cpp_atomic_ops_linkable.cc

Log Message:
Add a link time test to catch missing symbols in libc, as pointed
out in PR toolchain/49074.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sync/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sync/cpp_atomic_ops_linkable.cc

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/sync/Makefile
diff -u src/tests/lib/libc/sync/Makefile:1.1 src/tests/lib/libc/sync/Makefile:1.2
--- src/tests/lib/libc/sync/Makefile:1.1	Mon Feb 17 10:10:41 2014
+++ src/tests/lib/libc/sync/Makefile	Sat Oct 11 14:52:15 2014
@@ -1,11 +1,12 @@
-# $NetBSD: Makefile,v 1.1 2014/02/17 10:10:41 martin Exp $
+# $NetBSD: Makefile,v 1.2 2014/10/11 14:52:15 martin Exp $
 
 WARNS=0
 NOMAN=1
+CXXFLAGS+= -std=c++11
 
-PROG=all_sync_ops_linkable
+PROG=all_sync_ops_linkable cpp_atomic_ops_linkable
 
-proginstall-all_sync_ops_linkable:
-	@echo link time only test
+proginstall:
+	@echo This directory features link time only tests.
 
 .include 

Added files:

Index: src/tests/lib/libc/sync/cpp_atomic_ops_linkable.cc
diff -u /dev/null src/tests/lib/libc/sync/cpp_atomic_ops_linkable.cc:1.1
--- /dev/null	Sat Oct 11 14:52:16 2014
+++ src/tests/lib/libc/sync/cpp_atomic_ops_linkable.cc	Sat Oct 11 14:52:15 2014
@@ -0,0 +1,98 @@
+/* $NetBSD: cpp_atomic_ops_linkable.cc,v 1.1 2014/10/11 14:52:15 martin Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Martin Husemann .
+ *
+ * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION 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.
+ */
+
+/*
+ * This is a simple link-time test to verify all builtin atomic sync
+ * operations for C++  are available.
+ */
+
+#include 
+
+template 
+class ATest {
+public:
+  ATest() : m_val(0)
+  {
+m_val.exchange(std::atomic(8));
+m_val--;
+m_val++;
+m_val ^= 0x0f;
+m_val &= 0x0f;
+m_val |= 2;
+
+T tval(1), other(42);
+m_val.compare_exchange_weak(tval, other,
+  std::memory_order_release, std::memory_order_relaxed);
+  }
+
+private:
+  volatile std::atomic m_val;
+};
+
+int main(int argc, char **argv)
+{
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+  ATest();
+}



CVS commit: src/sys/dev/ata

2014-10-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Oct 11 14:05:12 UTC 2014

Modified Files:
src/sys/dev/ata: wd.c

Log Message:
The partition size is always computed in native blocks. The code also assumes
that native blocks are always DEVB_SIZE (a few lines earlier) which makes
the current calculation a no-op.


To generate a diff of this commit:
cvs rdiff -u -r1.413 -r1.414 src/sys/dev/ata/wd.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/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.413 src/sys/dev/ata/wd.c:1.414
--- src/sys/dev/ata/wd.c:1.413	Wed Sep 10 07:04:48 2014
+++ src/sys/dev/ata/wd.c	Sat Oct 11 14:05:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.413 2014/09/10 07:04:48 matt Exp $ */
+/*	$NetBSD: wd.c,v 1.414 2014/10/11 14:05:11 mlelstv Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.413 2014/09/10 07:04:48 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.414 2014/10/11 14:05:11 mlelstv Exp $");
 
 #include "opt_ata.h"
 
@@ -1082,8 +1082,7 @@ wdgetdefaultlabel(struct wd_softc *wd, s
 	lp->d_flags = 0;
 
 	lp->d_partitions[RAW_PART].p_offset = 0;
-	lp->d_partitions[RAW_PART].p_size =
-	lp->d_secperunit * (lp->d_secsize / DEV_BSIZE);
+	lp->d_partitions[RAW_PART].p_size = lp->d_secperunit;
 	lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED;
 	lp->d_npartitions = RAW_PART + 1;
 



CVS commit: src/sys/dev/spi

2014-10-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Oct 11 13:56:01 UTC 2014

Modified Files:
src/sys/dev/spi: spiflash.c

Log Message:
use disk_init() wrapper function instead of poking data structures.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/spi/spiflash.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/spi/spiflash.c
diff -u src/sys/dev/spi/spiflash.c:1.15 src/sys/dev/spi/spiflash.c:1.16
--- src/sys/dev/spi/spiflash.c:1.15	Fri Jul 25 08:10:39 2014
+++ src/sys/dev/spi/spiflash.c	Sat Oct 11 13:56:01 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: spiflash.c,v 1.15 2014/07/25 08:10:39 dholland Exp $ */
+/* $NetBSD: spiflash.c,v 1.16 2014/10/11 13:56:01 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spiflash.c,v 1.15 2014/07/25 08:10:39 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spiflash.c,v 1.16 2014/10/11 13:56:01 mlelstv Exp $");
 
 #include 
 #include 
@@ -232,9 +232,7 @@ spiflash_attach(device_t parent, device_
 	bufq_alloc(&sc->sc_workq, "fcfs", BUFQ_SORT_RAWBLOCK);
 	bufq_alloc(&sc->sc_doneq, "fcfs", BUFQ_SORT_RAWBLOCK);
 
-	sc->sc_dk.dk_driver = &spiflash_dkdriver;
-	sc->sc_dk.dk_name = device_xname(self);
-
+	disk_init(&sc->sc_dk, device_xname(self), &spiflash_dkdriver);
 	disk_attach(&sc->sc_dk);
 
 	/* arrange to allocate the kthread */



CVS commit: src/usr.sbin/sysinst/arch/i386

2014-10-11 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Oct 11 13:34:01 UTC 2014

Modified Files:
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev.  Also remove bp and bootxx since their only use was in
the incorrect check.  This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/arch/i386/md.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.sbin/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.3 src/usr.sbin/sysinst/arch/i386/md.c:1.4
--- src/usr.sbin/sysinst/arch/i386/md.c:1.3	Mon Aug 11 00:31:22 2014
+++ src/usr.sbin/sysinst/arch/i386/md.c	Sat Oct 11 13:34:01 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.3 2014/08/11 00:31:22 riz Exp $ */
+/*	$NetBSD: md.c,v 1.4 2014/10/11 13:34:01 gson Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -301,7 +301,6 @@ md_post_newfs(void)
 {
 	int ret;
 	size_t len;
-	char bootxx[8192 + 4];
 	char boot_options[1024];
 	char *bootxx_filename;
 	/*
@@ -324,7 +323,6 @@ md_post_newfs(void)
 	static int conmib[] = {CTL_MACHDEP, CPU_CONSDEV};
 	struct termios t;
 	dev_t condev;
-#define bp (*(struct x86_boot_params *)(bootxx + 512 * 2 + 8))
 
 	/*
 	 * Get console device, should either be ttyE0 or tty0n.
@@ -342,7 +340,8 @@ md_post_newfs(void)
 
 	process_menu(MENU_getboottype, &boottype);
 	msg_display(MSG_dobootblks, pm->diskdev);
-	if (bp.bp_consdev == ~0u)
+	if (boottype.bp_consdev == ~0u)
+		/* Use existing bootblocks */
 		return 0;
 
 	ret = cp_to_target("/usr/mdec/boot", "/boot");



CVS commit: src/sys/dev

2014-10-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Oct 11 12:36:25 UTC 2014

Modified Files:
src/sys/dev: ccd.c dksubr.c
src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
No longer warn about differences bewteen disk size and total sector count
in disklabel when the latter is just clamped to the maximum.


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/sys/dev/ccd.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/dksubr.c
cvs rdiff -u -r1.313 -r1.314 src/sys/dev/raidframe/rf_netbsdkintf.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/ccd.c
diff -u src/sys/dev/ccd.c:1.153 src/sys/dev/ccd.c:1.154
--- src/sys/dev/ccd.c:1.153	Sat Oct 11 12:01:27 2014
+++ src/sys/dev/ccd.c	Sat Oct 11 12:36:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ccd.c,v 1.153 2014/10/11 12:01:27 mlelstv Exp $	*/
+/*	$NetBSD: ccd.c,v 1.154 2014/10/11 12:36:25 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.153 2014/10/11 12:01:27 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.154 2014/10/11 12:36:25 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -1552,7 +1552,9 @@ ccdgetdisklabel(dev_t dev)
 		 * same componets are used, and old disklabel may used
 		 * if that is found.
 		 */
-		if (lp->d_secperunit != cs->sc_size)
+		if (lp->d_secperunit < UINT32_MAX ?
+			lp->d_secperunit != cs->sc_size :
+			lp->d_secperunit > cs->sc_size)
 			printf("WARNING: %s: "
 			"total sector size in disklabel (%ju) != "
 			"the size of ccd (%ju)\n", cs->sc_xname,

Index: src/sys/dev/dksubr.c
diff -u src/sys/dev/dksubr.c:1.52 src/sys/dev/dksubr.c:1.53
--- src/sys/dev/dksubr.c:1.52	Sat Oct 11 12:01:27 2014
+++ src/sys/dev/dksubr.c	Sat Oct 11 12:36:25 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.52 2014/10/11 12:01:27 mlelstv Exp $ */
+/* $NetBSD: dksubr.c,v 1.53 2014/10/11 12:36:25 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.52 2014/10/11 12:01:27 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.53 2014/10/11 12:36:25 mlelstv Exp $");
 
 #include 
 #include 
@@ -583,17 +583,21 @@ dk_getdisklabel(struct dk_intf *di, stru
 		return;
 
 	/* Sanity check */
-	if (lp->d_secperunit != dg->dg_secperunit)
-		printf("WARNING: %s: total sector size in disklabel (%d) "
-		"!= the size of %s (%" PRId64 ")\n", dksc->sc_xname,
-		lp->d_secperunit, di->di_dkname, dg->dg_secperunit);
+	if (lp->d_secperunit < UINT32_MAX ?
+		lp->d_secperunit != dg->dg_secperunit :
+		lp->d_secperunit > dg->dg_secperunit)
+		printf("WARNING: %s: total sector size in disklabel (%ju) "
+		"!= the size of %s (%ju)\n", dksc->sc_xname,
+		(uintmax_t)lp->d_secperunit, di->di_dkname,
+		(uintmax_t)dg->dg_secperunit);
 
 	for (i=0; i < lp->d_npartitions; i++) {
 		pp = &lp->d_partitions[i];
 		if (pp->p_offset + pp->p_size > dg->dg_secperunit)
 			printf("WARNING: %s: end of partition `%c' exceeds "
-			"the size of %s (%" PRId64 ")\n", dksc->sc_xname,
-			'a' + i, di->di_dkname, dg->dg_secperunit);
+			"the size of %s (%ju)\n", dksc->sc_xname,
+			'a' + i, di->di_dkname,
+			(uintmax_t)dg->dg_secperunit);
 	}
 }
 

Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.313 src/sys/dev/raidframe/rf_netbsdkintf.c:1.314
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.313	Sat Oct 11 12:01:27 2014
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Sat Oct 11 12:36:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.313 2014/10/11 12:01:27 mlelstv Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.314 2014/10/11 12:36:25 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.313 2014/10/11 12:01:27 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.314 2014/10/11 12:36:25 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2440,17 +2440,21 @@ raidgetdisklabel(dev_t dev)
 		 * same components are used, and old disklabel may used
 		 * if that is found.
 		 */
-		if (lp->d_secperunit != rs->sc_size)
+		if (lp->d_secperunit < UINT32_MAX ?
+		lp->d_secperunit != rs->sc_size :
+		lp->d_secperunit > rs->sc_size)
 			printf("raid%d: WARNING: %s: "
-			"total sector size in disklabel (%" PRIu32 ") != "
-			"the size of raid (%" PRIu64 ")\n", unit, rs->sc_xname,
-			lp->d_secperunit, rs->sc_size);
+			"total sector size in disklabel (%ju) != "
+			"the size of raid (%ju)\n", unit, rs->sc_xname,
+			(uintmax_t)lp->d_secperunit,
+			 

CVS commit: src/lib/libc/sys

2014-10-11 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sat Oct 11 12:06:58 UTC 2014

Modified Files:
src/lib/libc/sys: rmdir.2

Log Message:
Note that rmdir(2) fails with EINVAL when the path last component is
`.' (dot).


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/sys/rmdir.2

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

Modified files:

Index: src/lib/libc/sys/rmdir.2
diff -u src/lib/libc/sys/rmdir.2:1.21 src/lib/libc/sys/rmdir.2:1.22
--- src/lib/libc/sys/rmdir.2:1.21	Sat Oct 11 11:50:11 2014
+++ src/lib/libc/sys/rmdir.2	Sat Oct 11 12:06:58 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rmdir.2,v 1.21 2014/10/11 11:50:11 njoly Exp $
+.\"	$NetBSD: rmdir.2,v 1.22 2014/10/11 12:06:58 njoly Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)rmdir.2	8.1 (Berkeley) 6/4/93
 .\"
-.Dd June 4, 1993
+.Dd October 11, 2014
 .Dt RMDIR 2
 .Os
 .Sh NAME
@@ -66,6 +66,9 @@ for a mounted file system.
 .It Bq Er EFAULT
 .Fa path
 points outside the process's allocated address space.
+.It Bq Er EINVAL
+The last component of the path is
+.Ql \&. .
 .It Bq Er EIO
 An I/O error occurred while deleting the directory entry
 or deallocating the inode.



CVS commit: src/sys/dev

2014-10-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Oct 11 12:01:27 UTC 2014

Modified Files:
src/sys/dev: ccd.c dksubr.c ld.c vnd.c
src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
clamp total number of sectors to UINT32_MAX instead of providing the
lower 32bit of the 64bit number.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sys/dev/ccd.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/dksubr.c
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/ld.c
cvs rdiff -u -r1.232 -r1.233 src/sys/dev/vnd.c
cvs rdiff -u -r1.312 -r1.313 src/sys/dev/raidframe/rf_netbsdkintf.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/ccd.c
diff -u src/sys/dev/ccd.c:1.152 src/sys/dev/ccd.c:1.153
--- src/sys/dev/ccd.c:1.152	Sat Aug 16 19:27:27 2014
+++ src/sys/dev/ccd.c	Sat Oct 11 12:01:27 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ccd.c,v 1.152 2014/08/16 19:27:27 sborrill Exp $	*/
+/*	$NetBSD: ccd.c,v 1.153 2014/10/11 12:01:27 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.152 2014/08/16 19:27:27 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.153 2014/10/11 12:01:27 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -1479,7 +1479,10 @@ ccdgetdefaultlabel(struct ccd_softc *cs,
 
 	memset(lp, 0, sizeof(*lp));
 
-	lp->d_secperunit = cs->sc_size;
+	if (cs->sc_size > UINT32_MAX)
+		lp->d_secperunit = UINT32_MAX;
+	else
+		lp->d_secperunit = cs->sc_size;
 	lp->d_secsize = ccg->ccg_secsize;
 	lp->d_nsectors = ccg->ccg_nsectors;
 	lp->d_ntracks = ccg->ccg_ntracks;
@@ -1494,7 +1497,7 @@ ccdgetdefaultlabel(struct ccd_softc *cs,
 	lp->d_flags = 0;
 
 	lp->d_partitions[RAW_PART].p_offset = 0;
-	lp->d_partitions[RAW_PART].p_size = cs->sc_size;
+	lp->d_partitions[RAW_PART].p_size = lp->d_secperunit;
 	lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED;
 	lp->d_npartitions = RAW_PART + 1;
 

Index: src/sys/dev/dksubr.c
diff -u src/sys/dev/dksubr.c:1.51 src/sys/dev/dksubr.c:1.52
--- src/sys/dev/dksubr.c:1.51	Sat Jun 14 07:39:00 2014
+++ src/sys/dev/dksubr.c	Sat Oct 11 12:01:27 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.51 2014/06/14 07:39:00 hannken Exp $ */
+/* $NetBSD: dksubr.c,v 1.52 2014/10/11 12:01:27 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.51 2014/06/14 07:39:00 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.52 2014/10/11 12:01:27 mlelstv Exp $");
 
 #include 
 #include 
@@ -530,7 +530,10 @@ dk_getdefaultlabel(struct dk_intf *di, s
 
 	memset(lp, 0, sizeof(*lp));
 
-	lp->d_secperunit = dg->dg_secperunit;
+	if (dg->dg_secperunit > UINT32_MAX)
+		lp->d_secperunit = UINT32_MAX;
+	else
+		lp->d_secperunit = dg->dg_secperunit;
 	lp->d_secsize = dg->dg_secsize;
 	lp->d_nsectors = dg->dg_nsectors;
 	lp->d_ntracks = dg->dg_ntracks;
@@ -545,7 +548,7 @@ dk_getdefaultlabel(struct dk_intf *di, s
 	lp->d_flags = 0;
 
 	lp->d_partitions[RAW_PART].p_offset = 0;
-	lp->d_partitions[RAW_PART].p_size = dg->dg_secperunit;
+	lp->d_partitions[RAW_PART].p_size = lp->d_secperunit;
 	lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED;
 	lp->d_npartitions = RAW_PART + 1;
 

Index: src/sys/dev/ld.c
diff -u src/sys/dev/ld.c:1.76 src/sys/dev/ld.c:1.77
--- src/sys/dev/ld.c:1.76	Fri Sep  5 05:27:23 2014
+++ src/sys/dev/ld.c	Sat Oct 11 12:01:27 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld.c,v 1.76 2014/09/05 05:27:23 matt Exp $	*/
+/*	$NetBSD: ld.c,v 1.77 2014/10/11 12:01:27 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.76 2014/09/05 05:27:23 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.77 2014/10/11 12:01:27 mlelstv Exp $");
 
 #include 
 #include 
@@ -814,14 +814,16 @@ ldgetdefaultlabel(struct ld_softc *sc, s
 	lp->d_type = DTYPE_LD;
 	strlcpy(lp->d_typename, "unknown", sizeof(lp->d_typename));
 	strlcpy(lp->d_packname, "fictitious", sizeof(lp->d_packname));
-	lp->d_secperunit = sc->sc_secperunit;
+	if (sc->sc_secperunit > UINT32_MAX)
+		lp->d_secperunit = UINT32_MAX;
+	else
+		lp->d_secperunit = sc->sc_secperunit;
 	lp->d_rpm = 7200;
 	lp->d_interleave = 1;
 	lp->d_flags = 0;
 
 	lp->d_partitions[RAW_PART].p_offset = 0;
-	lp->d_partitions[RAW_PART].p_size =
-	lp->d_secperunit * (lp->d_secsize / DEV_BSIZE);
+	lp->d_partitions[RAW_PART].p_size = lp->d_secperunit;
 	lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED;
 	lp->d_npartitions = RAW_PART + 1;
 

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.232 src/sys/dev/vnd.c:1.233
--- src/sys/dev/vnd.c:1.232	Fri Jul 25 08:10:35 2014
+++ src/sys/dev/vnd.c	Sat Oct 11 12:01:27 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.232 2014/07/25 08:10:35 dholland Exp $	*/
+/*	$

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

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 11:55:07 UTC 2014

Modified Files:
src/sys/arch/evbarm/conf: BEAGLEBOARD BPI CUBIEBOARD CUBOX-I
IMX23_OLINUXINO KOBO NETWALKER NITROGEN6X ODROID-U ODROID-XU RPI

Log Message:
Device midi attachment where the evil usbdevices.config is included.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/evbarm/conf/BEAGLEBOARD
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/BPI
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/conf/CUBIEBOARD
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/CUBOX-I
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/IMX23_OLINUXINO
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/KOBO
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/evbarm/conf/NETWALKER
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/NITROGEN6X \
src/sys/arch/evbarm/conf/ODROID-XU
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/conf/ODROID-U
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/evbarm/conf/RPI

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/BEAGLEBOARD
diff -u src/sys/arch/evbarm/conf/BEAGLEBOARD:1.58 src/sys/arch/evbarm/conf/BEAGLEBOARD:1.59
--- src/sys/arch/evbarm/conf/BEAGLEBOARD:1.58	Sat Aug 30 15:21:17 2014
+++ src/sys/arch/evbarm/conf/BEAGLEBOARD	Sat Oct 11 11:55:07 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BEAGLEBOARD,v 1.58 2014/08/30 15:21:17 kiyohara Exp $
+#	$NetBSD: BEAGLEBOARD,v 1.59 2014/10/11 11:55:07 uebayasi Exp $
 #
 #	BEAGLEBOARD -- TI OMAP 3530 Eval Board Kernel
 #
@@ -278,6 +278,8 @@ usb*		at ehci?
 
 include "dev/usb/usbdevices.config"
 
+midi*		at midibus?
+
 ukphy*		at mii? phy ?
 
 # Hardware clocking and power management

Index: src/sys/arch/evbarm/conf/BPI
diff -u src/sys/arch/evbarm/conf/BPI:1.2 src/sys/arch/evbarm/conf/BPI:1.3
--- src/sys/arch/evbarm/conf/BPI:1.2	Mon Sep  8 07:57:36 2014
+++ src/sys/arch/evbarm/conf/BPI	Sat Oct 11 11:55:07 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BPI,v 1.2 2014/09/08 07:57:36 skrll Exp $
+#	$NetBSD: BPI,v 1.3 2014/10/11 11:55:07 uebayasi Exp $
 #
 #	BPI -- Banana Pi - an Allwinner A20 Eval Board Kernel
 #
@@ -287,6 +287,8 @@ awge0		at awinio0 port ?
 
 include "dev/usb/usbdevices.config"
 
+midi*		at midibus?
+
 rlphy*		at mii? phy ?
 ukphy*		at mii? phy ?
 

Index: src/sys/arch/evbarm/conf/CUBIEBOARD
diff -u src/sys/arch/evbarm/conf/CUBIEBOARD:1.26 src/sys/arch/evbarm/conf/CUBIEBOARD:1.27
--- src/sys/arch/evbarm/conf/CUBIEBOARD:1.26	Sat Sep 13 17:50:27 2014
+++ src/sys/arch/evbarm/conf/CUBIEBOARD	Sat Oct 11 11:55:07 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: CUBIEBOARD,v 1.26 2014/09/13 17:50:27 jmcneill Exp $
+#	$NetBSD: CUBIEBOARD,v 1.27 2014/10/11 11:55:07 uebayasi Exp $
 #
 #	CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel
 #
@@ -294,6 +294,8 @@ awge0		at awinio0 port ?
 
 include "dev/usb/usbdevices.config"
 
+midi*		at midibus?
+
 rlphy*		at mii? phy ?
 rgephy* 	at mii? phy ?
 ukphy*		at mii? phy ?

Index: src/sys/arch/evbarm/conf/CUBOX-I
diff -u src/sys/arch/evbarm/conf/CUBOX-I:1.1 src/sys/arch/evbarm/conf/CUBOX-I:1.2
--- src/sys/arch/evbarm/conf/CUBOX-I:1.1	Mon Oct  6 10:37:20 2014
+++ src/sys/arch/evbarm/conf/CUBOX-I	Sat Oct 11 11:55:07 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CUBOX-I,v 1.1 2014/10/06 10:37:20 ryo Exp $
+# $NetBSD: CUBOX-I,v 1.2 2014/10/11 11:55:07 uebayasi Exp $
 #
 # CuBox-i
 # - http://www.solid-run.com/products/cubox-i-mini-computer/
@@ -319,6 +319,8 @@ usb*		at ehci?
 # USB device drivers
 include "dev/usb/usbdevices.config"
 
+midi*		at midibus?
+
 # SD/MMC controller
 #sdhc0		at axi? addr 0x0219 irq 54		# uSDHC1
 #sdhc1		at axi? addr 0x02194000 irq 55		# uSDHC2

Index: src/sys/arch/evbarm/conf/IMX23_OLINUXINO
diff -u src/sys/arch/evbarm/conf/IMX23_OLINUXINO:1.9 src/sys/arch/evbarm/conf/IMX23_OLINUXINO:1.10
--- src/sys/arch/evbarm/conf/IMX23_OLINUXINO:1.9	Sun Aug 24 07:59:22 2014
+++ src/sys/arch/evbarm/conf/IMX23_OLINUXINO	Sat Oct 11 11:55:07 2014
@@ -1,4 +1,4 @@
-# $Id: IMX23_OLINUXINO,v 1.9 2014/08/24 07:59:22 jnemeth Exp $
+# $Id: IMX23_OLINUXINO,v 1.10 2014/10/11 11:55:07 uebayasi Exp $
 #
 # IMX23_OLINUXINO -- Olimex i.MX23 OLinuXino kernel configuration file.
 #
@@ -78,6 +78,8 @@ ugen*		at uhub? port ?
 
 include "dev/usb/usbdevices.config"
 
+midi*		at midibus?
+
 ukphy*		at mii? phy ?
 
 options		MEMSIZE=64

Index: src/sys/arch/evbarm/conf/KOBO
diff -u src/sys/arch/evbarm/conf/KOBO:1.5 src/sys/arch/evbarm/conf/KOBO:1.6
--- src/sys/arch/evbarm/conf/KOBO:1.5	Sat Aug 23 20:26:57 2014
+++ src/sys/arch/evbarm/conf/KOBO	Sat Oct 11 11:55:07 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: KOBO,v 1.5 2014/08/23 20:26:57 dholland Exp $
+#	$NetBSD: KOBO,v 1.6 2014/10/11 11:55:07 uebayasi Exp $
 #
 #	KOBO -- http://kobo.com
 #
@@ -261,6 +261,8 @@ usb*		at ehci?
 # USB device drivers, just as soon as we have something to attach them to
 include "dev/usb/usbdevices.config"
 
+midi*		at midibus?
+
 ukphy*		at mii? phy ?
 
 # Pseudo-De

CVS commit: src/lib/libc/sys

2014-10-11 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sat Oct 11 11:50:11 UTC 2014

Modified Files:
src/lib/libc/sys: rmdir.2

Log Message:
Use '.Rv -std' for RETURN VALUES, sort ERRORS.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/sys/rmdir.2

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

Modified files:

Index: src/lib/libc/sys/rmdir.2
diff -u src/lib/libc/sys/rmdir.2:1.20 src/lib/libc/sys/rmdir.2:1.21
--- src/lib/libc/sys/rmdir.2:1.20	Mon May 31 12:16:20 2010
+++ src/lib/libc/sys/rmdir.2	Sat Oct 11 11:50:11 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rmdir.2,v 1.20 2010/05/31 12:16:20 njoly Exp $
+.\"	$NetBSD: rmdir.2,v 1.21 2014/10/11 11:50:11 njoly Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -52,14 +52,25 @@ than
 and
 .Ql \&.. .
 .Sh RETURN VALUES
-A 0 is returned if the remove succeeds; otherwise a \-1 is
-returned and an error code is stored in the global location
-.Va errno .
+.Rv -std
 .Sh ERRORS
 The named file is removed unless:
 .Bl -tag -width Er
-.It Bq Er ENOTDIR
-A component of the path is not a directory.
+.It Bq Er EACCES
+Search permission is denied for a component of the path prefix, or
+write permission is denied on the directory containing the link
+to be removed.
+.It Bq Er EBUSY
+The directory to be removed is the mount point
+for a mounted file system.
+.It Bq Er EFAULT
+.Fa path
+points outside the process's allocated address space.
+.It Bq Er EIO
+An I/O error occurred while deleting the directory entry
+or deallocating the inode.
+.It Bq Er ELOOP
+Too many symbolic links were encountered in translating the pathname.
 .It Bq Er ENAMETOOLONG
 A component of a pathname exceeded
 .Brq Dv NAME_MAX
@@ -68,33 +79,20 @@ characters, or an entire path name excee
 characters.
 .It Bq Er ENOENT
 The named directory does not exist.
-.It Bq Er ELOOP
-Too many symbolic links were encountered in translating the pathname.
+.It Bq Er ENOTDIR
+A component of the path is not a directory.
 .It Bq Er ENOTEMPTY
 The named directory contains files other than
 .Ql \&.
 and
 .Ql \&..
 in it.
-.It Bq Er EACCES
-Search permission is denied for a component of the path prefix, or
-write permission is denied on the directory containing the link
-to be removed.
 .It Bq Er EPERM
 The directory containing the directory to be removed is marked sticky,
 and neither the containing directory nor the directory to be removed
 are owned by the effective user ID.
-.It Bq Er EBUSY
-The directory to be removed is the mount point
-for a mounted file system.
-.It Bq Er EIO
-An I/O error occurred while deleting the directory entry
-or deallocating the inode.
 .It Bq Er EROFS
 The directory entry to be removed resides on a read-only file system.
-.It Bq Er EFAULT
-.Fa path
-points outside the process's allocated address space.
 .El
 .Sh SEE ALSO
 .Xr mkdir 2 ,



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

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 11:26:57 UTC 2014

Modified Files:
src/sys/arch/rs6000/conf: GENERIC

Log Message:
Comment out wscons related options.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/rs6000/conf/GENERIC

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/rs6000/conf/GENERIC
diff -u src/sys/arch/rs6000/conf/GENERIC:1.30 src/sys/arch/rs6000/conf/GENERIC:1.31
--- src/sys/arch/rs6000/conf/GENERIC:1.30	Sat Aug 23 20:26:59 2014
+++ src/sys/arch/rs6000/conf/GENERIC	Sat Oct 11 11:26:57 2014
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.30 2014/08/23 20:26:59 dholland Exp $
+# $NetBSD: GENERIC,v 1.31 2014/10/11 11:26:57 uebayasi Exp $
 #
 # GENERIC machine description file
 # 
@@ -24,7 +24,7 @@ options 	INCLUDE_CONFIG_FILE	# embed con
 
 #makeoptions	COPTS="-O2 -mno-powerpc -mno-power"	# wh
 
-#ident		"GENERIC-$Revision: 1.30 $"
+#ident		"GENERIC-$Revision: 1.31 $"
 
 maxusers	32
 
@@ -157,17 +157,17 @@ options 	NFS_BOOT_DHCP
 # wscons options
 #
 # builtin terminal emulations
-options 	WSEMUL_VT100		# VT100 / VT220 emulation
-options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
+#options 	WSEMUL_VT100		# VT100 / VT220 emulation
+#options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
 # different kernel output - see dev/wscons/wsdisplayvar.h
-options 	WS_KERNEL_FG=WSCOL_GREEN
+#options 	WS_KERNEL_FG=WSCOL_GREEN
 #options 	WS_KERNEL_BG=WSCOL_BLACK
 # see dev/pckbport/wskbdmap_mfii.c for implemented layouts
 #options 	PCKBD_LAYOUT="(KB_DE | KB_NODEAD)"
 # allocate a number of virtual screens at autoconfiguration time
 #options 	WSDISPLAY_DEFAULTSCREENS=4
 # use a large software cursor that doesn't blink
-options 	PCDISPLAY_SOFTCURSOR
+#options 	PCDISPLAY_SOFTCURSOR
 
 # Kernel root file system and dump configuration.
 config	netbsd	root on ? type ?



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

2014-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 11 10:31:13 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_io.c

Log Message:
ahcisata is only available on the A10 and A20


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/allwinner/awin_io.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/allwinner/awin_io.c
diff -u src/sys/arch/arm/allwinner/awin_io.c:1.16 src/sys/arch/arm/allwinner/awin_io.c:1.17
--- src/sys/arch/arm/allwinner/awin_io.c:1.16	Fri Oct 10 07:36:11 2014
+++ src/sys/arch/arm/allwinner/awin_io.c	Sat Oct 11 10:31:13 2014
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.16 2014/10/10 07:36:11 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.17 2014/10/11 10:31:13 jmcneill Exp $");
 
 #include 
 #include 
@@ -121,7 +121,7 @@ static const struct awin_locators awin_l
 	{ "awinmmc", OFFANDSIZE(SDMMC3), 3, AWIN_IRQ_SDMMC3, A10|A20 },
 	{ "awinmmc", OFFANDSIZE(SDMMC1), 4, AWIN_IRQ_SDMMC1, A10|A20 },
 	{ "awinmmc", OFFANDSIZE(SDMMC0), 0, AWIN_A31_IRQ_SDMMC0, A31 },
-	{ "ahcisata", OFFANDSIZE(SATA), NOPORT, AWIN_IRQ_SATA, AANY },
+	{ "ahcisata", OFFANDSIZE(SATA), NOPORT, AWIN_IRQ_SATA, A10|A20 },
 	{ "awiniic", OFFANDSIZE(TWI0), 0, AWIN_IRQ_TWI0, AANY },
 	{ "awiniic", OFFANDSIZE(TWI1), 1, AWIN_IRQ_TWI1, AANY },
 	{ "awiniic", OFFANDSIZE(TWI2), 2, AWIN_IRQ_TWI2, AANY },



CVS commit: src/sys/net

2014-10-11 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Sat Oct 11 10:27:31 UTC 2014

Modified Files:
src/sys/net: if_vlan.c

Log Message:
Execute if_detach within splnet where vlan_unconfig is

With the fix, a ifnet data of vlan can avoid use after free
that results in a fatal page fault.

This problem was found when fixing PR 49264. See
http://mail-index.netbsd.org/netbsd-bugs/2014/10/10/msg038536.html
for more detail.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/net/if_vlan.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/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.77 src/sys/net/if_vlan.c:1.78
--- src/sys/net/if_vlan.c:1.77	Sat Oct 11 10:18:36 2014
+++ src/sys/net/if_vlan.c	Sat Oct 11 10:27:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.77 2014/10/11 10:18:36 ozaki-r Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.78 2014/10/11 10:27:31 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.77 2014/10/11 10:18:36 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.78 2014/10/11 10:27:31 ozaki-r Exp $");
 
 #include "opt_inet.h"
 
@@ -252,9 +252,9 @@ vlan_clone_destroy(struct ifnet *ifp)
 	s = splnet();
 	LIST_REMOVE(ifv, ifv_list);
 	vlan_unconfig(ifp);
+	if_detach(ifp);
 	splx(s);
 
-	if_detach(ifp);
 	free(ifv, M_DEVBUF);
 
 	return (0);



CVS commit: src/sys/net

2014-10-11 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Sat Oct 11 10:18:36 UTC 2014

Modified Files:
src/sys/net: if_vlan.c

Log Message:
Tweak vlan_unconfig

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/net/if_vlan.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/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.76 src/sys/net/if_vlan.c:1.77
--- src/sys/net/if_vlan.c:1.76	Sat Oct 11 10:16:49 2014
+++ src/sys/net/if_vlan.c	Sat Oct 11 10:18:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.76 2014/10/11 10:16:49 ozaki-r Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.77 2014/10/11 10:18:36 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.76 2014/10/11 10:16:49 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.77 2014/10/11 10:18:36 ozaki-r Exp $");
 
 #include "opt_inet.h"
 
@@ -362,10 +362,12 @@ static void
 vlan_unconfig(struct ifnet *ifp)
 {
 	struct ifvlan *ifv = ifp->if_softc;
+	struct ifnet *p;
 
 	mutex_enter(&ifv_mtx);
+	p = ifv->ifv_p;
 
-	if (ifv->ifv_p == NULL) {
+	if (p == NULL) {
 		mutex_exit(&ifv_mtx);
 		return;
 	}
@@ -378,20 +380,18 @@ vlan_unconfig(struct ifnet *ifp)
 	(*ifv->ifv_msw->vmsw_purgemulti)(ifv);
 
 	/* Disconnect from parent. */
-	switch (ifv->ifv_p->if_type) {
+	switch (p->if_type) {
 	case IFT_ETHER:
 	{
-		struct ethercom *ec = (void *) ifv->ifv_p;
+		struct ethercom *ec = (void *) p;
 
 		if (ec->ec_nvlans-- == 1) {
 			/*
 			 * Disable Tx/Rx of VLAN-sized frames.
 			 */
 			ec->ec_capenable &= ~ETHERCAP_VLAN_MTU;
-			if (ifv->ifv_p->if_flags & IFF_UP) {
-(void)if_flags_set(ifv->ifv_p,
-ifv->ifv_p->if_flags);
-			}
+			if (p->if_flags & IFF_UP)
+(void)if_flags_set(p, p->if_flags);
 		}
 
 		ether_ifdetach(ifp);



CVS commit: src/sys/net

2014-10-11 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Sat Oct 11 10:16:49 UTC 2014

Modified Files:
src/sys/net: if_vlan.c

Log Message:
Protect vlan_unconfig with a mutex

It is not thread-safe but is likely to be executed in concurrent.
See PR 49264 for more detail.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/net/if_vlan.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/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.75 src/sys/net/if_vlan.c:1.76
--- src/sys/net/if_vlan.c:1.75	Thu Oct  9 04:48:12 2014
+++ src/sys/net/if_vlan.c	Sat Oct 11 10:16:49 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.75 2014/10/09 04:48:12 ozaki-r Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.76 2014/10/11 10:16:49 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.75 2014/10/09 04:48:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.76 2014/10/11 10:16:49 ozaki-r Exp $");
 
 #include "opt_inet.h"
 
@@ -91,6 +91,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -180,6 +181,8 @@ void		vlanattach(int);
 /* XXX This should be a hash table with the tag as the basis of the key. */
 static LIST_HEAD(, ifvlan) ifv_list;
 
+static kmutex_t ifv_mtx __cacheline_aligned;
+
 struct if_clone vlan_cloner =
 IF_CLONE_INITIALIZER("vlan", vlan_clone_create, vlan_clone_destroy);
 
@@ -191,6 +194,7 @@ vlanattach(int n)
 {
 
 	LIST_INIT(&ifv_list);
+	mutex_init(&ifv_mtx, MUTEX_DEFAULT, IPL_NONE);
 	if_clone_attach(&vlan_cloner);
 }
 
@@ -359,8 +363,12 @@ vlan_unconfig(struct ifnet *ifp)
 {
 	struct ifvlan *ifv = ifp->if_softc;
 
-	if (ifv->ifv_p == NULL)
+	mutex_enter(&ifv_mtx);
+
+	if (ifv->ifv_p == NULL) {
+		mutex_exit(&ifv_mtx);
 		return;
+	}
 
 	/*
  	 * Since the interface is being unconfigured, we need to empty the
@@ -412,6 +420,8 @@ vlan_unconfig(struct ifnet *ifp)
 	if_down(ifp);
 	ifp->if_flags &= ~(IFF_UP|IFF_RUNNING);
 	ifp->if_capabilities = 0;
+
+	mutex_exit(&ifv_mtx);
 }
 
 /*



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

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 10:06:15 UTC 2014

Modified Files:
src/sys/arch/hppa/conf: GENERIC

Log Message:
Missing midi attachment.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/conf/GENERIC

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/hppa/conf/GENERIC
diff -u src/sys/arch/hppa/conf/GENERIC:1.3 src/sys/arch/hppa/conf/GENERIC:1.4
--- src/sys/arch/hppa/conf/GENERIC:1.3	Sat Aug 23 20:26:58 2014
+++ src/sys/arch/hppa/conf/GENERIC	Sat Oct 11 10:06:15 2014
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.3 2014/08/23 20:26:58 dholland Exp $
+# $NetBSD: GENERIC,v 1.4 2014/10/11 10:06:15 uebayasi Exp $
 #
 # GENERIC machine description file
 #
@@ -23,7 +23,7 @@ include 	"arch/hppa/conf/std.hppa"
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 
-#ident 		"GENERIC-$Revision: 1.3 $"
+#ident 		"GENERIC-$Revision: 1.4 $"
 
 maxusers	32		# estimated number of users
 
@@ -608,6 +608,7 @@ uaudio* at uhub? port ? configuration ?
 
 # USB MIDI
 umidi* at uhub? port ? configuration ?
+midi* at midibus?
 
 # USB IrDA
 # USB-IrDA bridge spec



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

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 09:50:03 UTC 2014

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0 std.xen

Log Message:
Don't include std.ath_hal for XEN3_DOMU.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amd64/conf/std.xen

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/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.108 src/sys/arch/amd64/conf/XEN3_DOM0:1.109
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.108	Fri Sep 19 17:30:03 2014
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Sat Oct 11 09:50:03 2014
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.108 2014/09/19 17:30:03 christos Exp $
+# $NetBSD: XEN3_DOM0,v 1.109 2014/10/11 09:50:03 uebayasi Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -847,3 +847,6 @@ pseudo-device	xbdback
 
 options 	PAX_MPROTECT=0		# PaX mprotect(2) restrictions
 options 	PAX_ASLR=0		# PaX Address Space Layout Randomization
+
+# Atheros HAL options
+include "external/isc/atheros_hal/conf/std.ath_hal"

Index: src/sys/arch/amd64/conf/std.xen
diff -u src/sys/arch/amd64/conf/std.xen:1.6 src/sys/arch/amd64/conf/std.xen:1.7
--- src/sys/arch/amd64/conf/std.xen:1.6	Wed Jul 29 12:02:05 2009
+++ src/sys/arch/amd64/conf/std.xen	Sat Oct 11 09:50:03 2014
@@ -1,4 +1,4 @@
-# $NetBSD: std.xen,v 1.6 2009/07/29 12:02:05 cegger Exp $
+# $NetBSD: std.xen,v 1.7 2014/10/11 09:50:03 uebayasi Exp $
 # NetBSD: std.i386,v 1.24 2003/02/26 21:33:36 fvdl Exp 
 #
 # standard, required NetBSD/i386 'options'
@@ -13,6 +13,3 @@ options 	CPU_IN_CKSUM
 options 	EXEC_ELF64	# exec ELF binaries
 options 	EXEC_SCRIPT	# exec #! scripts
 options 	MTRR
-
-# Atheros HAL options
-include "external/isc/atheros_hal/conf/std.ath_hal"



CVS commit: src/usr.bin/config

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 09:27:51 UTC 2014

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

Log Message:
Don't conplain devclass redifition to the same value; it can happen while
resolving dependency.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/config/sem.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/sem.c
diff -u src/usr.bin/config/sem.c:1.58 src/usr.bin/config/sem.c:1.59
--- src/usr.bin/config/sem.c:1.58	Sat Oct 11 09:06:29 2014
+++ src/usr.bin/config/sem.c	Sat Oct 11 09:27:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.58 2014/10/11 09:06:29 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.59 2014/10/11 09:27:51 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -174,15 +174,17 @@ fixdev(struct devbase *dev)
 			CFGDBG(3, "device `%s' has iattr `%s'", dev->d_name,
 			a->a_name);
 		} else if (a->a_devclass != NULL) {
-			if (dev->d_classattr != NULL) {
+			if (dev->d_classattr != NULL && dev->d_classattr != a) {
 cfgwarn("device `%s' has multiple classes "
 "(`%s' and `%s')",
 dev->d_name, dev->d_classattr->a_name,
 a->a_name);
 			}
-			dev->d_classattr = a;
-			CFGDBG(3, "device `%s' is devclass `%s'", dev->d_name,
-			a->a_name);
+			if (dev->d_classattr == NULL) {
+dev->d_classattr = a;
+CFGDBG(3, "device `%s' is devclass `%s'", dev->d_name,
+a->a_name);
+			}
 		} else {
 			if (strcmp(dev->d_name, a->a_name) != 0) {
 mergedeps(dev, a->a_name);



CVS commit: src/usr.bin/netstat

2014-10-11 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Oct 11 09:23:32 UTC 2014

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

Log Message:
Give flag argument in description. Add two articles.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/netstat/netstat.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/netstat/netstat.1
diff -u src/usr.bin/netstat/netstat.1:1.69 src/usr.bin/netstat/netstat.1:1.70
--- src/usr.bin/netstat/netstat.1:1.69	Sat Oct 11 06:25:32 2014
+++ src/usr.bin/netstat/netstat.1	Sat Oct 11 09:23:32 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: netstat.1,v 1.69 2014/10/11 06:25:32 enami Exp $
+.\"	$NetBSD: netstat.1,v 1.70 2014/10/11 09:23:32 wiz Exp $
 .\"
 .\" Copyright (c) 1983, 1990, 1992, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -222,16 +222,16 @@ option, display wider fields for the IPv
 and
 .Qq Group
 columns.
-.It Fl M
+.It Fl M Ar core
 Use
 .Xr kvm 3
 instead of
 .Xr sysctl 3
 to retrieve information and
 extract values associated with the name list from the specified core.
-If
+If the
 .Fl M
-option is not given but
+option is not given but the
 .Fl N
 option is given, the default
 .Pa /dev/mem
@@ -239,7 +239,7 @@ is used.
 .It Fl m
 Show statistics recorded by the mbuf memory management routines
 (the network manages a private pool of memory buffers).
-.It Fl N
+.It Fl N Ar system
 Use
 .Xr kvm 3
 instead of



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

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 09:16:15 UTC 2014

Modified Files:
src/sys/arch/alpha/conf: INSTALL

Log Message:
Missing agp attachment.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/alpha/conf/INSTALL

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

Modified files:

Index: src/sys/arch/alpha/conf/INSTALL
diff -u src/sys/arch/alpha/conf/INSTALL:1.107 src/sys/arch/alpha/conf/INSTALL:1.108
--- src/sys/arch/alpha/conf/INSTALL:1.107	Sat Aug 23 20:26:56 2014
+++ src/sys/arch/alpha/conf/INSTALL	Sat Oct 11 09:16:15 2014
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.107 2014/08/23 20:26:56 dholland Exp $
+# $NetBSD: INSTALL,v 1.108 2014/10/11 09:16:15 uebayasi Exp $
 #
 # Alpha INSTALL kernel.
 
@@ -185,6 +185,9 @@ pci*	at	mcpcia?
 pci*	at	tsp?
 pci*	at	ttwopci?
 
+# AGP support
+agp*	at	irongate?
+
 # PCI devices
 adv*	at	pci? dev ? function ?		# AdvanSys SCSI
 adw*	at	pci? dev ? function ?		# AdvanSys Wide SCSI



CVS commit: src/external/gpl3/gcc/lib/libstdc++-v3/arch

2014-10-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 11 09:15:04 UTC 2014

Modified Files:
src/external/gpl3/gcc/lib/libstdc++-v3/arch/or1k: c++config.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64: c++config.h
defs.mk gstdint.h

Log Message:
more regen after complex and other fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/or1k/c++config.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64/c++config.h \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64/gstdint.h
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64/defs.mk

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/lib/libstdc++-v3/arch/or1k/c++config.h
diff -u src/external/gpl3/gcc/lib/libstdc++-v3/arch/or1k/c++config.h:1.2 src/external/gpl3/gcc/lib/libstdc++-v3/arch/or1k/c++config.h:1.3
--- src/external/gpl3/gcc/lib/libstdc++-v3/arch/or1k/c++config.h:1.2	Fri Sep 19 00:24:28 2014
+++ src/external/gpl3/gcc/lib/libstdc++-v3/arch/or1k/c++config.h	Sat Oct 11 09:15:04 2014
@@ -804,7 +804,7 @@ namespace std
 #define _GLIBCXX_HAVE_SINL 1
 
 /* Defined if sleep exists. */
-#define _GLIBCXX_HAVE_SLEEP 1
+/* #undef _GLIBCXX_HAVE_SLEEP */
 
 /* Define to 1 if you have the `sqrtf' function. */
 #define _GLIBCXX_HAVE_SQRTF 1
@@ -919,7 +919,7 @@ namespace std
 #define _GLIBCXX_HAVE_UNISTD_H 1
 
 /* Defined if usleep exists. */
-#define _GLIBCXX_HAVE_USLEEP 1
+/* #undef _GLIBCXX_HAVE_USLEEP */
 
 /* Defined if vfwscanf exists. */
 #define _GLIBCXX_HAVE_VFWSCANF 1
@@ -1239,12 +1239,12 @@ namespace std
 
 /* Define if C99 functions or macros from , , ,
, and  can be used or exposed. */
-/* #undef _GLIBCXX_USE_C99 */
+#define _GLIBCXX_USE_C99 1
 
 /* Define if C99 functions in  should be used in . Using
compiler builtins for these functions requires corresponding C99 library
functions to be present. */
-/* #undef _GLIBCXX_USE_C99_COMPLEX */
+#define _GLIBCXX_USE_C99_COMPLEX 1
 
 /* Define if C99 functions in  should be used in .
Using compiler builtins for these functions requires corresponding C99
@@ -1280,13 +1280,13 @@ namespace std
 #define _GLIBCXX_USE_C99_STDINT_TR1 1
 
 /* Defined if clock_gettime has monotonic clock support. */
-/* #undef _GLIBCXX_USE_CLOCK_MONOTONIC */
+#define _GLIBCXX_USE_CLOCK_MONOTONIC 1
 
 /* Defined if clock_gettime syscall has monotonic and realtime clock support. */
 /* #undef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL */
 
 /* Defined if clock_gettime has realtime clock support. */
-/* #undef _GLIBCXX_USE_CLOCK_REALTIME */
+#define _GLIBCXX_USE_CLOCK_REALTIME 1
 
 /* Define if ISO/IEC TR 24733 decimal floating point types are supported on
this host. */
@@ -1311,7 +1311,7 @@ namespace std
 #define _GLIBCXX_USE_LONG_LONG 1
 
 /* Defined if nanosleep is available. */
-/* #undef _GLIBCXX_USE_NANOSLEEP */
+#define _GLIBCXX_USE_NANOSLEEP 1
 
 /* Define if NLS translations are to be used. */
 /* #undef _GLIBCXX_USE_NLS */
@@ -1324,7 +1324,7 @@ namespace std
 #define _GLIBCXX_USE_RANDOM_TR1 1
 
 /* Defined if sched_yield is available. */
-/* #undef _GLIBCXX_USE_SCHED_YIELD */
+#define _GLIBCXX_USE_SCHED_YIELD 1
 
 /* Define if _SC_NPROCESSORS_ONLN is available in . */
 #define _GLIBCXX_USE_SC_NPROCESSORS_ONLN 1

Index: src/external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64/c++config.h
diff -u src/external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64/c++config.h:1.3 src/external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64/c++config.h:1.4
--- src/external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64/c++config.h:1.3	Mon Jun 23 02:29:20 2014
+++ src/external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64/c++config.h	Sat Oct 11 09:15:04 2014
@@ -603,7 +603,7 @@ namespace std
 /* #undef _GLIBCXX_HAVE_FABSL */
 
 /* Define to 1 if you have the  header file. */
-#define _GLIBCXX_HAVE_FENV_H 1
+/* #undef _GLIBCXX_HAVE_FENV_H */
 
 /* Define to 1 if you have the `finite' function. */
 #define _GLIBCXX_HAVE_FINITE 1
@@ -804,7 +804,7 @@ namespace std
 #define _GLIBCXX_HAVE_SINL 1
 
 /* Defined if sleep exists. */
-#define _GLIBCXX_HAVE_SLEEP 1
+/* #undef _GLIBCXX_HAVE_SLEEP */
 
 /* Define to 1 if you have the `sqrtf' function. */
 #define _GLIBCXX_HAVE_SQRTF 1
@@ -919,7 +919,7 @@ namespace std
 #define _GLIBCXX_HAVE_UNISTD_H 1
 
 /* Defined if usleep exists. */
-#define _GLIBCXX_HAVE_USLEEP 1
+/* #undef _GLIBCXX_HAVE_USLEEP */
 
 /* Defined if vfwscanf exists. */
 #define _GLIBCXX_HAVE_VFWSCANF 1
@@ -1184,7 +1184,7 @@ namespace std
 /* #undef _GLIBCXX_VERSION */
 
 /* Define if the compiler supports C++11 atomics. */
-/* #undef _GLIBCXX_ATOMIC_BUILTINS */
+#define _GLIBCXX_ATOMIC_BUILTINS 1
 
 /* Define to use concept checking code from the boost libraries. */
 /* #undef _GLIBCXX_CONCEPT_CHECKS */
@@ -1239,12 +1239,12 @@ namespace std
 
 /* Define if C99 funct

CVS commit: src/usr.bin/config

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 09:09:19 UTC 2014

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

Log Message:
After yyparse() is done, print not file but stage for debug.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 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.65 src/usr.bin/config/main.c:1.66
--- src/usr.bin/config/main.c:1.65	Sat Oct 11 03:17:40 2014
+++ src/usr.bin/config/main.c	Sat Oct 11 09:09:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.65 2014/10/11 03:17:40 uebayasi Exp $	*/
+/*	$NetBSD: main.c,v 1.66 2014/10/11 09:09:19 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -149,6 +149,7 @@ static	int	extract_config(const char *, 
 int badfilename(const char *fname);
 
 const char *progname;
+extern const char *yyfile;
 
 int
 main(int argc, char **argv)
@@ -407,16 +408,19 @@ main(int argc, char **argv)
 	/*
 	 * Handle command line overrides
 	 */
+	yyfile = "handle_cmdline_makeoptions";
 	handle_cmdline_makeoptions();
 
 	/*
 	 * Detect and properly ignore orphaned devices
 	 */
+	yyfile = "kill_orphans";
 	kill_orphans();
 
 	/*
 	 * Select devices and pseudo devices and their attributes
 	 */
+	yyfile = "fixdevis";
 	if (fixdevis())
 		stop();
 
@@ -424,9 +428,13 @@ main(int argc, char **argv)
 	 * If working on an ioconf-only config, process here and exit
 	 */
 	if (ioconfname) {
+		yyfile = "pack";
 		pack();
+		yyfile = "mkioconf";
 		mkioconf();
+		yyfile = "emitlocs";
 		emitlocs();
+		yyfile = "emitioconfh";
 		emitioconfh();
 		return 0;
 	}
@@ -434,23 +442,27 @@ main(int argc, char **argv)
 	/*
 	 * Deal with option dependencies.
 	 */
+	yyfile = "dependopts";
 	dependopts();
 
 	/*
 	 * Fix (as in `set firmly in place') files.
 	 */
+	yyfile = "fixfiles";
 	if (fixfiles())
 		stop();
 
 	/*
 	 * Fix objects and libraries.
 	 */
+	yyfile = "fixobjects";
 	if (fixobjects())
 		stop();
 
 	/*
 	 * Fix device-majors.
 	 */
+	yyfile = "fixdevsw";
 	if (fixdevsw())
 		stop();
 
@@ -474,10 +486,13 @@ main(int argc, char **argv)
 	 * Squeeze things down and finish cross-checks (STAR checks must
 	 * run after packing).
 	 */
+	yyfile = "pack";
 	pack();
+	yyfile = "badstar";
 	if (badstar())
 		stop();
 
+	yyfile = NULL;
 	/*
 	 * Ready to go.  Build all the various files.
 	 */



CVS commit: src/usr.bin/config

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 09:06:29 UTC 2014

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

Log Message:
Redo "device" dependency.  It was completely wrong to select things just
after definitions at enddefs().  Resolve dependency in selectbase().


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/config/sem.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/sem.c
diff -u src/usr.bin/config/sem.c:1.57 src/usr.bin/config/sem.c:1.58
--- src/usr.bin/config/sem.c:1.57	Sat Oct 11 06:18:29 2014
+++ src/usr.bin/config/sem.c	Sat Oct 11 09:06:29 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.57 2014/10/11 06:18:29 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.58 2014/10/11 09:06:29 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -146,9 +146,8 @@ mergedeps(struct devbase *dev, const cha
 {
 	struct attr *a, *newa;
 
+	CFGDBG(4, "merging attr `%s' to devbase `%s'", name, dev->d_name);
 	a = refattr(dev->d_name);
-
-	CFGDBG(3, "merging attr `%s' in attr `%s'", name, a->a_name);
 	if (finddep(a, name) == NULL) {
 		newa = refattr(name);
 		a->a_deps = attrlist_cons(a->a_deps, newa);
@@ -167,19 +166,13 @@ fixdev(struct devbase *dev)
 	if (devattr->a_devclass)
 		panic("%s: dev %s is devclass!", __func__, devattr->a_name);
 
-	/*
-	 * For each interface attribute this device refers to, add this
-	 * device to its reference list.  This makes, e.g., finding all
-	 * "scsi"s easier.
-	 *
-	 * While looking through the attributes, set up the device
-	 * class if any are devclass attributes (and error out if the
-	 * device has two classes).
-	 */
+	CFGDBG(4, "fixing devbase `%s'", dev->d_name);
 	for (al = dev->d_attrs; al != NULL; al = al->al_next) {
 		a = al->al_this;
 		if (a->a_iattr) {
 			a->a_refs = addtoattr(a->a_refs, dev);
+			CFGDBG(3, "device `%s' has iattr `%s'", dev->d_name,
+			a->a_name);
 		} else if (a->a_devclass != NULL) {
 			if (dev->d_classattr != NULL) {
 cfgwarn("device `%s' has multiple classes "
@@ -188,6 +181,8 @@ fixdev(struct devbase *dev)
 a->a_name);
 			}
 			dev->d_classattr = a;
+			CFGDBG(3, "device `%s' is devclass `%s'", dev->d_name,
+			a->a_name);
 		} else {
 			if (strcmp(dev->d_name, a->a_name) != 0) {
 mergedeps(dev, a->a_name);
@@ -201,6 +196,8 @@ enddefs(void)
 {
 	struct devbase *dev;
 
+	yyfile = "enddefs";
+
 	TAILQ_FOREACH(dev, &allbases, d_next) {
 		if (!dev->d_isdef) {
 			(void)fprintf(stderr,
@@ -209,7 +206,6 @@ enddefs(void)
 			errors++;
 			continue;
 		}
-		fixdev(dev);
 	}
 	if (errors) {
 		(void)fprintf(stderr, "*** Stop.\n");
@@ -1965,6 +1961,8 @@ selectbase(struct devbase *d, struct dev
 			expandattr(a, selectattr);
 		}
 	}
+
+	fixdev(d);
 }
 
 /*



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

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 08:22:34 UTC 2014

Modified Files:
src/sys/arch/hpcmips/conf: GENERIC

Log Message:
Missing midi attachment.


To generate a diff of this commit:
cvs rdiff -u -r1.226 -r1.227 src/sys/arch/hpcmips/conf/GENERIC

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/hpcmips/conf/GENERIC
diff -u src/sys/arch/hpcmips/conf/GENERIC:1.226 src/sys/arch/hpcmips/conf/GENERIC:1.227
--- src/sys/arch/hpcmips/conf/GENERIC:1.226	Sat Aug 23 20:26:58 2014
+++ src/sys/arch/hpcmips/conf/GENERIC	Sat Oct 11 08:22:34 2014
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.226 2014/08/23 20:26:58 dholland Exp $
+# $NetBSD: GENERIC,v 1.227 2014/10/11 08:22:34 uebayasi Exp $
 #
 # GENERIC machine description file
 # 
@@ -24,7 +24,7 @@ include		"arch/hpcmips/conf/std.hpcmips.
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.226 $"
+#ident 		"GENERIC-$Revision: 1.227 $"
 
 maxusers	16
 
@@ -652,6 +652,7 @@ uyap* at uhub? port ?
 ugen*	at uhub? port ?
 
 audio*	at uaudio?
+midi*	at midibus?
 
 # Pseudo-Devices
 



CVS commit: src/lib/libm/noieee_src

2014-10-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 11 07:19:27 UTC 2014

Modified Files:
src/lib/libm/noieee_src: n_pow.c

Log Message:
Need powl as alias as well


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libm/noieee_src/n_pow.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/libm/noieee_src/n_pow.c
diff -u src/lib/libm/noieee_src/n_pow.c:1.10 src/lib/libm/noieee_src/n_pow.c:1.11
--- src/lib/libm/noieee_src/n_pow.c:1.10	Fri Oct 10 20:58:09 2014
+++ src/lib/libm/noieee_src/n_pow.c	Sat Oct 11 07:19:27 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: n_pow.c,v 1.10 2014/10/10 20:58:09 martin Exp $ */
+/*  $NetBSD: n_pow.c,v 1.11 2014/10/11 07:19:27 martin Exp $ */
 /*
  * Copyright (c) 1985, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -126,6 +126,7 @@ static double pow_P (double, double);
 __weak_alias(_powf, powf);
 __weak_alias(_pow, pow);
 __weak_alias(_powl, pow);
+__weak_alias(powl, pow);
 #endif
 
 float



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

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 07:18:43 UTC 2014

Modified Files:
src/sys/arch/emips/conf: INSTALL

Log Message:
Don't define WSDISPLAY_* without wsdisplay.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/conf/INSTALL

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

Modified files:

Index: src/sys/arch/emips/conf/INSTALL
diff -u src/sys/arch/emips/conf/INSTALL:1.4 src/sys/arch/emips/conf/INSTALL:1.5
--- src/sys/arch/emips/conf/INSTALL:1.4	Sat Apr 27 18:19:31 2013
+++ src/sys/arch/emips/conf/INSTALL	Sat Oct 11 07:18:43 2014
@@ -1,4 +1,4 @@
-# 	$NetBSD: INSTALL,v 1.4 2013/04/27 18:19:31 christos Exp $
+# 	$NetBSD: INSTALL,v 1.5 2014/10/11 07:18:43 uebayasi Exp $
 #
 # Distribution	install kernel (any model)
 #netbsd:	cut-down kernel for miniroots.
@@ -47,7 +47,7 @@ options 	FONT_BOLD8x16		# Font for fb de
 options 	FONT_GALLANT12x22
 
 options		WSEMUL_VT100
-options 	WSDISPLAY_DEFAULTSCREENS=1
+#options 	WSDISPLAY_DEFAULTSCREENS=1
 #options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
 options		WS_KERNEL_FG=WSCOL_GREEN
 options		WS_KERNEL_BG=WSCOL_BLACK



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

2014-10-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 11 07:03:10 UTC 2014

Modified Files:
src/sys/arch/macppc/conf: files.macppc

Log Message:
Probably agp_apple is never used.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/macppc/conf/files.macppc

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/macppc/conf/files.macppc
diff -u src/sys/arch/macppc/conf/files.macppc:1.100 src/sys/arch/macppc/conf/files.macppc:1.101
--- src/sys/arch/macppc/conf/files.macppc:1.100	Thu Apr 18 16:42:46 2013
+++ src/sys/arch/macppc/conf/files.macppc	Sat Oct 11 07:03:09 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.macppc,v 1.100 2013/04/18 16:42:46 macallan Exp $
+#	$NetBSD: files.macppc,v 1.101 2014/10/11 07:03:09 uebayasi Exp $
 #
 # macppc-specific configuration info
 
@@ -133,7 +133,7 @@ attach ofb at pci
 file arch/macppc/dev/ofb.c			ofb needs-flag
 
 # PCI-Host bridge chipsets
-device pchb: agpbus, agp_apple
+device pchb: agpbus
 attach pchb at pci
 file arch/powerpc/pci/pchb.c			pchb
 



CVS commit: src/lib/libm/arch/vax

2014-10-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 11 06:59:29 UTC 2014

Modified Files:
src/lib/libm/arch/vax: n_sqrt.S

Log Message:
Seems we need both sqrtl and _sqrtl as a weak alias - something must be
wrong namespapce wise here, but this should make it build for now.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libm/arch/vax/n_sqrt.S

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

Modified files:

Index: src/lib/libm/arch/vax/n_sqrt.S
diff -u src/lib/libm/arch/vax/n_sqrt.S:1.10 src/lib/libm/arch/vax/n_sqrt.S:1.11
--- src/lib/libm/arch/vax/n_sqrt.S:1.10	Sat Oct 11 06:34:31 2014
+++ src/lib/libm/arch/vax/n_sqrt.S	Sat Oct 11 06:59:29 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: n_sqrt.S,v 1.10 2014/10/11 06:34:31 martin Exp $	*/
+/*	$NetBSD: n_sqrt.S,v 1.11 2014/10/11 06:59:29 martin Exp $	*/
 /*
  * Copyright (c) 1985, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -34,6 +34,7 @@
 
 #ifdef WEAK_ALIAS
 WEAK_ALIAS(_sqrtl, sqrt)
+WEAK_ALIAS(sqrtl, sqrt)
 #endif
 
 /*