CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Oct 10 06:13:30 UTC 2014

Modified Files:
src/usr.bin/config: gram.y sem.c sem.h

Log Message:
Split plain/interface/devclass attribute initializers.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/config/gram.y
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/config/sem.c
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/config/sem.h

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/gram.y
diff -u src/usr.bin/config/gram.y:1.41 src/usr.bin/config/gram.y:1.42
--- src/usr.bin/config/gram.y:1.41	Thu Oct  9 09:39:24 2014
+++ src/usr.bin/config/gram.y	Fri Oct 10 06:13:30 2014
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: gram.y,v 1.41 2014/10/09 09:39:24 uebayasi Exp $	*/
+/*	$NetBSD: gram.y,v 1.42 2014/10/10 06:13:30 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -356,7 +356,7 @@ define_prefix:
 ;
 
 define_devclass:
-	DEVCLASS WORD			{ (void)defattr($2, NULL, NULL, 1); }
+	DEVCLASS WORD			{ (void)defdevclass($2, NULL, NULL, 1); }
 ;
 
 define_filesystems:
@@ -365,7 +365,7 @@ define_filesystems:
 
 define_attribute:
 	DEFINE WORD interface_opt depend_list
-	{ (void)defattr($2, $3, $4, 0); }
+	{ (void)defattr0($2, $3, $4, 0); }
 ;
 
 define_option:

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.48 src/usr.bin/config/sem.c:1.49
--- src/usr.bin/config/sem.c:1.48	Fri Oct 10 05:27:28 2014
+++ src/usr.bin/config/sem.c	Fri Oct 10 06:13:30 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.48 2014/10/10 05:27:28 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.49 2014/10/10 06:13:30 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -204,19 +204,24 @@ setident(const char *i)
  * all locator lists include a dummy head node, which we discard here.
  */
 int
+defattr0(const char *name, struct loclist *locs, struct attrlist *deps,
+int devclass)
+{
+
+	if (locs != NULL)
+		return defiattr(name, locs, deps, devclass);
+	else if (devclass)
+		return defdevclass(name, locs, deps, devclass);
+	else
+		return defattr(name, locs, deps, devclass);
+}
+
+int
 defattr(const char *name, struct loclist *locs, struct attrlist *deps,
 int devclass)
 {
 	struct attr *a, *dep;
 	struct attrlist *al;
-	struct loclist *ll;
-	int len;
-
-	if (locs != NULL && devclass)
-		panic("defattr(%s): locators and devclass", name);
-
-	if (deps != NULL && devclass)
-		panic("defattr(%s): dependencies and devclass", name);
 
 	/*
 	 * If this attribute depends on any others, make sure none of
@@ -243,41 +248,69 @@ defattr(const char *name, struct loclist
 	a->a_deps = deps;
 	a->a_expanding = 0;
 	TAILQ_INIT(&a->a_files);
+	expandattr(a, NULL);
 
-	/* "interface attribute" initialization */
-	if (locs != NULL) {
-		a->a_iattr = 1;
-		/* unwrap */
-		a->a_locs = locs->ll_next;
-		locs->ll_next = NULL;
-		loclist_destroy(locs);
-		len = 0;
-		for (ll = a->a_locs; ll != NULL; ll = ll->ll_next)
-			len++;
-		a->a_loclen = len;
-	}
-
-	/* "device class" initialization */
-	if (devclass) {
-		char classenum[256], *cp;
-		int errored = 0;
-
-		(void)snprintf(classenum, sizeof(classenum), "DV_%s", name);
-		for (cp = classenum + 3; *cp; cp++) {
-			if (!errored &&
-			(!isalnum((unsigned char)*cp) ||
-			  (isalpha((unsigned char)*cp) && !islower((unsigned char)*cp {
-cfgerror("device class names must be "
-"lower-case alphanumeric characters");
-errored = 1;
-			}
-			*cp = toupper((unsigned char)*cp);
+	return (0);
+}
+
+/* "interface attribute" initialization */
+int
+defiattr(const char *name, struct loclist *locs, struct attrlist *deps,
+int devclass)
+{
+	struct attr *a;
+	int len;
+	struct loclist *ll;
+
+	if (devclass)
+		panic("defattr(%s): locators and devclass", name);
+
+	if (defattr(name, locs, deps, devclass) != 0)
+		return (1);
+
+	a = getattr(name);
+	a->a_iattr = 1;
+	/* unwrap */
+	a->a_locs = locs->ll_next;
+	locs->ll_next = NULL;
+	loclist_destroy(locs);
+	len = 0;
+	for (ll = a->a_locs; ll != NULL; ll = ll->ll_next)
+		len++;
+	a->a_loclen = len;
+	if (deps)
+		CFGDBG(2, "attr `%s' iface with deps", a->a_name);
+	return (0);
+}
+
+/* "device class" initialization */
+int
+defdevclass(const char *name, struct loclist *locs, struct attrlist *deps,
+int devclass)
+{
+	struct attr *a;
+	char classenum[256], *cp;
+	int errored = 0;
+
+	if (deps)
+		panic("defattr(%s): dependencies and devclass", name);
+
+	if (defattr(name, locs, deps, devclass) != 0)
+		return (1);
+
+	a = getattr(name);
+	(void)snprintf(classenum, sizeof(classenum), "DV_%s", name);
+	for (cp = classenum + 3; *cp; cp++) {
+		if (!errored &&
+		(!isalnum((unsigned char)*cp) ||
+		  (isalpha((unsigned char)*cp) && !islower((unsigned char)*cp {
+			cfgerror("device class names must be "
+			"lower-case alphanumeric characters");
+			errored = 1;
 		}
-		a->a_devclass = intern(classenum);
+		*cp = toupper((unsigned char)*

CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Oct 10 05:27:29 UTC 2014

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

Log Message:
Refactor attr definition and initialization a little.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/config/defs.h
cvs rdiff -u -r1.47 -r1.48 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/defs.h
diff -u src/usr.bin/config/defs.h:1.53 src/usr.bin/config/defs.h:1.54
--- src/usr.bin/config/defs.h:1.53	Thu Oct  9 19:27:04 2014
+++ src/usr.bin/config/defs.h	Fri Oct 10 05:27:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.53 2014/10/09 19:27:04 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.54 2014/10/10 05:27:28 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -166,15 +166,19 @@ struct defoptlist {
  */
 struct attr {
 	const char *a_name;		/* name of this attribute */
+	struct	attrlist *a_deps;	/* we depend on these other attrs */
+	int	a_expanding;		/* to detect cycles in attr graph */
+	TAILQ_HEAD(, files) a_files;	/* files in this attr */
+
+	/* "interface attribute" */
 	int	a_iattr;		/* true => allows children */
-	const char *a_devclass;		/* device class described */
 	struct	loclist *a_locs;	/* locators required */
 	int	a_loclen;		/* length of above list */
 	struct	nvlist *a_devs;		/* children */
 	struct	nvlist *a_refs;		/* parents */
-	struct	attrlist *a_deps;	/* we depend on these other attrs */
-	int	a_expanding;		/* to detect cycles in attr graph */
-	TAILQ_HEAD(, files) a_files;	/* files in this attr */
+
+	/* "device class" */
+	const char *a_devclass;		/* device class described */
 };
 
 /*

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.47 src/usr.bin/config/sem.c:1.48
--- src/usr.bin/config/sem.c:1.47	Thu Oct  9 16:08:36 2014
+++ src/usr.bin/config/sem.c	Fri Oct 10 05:27:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.47 2014/10/09 16:08:36 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.48 2014/10/10 05:27:28 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -240,16 +240,24 @@ defattr(const char *name, struct loclist
 	}
 
 	a->a_name = name;
+	a->a_deps = deps;
+	a->a_expanding = 0;
+	TAILQ_INIT(&a->a_files);
+
+	/* "interface attribute" initialization */
 	if (locs != NULL) {
 		a->a_iattr = 1;
 		/* unwrap */
 		a->a_locs = locs->ll_next;
 		locs->ll_next = NULL;
 		loclist_destroy(locs);
-	} else {
-		a->a_iattr = 0;
-		a->a_locs = NULL;
+		len = 0;
+		for (ll = a->a_locs; ll != NULL; ll = ll->ll_next)
+			len++;
+		a->a_loclen = len;
 	}
+
+	/* "device class" initialization */
 	if (devclass) {
 		char classenum[256], *cp;
 		int errored = 0;
@@ -266,17 +274,7 @@ defattr(const char *name, struct loclist
 			*cp = toupper((unsigned char)*cp);
 		}
 		a->a_devclass = intern(classenum);
-	} else
-		a->a_devclass = NULL;
-	len = 0;
-	for (ll = a->a_locs; ll != NULL; ll = ll->ll_next)
-		len++;
-	a->a_loclen = len;
-	a->a_devs = NULL;
-	a->a_refs = NULL;
-	a->a_deps = deps;
-	a->a_expanding = 0;
-	TAILQ_INIT(&a->a_files);
+	}
 
 	/* Expand the attribute to check for cycles in the graph. */
 	expandattr(a, NULL);



CVS commit: src/libexec/httpd

2014-10-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Oct 10 05:10:59 UTC 2014

Modified Files:
src/libexec/httpd: bozohttpd.c dir-index-bozo.c

Log Message:
don't truncate file sizes to 32 bits for directory indexes.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.19 -r1.20 src/libexec/httpd/dir-index-bozo.c

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

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.56 src/libexec/httpd/bozohttpd.c:1.57
--- src/libexec/httpd/bozohttpd.c:1.56	Thu Jul 17 10:21:51 2014
+++ src/libexec/httpd/bozohttpd.c	Fri Oct 10 05:10:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.56 2014/07/17 10:21:51 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.57 2014/10/10 05:10:59 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -109,7 +109,7 @@
 #define INDEX_HTML		"index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE		"bozohttpd/20140717"
+#define SERVER_SOFTWARE		"bozohttpd/20141009"
 #endif
 #ifndef DIRECT_ACCESS_FILE
 #define DIRECT_ACCESS_FILE	".bzdirect"

Index: src/libexec/httpd/dir-index-bozo.c
diff -u src/libexec/httpd/dir-index-bozo.c:1.19 src/libexec/httpd/dir-index-bozo.c:1.20
--- src/libexec/httpd/dir-index-bozo.c:1.19	Thu Jan  2 08:21:38 2014
+++ src/libexec/httpd/dir-index-bozo.c	Fri Oct 10 05:10:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir-index-bozo.c,v 1.19 2014/01/02 08:21:38 mrg Exp $	*/
+/*	$NetBSD: dir-index-bozo.c,v 1.20 2014/10/10 05:10:59 mrg Exp $	*/
 
 /*	$eterna: dir-index-bozo.c,v 1.20 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -189,8 +189,8 @@ bozo_dir_index(bozo_httpreq_t *request, 
 			spacebuf[i] = '\0';
 			bozo_printf(httpd, "%s", spacebuf);
 
-			bozo_printf(httpd, "%7ukB",
-			((unsigned)((unsigned)(sb.st_size) >> 10)));
+			bozo_printf(httpd, "%12llukB",
+(unsigned long long)sb.st_size >> 10);
 		}
 		bozo_printf(httpd, "\r\n");
 	}



CVS commit: src/distrib/sets/lists

2014-10-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 10 00:49:14 UTC 2014

Modified Files:
src/distrib/sets/lists/base: ad.aarch64 ad.arm ad.mips ad.powerpc
ad.riscv md.amd64 md.sparc64 shl.mi
src/distrib/sets/lists/debug: ad.aarch64 ad.arm ad.mips ad.powerpc
ad.riscv md.amd64 md.sparc64 shl.mi

Log Message:
bump libm for long double complex functions


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/distrib/sets/lists/base/ad.aarch64
cvs rdiff -u -r1.56 -r1.57 src/distrib/sets/lists/base/ad.arm
cvs rdiff -u -r1.51 -r1.52 src/distrib/sets/lists/base/ad.mips
cvs rdiff -u -r1.20 -r1.21 src/distrib/sets/lists/base/ad.powerpc
cvs rdiff -u -r1.3 -r1.4 src/distrib/sets/lists/base/ad.riscv
cvs rdiff -u -r1.247 -r1.248 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.235 -r1.236 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.716 -r1.717 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.6 -r1.7 src/distrib/sets/lists/debug/ad.aarch64
cvs rdiff -u -r1.45 -r1.46 src/distrib/sets/lists/debug/ad.arm
cvs rdiff -u -r1.41 -r1.42 src/distrib/sets/lists/debug/ad.mips
cvs rdiff -u -r1.21 -r1.22 src/distrib/sets/lists/debug/ad.powerpc
cvs rdiff -u -r1.3 -r1.4 src/distrib/sets/lists/debug/ad.riscv
cvs rdiff -u -r1.65 -r1.66 src/distrib/sets/lists/debug/md.amd64
cvs rdiff -u -r1.64 -r1.65 src/distrib/sets/lists/debug/md.sparc64
cvs rdiff -u -r1.75 -r1.76 src/distrib/sets/lists/debug/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/base/ad.aarch64
diff -u src/distrib/sets/lists/base/ad.aarch64:1.7 src/distrib/sets/lists/base/ad.aarch64:1.8
--- src/distrib/sets/lists/base/ad.aarch64:1.7	Fri Sep 26 15:25:56 2014
+++ src/distrib/sets/lists/base/ad.aarch64	Thu Oct  9 20:49:14 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ad.aarch64,v 1.7 2014/09/26 19:25:56 christos Exp $
+# $NetBSD: ad.aarch64,v 1.8 2014/10/10 00:49:14 christos Exp $
 ./lib/eabi	base-compat-shlib	compat
 ./lib/eabi/npf	base-npf-shlib		compat
 ./lib/eabi/npf/ext_log.so			base-npf-shlib		compat,pic
@@ -212,7 +212,7 @@
 ./usr/lib/eabi/liblzma.so.1			base-compat-shlib	compat,pic
 ./usr/lib/eabi/liblzma.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/eabi/libm.so.0base-compat-shlib	compat,pic
-./usr/lib/eabi/libm.so.0.10			base-compat-shlib	compat,pic
+./usr/lib/eabi/libm.so.0.11			base-compat-shlib	compat,pic
 ./usr/lib/eabi/libmagic.so.5			base-compat-shlib	compat,pic
 ./usr/lib/eabi/libmagic.so.5.0			base-compat-shlib	compat,pic
 ./usr/lib/eabi/libmenu.so.6			base-compat-shlib	compat,pic
@@ -526,7 +526,7 @@
 ./usr/lib/eabihf/liblzma.so.1			base-compat-shlib	compat,pic
 ./usr/lib/eabihf/liblzma.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/eabihf/libm.so.0base-compat-shlib	compat,pic
-./usr/lib/eabihf/libm.so.0.10			base-compat-shlib	compat,pic
+./usr/lib/eabihf/libm.so.0.11			base-compat-shlib	compat,pic
 ./usr/lib/eabihf/libmagic.so.5			base-compat-shlib	compat,pic
 ./usr/lib/eabihf/libmagic.so.5.0			base-compat-shlib	compat,pic
 ./usr/lib/eabihf/libmenu.so.6			base-compat-shlib	compat,pic
@@ -838,7 +838,7 @@
 ./usr/lib/oabi/liblzma.so.1			base-compat-shlib	compat,pic
 ./usr/lib/oabi/liblzma.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libm.so.0			base-compat-shlib	compat,pic
-./usr/lib/oabi/libm.so.0.10			base-compat-shlib	compat,pic
+./usr/lib/oabi/libm.so.0.11			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmagic.so.5			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmagic.so.5.0			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmenu.so.6			base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/base/ad.arm
diff -u src/distrib/sets/lists/base/ad.arm:1.56 src/distrib/sets/lists/base/ad.arm:1.57
--- src/distrib/sets/lists/base/ad.arm:1.56	Fri Sep 26 15:25:56 2014
+++ src/distrib/sets/lists/base/ad.arm	Thu Oct  9 20:49:14 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ad.arm,v 1.56 2014/09/26 19:25:56 christos Exp $
+# $NetBSD: ad.arm,v 1.57 2014/10/10 00:49:14 christos Exp $
 ./lib/oabi	base-compat-shlib	compat
 ./lib/oabi/npf	base-npf-shlib		compat
 ./lib/oabi/npf/ext_log.so			base-npf-shlib		compat,pic
@@ -207,7 +207,7 @@
 ./usr/lib/oabi/liblzma.so.1			base-compat-shlib	compat,pic
 ./usr/lib/oabi/liblzma.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libm.so.0			base-compat-shlib	compat,pic
-./usr/lib/oabi/libm.so.0.10			base-compat-shlib	compat,pic
+./usr/lib/oabi/libm.so.0.11			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmagic.so.5			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmagic.so.5.0			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libmenu.so.6			base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/base/ad.mips
diff -u src/distrib/sets/lists/base/ad.mips:1.51 src/distrib/sets/lists/base/ad.mips:1.52
--- src/distrib/sets/lists/base/ad.mips:1.51	Fri Sep 26 15:25:56 2014
+++ src/distrib/sets/lists/base/ad.mips	Thu Oct  9

CVS commit: src/lib/libm

2014-10-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 10 00:48:18 UTC 2014

Modified Files:
src/lib/libm: shlib_version
src/lib/libm/complex: Makefile.inc cprojl.c
Added Files:
src/lib/libm/complex: cabsl.c cacoshl.c cacosl.c cargl.c casinhl.c
casinl.c catanl.c ccoshl.c ccosl.c cephes_subrl.c cephes_subrl.h
cexpl.c clogl.c cpowl.c csinhl.c csinl.c csqrtl.c ctanhl.c ctanl.c

Log Message:
Add the missing complex functions.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libm/shlib_version
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/complex/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libm/complex/cabsl.c \
src/lib/libm/complex/cacoshl.c src/lib/libm/complex/cacosl.c \
src/lib/libm/complex/cargl.c src/lib/libm/complex/casinhl.c \
src/lib/libm/complex/casinl.c src/lib/libm/complex/catanl.c \
src/lib/libm/complex/ccoshl.c src/lib/libm/complex/ccosl.c \
src/lib/libm/complex/cephes_subrl.c src/lib/libm/complex/cephes_subrl.h \
src/lib/libm/complex/cexpl.c src/lib/libm/complex/clogl.c \
src/lib/libm/complex/cpowl.c src/lib/libm/complex/csinhl.c \
src/lib/libm/complex/csinl.c src/lib/libm/complex/csqrtl.c \
src/lib/libm/complex/ctanhl.c src/lib/libm/complex/ctanl.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/complex/cprojl.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/shlib_version
diff -u src/lib/libm/shlib_version:1.13 src/lib/libm/shlib_version:1.14
--- src/lib/libm/shlib_version:1.13	Tue Jul 26 12:10:16 2011
+++ src/lib/libm/shlib_version	Thu Oct  9 20:48:18 2014
@@ -1,5 +1,5 @@
-#	$NetBSD: shlib_version,v 1.13 2011/07/26 16:10:16 joerg Exp $
+#	$NetBSD: shlib_version,v 1.14 2014/10/10 00:48:18 christos Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
 major=0
-minor=10
+minor=11

Index: src/lib/libm/complex/Makefile.inc
diff -u src/lib/libm/complex/Makefile.inc:1.4 src/lib/libm/complex/Makefile.inc:1.5
--- src/lib/libm/complex/Makefile.inc:1.4	Thu Mar 17 20:57:22 2011
+++ src/lib/libm/complex/Makefile.inc	Thu Oct  9 20:48:18 2014
@@ -1,29 +1,14 @@
-# $NetBSD: Makefile.inc,v 1.4 2011/03/18 00:57:22 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.5 2014/10/10 00:48:18 christos Exp $
 
 .PATH: ${.CURDIR}/complex
 
-SRCS+= cabs.c cabsf.c carg.c cargf.c
-SRCS+= creal.c crealf.c creall.c cimag.c cimagf.c cimagl.c
-SRCS+= conj.c conjf.c conjl.c
-SRCS+= csqrt.c cexp.c clog.c cpow.c
-SRCS+= cephes_subr.c csin.c ccos.c ctan.c csinh.c ccosh.c ctanh.c
-SRCS+= casin.c cacos.c catan.c casinh.c cacosh.c catanh.c
-SRCS+= csqrtf.c cexpf.c clogf.c cpowf.c
-SRCS+= cephes_subrf.c csinf.c ccosf.c ctanf.c csinhf.c ccoshf.c ctanhf.c
-SRCS+= casinf.c cacosf.c catanf.c casinhf.c cacoshf.c catanhf.c
-SRCS+= cproj.c cprojf.c cprojl.c
+COMPLEX_SRCS = cabs.c cacos.c cacosh.c carg.c casin.c casinh.c catan.c \
+	ccos.c ccosh.c cephes_subr.c cexp.c clog.c conj.c cpow.c cproj.c\
+	creal.c csin.c csinh.c csqrt.c ctan.c ctanh.c
 
-MAN+= cabs.3 cacos.3 cacosh.3 carg.3 casin.3 casinh.3 catan.3 catanh.3
-MAN+= ccos.3 ccosh.3 cexp.3 cimag.3 clog.3 conj.3 cpow.3 cproj.3 creal.3
-MAN+= csin.3 csinh.3 csqrt.3 ctan.3 ctanh.3
-
-MLINKS+= cabs.3 cabsf.3 cacos.3 cacosf.3 cacosh.3 cacoshf.3
-MLINKS+= carg.3 cargf.3 casin.3 casinf.3 casinh.3 casinhf.3
-MLINKS+= catan.3 catanf.3 catanh.3 catanhf.3 ccos.3 ccosf.3
-MLINKS+= ccosh.3 ccoshf.3 cexp.3 cexpf.3
-MLINKS+= cimag.3 cimagf.3 cimag.3 cimagl.3
-MLINKS+= clog.3 clogf.3 conj.3 conjf.3 conj.3 conjl.3 cpow.3 cpowf.3
-MLINKS+= cproj.3 cprojf.3 cproj.3 cprojl.3
-MLINKS+= creal.3 crealf.3 creal.3 creall.3
-MLINKS+= csin.3 csinf.3 csinh.3 csinhf.3
-MLINKS+= csqrt.3 csqrtf.3 ctan.3 ctanf.3 ctanh.3 ctanhf.3
+.for i in ${COMPLEX_SRCS}
+SRCS+=	$i ${i:S/.c/f.c/} ${i:S/.c/l.c/}
+MAN+= ${i:Ncephes_*:S/.c/.3/}
+MLINKS+= ${i:Ncephes_*:S/.c/.3/} ${i:Ncephes_*:S/.c/f.3/}
+MLINKS+= ${i:Ncephes_*:S/.c/.3/} ${i:Ncephes_*:S/.c/l.3/}
+.endfor

Index: src/lib/libm/complex/cprojl.c
diff -u src/lib/libm/complex/cprojl.c:1.6 src/lib/libm/complex/cprojl.c:1.7
--- src/lib/libm/complex/cprojl.c:1.6	Tue Nov  1 22:34:56 2011
+++ src/lib/libm/complex/cprojl.c	Thu Oct  9 20:48:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cprojl.c,v 1.6 2011/11/02 02:34:56 christos Exp $	*/
+/*	$NetBSD: cprojl.c,v 1.7 2014/10/10 00:48:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: cprojl.c,v 1.6 2011/11/02 02:34:56 christos Exp $");
+__RCSID("$NetBSD: cprojl.c,v 1.7 2014/10/10 00:48:18 christos Exp $");
 
 #include 
 #include 
@@ -57,7 +57,7 @@ cprojl(long double complex z)
 #else
 		REAL_PART(w) = INFINITY;
 #endif
-		IMAG_PART(w) = copysignl(0.0, cimagl(z));
+		IMAG_PART(w) = copysignl(0.0L, cimagl(z));
 	}
 
 	return (w.z);

Added files:

Index: src/lib/libm/complex/cabsl.c
diff -u /dev/null src/lib/libm/complex/cabs

CVS commit: src/usr.bin/netstat

2014-10-09 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Oct  9 23:52:47 UTC 2014

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

Log Message:
As described in kvm_openfiles(3), default core file is not /dev/kmem
but /dev/mem.  Actually, passing /dev/kmem to -M doesn't work.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 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.67 src/usr.bin/netstat/netstat.1:1.68
--- src/usr.bin/netstat/netstat.1:1.67	Fri Oct 18 22:18:14 2013
+++ src/usr.bin/netstat/netstat.1	Thu Oct  9 23:52:47 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: netstat.1,v 1.67 2013/10/18 22:18:14 bad Exp $
+.\"	$NetBSD: netstat.1,v 1.68 2014/10/09 23:52:47 enami Exp $
 .\"
 .\" Copyright (c) 1983, 1990, 1992, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -225,7 +225,7 @@ columns.
 .It Fl M
 Extract values associated with the name list from the specified core
 instead of the default
-.Pa /dev/kmem .
+.Pa /dev/mem .
 .It Fl m
 Show statistics recorded by the mbuf memory management routines
 (the network manages a private pool of memory buffers).
@@ -443,10 +443,10 @@ command appeared in
 .Bx 4.2 .
 IPv6 support was added by WIDE/KAME project.
 .\" .Sh FILES
-.\" .Bl -tag -width /dev/kmem -compact
+.\" .Bl -tag -width /dev/mem -compact
 .\" .It Pa /netbsd
 .\" default kernel namelist
-.\" .It Pa /dev/kmem
+.\" .It Pa /dev/mem
 .\" default memory file
 .\" .El
 .Sh BUGS



CVS commit: src/usr.bin/netstat

2014-10-09 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Oct  9 23:45:47 UTC 2014

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

Log Message:
Fix a bug introduced in rev. 1.62; it fails to negate (a && b).


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/usr.bin/netstat/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/netstat/main.c
diff -u src/usr.bin/netstat/main.c:1.91 src/usr.bin/netstat/main.c:1.92
--- src/usr.bin/netstat/main.c:1.91	Fri May 30 01:44:21 2014
+++ src/usr.bin/netstat/main.c	Thu Oct  9 23:45:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.91 2014/05/30 01:44:21 rmind Exp $	*/
+/*	$NetBSD: main.c,v 1.92 2014/10/09 23:45:47 enami Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "from: @(#)main.c	8.4 (Berkeley) 3/1/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.91 2014/05/30 01:44:21 rmind Exp $");
+__RCSID("$NetBSD: main.c,v 1.92 2014/10/09 23:45:47 enami Exp $");
 #endif
 #endif /* not lint */
 
@@ -344,12 +344,17 @@ prepare(const char *nf, const char *mf, 
 	/*
 	 * Try to figure out if we can use sysctl or not.
 	 */
-	if (nf != NULL && mf != NULL) {
+	if (nf != NULL || mf != NULL) {
 		/* Of course, we can't use sysctl with dumps. */
 		if (force_sysctl)
 			errx(EXIT_FAILURE, "can't use sysctl with dumps");
 
-		/* If we have -M and -N, we're not dealing with live memory. */
+		/*
+		 * If we have -M or -N, we're not dealing with live memory
+		 * or want to use kvm interface explicitly.  It is sometimes
+		 * useful to dig inside of kernel without extending
+		 * sysctl interface (i.e., without rebuilding kernel).
+		 */
 		use_sysctl = 0;
 	} else if (qflag ||
 		   iflag ||



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 19:33:43 UTC 2014

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

Log Message:
Style.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/config/mkmakefile.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/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.23 src/usr.bin/config/mkmakefile.c:1.24
--- src/usr.bin/config/mkmakefile.c:1.23	Thu Oct  9 19:24:36 2014
+++ src/usr.bin/config/mkmakefile.c	Thu Oct  9 19:33:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.23 2014/10/09 19:24:36 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.24 2014/10/09 19:33:43 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -100,7 +100,8 @@ mkmakefile(void)
 	machine, machine);
 	ifname = sourcepath(buf);
 	if ((ifp = fopen(ifname, "r")) == NULL) {
-		/* Try a makefile for the architecture second.
+		/*
+		 * Try a makefile for the architecture second.
 		 */
 		(void)snprintf(buf, sizeof(buf), "arch/%s/conf/Makefile.%s",
 		machinearch, machinearch);
@@ -232,11 +233,13 @@ emitsubs(FILE *fp, const char *line, con
 			if (option != NULL)
 fputs(option->nv_str ? option->nv_str : "1",
 fp);
-			/* Otherwise it's not a selected option and we don't
-			 * output anything. */
+			/*
+			 * Otherwise it's not a selected option and we don't
+			 * output anything.
+			 */
 		}
 
-		line = nextpct+1;
+		line = nextpct + 1;
 	}
 }
 
@@ -295,12 +298,12 @@ emitdefs(FILE *fp)
 	sp = "";
 	for (nv = options; nv != NULL; nv = nv->nv_next) {
 
-		/* skip any options output to a header file */
+		/* Skip any options output to a header file */
 		if (DEFINED_OPTION(nv->nv_name))
 			continue;
 		fprintf(fp, "%s-D%s", sp, nv->nv_name);
 		if (nv->nv_str)
-		fprintf(fp, "=\"%s\"", nv->nv_str);
+			fprintf(fp, "=\"%s\"", nv->nv_str);
 		sp = " ";
 	}
 	putc('\n', fp);
@@ -339,12 +342,12 @@ emitobjs(FILE *fp)
 		} else {
 			if (oi->oi_prefix != NULL) {
 fprintf(fp, "\t%s%s/%s \\\n",
-	prefix_prologue(oi->oi_path),
-	oi->oi_prefix, oi->oi_path);
+prefix_prologue(oi->oi_path),
+oi->oi_prefix, oi->oi_path);
 			} else {
 fprintf(fp, "\t%s%s \\\n",
-filetype_prologue(&oi->oi_fit),
-oi->oi_path);
+filetype_prologue(&oi->oi_fit),
+oi->oi_path);
 			}
 		}
 	}
@@ -447,12 +450,12 @@ emitfiles(FILE *fp, int suffix, int uppe
 		} else {
 			if (fi->fi_prefix != NULL) {
 fprintf(fp, "\t%s%s/%s \\\n",
-	prefix_prologue(fi->fi_prefix),
-	fi->fi_prefix, fpath);
+prefix_prologue(fi->fi_prefix),
+fi->fi_prefix, fpath);
 			} else {
 fprintf(fp, "\t%s%s \\\n",
-filetype_prologue(&fi->fi_fit),
-fpath);
+filetype_prologue(&fi->fi_fit),
+fpath);
 			}
 		}
 	}
@@ -490,13 +493,13 @@ emitrules(FILE *fp)
 		} else {
 			if (fi->fi_prefix != NULL) {
 fprintf(fp, "%s.o: %s%s/%s\n", fi->fi_base,
-	prefix_prologue(fi->fi_prefix),
-	fi->fi_prefix, fpath);
+prefix_prologue(fi->fi_prefix),
+fi->fi_prefix, fpath);
 			} else {
 fprintf(fp, "%s.o: %s%s\n",
-fi->fi_base,
-filetype_prologue(&fi->fi_fit),
-fpath);
+fi->fi_base,
+filetype_prologue(&fi->fi_fit),
+fpath);
  			}
 		}
 		if (fi->fi_mkrule != NULL) {
@@ -538,9 +541,9 @@ emitload(FILE *fp)
 	TAILQ_FOREACH(cf, &allcf, cf_next) {
 		fprintf(fp, "KERNELS+=%s\n", cf->cf_name);
 		fprintf(fp, "%s: ${SYSTEM_DEP} swap%s.o vers.o build_kernel\n",
-			cf->cf_name, cf->cf_name);
+		cf->cf_name, cf->cf_name);
 		fprintf(fp, "swap%s.o: swap%s.c\n"
-			"\t${NORMAL_C}\n\n", cf->cf_name, cf->cf_name);
+		"\t${NORMAL_C}\n\n", cf->cf_name, cf->cf_name);
 	}
 	fputs("\n", fp);
 }



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 19:27:05 UTC 2014

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

Log Message:
FIT_FORCESELECT is never set anywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/config/defs.h
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/config/files.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.52 src/usr.bin/config/defs.h:1.53
--- src/usr.bin/config/defs.h:1.52	Thu Oct  9 19:24:36 2014
+++ src/usr.bin/config/defs.h	Thu Oct  9 19:27:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.52 2014/10/09 19:24:36 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.53 2014/10/09 19:27:04 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -324,7 +324,6 @@ struct filetype
 	TAILQ_ENTRY(files) fit_anext;	/* next file in attr */
 };
 /* Anything less than 0x10 is sub-type specific */
-#define FIT_FORCESELECT 0x20/* Always include this file */
 
 /*
  * Files.  Each file is either standard (always included) or optional,

Index: src/usr.bin/config/files.c
diff -u src/usr.bin/config/files.c:1.15 src/usr.bin/config/files.c:1.16
--- src/usr.bin/config/files.c:1.15	Thu Oct  9 15:25:26 2014
+++ src/usr.bin/config/files.c	Thu Oct  9 19:27:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: files.c,v 1.15 2014/10/09 15:25:26 uebayasi Exp $	*/
+/*	$NetBSD: files.c,v 1.16 2014/10/09 19:27:04 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -270,12 +270,7 @@ fixfiles(void)
 		if (fi->fi_flags & FI_HIDDEN)
 			continue;
 
-		/* Optional: see if it is to be included. */
-		if (fi->fi_flags & FIT_FORCESELECT)
-		{
-			/* include it */ ;
-		}
-		else if (fi->fi_optx != NULL) {
+		if (fi->fi_optx != NULL) {
 			if (fi->fi_optx->cx_type == CX_ATOM) {
 addfiletoattr(fi->fi_optx->cx_u.atom, fi);
 			}



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 19:24:36 UTC 2014

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

Log Message:
FIT_NOPROLOGUE is never set anywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/config/defs.h
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/config/mkmakefile.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.51 src/usr.bin/config/defs.h:1.52
--- src/usr.bin/config/defs.h:1.51	Thu Oct  9 19:20:56 2014
+++ src/usr.bin/config/defs.h	Thu Oct  9 19:24:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.51 2014/10/09 19:20:56 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.52 2014/10/09 19:24:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -324,7 +324,6 @@ struct filetype
 	TAILQ_ENTRY(files) fit_anext;	/* next file in attr */
 };
 /* Anything less than 0x10 is sub-type specific */
-#define FIT_NOPROLOGUE  0x10/* Don't prepend $S/ */
 #define FIT_FORCESELECT 0x20/* Always include this file */
 
 /*

Index: src/usr.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.22 src/usr.bin/config/mkmakefile.c:1.23
--- src/usr.bin/config/mkmakefile.c:1.22	Thu Oct  9 19:22:31 2014
+++ src/usr.bin/config/mkmakefile.c	Thu Oct  9 19:24:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.22 2014/10/09 19:22:31 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.23 2014/10/09 19:24:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -269,7 +269,7 @@ srcpath(struct files *fi)
 static const char *
 filetype_prologue(struct filetype *fit)
 {
-	if (fit->fit_flags & FIT_NOPROLOGUE || *fit->fit_path == '/')
+	if (*fit->fit_path == '/')
 		return ("");
 	else
 		return ("$S/");



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 19:22:31 UTC 2014

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

Log Message:
Kill more unused indent code in emitfiles().


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/config/mkmakefile.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/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.21 src/usr.bin/config/mkmakefile.c:1.22
--- src/usr.bin/config/mkmakefile.c:1.21	Thu Oct  9 19:20:56 2014
+++ src/usr.bin/config/mkmakefile.c	Thu Oct  9 19:22:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.21 2014/10/09 19:20:56 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.22 2014/10/09 19:22:31 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -442,14 +442,6 @@ emitfiles(FILE *fp, int suffix, int uppe
 		len = strlen(fpath);
 		if (fpath[len - 1] != suffix && fpath[len - 1] != upper_suffix)
 			continue;
-		if (*fpath != '/') {
-			/* "$S/" */
- 			if (fi->fi_prefix != NULL)
-len += strlen(prefix_prologue(fi->fi_prefix)) +
-   strlen(fi->fi_prefix) + 1;
-			else
-len += strlen(filetype_prologue(&fi->fi_fit));
-		}
 		if (*fi->fi_path == '/') {
 			fprintf(fp, "\t%s \\\n", fpath);
 		} else {



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 19:20:56 UTC 2014

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

Log Message:
Steal -M to enable "modular" build.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/config/defs.h
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/config/main.c
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/config/mkmakefile.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.50 src/usr.bin/config/defs.h:1.51
--- src/usr.bin/config/defs.h:1.50	Thu Oct  9 15:25:26 2014
+++ src/usr.bin/config/defs.h	Thu Oct  9 19:20:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.50 2014/10/09 15:25:26 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.51 2014/10/09 19:20:56 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -606,6 +606,7 @@ int	emitioconfh(void);
 int	mkioconf(void);
 
 /* mkmakefile.c */
+extern int usekobjs;
 int	mkmakefile(void);
 
 /* mkswap.c */

Index: src/usr.bin/config/main.c
diff -u src/usr.bin/config/main.c:1.57 src/usr.bin/config/main.c:1.58
--- src/usr.bin/config/main.c:1.57	Thu Oct  9 16:08:36 2014
+++ src/usr.bin/config/main.c	Thu Oct  9 19:20:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.57 2014/10/09 16:08:36 uebayasi Exp $	*/
+/*	$NetBSD: main.c,v 1.58 2014/10/09 19:20:56 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -161,7 +161,7 @@ main(int argc, char **argv)
 
 	pflag = 0;
 	xflag = 0;
-	while ((ch = getopt(argc, argv, "D:LPU:dgpvb:s:x")) != -1) {
+	while ((ch = getopt(argc, argv, "D:LMPU:dgpvb:s:x")) != -1) {
 		switch (ch) {
 
 #ifndef MAKE_BOOTSTRAP
@@ -171,6 +171,10 @@ main(int argc, char **argv)
 			break;
 #endif
 
+		case 'M':
+			usekobjs = 1;
+			break;
+
 		case 'L':
 			Lflag = 1;
 			break;

Index: src/usr.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.20 src/usr.bin/config/mkmakefile.c:1.21
--- src/usr.bin/config/mkmakefile.c:1.20	Thu Oct  9 17:36:10 2014
+++ src/usr.bin/config/mkmakefile.c	Thu Oct  9 19:20:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.20 2014/10/09 17:36:10 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.21 2014/10/09 19:20:56 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -83,7 +83,7 @@ static void emitsubs(FILE *, const char 
 static int  selectopt(const char *, void *);
 
 /* Generate Makefile to build things per-attribute *.ko (a.k.a modular build). */
-int usekobjs = 0;	/* XXX */
+int usekobjs = 0;
 
 int
 mkmakefile(void)



CVS commit: src/sys/arch

2014-10-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct  9 18:34:24 UTC 2014

Modified Files:
src/sys/arch/amd64/amd64: db_disasm.c
src/sys/arch/i386/i386: db_disasm.c

Log Message:
Fix bugs:
- aaa and daa were reversed. Same as *BSDs.
- fix operand order of shld and shrd. Same as *BSDs.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/amd64/amd64/db_disasm.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/i386/i386/db_disasm.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/amd64/amd64/db_disasm.c
diff -u src/sys/arch/amd64/amd64/db_disasm.c:1.18 src/sys/arch/amd64/amd64/db_disasm.c:1.19
--- src/sys/arch/amd64/amd64/db_disasm.c:1.18	Tue Oct  7 15:34:05 2014
+++ src/sys/arch/amd64/amd64/db_disasm.c	Thu Oct  9 18:34:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_disasm.c,v 1.18 2014/10/07 15:34:05 msaitoh Exp $	*/
+/*	$NetBSD: db_disasm.c,v 1.19 2014/10/09 18:34:24 msaitoh Exp $	*/
 
 /* 
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.18 2014/10/07 15:34:05 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.19 2014/10/09 18:34:24 msaitoh Exp $");
 
 #ifndef _KERNEL
 #include 
@@ -295,8 +295,8 @@ const struct inst db_inst_0fax[] = {
 /*a1*/	{ "pop",   false, NONE,  op1(Si), 0 },
 /*a2*/	{ "cpuid", false, NONE,  0,	  0 },
 /*a3*/	{ "bt",true,  LONG,  op2(R,E),0 },
-/*a4*/	{ "shld",  true,  LONG,  op3(Ib,E,R), 0 },
-/*a5*/	{ "shld",  true,  LONG,  op3(CL,E,R), 0 },
+/*a4*/	{ "shld",  true,  LONG,  op3(Ib,R,E), 0 },
+/*a5*/	{ "shld",  true,  LONG,  op3(CL,R,E), 0 },
 /*a6*/	{ "",  false, NONE,  0,	  0 },
 /*a7*/	{ "",  false, NONE,  0,	  0 },
 
@@ -304,8 +304,8 @@ const struct inst db_inst_0fax[] = {
 /*a9*/	{ "pop",   false, NONE,  op1(Si), 0 },
 /*aa*/	{ "rsm",   false, NONE,  0,	  0 },
 /*ab*/	{ "bts",   true,  LONG,  op2(R,E),0 },
-/*ac*/	{ "shrd",  true,  LONG,  op3(Ib,E,R), 0 },
-/*ad*/	{ "shrd",  true,  LONG,  op3(CL,E,R), 0 },
+/*ac*/	{ "shrd",  true,  LONG,  op3(Ib,R,E), 0 },
+/*ad*/	{ "shrd",  true,  LONG,  op3(CL,R,E), 0 },
 /*ae*/	{ "fxsave",true,  LONG,  0,	  0 },
 /*af*/	{ "imul",  true,  LONG,  op2(E,R),0 },
 };
@@ -339,6 +339,7 @@ const struct inst db_inst_0fcx[] = {
 /*c5*/	{ "",	   false, NONE,  0,	  0 },
 /*c6*/	{ "",	   false, NONE,  0,	  0 },
 /*c7*/	{ "",	   true,  NONE,  op1(E),  db_Grp9 },
+
 /*c8*/	{ "bswap", false, LONG,  op1(Ri), 0 },
 /*c9*/	{ "bswap", false, LONG,  op1(Ri), 0 },
 /*ca*/	{ "bswap", false, LONG,  op1(Ri), 0 },
@@ -596,7 +597,7 @@ const struct inst db_inst_table[256] = {
 /*24*/	{ "and",   false, BYTE,  op2(I, A),  0 },
 /*25*/	{ "and",   false, LONG,  op2(I, A),  0 },
 /*26*/	{ "",  false, NONE,  0,	 0 },
-/*27*/	{ "aaa",   false, NONE,  0,	 0 },
+/*27*/	{ "daa",   false, NONE,  0,	 0 },
 
 /*28*/	{ "sub",   true,  BYTE,  op2(R, E),  0 },
 /*29*/	{ "sub",   true,  LONG,  op2(R, E),  0 },
@@ -614,7 +615,7 @@ const struct inst db_inst_table[256] = {
 /*34*/	{ "xor",   false, BYTE,  op2(I, A),  0 },
 /*35*/	{ "xor",   false, LONG,  op2(I, A),  0 },
 /*36*/	{ "",  false, NONE,  0,	 0 },
-/*37*/	{ "daa",   false, NONE,  0,	 0 },
+/*37*/	{ "aaa",   false, NONE,  0,	 0 },
 
 /*38*/	{ "cmp",   true,  BYTE,  op2(R, E),  0 },
 /*39*/	{ "cmp",   true,  LONG,  op2(R, E),  0 },

Index: src/sys/arch/i386/i386/db_disasm.c
diff -u src/sys/arch/i386/i386/db_disasm.c:1.42 src/sys/arch/i386/i386/db_disasm.c:1.43
--- src/sys/arch/i386/i386/db_disasm.c:1.42	Tue Oct  7 15:34:05 2014
+++ src/sys/arch/i386/i386/db_disasm.c	Thu Oct  9 18:34:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_disasm.c,v 1.42 2014/10/07 15:34:05 msaitoh Exp $	*/
+/*	$NetBSD: db_disasm.c,v 1.43 2014/10/09 18:34:24 msaitoh Exp $	*/
 
 /* 
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.42 2014/10/07 15:34:05 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.43 2014/10/09 18:34:24 msaitoh Exp $");
 
 #include 
 #include 
@@ -228,6 +228,7 @@ const struct inst db_inst_0f4x[] = {
 /*45*/	{ "cmovnz", true,  LONG,  op2(E,R),0 },
 /*46*/	{ "cmovbe", true,  LONG,  op2(E,R),0 },
 /*47*/	{ "cmovmbe",true,  LONG,  op2(E,R),0 },
+
 /*48*/	{ "cmovs",  true,  LONG,  op2(E,R),0 },
 /*49*/	{ "cmovns", true,  LONG,  op2(E,R),0 },
 /*4a*/	{ "cmovp",  true,  LONG,  op2(E,R),0 },
@@ -283,8 +284,8 @@ const struct inst db_inst_0fax[] = {
 /*a1*/	{ "pop",   false, NONE,  op1(Si), 0 },
 /*a2*/	{ "cpuid", false, NONE,  0,	  0 },
 /*a3*/	{ "bt",true,  LONG,  op2(R,E),0 },
-/*a4*/	{ "shld",  true,  LONG,  op3(Ib,E,R), 0 },
-/*a5*/	{ "shld",  true,  LONG,  op3(CL,E,R), 0 },
+/*a4*/	{ "shld",  true,  LONG,  op3(Ib,R,E), 0 },
+/*a5*/	{ "shld",  true,  LONG,  op3(CL,R,E), 0 },
 /*a6*/	{ "",  false, NONE,  0,	  0 },
 /*a7*/

CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 17:36:10 UTC 2014

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

Log Message:
Print one file per line.  Simplify code.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/config/mkmakefile.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/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.19 src/usr.bin/config/mkmakefile.c:1.20
--- src/usr.bin/config/mkmakefile.c:1.19	Thu Oct  9 17:22:55 2014
+++ src/usr.bin/config/mkmakefile.c	Thu Oct  9 17:36:10 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.19 2014/10/09 17:22:55 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.20 2014/10/09 17:36:10 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -324,57 +324,29 @@ emitobjs(FILE *fp)
 {
 	struct files *fi;
 	struct objects *oi;
-	int lpos, len, sp;
 
-	fputs("OBJS=", fp);
-	sp = '\t';
-	lpos = 7;
+	fputs("OBJS= \\\n", fp);
 	TAILQ_FOREACH(fi, &allfiles, fi_next) {
 		if ((fi->fi_flags & FI_SEL) == 0)
 			continue;
-		len = strlen(fi->fi_base) + 2;
-		if (lpos + len > 72) {
-			fputs(" \\\n", fp);
-			sp = '\t';
-			lpos = 7;
-		}
-		fprintf(fp, "%c%s.o", sp, fi->fi_base);
-		lpos += len + 1;
-		sp = ' ';
+		fprintf(fp, "\t%s.o \\\n", fi->fi_base);
 	}
 	TAILQ_FOREACH(oi, &allobjects, oi_next) {
 		if ((oi->oi_flags & OI_SEL) == 0)
 			continue;
-		len = strlen(oi->oi_path);
-		if (*oi->oi_path != '/')
-		{
-			/* e.g. "$S/" */
- 			if (oi->oi_prefix != NULL)
-len += strlen(prefix_prologue(oi->oi_path)) +
-   strlen(oi->oi_prefix) + 1;
-			else
-len += strlen(filetype_prologue(&oi->oi_fit));
-		}
-		if (lpos + len > 72) {
-			fputs(" \\\n", fp);
-			sp = '\t';
-			lpos = 7;
-		}
 		if (*oi->oi_path == '/') {
-			fprintf(fp, "%c%s", sp, oi->oi_path);
+			fprintf(fp, "\t%s \\\n", oi->oi_path);
 		} else {
 			if (oi->oi_prefix != NULL) {
-fprintf(fp, "%c%s%s/%s", sp,
+fprintf(fp, "\t%s%s/%s \\\n",
 	prefix_prologue(oi->oi_path),
 	oi->oi_prefix, oi->oi_path);
 			} else {
-fprintf(fp, "%c%s%s", sp,
+fprintf(fp, "\t%s%s \\\n",
 filetype_prologue(&oi->oi_fit),
 oi->oi_path);
 			}
 		}
-		lpos += len + 1;
-		sp = ' ';
 	}
 	putc('\n', fp);
 }
@@ -457,14 +429,12 @@ static void
 emitfiles(FILE *fp, int suffix, int upper_suffix)
 {
 	struct files *fi;
-	int lpos, len, sp;
+	int len;
 	const char *fpath;
  	struct config *cf;
  	char swapname[100];
 
-	fprintf(fp, "%cFILES=", toupper(suffix));
-	sp = '\t';
-	lpos = 7;
+	fprintf(fp, "%cFILES= \\\n", toupper(suffix));
 	TAILQ_FOREACH(fi, &allfiles, fi_next) {
 		if ((fi->fi_flags & FI_SEL) == 0)
 			continue;
@@ -480,26 +450,19 @@ emitfiles(FILE *fp, int suffix, int uppe
 			else
 len += strlen(filetype_prologue(&fi->fi_fit));
 		}
-		if (lpos + len > 72) {
-			fputs(" \\\n", fp);
-			sp = '\t';
-			lpos = 7;
-		}
 		if (*fi->fi_path == '/') {
-			fprintf(fp, "%c%s", sp, fpath);
+			fprintf(fp, "\t%s \\\n", fpath);
 		} else {
 			if (fi->fi_prefix != NULL) {
-fprintf(fp, "%c%s%s/%s", sp,
+fprintf(fp, "\t%s%s/%s \\\n",
 	prefix_prologue(fi->fi_prefix),
 	fi->fi_prefix, fpath);
 			} else {
-fprintf(fp, "%c%s%s", sp,
+fprintf(fp, "\t%s%s \\\n",
 filetype_prologue(&fi->fi_fit),
 fpath);
 			}
 		}
-		lpos += len + 1;
-		sp = ' ';
 	}
  	/*
  	 * The allfiles list does not include the configuration-specific
@@ -510,15 +473,7 @@ emitfiles(FILE *fp, int suffix, int uppe
  		TAILQ_FOREACH(cf, &allcf, cf_next) {
  			(void)snprintf(swapname, sizeof(swapname), "swap%s.c",
  			cf->cf_name);
- 			len = strlen(swapname);
- 			if (lpos + len > 72) {
- fputs(" \\\n", fp);
- sp = '\t';
- lpos = 7;
- 			}
- 			fprintf(fp, "%c%s", sp, swapname);
- 			lpos += len + 1;
- 			sp = ' ';
+ 			fprintf(fp, "\t%s \\\n", swapname);
  		}
  	}
 	putc('\n', fp);



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 17:22:55 UTC 2014

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

Log Message:
Correct inverted logic.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/config/mkmakefile.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/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.18 src/usr.bin/config/mkmakefile.c:1.19
--- src/usr.bin/config/mkmakefile.c:1.18	Thu Oct  9 17:00:15 2014
+++ src/usr.bin/config/mkmakefile.c	Thu Oct  9 17:22:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.18 2014/10/09 17:00:15 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.19 2014/10/09 17:22:55 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -128,7 +128,7 @@ mkmakefile(void)
 			continue;
 		}
 		if (strcmp(line, "%OBJS\n") == 0)
-			fn = usekobjs ? emitobjs : emitkobjs;
+			fn = usekobjs ? emitkobjs : emitobjs;
 		else if (strcmp(line, "%CFILES\n") == 0)
 			fn = emitcfiles;
 		else if (strcmp(line, "%SFILES\n") == 0)



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 17:00:15 UTC 2014

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

Log Message:
Implement code to generate Makefile to build netbsd via intermediate relocatable
object files.  Disabled for now.  Commit this for further experiments.

Kernel (netbsd) has been built as:

netbsd: *.o
ld -o netbsd *.o

Change this to:

netbsd: *.ko
ld -o netbsd *.ko
acpica.ko: ${OBJS.acpica}
ld -r acpica.ko ${OBJS.acpica}
:

You can call *.ko as a module, but this is not only beneficial for loadable
module, but also localize related text/data.  Various options/flags/params
will be able to be per-ko.  Unnecessary symbols can be hidden.  Many ideas
will follow.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/config/mkmakefile.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/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.17 src/usr.bin/config/mkmakefile.c:1.18
--- src/usr.bin/config/mkmakefile.c:1.17	Mon Aug 18 08:07:02 2014
+++ src/usr.bin/config/mkmakefile.c	Thu Oct  9 17:00:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.17 2014/08/18 08:07:02 joerg Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.18 2014/10/09 17:00:15 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -68,6 +68,11 @@ static void emitdefs(FILE *);
 static void emitfiles(FILE *, int, int);
 
 static void emitobjs(FILE *);
+static void emitallkobjs(FILE *);
+static int emitallkobjscb(const char *, void *, void *);
+static void emitattrkobjs(FILE *);
+static int emitattrkobjscb(const char *, void *, void *);
+static void emitkobjs(FILE *);
 static void emitcfiles(FILE *);
 static void emitsfiles(FILE *);
 static void emitrules(FILE *);
@@ -77,6 +82,9 @@ static void emitappmkoptions(FILE *);
 static void emitsubs(FILE *, const char *, const char *, int);
 static int  selectopt(const char *, void *);
 
+/* Generate Makefile to build things per-attribute *.ko (a.k.a modular build). */
+int usekobjs = 0;	/* XXX */
+
 int
 mkmakefile(void)
 {
@@ -120,7 +128,7 @@ mkmakefile(void)
 			continue;
 		}
 		if (strcmp(line, "%OBJS\n") == 0)
-			fn = emitobjs;
+			fn = usekobjs ? emitobjs : emitkobjs;
 		else if (strcmp(line, "%CFILES\n") == 0)
 			fn = emitcfiles;
 		else if (strcmp(line, "%SFILES\n") == 0)
@@ -372,6 +380,66 @@ emitobjs(FILE *fp)
 }
 
 static void
+emitkobjs(FILE *fp)
+{
+	emitallkobjs(fp);
+	emitattrkobjs(fp);
+}
+
+static void
+emitallkobjs(FILE *fp)
+{
+
+	fputs("OBJS=", fp);
+	ht_enumerate(attrtab, emitallkobjscb, fp);
+	putc('\n', fp);
+}
+
+static int
+emitallkobjscb(const char *name, void *v, void *arg)
+{
+	struct attr *a = v;
+	FILE *fp = arg;
+
+	if (ht_lookup(selecttab, name) == NULL)
+		return 0;
+	if (TAILQ_EMPTY(&a->a_files))
+		return 0;
+	fprintf(fp, " %s.ko", name);
+	return 0;
+}
+
+static void
+emitattrkobjs(FILE *fp)
+{
+	extern struct	hashtab *attrtab;
+
+	ht_enumerate(attrtab, emitattrkobjscb, fp);
+}
+
+static int
+emitattrkobjscb(const char *name, void *v, void *arg)
+{
+	struct attr *a = v;
+	struct files *fi;
+	FILE *fp = arg;
+
+	if (ht_lookup(selecttab, name) == NULL)
+		return 0;
+	if (TAILQ_EMPTY(&a->a_files))
+		return 0;
+	fputc('\n', fp);
+	fprintf(fp, "OBJS.%s=", name);
+	TAILQ_FOREACH(fi, &a->a_files, fi_anext) {
+		fprintf(fp, " %s.o", fi->fi_base);
+	}
+	fputc('\n', fp);
+	fprintf(fp, "%s.ko: ${OBJS.%s}\n", name, name);
+	fprintf(fp, "\t${LINK_O}\n");
+	return 0;
+}
+
+static void
 emitcfiles(FILE *fp)
 {
 



CVS commit: src/sys/conf

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 16:35:57 UTC 2014

Modified Files:
src/sys/conf: Makefile.kern.inc

Log Message:
Define a command to generate relocatable objects using ld -r.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/conf/Makefile.kern.inc

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.174 src/sys/conf/Makefile.kern.inc:1.175
--- src/sys/conf/Makefile.kern.inc:1.174	Sat Sep 20 19:22:09 2014
+++ src/sys/conf/Makefile.kern.inc	Thu Oct  9 16:35:57 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.174 2014/09/20 19:22:09 matt Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.175 2014/10/09 16:35:57 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -156,6 +156,12 @@ NORMAL_S?=	@${_MKSHMSG} "compile  ${.CUR
 		${_MKSHECHO}\
 		${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${CPPFLAGS} -c $< && \
 		${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${CPPFLAGS} -c $<
+ 
+# link rules: 
+LINK_O?=	@${_MKSHMSG} "   link ${.CURDIR:T}/${.TARGET}" && \
+		${_MKSHECHO}\
+		${LD} -r -o ${.TARGET} ${.ALLSRC} && \
+		${LD} -r -o ${.TARGET} ${.ALLSRC}
 
 ##
 ## (3) libkern and compat



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 16:08:36 UTC 2014

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

Log Message:
Always select the fallback allattr.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/config/main.c
cvs rdiff -u -r1.46 -r1.47 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.56 src/usr.bin/config/main.c:1.57
--- src/usr.bin/config/main.c:1.56	Thu Oct  9 06:49:53 2014
+++ src/usr.bin/config/main.c	Thu Oct  9 16:08:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.56 2014/10/09 06:49:53 uebayasi Exp $	*/
+/*	$NetBSD: main.c,v 1.57 2014/10/09 16:08:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -283,8 +283,6 @@ main(int argc, char **argv)
 	minmaxusers = 1;
 	maxmaxusers = 1;
 	initintern();
-	initfiles();
-	initsem();
 	ident = NULL;
 	devbasetab = ht_new();
 	devroottab = ht_new();
@@ -312,6 +310,8 @@ main(int argc, char **argv)
 	nextappmkopt = &appmkoptions;
 	nextcndmkopt = &condmkoptions;
 	nextfsopt = &fsoptions;
+	initfiles();
+	initsem();
 
 	/*
 	 * Handle profiling (must do this before we try to create any

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.46 src/usr.bin/config/sem.c:1.47
--- src/usr.bin/config/sem.c:1.46	Thu Oct  9 15:25:26 2014
+++ src/usr.bin/config/sem.c	Thu Oct  9 16:08:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.46 2014/10/09 15:25:26 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.47 2014/10/09 16:08:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -100,6 +100,7 @@ initsem(void)
 	allattr.a_name = "netbsd";
 	TAILQ_INIT(&allattr.a_files);
 	(void)ht_insert(attrtab, allattr.a_name, &allattr);
+	selectattr(&allattr);
 
 	errattr.a_name = "";
 



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 15:25:26 UTC 2014

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

Log Message:
Define an implicit attribute "netbsd" internally to collect files that don't
belong to any specific attribute.

Eventually, all operations doing "foreach (files)" can be rewritten as "foreach
(attributes) foreach (files)".


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/config/defs.h
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/config/files.c
cvs rdiff -u -r1.45 -r1.46 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/defs.h
diff -u src/usr.bin/config/defs.h:1.49 src/usr.bin/config/defs.h:1.50
--- src/usr.bin/config/defs.h:1.49	Thu Oct  9 10:29:36 2014
+++ src/usr.bin/config/defs.h	Thu Oct  9 15:25:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.49 2014/10/09 10:29:36 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.50 2014/10/09 15:25:26 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -507,6 +507,7 @@ SLIST_HEAD(, prefix)	prefixes,	/* prefix
 			allprefixes;	/* all prefixes used (after popped) */
 SLIST_HEAD(, prefix)	curdirs;	/* curdir stack */
 
+extern struct attr allattr;
 struct	devi **packed;		/* arrayified table for packed devi's */
 size_t	npacked;		/* size of packed table, <= ndevi */
 

Index: src/usr.bin/config/files.c
diff -u src/usr.bin/config/files.c:1.14 src/usr.bin/config/files.c:1.15
--- src/usr.bin/config/files.c:1.14	Thu Oct  9 10:29:36 2014
+++ src/usr.bin/config/files.c	Thu Oct  9 15:25:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: files.c,v 1.14 2014/10/09 10:29:36 uebayasi Exp $	*/
+/*	$NetBSD: files.c,v 1.15 2014/10/09 15:25:26 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -203,9 +203,11 @@ addfiletoattr(const char *name, struct f
 	struct attr *a;
 
 	a = ht_lookup(attrtab, name);
-	if (a != NULL) {
-		TAILQ_INSERT_TAIL(&a->a_files, fi, fi_anext);
+	if (a == NULL) {
+		CFGDBG(1, "attr `%s' not found", name);
+	} else {
 		fi->fi_attr = a;
+		TAILQ_INSERT_TAIL(&a->a_files, fi, fi_anext);
 	}
 }
 
@@ -314,10 +316,14 @@ fixfiles(void)
 			}
 		}
 		fi->fi_flags |= FI_SEL;
-		CFGDBG(3, "file slected `%s'", fi->fi_path);
-		if (fi->fi_attr != NULL)
-			CFGDBG(3, "file `%s' belongs to attr `%s'", fi->fi_path,
-			fi->fi_attr->a_name);
+		CFGDBG(3, "file selected `%s'", fi->fi_path);
+
+		/* Add other files to the default "netbsd" attribute. */
+		if (fi->fi_attr == NULL) {
+			addfiletoattr(allattr.a_name, fi);
+		}
+		CFGDBG(3, "file `%s' belongs to attr `%s'", fi->fi_path,
+		fi->fi_attr->a_name);
 	}
 	return (err);
 }

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.45 src/usr.bin/config/sem.c:1.46
--- src/usr.bin/config/sem.c:1.45	Thu Oct  9 10:29:36 2014
+++ src/usr.bin/config/sem.c	Thu Oct  9 15:25:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.45 2014/10/09 10:29:36 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.46 2014/10/09 15:25:26 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -65,6 +65,7 @@ const char *s_none;
 
 static struct hashtab *cfhashtab;	/* for config lookup */
 struct hashtab *devitab;		/* etc */
+struct attr allattr;
 
 static struct attr errattr;
 static struct devbase errdev;
@@ -95,6 +96,11 @@ initsem(void)
 {
 
 	attrtab = ht_new();
+
+	allattr.a_name = "netbsd";
+	TAILQ_INIT(&allattr.a_files);
+	(void)ht_insert(attrtab, allattr.a_name, &allattr);
+
 	errattr.a_name = "";
 
 	TAILQ_INIT(&allbases);



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 10:29:36 UTC 2014

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

Log Message:
If a file is marked by an atom expression, like "file a.c foo", and if the
specified expression is an attribute, mark the file as belonging to the
attribute.

At this moment this information is not used for any purpose, but can be
traced by config -ddd.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/config/defs.h
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/config/files.c
cvs rdiff -u -r1.44 -r1.45 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/defs.h
diff -u src/usr.bin/config/defs.h:1.48 src/usr.bin/config/defs.h:1.49
--- src/usr.bin/config/defs.h:1.48	Thu Oct  9 07:43:55 2014
+++ src/usr.bin/config/defs.h	Thu Oct  9 10:29:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.48 2014/10/09 07:43:55 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.49 2014/10/09 10:29:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -174,6 +174,7 @@ struct attr {
 	struct	nvlist *a_refs;		/* parents */
 	struct	attrlist *a_deps;	/* we depend on these other attrs */
 	int	a_expanding;		/* to detect cycles in attr graph */
+	TAILQ_HEAD(, files) a_files;	/* files in this attr */
 };
 
 /*
@@ -319,6 +320,8 @@ struct filetype
 	char	fit_lastc;	/* last char from path */
 	const char *fit_path;	/* full file path */
 	const char *fit_prefix;	/* any file prefix */
+	struct attr *fit_attr;	/* owner attr */
+	TAILQ_ENTRY(files) fit_anext;	/* next file in attr */
 };
 /* Anything less than 0x10 is sub-type specific */
 #define FIT_NOPROLOGUE  0x10/* Don't prepend $S/ */
@@ -350,6 +353,8 @@ struct files {
 #define fi_lastc   fi_fit.fit_lastc
 #define fi_pathfi_fit.fit_path
 #define fi_prefix  fi_fit.fit_prefix
+#define fi_attrfi_fit.fit_attr
+#define fi_anext   fi_fit.fit_anext
 
 /* flags */
 #define	FI_SEL		0x01	/* selected */

Index: src/usr.bin/config/files.c
diff -u src/usr.bin/config/files.c:1.13 src/usr.bin/config/files.c:1.14
--- src/usr.bin/config/files.c:1.13	Thu Oct  9 06:49:53 2014
+++ src/usr.bin/config/files.c	Thu Oct  9 10:29:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: files.c,v 1.13 2014/10/09 06:49:53 uebayasi Exp $	*/
+/*	$NetBSD: files.c,v 1.14 2014/10/09 10:29:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -65,6 +65,7 @@ static struct hashtab *pathtab;		/* full
 
 static struct files **unchecked;
 
+static void	addfiletoattr(const char *, struct files *);
 static int	checkaux(const char *, void *);
 static int	fixcount(const char *, void *);
 static int	fixfsel(const char *, void *);
@@ -157,6 +158,7 @@ addfile(const char *path, struct condexp
 	fi->fi_optx = optx;
 	fi->fi_optf = NULL;
 	fi->fi_mkrule = rule;
+	fi->fi_attr = NULL;
 	TAILQ_INSERT_TAIL(&allfiles, fi, fi_next);
 	return;
  bad:
@@ -195,6 +197,18 @@ addobject(const char *path, struct conde
 	return;
 } 
 
+static void
+addfiletoattr(const char *name, struct files *fi)
+{
+	struct attr *a;
+
+	a = ht_lookup(attrtab, name);
+	if (a != NULL) {
+		TAILQ_INSERT_TAIL(&a->a_files, fi, fi_anext);
+		fi->fi_attr = a;
+	}
+}
+
 /*
  * We have finished reading some "files" file, either ../../conf/files
  * or ./files.$machine.  Make sure that everything that is flagged as
@@ -260,6 +274,9 @@ fixfiles(void)
 			/* include it */ ;
 		}
 		else if (fi->fi_optx != NULL) {
+			if (fi->fi_optx->cx_type == CX_ATOM) {
+addfiletoattr(fi->fi_optx->cx_u.atom, fi);
+			}
 			flathead = NULL;
 			flatp = &flathead;
 			sel = expr_eval(fi->fi_optx,
@@ -298,6 +315,9 @@ fixfiles(void)
 		}
 		fi->fi_flags |= FI_SEL;
 		CFGDBG(3, "file slected `%s'", fi->fi_path);
+		if (fi->fi_attr != NULL)
+			CFGDBG(3, "file `%s' belongs to attr `%s'", fi->fi_path,
+			fi->fi_attr->a_name);
 	}
 	return (err);
 }

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.44 src/usr.bin/config/sem.c:1.45
--- src/usr.bin/config/sem.c:1.44	Thu Oct  9 06:49:53 2014
+++ src/usr.bin/config/sem.c	Thu Oct  9 10:29:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.44 2014/10/09 06:49:53 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.45 2014/10/09 10:29:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -269,6 +269,7 @@ defattr(const char *name, struct loclist
 	a->a_refs = NULL;
 	a->a_deps = deps;
 	a->a_expanding = 0;
+	TAILQ_INIT(&a->a_files);
 
 	/* Expand the attribute to check for cycles in the graph. */
 	expandattr(a, NULL);



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 09:39:24 UTC 2014

Modified Files:
src/usr.bin/config: gram.y

Log Message:
Sort definition/selection rules to clarify which is which.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/config/gram.y

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/gram.y
diff -u src/usr.bin/config/gram.y:1.40 src/usr.bin/config/gram.y:1.41
--- src/usr.bin/config/gram.y:1.40	Thu Oct  9 07:05:01 2014
+++ src/usr.bin/config/gram.y	Thu Oct  9 09:39:24 2014
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: gram.y,v 1.40 2014/10/09 07:05:01 uebayasi Exp $	*/
+/*	$NetBSD: gram.y,v 1.41 2014/10/09 09:39:24 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -307,44 +307,132 @@ definitions:
 
 /* A single definition. */
 definition:
-	  file
-	| object
-	| device_major			{ do_devsw = 1; }
-	| prefix
-	| DEVCLASS WORD			{ (void)defattr($2, NULL, NULL, 1); }
-	| DEFFS deffses optdepend_list	{ deffilesystem($2, $3); }
-	| DEFINE WORD interface_opt depend_list
+	  define_file
+	| define_object
+	| define_device_major
+	| define_prefix
+	| define_devclass
+	| define_filesystems
+	| define_attribute
+	| define_option
+	| define_flag
+	| define_obsolete_flag
+	| define_param
+	| define_obsolete_param
+	| define_device
+	| define_device_attachment
+	| define_maxpartitions
+	| define_maxusers
+	| define_makeoptions
+	| define_pseudo
+	| define_pseudodev
+	| define_major
+	| define_version
+;
+
+/* source file: file foo/bar.c bar|baz needs-flag compile-with blah */
+define_file:
+	XFILE filename fopts fflags rule	{ addfile($2, $3, $4, $5); }
+;
+
+/* object file: object zot.o foo|zot needs-flag */
+define_object:
+	XOBJECT filename fopts oflags	{ addobject($2, $3, $4); }
+;
+
+/* device major declaration */
+define_device_major:
+	DEVICE_MAJOR WORD device_major_char device_major_block fopts devnodes
+	{
+		adddevm($2, $3, $4, $5, $6);
+		do_devsw = 1;
+	}
+;
+
+/* prefix delimiter */
+define_prefix:
+	  PREFIX filename		{ prefix_push($2); }
+	| PREFIX			{ prefix_pop(); }
+;
+
+define_devclass:
+	DEVCLASS WORD			{ (void)defattr($2, NULL, NULL, 1); }
+;
+
+define_filesystems:
+	DEFFS deffses optdepend_list	{ deffilesystem($2, $3); }
+;
+
+define_attribute:
+	DEFINE WORD interface_opt depend_list
 	{ (void)defattr($2, $3, $4, 0); }
-	| DEFOPT optfile_opt defopts optdepend_list
+;
+
+define_option:
+	DEFOPT optfile_opt defopts optdepend_list
 	{ defoption($2, $3, $4); }
-	| DEFFLAG optfile_opt defopts optdepend_list
+;
+
+define_flag:
+	DEFFLAG optfile_opt defopts optdepend_list
 	{ defflag($2, $3, $4, 0); }
-	| OBSOLETE DEFFLAG optfile_opt defopts
+;
+
+define_obsolete_flag:
+	OBSOLETE DEFFLAG optfile_opt defopts
 	{ defflag($3, $4, NULL, 1); }
-	| DEFPARAM optfile_opt defopts optdepend_list
+;
+
+define_param:
+	DEFPARAM optfile_opt defopts optdepend_list
 	{ defparam($2, $3, $4, 0); }
-	| OBSOLETE DEFPARAM optfile_opt defopts
+;
+
+define_obsolete_param:
+	OBSOLETE DEFPARAM optfile_opt defopts
 	{ defparam($3, $4, NULL, 1); }
-	| DEVICE devbase interface_opt depend_list
+;
+
+define_device:
+	DEVICE devbase interface_opt depend_list
 	{ defdev($2, $3, $4, 0); }
-	| ATTACH devbase AT atlist devattach_opt depend_list
+;
+
+define_device_attachment:
+	ATTACH devbase AT atlist devattach_opt depend_list
 	{ defdevattach($5, $2, $4, $6); }
-	| MAXPARTITIONS NUMBER		{ maxpartitions = $2.val; }
-	| MAXUSERS NUMBER NUMBER NUMBER
-{ setdefmaxusers($2.val, $3.val, $4.val); }
-	| MAKEOPTIONS condmkopt_list
+;
+
+define_maxpartitions:
+	MAXPARTITIONS NUMBER		{ maxpartitions = $2.val; }
+;
+
+define_maxusers:
+	MAXUSERS NUMBER NUMBER NUMBER
+	{ setdefmaxusers($2.val, $3.val, $4.val); }
+;
+
+define_makeoptions:
+	MAKEOPTIONS condmkopt_list
+;
+
+define_pseudo:
 	/* interface_opt in DEFPSEUDO is for backwards compatibility */
-	| DEFPSEUDO devbase interface_opt depend_list
+	DEFPSEUDO devbase interface_opt depend_list
 	{ defdev($2, $3, $4, 1); }
-	| DEFPSEUDODEV devbase interface_opt depend_list
+;
+
+define_pseudodev:
+	DEFPSEUDODEV devbase interface_opt depend_list
 	{ defdev($2, $3, $4, 2); }
-	| MAJOR '{' majorlist '}'
-	| VERSION NUMBER		{ setversion($2.val); }
 ;
 
-/* source file: file foo/bar.c bar|baz needs-flag compile-with blah */
-file:
-	XFILE filename fopts fflags rule	{ addfile($2, $3, $4, $5); }
+define_major:
+	MAJOR '{' majorlist '}'
+;
+
+define_version:
+	VERSION NUMBER		{ setversion($2.val); }
 ;
 
 /* file options: optional expression of conditions */
@@ -371,11 +459,6 @@ rule:
 	| COMPILE_WITH stringvalue	{ $$ = $2; }
 ;
 
-/* object file: object zot.o foo|zot needs-flag */
-object:
-	XOBJECT filename fopts oflags	{ addobject($2, $3, $4); }
-;
-
 /* zero or more flags for an object file */
 oflags:
 	  /* empty */			{ $$ = 0; }
@@ -387,12 +470,6 @@ oflag:
 	NEEDS_FLAG			{ $$ = OI_NE

CVS commit: src/usr.bin/config

2014-10-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct  9 07:43:55 UTC 2014

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

Log Message:
Provide a CFGDBG version for the tools build.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/config/defs.h

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.47 src/usr.bin/config/defs.h:1.48
--- src/usr.bin/config/defs.h:1.47	Thu Oct  9 06:45:31 2014
+++ src/usr.bin/config/defs.h	Thu Oct  9 07:43:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.47 2014/10/09 06:45:31 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.48 2014/10/09 07:43:55 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -628,6 +628,8 @@ extern	int dflag;
 	do { if ((dflag) >= (n)) cfgdbg(__VA_ARGS__); } while (0)
 void	cfgdbg(const char *, ...)			/* debug info */
  __printflike(1, 2);
+#else
+#define	CFGDBG(n, ...) /* */
 #endif
 void	cfgwarn(const char *, ...)			/* immediate warns */
  __printflike(1, 2);



CVS commit: src/usr.bin/config

2014-10-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct  9 07:05:01 UTC 2014

Modified Files:
src/usr.bin/config: gram.y

Log Message:
The word "configuration" is too ambiguous; use "selection" meaning that
user selects some of provided "definitions".


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/config/gram.y

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/gram.y
diff -u src/usr.bin/config/gram.y:1.39 src/usr.bin/config/gram.y:1.40
--- src/usr.bin/config/gram.y:1.39	Thu May 29 07:47:45 2014
+++ src/usr.bin/config/gram.y	Thu Oct  9 07:05:01 2014
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: gram.y,v 1.39 2014/05/29 07:47:45 mrg Exp $	*/
+/*	$NetBSD: gram.y,v 1.40 2014/10/09 07:05:01 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -223,7 +223,7 @@ static struct loclist *namelocvals(const
 %%
 
 /*
- * A complete configuration consists of both the configuration part (a
+ * A complete configuration consists of both the selection part (a
  * kernel config such as GENERIC or SKYNET, plus also the various
  * std.* files), which selects the material to be in the kernel, and
  * also the definition part (files, files.*, etc.) that declares what
@@ -254,7 +254,7 @@ static struct loclist *namelocvals(const
 
 /* Complete configuration. */
 configuration:
-	topthings machine_spec definition_part configuration_part
+	topthings machine_spec definition_part selection_part
 ;
 
 /* Sequence of zero or more topthings. */
@@ -600,24 +600,24 @@ majordef:
 //
 
 /*
- * The configuration grammar.
+ * The selection grammar.
  */
 
-/* Complete configuration part: all std.* files plus selected config. */
-configuration_part:
-	config_items
+/* Complete selection part: all std.* files plus selected config. */
+selection_part:
+	selections
 ;
 
 /* Zero or more config items. Trap errors. */
-config_items:
+selections:
 	  /* empty */
-	| config_items '\n'
-	| config_items config_item '\n'	{ wrap_continue(); }
-	| config_items error '\n'	{ wrap_cleanup(); }
+	| selections '\n'
+	| selections selection '\n'	{ wrap_continue(); }
+	| selections error '\n'	{ wrap_cleanup(); }
 ;
 
 /* One config item. */
-config_item:
+selection:
 	  definition
 	| NO FILE_SYSTEM no_fs_list
 	| FILE_SYSTEM fs_list