CVS commit: src
Module Name:src Committed By: uebayasi Date: Sat Aug 29 07:33:18 UTC 2015 Modified Files: src/sys/conf: Makefile.kern.inc files src/sys/sys: param.h src/usr.bin/config: defs.h mkmakefile.c Log Message: Revert MAXUSERS changes. Need fresh air. To generate a diff of this commit: cvs rdiff -u -r1.201 -r1.202 src/sys/conf/Makefile.kern.inc cvs rdiff -u -r1.1137 -r1.1138 src/sys/conf/files cvs rdiff -u -r1.484 -r1.485 src/sys/sys/param.h cvs rdiff -u -r1.68 -r1.69 src/usr.bin/config/defs.h cvs rdiff -u -r1.43 -r1.44 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/sys/conf/Makefile.kern.inc diff -u src/sys/conf/Makefile.kern.inc:1.201 src/sys/conf/Makefile.kern.inc:1.202 --- src/sys/conf/Makefile.kern.inc:1.201 Sat Aug 29 07:08:38 2015 +++ src/sys/conf/Makefile.kern.inc Sat Aug 29 07:33:18 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.201 2015/08/29 07:08:38 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.202 2015/08/29 07:33:18 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -62,7 +62,7 @@ S!= cd ../../../..; pwd ## INCLUDES?= -I. ${EXTRA_INCLUDES} -I${S}/../common/include -I$S/arch \ -I$S -nostdinc -CPPFLAGS+= ${INCLUDES} ${IDENT} -D_KERNEL -D_KERNEL_OPT +CPPFLAGS+= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT CPPFLAGS+= -std=gnu99 DEFCOPTS?= -O2 COPTS?= ${DEFCOPTS} Index: src/sys/conf/files diff -u src/sys/conf/files:1.1137 src/sys/conf/files:1.1138 --- src/sys/conf/files:1.1137 Sat Aug 29 07:08:38 2015 +++ src/sys/conf/files Sat Aug 29 07:33:18 2015 @@ -1,7 +1,7 @@ -# $NetBSD: files,v 1.1137 2015/08/29 07:08:38 uebayasi Exp $ +# $NetBSD: files,v 1.1138 2015/08/29 07:33:18 uebayasi Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 -version 20150829 +version 20150820 # # device classes @@ -17,7 +17,6 @@ devclass bus # options understood by the machine-independent part of the kernel # (note, these are case-sensitive) # -defparam opt_param.h MAXUSERS defflagINSECURE defflagKMEMSTATS defflagKTRACE Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.484 src/sys/sys/param.h:1.485 --- src/sys/sys/param.h:1.484 Sat Aug 29 07:08:38 2015 +++ src/sys/sys/param.h Sat Aug 29 07:33:18 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.484 2015/08/29 07:08:38 uebayasi Exp $ */ +/* $NetBSD: param.h,v 1.485 2015/08/29 07:33:18 uebayasi Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -39,10 +39,6 @@ #ifndef _SYS_PARAM_H_ #define _SYS_PARAM_H_ -#ifdef _KERNEL_OPT -#include opt_param.h -#endif - /* * Historic BSD #defines -- probably will remain untouched for all time. */ Index: src/usr.bin/config/defs.h diff -u src/usr.bin/config/defs.h:1.68 src/usr.bin/config/defs.h:1.69 --- src/usr.bin/config/defs.h:1.68 Sat Aug 29 07:08:38 2015 +++ src/usr.bin/config/defs.h Sat Aug 29 07:33:18 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.68 2015/08/29 07:08:38 uebayasi Exp $ */ +/* $NetBSD: defs.h,v 1.69 2015/08/29 07:33:18 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -107,7 +107,7 @@ extern const char *progname; * The next two lines define the current version of the config(1) binary, * and the minimum version of the configuration files it supports. */ -#define CONFIG_VERSION 20150829 +#define CONFIG_VERSION 20150820 #define CONFIG_MINVERSION 0 /* Index: src/usr.bin/config/mkmakefile.c diff -u src/usr.bin/config/mkmakefile.c:1.43 src/usr.bin/config/mkmakefile.c:1.44 --- src/usr.bin/config/mkmakefile.c:1.43 Sat Aug 29 07:08:38 2015 +++ src/usr.bin/config/mkmakefile.c Sat Aug 29 07:33:18 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: mkmakefile.c,v 1.43 2015/08/29 07:08:38 uebayasi Exp $ */ +/* $NetBSD: mkmakefile.c,v 1.44 2015/08/29 07:33:18 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include sys/cdefs.h -__RCSID($NetBSD: mkmakefile.c,v 1.43 2015/08/29 07:08:38 uebayasi Exp $); +__RCSID($NetBSD: mkmakefile.c,v 1.44 2015/08/29 07:33:18 uebayasi Exp $); #include sys/param.h #include ctype.h @@ -276,6 +276,7 @@ emitdefs(FILE *fp) s ? \ : ); } putc('\n', fp); + fprintf(fp, PARAM=-DMAXUSERS=%d\n, maxusers); fprintf(fp, MACHINE=%s\n, machine); const char *subdir = ;
CVS commit: src
Module Name:src Committed By: uebayasi Date: Sat Aug 29 07:08:38 UTC 2015 Modified Files: src/sys/conf: Makefile.kern.inc files src/sys/sys: param.h src/usr.bin/config: defs.h mkmakefile.c sem.c Log Message: Define MAXUXERS in opt_param.h. Bump config(1) version. To generate a diff of this commit: cvs rdiff -u -r1.200 -r1.201 src/sys/conf/Makefile.kern.inc cvs rdiff -u -r1.1136 -r1.1137 src/sys/conf/files cvs rdiff -u -r1.483 -r1.484 src/sys/sys/param.h cvs rdiff -u -r1.67 -r1.68 src/usr.bin/config/defs.h cvs rdiff -u -r1.42 -r1.43 src/usr.bin/config/mkmakefile.c cvs rdiff -u -r1.71 -r1.72 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/sys/conf/Makefile.kern.inc diff -u src/sys/conf/Makefile.kern.inc:1.200 src/sys/conf/Makefile.kern.inc:1.201 --- src/sys/conf/Makefile.kern.inc:1.200 Sat Aug 29 05:03:36 2015 +++ src/sys/conf/Makefile.kern.inc Sat Aug 29 07:08:38 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.200 2015/08/29 05:03:36 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.201 2015/08/29 07:08:38 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -62,7 +62,7 @@ S!= cd ../../../..; pwd ## INCLUDES?= -I. ${EXTRA_INCLUDES} -I${S}/../common/include -I$S/arch \ -I$S -nostdinc -CPPFLAGS+= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT +CPPFLAGS+= ${INCLUDES} ${IDENT} -D_KERNEL -D_KERNEL_OPT CPPFLAGS+= -std=gnu99 DEFCOPTS?= -O2 COPTS?= ${DEFCOPTS} Index: src/sys/conf/files diff -u src/sys/conf/files:1.1136 src/sys/conf/files:1.1137 --- src/sys/conf/files:1.1136 Fri Aug 21 07:19:39 2015 +++ src/sys/conf/files Sat Aug 29 07:08:38 2015 @@ -1,7 +1,7 @@ -# $NetBSD: files,v 1.1136 2015/08/21 07:19:39 uebayasi Exp $ +# $NetBSD: files,v 1.1137 2015/08/29 07:08:38 uebayasi Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 -version 20150820 +version 20150829 # # device classes @@ -17,6 +17,7 @@ devclass bus # options understood by the machine-independent part of the kernel # (note, these are case-sensitive) # +defparam opt_param.h MAXUSERS defflagINSECURE defflagKMEMSTATS defflagKTRACE Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.483 src/sys/sys/param.h:1.484 --- src/sys/sys/param.h:1.483 Sun Aug 16 18:00:03 2015 +++ src/sys/sys/param.h Sat Aug 29 07:08:38 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.483 2015/08/16 18:00:03 mlelstv Exp $ */ +/* $NetBSD: param.h,v 1.484 2015/08/29 07:08:38 uebayasi Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -39,6 +39,10 @@ #ifndef _SYS_PARAM_H_ #define _SYS_PARAM_H_ +#ifdef _KERNEL_OPT +#include opt_param.h +#endif + /* * Historic BSD #defines -- probably will remain untouched for all time. */ Index: src/usr.bin/config/defs.h diff -u src/usr.bin/config/defs.h:1.67 src/usr.bin/config/defs.h:1.68 --- src/usr.bin/config/defs.h:1.67 Sat Aug 29 02:54:07 2015 +++ src/usr.bin/config/defs.h Sat Aug 29 07:08:38 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.67 2015/08/29 02:54:07 uebayasi Exp $ */ +/* $NetBSD: defs.h,v 1.68 2015/08/29 07:08:38 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -107,7 +107,7 @@ extern const char *progname; * The next two lines define the current version of the config(1) binary, * and the minimum version of the configuration files it supports. */ -#define CONFIG_VERSION 20150820 +#define CONFIG_VERSION 20150829 #define CONFIG_MINVERSION 0 /* Index: src/usr.bin/config/mkmakefile.c diff -u src/usr.bin/config/mkmakefile.c:1.42 src/usr.bin/config/mkmakefile.c:1.43 --- src/usr.bin/config/mkmakefile.c:1.42 Sat Aug 29 02:54:07 2015 +++ src/usr.bin/config/mkmakefile.c Sat Aug 29 07:08:38 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: mkmakefile.c,v 1.42 2015/08/29 02:54:07 uebayasi Exp $ */ +/* $NetBSD: mkmakefile.c,v 1.43 2015/08/29 07:08:38 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include sys/cdefs.h -__RCSID($NetBSD: mkmakefile.c,v 1.42 2015/08/29 02:54:07 uebayasi Exp $); +__RCSID($NetBSD: mkmakefile.c,v 1.43 2015/08/29 07:08:38 uebayasi Exp $); #include sys/param.h #include ctype.h @@ -276,7 +276,6 @@ emitdefs(FILE *fp) s ? \ : ); } putc('\n', fp); - fprintf(fp, PARAM=-DMAXUSERS=%d\n, maxusers); fprintf(fp, MACHINE=%s\n, machine); const char *subdir = ; Index: src/usr.bin/config/sem.c diff -u src/usr.bin/config/sem.c:1.71 src/usr.bin/config/sem.c:1.72 --- src/usr.bin/config/sem.c:1.71 Fri Nov 21 20:46:56 2014 +++ src/usr.bin/config/sem.c Sat Aug 29 07:08:38 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sem.c,v 1.71 2014/11/21 20:46:56 christos Exp $ */ +/* $NetBSD: sem.c,v 1.72 2015/08/29 07:08:38 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include sys/cdefs.h -__RCSID($NetBSD: sem.c,v 1.71 2014/11/21 20:46
CVS commit: src/usr.bin/config
Module Name:src Committed By: uebayasi Date: Sat Aug 29 07:24:49 UTC 2015 Modified Files: src/usr.bin/config: main.c sem.c Log Message: Fix previous. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/usr.bin/config/main.c cvs rdiff -u -r1.72 -r1.73 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.77 src/usr.bin/config/main.c:1.78 --- src/usr.bin/config/main.c:1.77 Fri Aug 28 03:55:15 2015 +++ src/usr.bin/config/main.c Sat Aug 29 07:24:49 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.77 2015/08/28 03:55:15 uebayasi Exp $ */ +/* $NetBSD: main.c,v 1.78 2015/08/29 07:24:49 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include sys/cdefs.h -__RCSID($NetBSD: main.c,v 1.77 2015/08/28 03:55:15 uebayasi Exp $); +__RCSID($NetBSD: main.c,v 1.78 2015/08/29 07:24:49 uebayasi Exp $); #ifndef MAKE_BOOTSTRAP #include sys/cdefs.h @@ -429,6 +429,13 @@ main(int argc, char **argv) stop(); /* + * Fix maxusers. + */ + char buf[32]; + snprintf(buf, sizeof(buf), %d, maxusers); + addoption(intern(MAXUSERS), intern(buf)); + + /* * If working on an ioconf-only config, process here and exit */ if (ioconfname) { Index: src/usr.bin/config/sem.c diff -u src/usr.bin/config/sem.c:1.72 src/usr.bin/config/sem.c:1.73 --- src/usr.bin/config/sem.c:1.72 Sat Aug 29 07:08:38 2015 +++ src/usr.bin/config/sem.c Sat Aug 29 07:24:49 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sem.c,v 1.72 2015/08/29 07:08:38 uebayasi Exp $ */ +/* $NetBSD: sem.c,v 1.73 2015/08/29 07:24:49 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include sys/cdefs.h -__RCSID($NetBSD: sem.c,v 1.72 2015/08/29 07:08:38 uebayasi Exp $); +__RCSID($NetBSD: sem.c,v 1.73 2015/08/29 07:24:49 uebayasi Exp $); #include sys/param.h #include ctype.h @@ -239,7 +239,6 @@ setdefmaxusers(int min, int def, int max void setmaxusers(int n) { - char buf[32]; if (maxusers == n) { cfgerror(duplicate maxusers parameter); @@ -257,8 +256,6 @@ setmaxusers(int n) cfgerror(warning: maxusers (%d) %d, n, maxmaxusers); errors--; } - snprintf(buf, sizeof(buf), %d, maxusers); - addoption(MAXUSERS, buf); } void
CVS commit: src/sys/kern
Module Name:src Committed By: maxv Date: Sat Aug 29 12:24:00 UTC 2015 Modified Files: src/sys/kern: kern_cpu.c Log Message: Don't decrement the number of offline cpus if we fail to shut down one. ok christos@, via tech-kern@ To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/kern/kern_cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_cpu.c diff -u src/sys/kern/kern_cpu.c:1.70 src/sys/kern/kern_cpu.c:1.71 --- src/sys/kern/kern_cpu.c:1.70 Thu Aug 20 09:45:45 2015 +++ src/sys/kern/kern_cpu.c Sat Aug 29 12:24:00 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_cpu.c,v 1.70 2015/08/20 09:45:45 christos Exp $ */ +/* $NetBSD: kern_cpu.c,v 1.71 2015/08/29 12:24:00 maxv Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2010, 2012 The NetBSD Foundation, Inc. @@ -56,7 +56,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kern_cpu.c,v 1.70 2015/08/20 09:45:45 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: kern_cpu.c,v 1.71 2015/08/29 12:24:00 maxv Exp $); #include opt_cpu_ucode.h #include opt_compat_netbsd.h @@ -444,7 +444,6 @@ cpu_setstate(struct cpu_info *ci, bool o if ((spc-spc_flags SPCF_OFFLINE) == 0) return 0; func = (xcfunc_t)cpu_xc_online; - ncpuonline++; } else { if ((spc-spc_flags SPCF_OFFLINE) != 0) return 0; @@ -463,16 +462,19 @@ cpu_setstate(struct cpu_info *ci, bool o if (nonline == 1) return EBUSY; func = (xcfunc_t)cpu_xc_offline; - ncpuonline--; } where = xc_unicast(0, func, ci, NULL, ci); xc_wait(where); if (online) { KASSERT((spc-spc_flags SPCF_OFFLINE) == 0); - } else if ((spc-spc_flags SPCF_OFFLINE) == 0) { - /* If was not set offline, then it is busy */ - return EBUSY; + ncpuonline++; + } else { + if ((spc-spc_flags SPCF_OFFLINE) == 0) { + /* If was not set offline, then it is busy */ + return EBUSY; + } + ncpuonline--; } spc-spc_lastmod = time_second;
CVS commit: src/usr.bin/config
Module Name:src Committed By: uebayasi Date: Sat Aug 29 13:34:21 UTC 2015 Modified Files: src/usr.bin/config: main.c Log Message: Revert MAXUSERS. CVS is hard. To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 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.78 src/usr.bin/config/main.c:1.79 --- src/usr.bin/config/main.c:1.78 Sat Aug 29 07:24:49 2015 +++ src/usr.bin/config/main.c Sat Aug 29 13:34:21 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.78 2015/08/29 07:24:49 uebayasi Exp $ */ +/* $NetBSD: main.c,v 1.79 2015/08/29 13:34:21 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include sys/cdefs.h -__RCSID($NetBSD: main.c,v 1.78 2015/08/29 07:24:49 uebayasi Exp $); +__RCSID($NetBSD: main.c,v 1.79 2015/08/29 13:34:21 uebayasi Exp $); #ifndef MAKE_BOOTSTRAP #include sys/cdefs.h @@ -429,13 +429,6 @@ main(int argc, char **argv) stop(); /* - * Fix maxusers. - */ - char buf[32]; - snprintf(buf, sizeof(buf), %d, maxusers); - addoption(intern(MAXUSERS), intern(buf)); - - /* * If working on an ioconf-only config, process here and exit */ if (ioconfname) {
CVS commit: src
Module Name:src Committed By: uebayasi Date: Sat Aug 29 14:07:46 UTC 2015 Modified Files: src/sys/conf: Makefile.kern.inc files src/sys/sys: param.h src/usr.bin/config: defs.h gram.y mkmakefile.c Log Message: Convert MAXUSERS, take 2. Define MAXUSERS in opt_param.h and include it from sys/param.h, for more accurate dependency. Don't define -DMAXUSERS and add it to ${CPPFLAGS}. config(5)'s maxusers syntax doesn't change. (The version just before revert was OK, but I had something bad in my obj dirs.) To generate a diff of this commit: cvs rdiff -u -r1.202 -r1.203 src/sys/conf/Makefile.kern.inc cvs rdiff -u -r1.1138 -r1.1139 src/sys/conf/files cvs rdiff -u -r1.485 -r1.486 src/sys/sys/param.h cvs rdiff -u -r1.69 -r1.70 src/usr.bin/config/defs.h cvs rdiff -u -r1.48 -r1.49 src/usr.bin/config/gram.y cvs rdiff -u -r1.44 -r1.45 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/sys/conf/Makefile.kern.inc diff -u src/sys/conf/Makefile.kern.inc:1.202 src/sys/conf/Makefile.kern.inc:1.203 --- src/sys/conf/Makefile.kern.inc:1.202 Sat Aug 29 07:33:18 2015 +++ src/sys/conf/Makefile.kern.inc Sat Aug 29 14:07:45 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.202 2015/08/29 07:33:18 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.203 2015/08/29 14:07:45 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -62,7 +62,7 @@ S!= cd ../../../..; pwd ## INCLUDES?= -I. ${EXTRA_INCLUDES} -I${S}/../common/include -I$S/arch \ -I$S -nostdinc -CPPFLAGS+= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT +CPPFLAGS+= ${INCLUDES} ${IDENT} -D_KERNEL -D_KERNEL_OPT CPPFLAGS+= -std=gnu99 DEFCOPTS?= -O2 COPTS?= ${DEFCOPTS} Index: src/sys/conf/files diff -u src/sys/conf/files:1.1138 src/sys/conf/files:1.1139 --- src/sys/conf/files:1.1138 Sat Aug 29 07:33:18 2015 +++ src/sys/conf/files Sat Aug 29 14:07:45 2015 @@ -1,7 +1,7 @@ -# $NetBSD: files,v 1.1138 2015/08/29 07:33:18 uebayasi Exp $ +# $NetBSD: files,v 1.1139 2015/08/29 14:07:45 uebayasi Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 -version 20150820 +version 20150830 # # device classes @@ -17,6 +17,7 @@ devclass bus # options understood by the machine-independent part of the kernel # (note, these are case-sensitive) # +defparam opt_param.h MAXUSERS defflagINSECURE defflagKMEMSTATS defflagKTRACE Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.485 src/sys/sys/param.h:1.486 --- src/sys/sys/param.h:1.485 Sat Aug 29 07:33:18 2015 +++ src/sys/sys/param.h Sat Aug 29 14:07:45 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.485 2015/08/29 07:33:18 uebayasi Exp $ */ +/* $NetBSD: param.h,v 1.486 2015/08/29 14:07:45 uebayasi Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -39,6 +39,10 @@ #ifndef _SYS_PARAM_H_ #define _SYS_PARAM_H_ +#ifdef _KERNEL_OPT +#include opt_param.h +#endif + /* * Historic BSD #defines -- probably will remain untouched for all time. */ Index: src/usr.bin/config/defs.h diff -u src/usr.bin/config/defs.h:1.69 src/usr.bin/config/defs.h:1.70 --- src/usr.bin/config/defs.h:1.69 Sat Aug 29 07:33:18 2015 +++ src/usr.bin/config/defs.h Sat Aug 29 14:07:45 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.69 2015/08/29 07:33:18 uebayasi Exp $ */ +/* $NetBSD: defs.h,v 1.70 2015/08/29 14:07:45 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -107,7 +107,7 @@ extern const char *progname; * The next two lines define the current version of the config(1) binary, * and the minimum version of the configuration files it supports. */ -#define CONFIG_VERSION 20150820 +#define CONFIG_VERSION 20150830 #define CONFIG_MINVERSION 0 /* Index: src/usr.bin/config/gram.y diff -u src/usr.bin/config/gram.y:1.48 src/usr.bin/config/gram.y:1.49 --- src/usr.bin/config/gram.y:1.48 Sat Aug 29 02:54:07 2015 +++ src/usr.bin/config/gram.y Sat Aug 29 14:07:45 2015 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: gram.y,v 1.48 2015/08/29 02:54:07 uebayasi Exp $ */ +/* $NetBSD: gram.y,v 1.49 2015/08/29 14:07:45 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -42,7 +42,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: gram.y,v 1.48 2015/08/29 02:54:07 uebayasi Exp $); +__RCSID($NetBSD: gram.y,v 1.49 2015/08/29 14:07:45 uebayasi Exp $); #include sys/types.h #include sys/param.h @@ -760,7 +760,13 @@ select_options: ; select_maxusers: - MAXUSERS int32 { setmaxusers($2); } + MAXUSERS int32 { + char str[32]; + + setmaxusers($2); + snprintf(str, sizeof(str), %d, $2); + addoption(intern(MAXUSERS), intern(str)); + } ; select_ident: Index: src/usr.bin/config/mkmakefile.c diff -u src/usr.bin/config/mkmakefile.c:1.44 src/usr.bin/config/mkmakefile.c:1.45 --- src/usr.bin/config/mkmakefile.c:1.44 Sat Aug 29 07:33:18 2015 +++
CVS commit: src/sys/conf
Module Name:src Committed By: uebayasi Date: Sat Aug 29 16:07:07 UTC 2015 Modified Files: src/sys/conf: Makefile.kern.inc Added Files: src/sys/conf: kern.ldscript Log Message: Define two suffix rules, .c - .o and .S - .o, using ${NORMAL_C} and ${NORMAL_S} respectively. Use the .c rule to build devsw.c, ioconf.c, and param.c. Other .c/.S files have explicit rules in the generated `Makefile', and unaffected. To generate a diff of this commit: cvs rdiff -u -r1.208 -r1.209 src/sys/conf/Makefile.kern.inc cvs rdiff -u -r0 -r1.1 src/sys/conf/kern.ldscript 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.208 src/sys/conf/Makefile.kern.inc:1.209 --- src/sys/conf/Makefile.kern.inc:1.208 Sat Aug 29 15:58:38 2015 +++ src/sys/conf/Makefile.kern.inc Sat Aug 29 16:07:07 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.208 2015/08/29 15:58:38 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.209 2015/08/29 16:07:07 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -163,6 +163,14 @@ LINK_O?= @${_MKSHMSG}link ${.CURDI ${LD} -r ${LINKFORMAT} -Map=${.TARGET}.map -o ${.TARGET} ${.ALLSRC} \ ${LD} -r ${LINKFORMAT} -Map=${.TARGET}.map -o ${.TARGET} ${.ALLSRC} +.SUFFIXES: .c .o +.c.o: + ${NORMAL_C} + +.SUFFIXES: .S .o +.S.o: + ${NORMAL_S} + ## ## (3) libkern and compat ## @@ -196,6 +204,7 @@ SYSLIBCOMPATLN?= ${COMPATLIBLN} ## Each port should have a corresponding section with settings for ## MD_CFILES, MD_SFILES, and MD_OBJS, along with build rules for same. ## + MI_CFILES=devsw.c ioconf.c param.c # the need for a MI_SFILES variable is dubitable at best MI_OBJS=${MI_CFILES:S/.c/.o/} @@ -205,11 +214,6 @@ param.c: $S/conf/param.c rm -f param.c cp $S/conf/param.c . -.for _cfile in ${MI_CFILES} -${_cfile:T:R}.o: ${_cfile} - ${NORMAL_C} -.endfor - ## ## (5) link settings ## Added files:
CVS commit: src/sys/conf
Module Name:src Committed By: uebayasi Date: Sat Aug 29 16:27:07 UTC 2015 Modified Files: src/sys/conf: Makefile.kern.inc Added Files: src/sys/conf: cscope.mk gdbinit.mk lint.mk Log Message: Move less important part out of Makefile.kern.inc. To generate a diff of this commit: cvs rdiff -u -r1.209 -r1.210 src/sys/conf/Makefile.kern.inc cvs rdiff -u -r0 -r1.1 src/sys/conf/cscope.mk src/sys/conf/gdbinit.mk \ src/sys/conf/lint.mk 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.209 src/sys/conf/Makefile.kern.inc:1.210 --- src/sys/conf/Makefile.kern.inc:1.209 Sat Aug 29 16:07:07 2015 +++ src/sys/conf/Makefile.kern.inc Sat Aug 29 16:27:07 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.209 2015/08/29 16:07:07 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.210 2015/08/29 16:27:07 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -446,51 +446,14 @@ DEPS+= assym.d .endif ## -## lint +## install ## -.if !target(lint) -ALLSFILES?= ${MD_SFILES} ${SFILES} -LINTSTUBS?= ${ALLSFILES:T:R:C/^.*$/LintStub_.c/g} -KERNLINTFLAGS?= -bcehnxzFS -NORMAL_LN?= ${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i $ -o $@ - -_lsrc=${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES} -LOBJS?= ${_lsrc:T:S/.c$/.ln/g} ${LIBKERNLN} ${SYSLIBCOMPATLN} - -.for _sfile in ${ALLSFILES} -LintStub_${_sfile:T:R}.c: ${_sfile} assym.h - ${_MKTARGET_COMPILE} - ${CC} -E -C ${AFLAGS} ${CPPFLAGS} ${_sfile} | \ - ${TOOL_AWK} -f $S/kern/genlintstub.awk ${.TARGET} -.endfor - -.for _cfile in ${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES} -${_cfile:T:R}.ln: ${_cfile} - ${_MKTARGET_COMPILE} - ${NORMAL_LN} -.endfor - -lint: ${LOBJS} - ${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} ${LOBJS} -.endif - -# Attempt to do a syntax-only compile of the entire kernel as one entity. -# Alas, bugs in the GCC C frontend prevent this from completely effective -# but information can be gleaned from the output. -syntax-only: ${CFILES} ${MD_CFILES} - ${CC} -fsyntax-only -combine ${CFLAGS} ${CPPFLAGS} \ - ${CFILES} ${MD_CFILES} - # List of kernel images that will be installed into the root file system. # Some platforms may need to install more than one (e.g. a netbsd.aout file # to be loaded directly by the firmware), so this can be overriden by them. KERNIMAGES?= netbsd -## -## install -## - .if !target(install) # The install target can be redefined by putting a # install-kernel-${MACHINE_NAME} target into /etc/mk.conf @@ -507,81 +470,9 @@ install-kernel-${MACHINE_NAME}: .endif .endif -## -## tags -## - -.if !target(tags) -tags: - @echo see $S/kern/Makefile for tags -.endif - -## -## cscope -## - -EXTRA_CLEAN+= cscope.out cscope.tmp -.if !target(cscope.out) -cscope.out: Makefile depend - ${_MKTARGET_CREATE} - @${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\ *$$//;' lib/kern/.depend \ - | tr -s ' ' '\n' \ - | ${TOOL_SED} ';s|^../../||;' \ - cscope.tmp - @${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\ *$$//;' lib/compat/.depend \ - | tr -s ' ' '\n' \ - | ${TOOL_SED} 's|^../../||;' \ - cscope.tmp - @echo ${SRCS} | cat - cscope.tmp | tr -s ' ' '\n' | sort -u | \ - ${CSCOPE} -k -i - -b `echo ${INCLUDES} | ${TOOL_SED} s/-nostdinc//` -# cscope doesn't write cscope.out if it's uptodate, so ensure -# make doesn't keep calling cscope when not needed. - @rm -f cscope.tmp; touch cscope.out -.endif - -.if !target(cscope) -cscope: cscope.out - @${CSCOPE} -d -.endif - -EXTRA_CLEAN+= ID -.if !target(mkid) -.PHONY: mkid -mkid: ID - -ID: Makefile depend - ${_MKTARGET_CREATE} - @${MKID} \ - `${TOOL_SED} 's/[^:]*://;s/^ *//;s/ * *$$//;' \ - lib/kern/.depend lib/compat/.depend \ - | tr ' ' '\n' \ - | ${TOOL_SED} s|^../../|| \ - | sort -u` \ - `${TOOL_SED} 's/[^:]*://;s/^ *//;s/ * *$$//;' \ - .depend \ - | tr ' ' '\n' \ - | sort -u` - -.endif - -## -## .gdbinit -## - -.include ${S}/gdbscripts/Makefile.inc - -EXTRA_CLEAN+= .gdbinit -.gdbinit: Makefile ${S}/gdbscripts/Makefile.inc - ${_MKTARGET_CREATE} - rm -f .gdbinit -.for __gdbinit in ${SYS_GDBINIT} - echo source ${S}/gdbscripts/${__gdbinit} .gdbinit -.endfor -.if defined(GDBINIT) !empty(GDBINIT) -.for __gdbinit in ${GDBINIT} - echo source ${__gdbinit} .gdbinit -.endfor -.endif +.include ${S}/conf/lint.mk +.include ${S}/conf/cscope.mk +.include ${S}/conf/gdbinit.mk ## ## the kernel Added files: Index: src/sys/conf/cscope.mk diff -u /dev/null src/sys/conf/cscope.mk:1.1 --- /dev/null Sat Aug 29 16:27:07 2015 +++ src/sys/conf/cscope.mk Sat Aug 29 16:27:07 2015 @@ -0,0 +1,49 @@ +# $NetBSD: cscope.mk,v 1.1 2015/08/29 16:27:07 uebayasi Exp $ + +## +## cscope +## + +EXTRA_CLEAN+= cscope.out cscope.tmp +.if !target(cscope.out) +cscope.out: Makefile
CVS commit: src/sys/conf
Module Name:src Committed By: uebayasi Date: Sat Aug 29 15:06:35 UTC 2015 Modified Files: src/sys/conf: Makefile.kern.inc Log Message: conf.c doesn't exist. autoconf.c exists, but it's just a C file, no need to depend on Makefile. To generate a diff of this commit: cvs rdiff -u -r1.204 -r1.205 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.204 src/sys/conf/Makefile.kern.inc:1.205 --- src/sys/conf/Makefile.kern.inc:1.204 Sat Aug 29 14:43:38 2015 +++ src/sys/conf/Makefile.kern.inc Sat Aug 29 15:06:35 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.204 2015/08/29 14:43:38 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.205 2015/08/29 15:06:35 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -362,9 +362,6 @@ md_root.o: md_root_image.h # depend on MEMORY_DISK_IMAGE configuration md_root.o: Makefile -# depend on root or device configuration -autoconf.o conf.o: Makefile - # depend on maxusers and CPU configuration assym.h machdep.o: Makefile
CVS commit: src/sys/conf
Module Name:src Committed By: uebayasi Date: Sat Aug 29 15:58:38 UTC 2015 Modified Files: src/sys/conf: Makefile.kern.inc Log Message: Now that MAXUSERS is in opt_param.h, param.o doesn't depend on Makefile. To generate a diff of this commit: cvs rdiff -u -r1.207 -r1.208 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.207 src/sys/conf/Makefile.kern.inc:1.208 --- src/sys/conf/Makefile.kern.inc:1.207 Sat Aug 29 15:51:53 2015 +++ src/sys/conf/Makefile.kern.inc Sat Aug 29 15:58:38 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.207 2015/08/29 15:51:53 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.208 2015/08/29 15:58:38 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -205,8 +205,6 @@ param.c: $S/conf/param.c rm -f param.c cp $S/conf/param.c . -param.o: Makefile - .for _cfile in ${MI_CFILES} ${_cfile:T:R}.o: ${_cfile} ${NORMAL_C}
CVS commit: src/sys/conf
Module Name:src Committed By: uebayasi Date: Sat Aug 29 16:10:01 UTC 2015 Removed Files: src/sys/conf: kern.ldscript Log Message: Revert a mistakenly added file. To generate a diff of this commit: cvs rdiff -u -r1.1 -r0 src/sys/conf/kern.ldscript Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/config
Module Name:src Committed By: uebayasi Date: Sat Aug 29 17:42:05 UTC 2015 Modified Files: src/usr.bin/config: mkmakefile.c Log Message: No need to define swapkernel.o build rule. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 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.46 src/usr.bin/config/mkmakefile.c:1.47 --- src/usr.bin/config/mkmakefile.c:1.46 Sat Aug 29 17:35:23 2015 +++ src/usr.bin/config/mkmakefile.c Sat Aug 29 17:42:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: mkmakefile.c,v 1.46 2015/08/29 17:35:23 uebayasi Exp $ */ +/* $NetBSD: mkmakefile.c,v 1.47 2015/08/29 17:42:05 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include sys/cdefs.h -__RCSID($NetBSD: mkmakefile.c,v 1.46 2015/08/29 17:35:23 uebayasi Exp $); +__RCSID($NetBSD: mkmakefile.c,v 1.47 2015/08/29 17:42:05 uebayasi Exp $); #include sys/param.h #include ctype.h @@ -583,8 +583,6 @@ emitload(FILE *fp) 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); - fprintf(fp, swap%s.o: swap%s.c\n - \t${NORMAL_C}\n\n, cf-cf_name, cf-cf_name); } fputs(\n, fp); }
CVS commit: src/sys/conf
Module Name:src Committed By: uebayasi Date: Sat Aug 29 15:37:18 UTC 2015 Modified Files: src/sys/conf: Makefile.kern.inc Log Message: genassym.cf and machdep.c are _KERNEL_OPT'ed, don't depend on Makefile. To generate a diff of this commit: cvs rdiff -u -r1.205 -r1.206 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.205 src/sys/conf/Makefile.kern.inc:1.206 --- src/sys/conf/Makefile.kern.inc:1.205 Sat Aug 29 15:06:35 2015 +++ src/sys/conf/Makefile.kern.inc Sat Aug 29 15:37:18 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.205 2015/08/29 15:06:35 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.206 2015/08/29 15:37:18 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -362,9 +362,6 @@ md_root.o: md_root_image.h # depend on MEMORY_DISK_IMAGE configuration md_root.o: Makefile -# depend on maxusers and CPU configuration -assym.h machdep.o: Makefile - ## ## (7) misc targets: install, clean(dir), depend(all), lint, links, tags, ## cscope, mkid
CVS commit: src/doc
Module Name:src Committed By: wiz Date: Sat Aug 29 17:18:36 UTC 2015 Modified Files: src/doc: 3RDPARTY Log Message: gdb-7.10 is available. To generate a diff of this commit: cvs rdiff -u -r1.1248 -r1.1249 src/doc/3RDPARTY Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/3RDPARTY diff -u src/doc/3RDPARTY:1.1248 src/doc/3RDPARTY:1.1249 --- src/doc/3RDPARTY:1.1248 Fri Aug 21 10:47:53 2015 +++ src/doc/3RDPARTY Sat Aug 29 17:18:35 2015 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1248 2015/08/21 10:47:53 roy Exp $ +# $NetBSD: 3RDPARTY,v 1.1249 2015/08/29 17:18:35 wiz Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -451,7 +451,7 @@ Before importing a new version of extern Package: gdb Version: 7.9.1 -Current Vers: 7.9.1 +Current Vers: 7.10 Maintainer: FSF Archive Site: ftp://ftp.gnu.org/gnu/gdb/ Home Page: http://www.gnu.org/software/gdb/
CVS commit: src/sys
Module Name:src Committed By: uebayasi Date: Sat Aug 29 15:51:53 UTC 2015 Modified Files: src/sys/conf: Makefile.kern.inc src/sys/dev: md_root.c Log Message: According to nxr.netbsd.org, nothing uses MEMORY_DISK_IMAGE. Retire it. Premature design and its build rule bloats Makefile.kern.inc. There are other ways like MEMORY_DISK_DYNAMIC. (When kernel will be built as relocatable, embedding binary data will be much easier, and md(4), splash(4), and ksyms(4) will all benefit.) To generate a diff of this commit: cvs rdiff -u -r1.206 -r1.207 src/sys/conf/Makefile.kern.inc cvs rdiff -u -r1.17 -r1.18 src/sys/dev/md_root.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/conf/Makefile.kern.inc diff -u src/sys/conf/Makefile.kern.inc:1.206 src/sys/conf/Makefile.kern.inc:1.207 --- src/sys/conf/Makefile.kern.inc:1.206 Sat Aug 29 15:37:18 2015 +++ src/sys/conf/Makefile.kern.inc Sat Aug 29 15:51:53 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.206 2015/08/29 15:37:18 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.207 2015/08/29 15:51:53 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -349,19 +349,6 @@ vers.o: ${SYSTEM_OBJ} Makefile $S/conf/n init_main.o: splash_image.o .endif -.if defined(MEMORY_DISK_IMAGE) -md_root_image.h: ${MEMORY_DISK_IMAGE} - ${_MKTARGET_CREATE} - ${TOOL_HEXDUMP} -v -e '\t 8/1 0x%02x, \n' ${.ALLSRC} ${.TARGET} - -# XXX This is only needed when building md_root.o -CPPFLAGS+= -DMEMORY_DISK_IMAGE -md_root.o: md_root_image.h -.endif - -# depend on MEMORY_DISK_IMAGE configuration -md_root.o: Makefile - ## ## (7) misc targets: install, clean(dir), depend(all), lint, links, tags, ## cscope, mkid Index: src/sys/dev/md_root.c diff -u src/sys/dev/md_root.c:1.17 src/sys/dev/md_root.c:1.18 --- src/sys/dev/md_root.c:1.17 Thu Apr 16 14:46:33 2009 +++ src/sys/dev/md_root.c Sat Aug 29 15:51:53 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: md_root.c,v 1.17 2009/04/16 14:46:33 tsutsui Exp $ */ +/* $NetBSD: md_root.c,v 1.18 2015/08/29 15:51:53 uebayasi Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: md_root.c,v 1.17 2009/04/16 14:46:33 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: md_root.c,v 1.18 2015/08/29 15:51:53 uebayasi Exp $); #include opt_md.h @@ -41,23 +41,10 @@ __KERNEL_RCSID(0, $NetBSD: md_root.c,v #include dev/md.h #ifdef MEMORY_DISK_DYNAMIC -#ifdef MEMORY_DISK_IMAGE -#error MEMORY_DISK_DYNAMIC is not compatible with MEMORY_DISK_IMAGE -#endif size_t md_root_size; char *md_root_image; #else /* MEMORY_DISK_DYNAMIC */ -#ifdef MEMORY_DISK_IMAGE -#ifdef MEMORY_DISK_ROOT_SIZE -#error MEMORY_DISK_ROOT_SIZE is not compatible with MEMORY_DISK_IMAGE -#endif -char md_root_image[] = { -#include md_root_image.h -}; -uint32_t md_root_size = sizeof(md_root_image) ~(DEV_BSIZE - 1); - -#else /* MEMORY_DISK_IMAGE */ #ifndef MEMORY_DISK_ROOT_SIZE #define MEMORY_DISK_ROOT_SIZE 512 @@ -70,7 +57,6 @@ uint32_t md_root_size = sizeof(md_root_i */ uint32_t md_root_size = ROOTBYTES; char md_root_image[ROOTBYTES] = |This is the root ramdisk!\n; -#endif /* MEMORY_DISK_IMAGE */ #endif /* MEMORY_DISK_DYNAMIC */ #ifndef MEMORY_DISK_RBFLAGS
CVS commit: src/usr.bin/config
Module Name:src Committed By: uebayasi Date: Sat Aug 29 17:35:23 UTC 2015 Modified Files: src/usr.bin/config: mkmakefile.c Log Message: Define ``normal'' .c/.S rules as .for loops. Still explicit and ugly, but these will be eventually replaced with suffix rules. Tested x68k where .c/.S rules are overriden with compile-with. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 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.45 src/usr.bin/config/mkmakefile.c:1.46 --- src/usr.bin/config/mkmakefile.c:1.45 Sat Aug 29 14:07:45 2015 +++ src/usr.bin/config/mkmakefile.c Sat Aug 29 17:35:23 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: mkmakefile.c,v 1.45 2015/08/29 14:07:45 uebayasi Exp $ */ +/* $NetBSD: mkmakefile.c,v 1.46 2015/08/29 17:35:23 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include sys/cdefs.h -__RCSID($NetBSD: mkmakefile.c,v 1.45 2015/08/29 14:07:45 uebayasi Exp $); +__RCSID($NetBSD: mkmakefile.c,v 1.46 2015/08/29 17:35:23 uebayasi Exp $); #include sys/param.h #include ctype.h @@ -445,13 +445,13 @@ emitsfiles(FILE *fp) } static void -emitfiles(FILE *fp, int suffix, int upper_suffix) +emitxfiles(FILE *fp, int suffix, int upper_suffix, int normal) { struct files *fi; struct config *cf; - char swapname[100]; - fprintf(fp, %cFILES= \\\n, toupper(suffix)); + fprintf(fp, %cFILES.%snormal= \\\n, toupper(suffix), + normal ? : ab); TAILQ_FOREACH(fi, allfiles, fi_next) { const char *prefix, *sep; @@ -465,9 +465,25 @@ emitfiles(FILE *fp, int suffix, int uppe } else { prefix = sep = ; } - fprintf(fp, \t%s%s%s%s \\\n, $S/, prefix, sep, - fi-fi_path); + if (((fi-fi_mkrule == NULL) normal) || + ((fi-fi_mkrule != NULL) !normal)) + fprintf(fp, \t%s%s%s%s \\\n, $S/, prefix, sep, + fi-fi_path); } + putc('\n', fp); +} + +static void +emitfiles(FILE *fp, int suffix, int upper_suffix) +{ + struct files *fi; + struct config *cf; + char swapname[100]; + + emitxfiles(fp, suffix, upper_suffix, 1); + emitxfiles(fp, suffix, upper_suffix, 0); + fprintf(fp, %cFILES= ${%cFILES.normal} ${%cFILES.abnormal} \\\n, + toupper(suffix), toupper(suffix), toupper(suffix)); /* * The allfiles list does not include the configuration-specific * C source files. These files should be eliminated someday, but @@ -487,15 +503,33 @@ emitfiles(FILE *fp, int suffix, int uppe * Emit the make-rules. */ static void +emitxrules(FILE *fp, int suffix) +{ + char s = tolower(suffix), S = toupper(suffix); + + fprintf(fp, .for _%cfile in ${%cFILES.normal}\n, s, S); + fprintf(fp, ${_%cfile:T:R}.o: ${_%cfile}\n, s, s); + fprintf(fp, \t${NORMAL_%c}\n, S); + fprintf(fp, .endfor\n\n); +} + +static void emitrules(FILE *fp) { struct files *fi; + /* normal */ + emitxrules(fp, 'c'); + emitxrules(fp, 's'); + + /* abnormal */ TAILQ_FOREACH(fi, allfiles, fi_next) { const char *prefix, *sep; if ((fi-fi_flags FI_SEL) == 0) continue; + if (fi-fi_mkrule == NULL) + continue; if (fi-fi_prefix != NULL) { prefix = fi-fi_prefix; sep = /; @@ -504,11 +538,7 @@ emitrules(FILE *fp) } fprintf(fp, %s.o: %s%s%s%s\n, fi-fi_base, $S/, prefix, sep, fi-fi_path); - if (fi-fi_mkrule != NULL) { - fprintf(fp, \t%s\n\n, fi-fi_mkrule); - } else { - fprintf(fp, \t${NORMAL_%c}\n\n, toupper(fi-fi_suffix)); - } + fprintf(fp, \t%s\n\n, fi-fi_mkrule); } }
CVS commit: src/tests/fs/common
Module Name:src Committed By: dholland Date: Sat Aug 29 19:19:43 UTC 2015 Modified Files: src/tests/fs/common: h_fsmacros.h Log Message: Fix glaringly wrong indent. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/tests/fs/common/h_fsmacros.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/fs/common/h_fsmacros.h diff -u src/tests/fs/common/h_fsmacros.h:1.39 src/tests/fs/common/h_fsmacros.h:1.40 --- src/tests/fs/common/h_fsmacros.h:1.39 Tue Mar 24 23:22:47 2015 +++ src/tests/fs/common/h_fsmacros.h Sat Aug 29 19:19:43 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: h_fsmacros.h,v 1.39 2015/03/24 23:22:47 riastradh Exp $ */ +/* $NetBSD: h_fsmacros.h,v 1.40 2015/08/29 19:19:43 dholland Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -145,7 +145,7 @@ do { \ atf_tc_fail_errno(unmount r/w failed); \ if (_fs_##_fstest_mount(tc, _fs_##_func_##tmp, \ FSTEST_MNTNAME, MNT_RDONLY) != 0) \ - atf_tc_fail_errno(mount ro failed); \ + atf_tc_fail_errno(mount ro failed); \ _func_(tc,FSTEST_MNTNAME);\ if (_fs_##_fstest_unmount(tc, FSTEST_MNTNAME, 0) != 0) {\ rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1); \
CVS commit: src/sys/ufs/lfs
Module Name:src Committed By: mlelstv Date: Sat Aug 29 21:04:22 UTC 2015 Modified Files: src/sys/ufs/lfs: lfs_accessors.h lfs_alloc.c Log Message: Fix IFILE pointer calculation when scanning freelist. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/ufs/lfs/lfs_accessors.h cvs rdiff -u -r1.127 -r1.128 src/sys/ufs/lfs/lfs_alloc.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/ufs/lfs/lfs_accessors.h diff -u src/sys/ufs/lfs/lfs_accessors.h:1.14 src/sys/ufs/lfs/lfs_accessors.h:1.15 --- src/sys/ufs/lfs/lfs_accessors.h:1.14 Wed Aug 19 20:33:29 2015 +++ src/sys/ufs/lfs/lfs_accessors.h Sat Aug 29 21:04:22 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_accessors.h,v 1.14 2015/08/19 20:33:29 dholland Exp $ */ +/* $NetBSD: lfs_accessors.h,v 1.15 2015/08/29 21:04:22 mlelstv Exp $ */ /* from NetBSD: lfs.h,v 1.165 2015/07/24 06:59:32 dholland Exp */ /* from NetBSD: dinode.h,v 1.22 2013/01/22 09:39:18 dholland Exp */ @@ -494,6 +494,15 @@ lfs_fi_setblock(STRUCT_LFS *fs, FINFO *f }\ UNSHARE_IFLOCK(F); \ } while (0) +#define LFS_IENTRY_NEXT(IP, F) do { \ + if ((F)-lfs_is64) { \ + (IP) = (IFILE *)((IFILE64 *)(IP) + 1); \ + } else if (lfs_sb_getversion(F) 1) {\ + (IP) = (IFILE *)((IFILE32 *)(IP) + 1); \ + } else { \ + (IP) = (IFILE *)((IFILE_V1 *)(IP) + 1); \ + }\ +} while (0) #define LFS_DEF_IF_ACCESSOR(type, type32, field) \ static __unused inline type\ Index: src/sys/ufs/lfs/lfs_alloc.c diff -u src/sys/ufs/lfs/lfs_alloc.c:1.127 src/sys/ufs/lfs/lfs_alloc.c:1.128 --- src/sys/ufs/lfs/lfs_alloc.c:1.127 Wed Aug 12 18:28:01 2015 +++ src/sys/ufs/lfs/lfs_alloc.c Sat Aug 29 21:04:22 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_alloc.c,v 1.127 2015/08/12 18:28:01 dholland Exp $ */ +/* $NetBSD: lfs_alloc.c,v 1.128 2015/08/29 21:04:22 mlelstv Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: lfs_alloc.c,v 1.127 2015/08/12 18:28:01 dholland Exp $); +__KERNEL_RCSID(0, $NetBSD: lfs_alloc.c,v 1.128 2015/08/29 21:04:22 mlelstv Exp $); #if defined(_KERNEL_OPT) #include opt_quota.h @@ -586,7 +586,7 @@ lfs_order_freelist(struct lfs *fs) if (ino % lfs_sb_getifpb(fs) == 0) LFS_IENTRY(ifp, fs, ino, bp); else - ++ifp; + LFS_IENTRY_NEXT(ifp, fs); /* Don't put zero or ifile on the free list */ if (ino == LFS_UNUSED_INUM || ino == LFS_IFILE_INUM)
CVS commit: src/sys/arch/mips/alchemy/dev
Module Name:src Committed By: dholland Date: Sun Aug 30 04:09:22 UTC 2015 Modified Files: src/sys/arch/mips/alchemy/dev: aupcmcia.c Log Message: Turn interrupts back off after sleeping. From maxv's Brainy list. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mips/alchemy/dev/aupcmcia.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/mips/alchemy/dev/aupcmcia.c diff -u src/sys/arch/mips/alchemy/dev/aupcmcia.c:1.9 src/sys/arch/mips/alchemy/dev/aupcmcia.c:1.10 --- src/sys/arch/mips/alchemy/dev/aupcmcia.c:1.9 Wed Jan 4 02:36:26 2012 +++ src/sys/arch/mips/alchemy/dev/aupcmcia.c Sun Aug 30 04:09:21 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: aupcmcia.c,v 1.9 2012/01/04 02:36:26 kiyohara Exp $ */ +/* $NetBSD: aupcmcia.c,v 1.10 2015/08/30 04:09:21 dholland Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -35,7 +35,7 @@ /* #include pci.h */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: aupcmcia.c,v 1.9 2012/01/04 02:36:26 kiyohara Exp $); +__KERNEL_RCSID(0, $NetBSD: aupcmcia.c,v 1.10 2015/08/30 04:09:21 dholland Exp $); #include sys/types.h #include sys/param.h @@ -379,6 +379,7 @@ aupcm_event_thread(void *arg) * Go figure. */ tsleep(sc-sc_wake, PWAIT, aupcm_event, hz); + s = splhigh(); } sc-sc_wake = 0;
CVS commit: src/sys/arch/mips/ingenic
Module Name:src Committed By: macallan Date: Sun Aug 30 05:09:16 UTC 2015 Modified Files: src/sys/arch/mips/ingenic: ingenic_rng.c Log Message: add attribution, no functional change. from Michael McConville To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mips/ingenic/ingenic_rng.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/mips/ingenic/ingenic_rng.c diff -u src/sys/arch/mips/ingenic/ingenic_rng.c:1.1 src/sys/arch/mips/ingenic/ingenic_rng.c:1.2 --- src/sys/arch/mips/ingenic/ingenic_rng.c:1.1 Fri Aug 7 17:39:58 2015 +++ src/sys/arch/mips/ingenic/ingenic_rng.c Sun Aug 30 05:09:16 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: ingenic_rng.c,v 1.1 2015/08/07 17:39:58 macallan Exp $ */ +/* $NetBSD: ingenic_rng.c,v 1.2 2015/08/30 05:09:16 macallan Exp $ */ /*- * Copyright (c) 2015 Michael McConville @@ -27,7 +27,11 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ingenic_rng.c,v 1.1 2015/08/07 17:39:58 macallan Exp $); +__KERNEL_RCSID(0, $NetBSD: ingenic_rng.c,v 1.2 2015/08/30 05:09:16 macallan Exp $); + +/* + * adapted from Jared McNeill's amlogic_rng.c + */ #include sys/param.h #include sys/systm.h
CVS commit: src/sys/dev/ic
Module Name:src Committed By: dholland Date: Sun Aug 30 04:02:06 UTC 2015 Modified Files: src/sys/dev/ic: sgec.c Log Message: Initialize uninitialized variable; from maxv's brainy list. Fixes slipup in -r1.30 back in 2007. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/dev/ic/sgec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/sgec.c diff -u src/sys/dev/ic/sgec.c:1.40 src/sys/dev/ic/sgec.c:1.41 --- src/sys/dev/ic/sgec.c:1.40 Thu Oct 24 13:15:12 2013 +++ src/sys/dev/ic/sgec.c Sun Aug 30 04:02:06 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sgec.c,v 1.40 2013/10/24 13:15:12 martin Exp $ */ +/* $NetBSD: sgec.c,v 1.41 2015/08/30 04:02:06 dholland Exp $ */ /* * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved. * @@ -45,7 +45,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: sgec.c,v 1.40 2013/10/24 13:15:12 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: sgec.c,v 1.41 2015/08/30 04:02:06 dholland Exp $); #include opt_inet.h @@ -332,7 +332,7 @@ zestart(struct ifnet *ifp) int nexttx, starttx; int len, i, totlen, error; int old_inq = sc-sc_inq; - uint16_t orword, tdr; + uint16_t orword, tdr = 0; bus_dmamap_t map; while (sc-sc_inq (TXDESCS - 1)) {
CVS commit: src/sys/dev/ic
Module Name:src Committed By: dholland Date: Sun Aug 30 04:27:03 UTC 2015 Modified Files: src/sys/dev/ic: rrunner.c Log Message: Restore interrupts on error path. Also, on another path, avoid splx()'ing twice. While calling splx() a second time with the same value has no further effect, it looks to me like the first one of these calls is too early and some of the subsequent operations are potential races. Not actually tested, I'm afraid. From maxv's brainy list. To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/dev/ic/rrunner.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/rrunner.c diff -u src/sys/dev/ic/rrunner.c:1.78 src/sys/dev/ic/rrunner.c:1.79 --- src/sys/dev/ic/rrunner.c:1.78 Fri Jul 25 08:10:37 2014 +++ src/sys/dev/ic/rrunner.c Sun Aug 30 04:27:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: rrunner.c,v 1.78 2014/07/25 08:10:37 dholland Exp $ */ +/* $NetBSD: rrunner.c,v 1.79 2015/08/30 04:27:03 dholland Exp $ */ /* * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rrunner.c,v 1.78 2014/07/25 08:10:37 dholland Exp $); +__KERNEL_RCSID(0, $NetBSD: rrunner.c,v 1.79 2015/08/30 04:27:03 dholland Exp $); #include opt_inet.h @@ -724,8 +724,10 @@ esh_fpopen(dev_t dev, int oflags, int de if ((sc-sc_flags ESH_FL_INITIALIZED) == 0) { eshinit(sc); - if ((sc-sc_flags ESH_FL_INITIALIZED) == 0) + if ((sc-sc_flags ESH_FL_INITIALIZED) == 0) { + splx(s); return EIO; + } } if ((sc-sc_flags ESH_FL_RUNCODE_UP) == 0) { @@ -867,7 +869,6 @@ esh_fpopen(dev_t dev, int oflags, int de error = tsleep((void *) recv-ec_ulp, PCATCH | PRIBIO, eshfpopen, 0); if (error != 0 || recv-ec_index == -1) { - splx(s); goto bad_fp_ring_create; } }
CVS commit: src/sys
Module Name:src Committed By: uebayasi Date: Sun Aug 30 05:24:04 UTC 2015 Modified Files: src/sys/conf: Makefile.kern.inc files src/sys/dev: md_root.c Added Files: src/sys/conf: mdroot.mk Log Message: Put back MEMORY_DISK_IMAGE logic, but use generated opt_memory_root_image.h and don't polute Makefile.kern.inc. To generate a diff of this commit: cvs rdiff -u -r1.212 -r1.213 src/sys/conf/Makefile.kern.inc cvs rdiff -u -r1.1141 -r1.1142 src/sys/conf/files cvs rdiff -u -r0 -r1.1 src/sys/conf/mdroot.mk cvs rdiff -u -r1.18 -r1.19 src/sys/dev/md_root.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/conf/Makefile.kern.inc diff -u src/sys/conf/Makefile.kern.inc:1.212 src/sys/conf/Makefile.kern.inc:1.213 --- src/sys/conf/Makefile.kern.inc:1.212 Sun Aug 30 05:12:00 2015 +++ src/sys/conf/Makefile.kern.inc Sun Aug 30 05:24:04 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.212 2015/08/30 05:12:00 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.213 2015/08/30 05:24:04 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -484,6 +484,7 @@ install-kernel-${MACHINE_NAME}: .endif .endif +.include ${S}/conf/mdroot.mk .include ${S}/conf/lint.mk .include ${S}/conf/cscope.mk .include ${S}/conf/gdbinit.mk Index: src/sys/conf/files diff -u src/sys/conf/files:1.1141 src/sys/conf/files:1.1142 --- src/sys/conf/files:1.1141 Sun Aug 30 05:12:00 2015 +++ src/sys/conf/files Sun Aug 30 05:24:04 2015 @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.1141 2015/08/30 05:12:00 uebayasi Exp $ +# $NetBSD: files,v 1.1142 2015/08/30 05:24:04 uebayasi Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 version 20150832 @@ -290,6 +290,7 @@ defflag opt_md.h MEMORY_DISK_HOOKS MEMO MEMORY_DISK_DYNAMIC defparam opt_md.h MEMORY_DISK_SERVER=1 MEMORY_DISK_ROOT_SIZE MEMORY_DISK_RBFLAGS +defparam opt_memory_disk_image makeoptions_MEMORY_DISK_IMAGE defflag opt_tftproot.h TFTPROOT TFTPROOT_DEBUG Index: src/sys/dev/md_root.c diff -u src/sys/dev/md_root.c:1.18 src/sys/dev/md_root.c:1.19 --- src/sys/dev/md_root.c:1.18 Sat Aug 29 15:51:53 2015 +++ src/sys/dev/md_root.c Sun Aug 30 05:24:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: md_root.c,v 1.18 2015/08/29 15:51:53 uebayasi Exp $ */ +/* $NetBSD: md_root.c,v 1.19 2015/08/30 05:24:03 uebayasi Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -30,9 +30,10 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: md_root.c,v 1.18 2015/08/29 15:51:53 uebayasi Exp $); +__KERNEL_RCSID(0, $NetBSD: md_root.c,v 1.19 2015/08/30 05:24:03 uebayasi Exp $); #include opt_md.h +#include opt_memory_disk_image.h #include sys/param.h #include sys/systm.h @@ -41,10 +42,23 @@ __KERNEL_RCSID(0, $NetBSD: md_root.c,v #include dev/md.h #ifdef MEMORY_DISK_DYNAMIC +#ifdef makeoptions_MEMORY_DISK_IMAGE +#error MEMORY_DISK_DYNAMIC is not compatible with MEMORY_DISK_IMAGE +#endif size_t md_root_size; char *md_root_image; #else /* MEMORY_DISK_DYNAMIC */ +#ifdef makeoptions_MEMORY_DISK_IMAGE +#ifdef MEMORY_DISK_ROOT_SIZE +#error MEMORY_DISK_ROOT_SIZE is not compatible with MEMORY_DISK_IMAGE +#endif +char md_root_image[] = { +#include md_root_image.h +}; +uint32_t md_root_size = sizeof(md_root_image) ~(DEV_BSIZE - 1); + +#else /* makeoptions_MEMORY_DISK_IMAGE */ #ifndef MEMORY_DISK_ROOT_SIZE #define MEMORY_DISK_ROOT_SIZE 512 @@ -57,6 +71,7 @@ char *md_root_image; */ uint32_t md_root_size = ROOTBYTES; char md_root_image[ROOTBYTES] = |This is the root ramdisk!\n; +#endif /* makeoptions_MEMORY_DISK_IMAGE */ #endif /* MEMORY_DISK_DYNAMIC */ #ifndef MEMORY_DISK_RBFLAGS Added files: Index: src/sys/conf/mdroot.mk diff -u /dev/null src/sys/conf/mdroot.mk:1.1 --- /dev/null Sun Aug 30 05:24:04 2015 +++ src/sys/conf/mdroot.mk Sun Aug 30 05:24:04 2015 @@ -0,0 +1,8 @@ +# $NetBSD: mdroot.mk,v 1.1 2015/08/30 05:24:04 uebayasi Exp $ + +.if defined(MEMORY_DISK_IMAGE) +md_root_image.h: ${MEMORY_DISK_IMAGE} + ${_MKTARGET_CREATE} + ${TOOL_HEXDUMP} -v -e '\t 8/1 0x%02x, \n' ${.ALLSRC} ${.TARGET} +md_root.o: md_root_image.h +.endif
CVS commit: src/sbin/clri
Module Name:src Committed By: mlelstv Date: Sun Aug 30 05:23:17 UTC 2015 Modified Files: src/sbin/clri: clri.c Log Message: Calculate sector size from superblock and use that instead of DEV_BSIZE. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sbin/clri/clri.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/clri/clri.c diff -u src/sbin/clri/clri.c:1.23 src/sbin/clri/clri.c:1.24 --- src/sbin/clri/clri.c:1.23 Sun Jun 23 02:06:04 2013 +++ src/sbin/clri/clri.c Sun Aug 30 05:23:17 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: clri.c,v 1.23 2013/06/23 02:06:04 dholland Exp $ */ +/* $NetBSD: clri.c,v 1.24 2015/08/30 05:23:17 mlelstv Exp $ */ /* * Copyright (c) 1990, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1990, 19 #if 0 static char sccsid[] = @(#)clri.c 8.3 (Berkeley) 4/28/95; #else -__RCSID($NetBSD: clri.c,v 1.23 2013/06/23 02:06:04 dholland Exp $); +__RCSID($NetBSD: clri.c,v 1.24 2015/08/30 05:23:17 mlelstv Exp $); #endif #endif /* not lint */ @@ -84,6 +84,7 @@ main(int argc, char *argv[]) char *fs, sblock[SBLOCKSIZE]; int needswap = 0, is_ufs2 = 0; int i, imax; + long dev_bsize; if (argc 3) { (void)fprintf(stderr, usage: clri filesystem inode ...\n); @@ -151,6 +152,9 @@ main(int argc, char *argv[]) if (needswap) ffs_sb_swap(sbp, sbp); + /* compute disk block size from superblock parameters */ + dev_bsize = sbp-fs_fsize / FFS_FSBTODB(sbp, 1); + bsize = sbp-fs_bsize; ibuf = malloc(bsize); if (ibuf == NULL) { @@ -166,7 +170,7 @@ main(int argc, char *argv[]) /* read in the appropriate block. */ offset = ino_to_fsba(sbp, inonum); /* inode to fs blk */ offset = FFS_FSBTODB(sbp, offset); /* fs blk disk blk */ - offset *= DEV_BSIZE; /* disk blk to bytes */ + offset *= dev_bsize; /* disk blk to bytes */ /* seek and read the block */ if (lseek(fd, offset, SEEK_SET) 0)
CVS commit: src/sys
Module Name:src Committed By: uebayasi Date: Sun Aug 30 01:46:03 UTC 2015 Modified Files: src/sys/arch/amd64/amd64: locore.S src/sys/arch/i386/i386: locore.S src/sys/arch/mac68k/mac68k: machdep.c src/sys/conf: Makefile.kern.inc files src/sys/kern: kern_ksyms.c kern_ksyms_buf.c Log Message: Use makeoptions_COPY_SYMTAB via opt_copy_symtab.h in sources. Remove a hack to set -DCOPY_SYMTAB from sys/conf/Makefile.kern.inc. Remove unnecessary dependencies too. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/arch/amd64/amd64/locore.S cvs rdiff -u -r1.113 -r1.114 src/sys/arch/i386/i386/locore.S cvs rdiff -u -r1.348 -r1.349 src/sys/arch/mac68k/mac68k/machdep.c cvs rdiff -u -r1.210 -r1.211 src/sys/conf/Makefile.kern.inc cvs rdiff -u -r1.1139 -r1.1140 src/sys/conf/files cvs rdiff -u -r1.80 -r1.81 src/sys/kern/kern_ksyms.c cvs rdiff -u -r1.3 -r1.4 src/sys/kern/kern_ksyms_buf.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/locore.S diff -u src/sys/arch/amd64/amd64/locore.S:1.77 src/sys/arch/amd64/amd64/locore.S:1.78 --- src/sys/arch/amd64/amd64/locore.S:1.77 Sun Aug 17 21:17:43 2014 +++ src/sys/arch/amd64/amd64/locore.S Sun Aug 30 01:46:02 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.77 2014/08/17 21:17:43 joerg Exp $ */ +/* $NetBSD: locore.S,v 1.78 2015/08/30 01:46:02 uebayasi Exp $ */ /* * Copyright-o-rama! @@ -153,6 +153,7 @@ #include machine/asm.h +#include opt_copy_symtab.h #include opt_ddb.h #include opt_ddbparam.h #include opt_modular.h @@ -520,7 +521,7 @@ ENTRY(start) /* Find end of kernel image. */ movl $RELOC(end),%edi -#if (NKSYMS || defined(DDB) || defined(MODULAR)) !defined(COPY_SYMTAB) +#if (NKSYMS || defined(DDB) || defined(MODULAR)) !defined(makeoptions_COPY_SYMTAB) /* Save the symbols (if loaded). */ movl RELOC(esym),%eax testl %eax,%eax Index: src/sys/arch/i386/i386/locore.S diff -u src/sys/arch/i386/i386/locore.S:1.113 src/sys/arch/i386/i386/locore.S:1.114 --- src/sys/arch/i386/i386/locore.S:1.113 Sun Aug 17 21:17:43 2014 +++ src/sys/arch/i386/i386/locore.S Sun Aug 30 01:46:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.113 2014/08/17 21:17:43 joerg Exp $ */ +/* $NetBSD: locore.S,v 1.114 2015/08/30 01:46:03 uebayasi Exp $ */ /* * Copyright-o-rama! @@ -129,9 +129,10 @@ */ #include machine/asm.h -__KERNEL_RCSID(0, $NetBSD: locore.S,v 1.113 2014/08/17 21:17:43 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: locore.S,v 1.114 2015/08/30 01:46:03 uebayasi Exp $); #include opt_compat_oldboot.h +#include opt_copy_symtab.h #include opt_ddb.h #include opt_modular.h #include opt_multiboot.h @@ -184,7 +185,7 @@ __KERNEL_RCSID(0, $NetBSD: locore.S,v 1 .ascii ,PAE=yes[extended-cr3] #endif .ascii ,LOADER=generic -#if (NKSYMS || defined(DDB) || defined(MODULAR)) !defined(COPY_SYMTAB) +#if (NKSYMS || defined(DDB) || defined(MODULAR)) !defined(makeoptions_COPY_SYMTAB) .ascii ,BSD_SYMTAB=yes #endif .byte 0 @@ -544,7 +545,7 @@ try586: /* Use the `cpuid' instruction. /* Find end of kernel image. */ movl $RELOC(end),%edi -#if (NKSYMS || defined(DDB) || defined(MODULAR)) !defined(COPY_SYMTAB) +#if (NKSYMS || defined(DDB) || defined(MODULAR)) !defined(makeoptions_COPY_SYMTAB) /* Save the symbols (if loaded). */ movl RELOC(esym),%eax testl %eax,%eax Index: src/sys/arch/mac68k/mac68k/machdep.c diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.348 src/sys/arch/mac68k/mac68k/machdep.c:1.349 --- src/sys/arch/mac68k/mac68k/machdep.c:1.348 Sun Aug 17 21:17:44 2014 +++ src/sys/arch/mac68k/mac68k/machdep.c Sun Aug 30 01:46:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.348 2014/08/17 21:17:44 joerg Exp $ */ +/* $NetBSD: machdep.c,v 1.349 2015/08/30 01:46:03 uebayasi Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -74,9 +74,10 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.348 2014/08/17 21:17:44 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.349 2015/08/30 01:46:03 uebayasi Exp $); #include opt_adb.h +#include opt_copy_symtab.h #include opt_ddb.h #include opt_ddbparam.h #include opt_kgdb.h @@ -961,7 +962,7 @@ getenvvars(u_long flag, char *buf) * Get end of symbols for kernel debugging */ esym = (int *)getenv(END_SYM); -#ifndef COPY_SYMTAB +#ifndef makeoptions_COPY_SYMTAB if (esym == (int *)0) #endif esym = (int *)end; Index: src/sys/conf/Makefile.kern.inc diff -u src/sys/conf/Makefile.kern.inc:1.210 src/sys/conf/Makefile.kern.inc:1.211 --- src/sys/conf/Makefile.kern.inc:1.210 Sat Aug 29 16:27:07 2015 +++ src/sys/conf/Makefile.kern.inc Sun Aug 30 01:46:02 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.210 2015/08/29 16:27:07 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.211 2015/08/30 01:46:02 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included
CVS commit: src/sys/dev/ic
Module Name:src Committed By: dholland Date: Sun Aug 30 04:11:40 UTC 2015 Modified Files: src/sys/dev/ic: smc91cxx.c Log Message: Even if the card went away, don't return from smc91cxx_init without restoring interrupts. From maxv's brainy list. To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sys/dev/ic/smc91cxx.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/smc91cxx.c diff -u src/sys/dev/ic/smc91cxx.c:1.89 src/sys/dev/ic/smc91cxx.c:1.90 --- src/sys/dev/ic/smc91cxx.c:1.89 Mon Apr 13 16:33:24 2015 +++ src/sys/dev/ic/smc91cxx.c Sun Aug 30 04:11:40 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: smc91cxx.c,v 1.89 2015/04/13 16:33:24 riastradh Exp $ */ +/* $NetBSD: smc91cxx.c,v 1.90 2015/08/30 04:11:40 dholland Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: smc91cxx.c,v 1.89 2015/04/13 16:33:24 riastradh Exp $); +__KERNEL_RCSID(0, $NetBSD: smc91cxx.c,v 1.90 2015/08/30 04:11:40 dholland Exp $); #include opt_inet.h @@ -524,8 +524,11 @@ smc91cxx_init(struct smc91cxx_softc *sc) sc-sc_txpacketno = ARR_FAILED; for (;;) { tmp = bus_space_read_2(bst, bsh, MMU_CMD_REG_W); - if (tmp == 0x) /* card went away! */ + if (tmp == 0x) { + /* card went away! */ + splx(s); return; + } if ((tmp MMUCR_BUSY) == 0) break; }
CVS commit: src
Module Name:src Committed By: uebayasi Date: Sun Aug 30 05:12:00 UTC 2015 Modified Files: src/sys/conf: Makefile.kern.inc files src/usr.bin/config: defs.h mkmakefile.c Log Message: Define compile rules in sys/conf/Makefile.kern.inc except those overriden by file ... compile-with As rules are still explicit, be careful to not override by checking .if !target(xxx.o). To generate a diff of this commit: cvs rdiff -u -r1.211 -r1.212 src/sys/conf/Makefile.kern.inc cvs rdiff -u -r1.1140 -r1.1141 src/sys/conf/files cvs rdiff -u -r1.71 -r1.72 src/usr.bin/config/defs.h cvs rdiff -u -r1.47 -r1.48 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/sys/conf/Makefile.kern.inc diff -u src/sys/conf/Makefile.kern.inc:1.211 src/sys/conf/Makefile.kern.inc:1.212 --- src/sys/conf/Makefile.kern.inc:1.211 Sun Aug 30 01:46:02 2015 +++ src/sys/conf/Makefile.kern.inc Sun Aug 30 05:12:00 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.211 2015/08/30 01:46:02 uebayasi Exp $ +# $NetBSD: Makefile.kern.inc,v 1.212 2015/08/30 05:12:00 uebayasi Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -163,6 +163,20 @@ LINK_O?= @${_MKSHMSG}link ${.CURDI ${LD} -r ${LINKFORMAT} -Map=${.TARGET}.map -o ${.TARGET} ${.ALLSRC} \ ${LD} -r ${LINKFORMAT} -Map=${.TARGET}.map -o ${.TARGET} ${.ALLSRC} +.for _s in ${CFILES} +.if !target(${_s:T:R}.o) +${_s:T:R}.o: ${_s} + ${NORMAL_C} +.endif +.endfor + +.for _s in ${SFILES} +.if !target(${_s:T:R}.o) +${_s:T:R}.o: ${_s} + ${NORMAL_S} +.endif +.endfor + .SUFFIXES: .c .o .c.o: ${NORMAL_C} Index: src/sys/conf/files diff -u src/sys/conf/files:1.1140 src/sys/conf/files:1.1141 --- src/sys/conf/files:1.1140 Sun Aug 30 01:46:02 2015 +++ src/sys/conf/files Sun Aug 30 05:12:00 2015 @@ -1,7 +1,7 @@ -# $NetBSD: files,v 1.1140 2015/08/30 01:46:02 uebayasi Exp $ +# $NetBSD: files,v 1.1141 2015/08/30 05:12:00 uebayasi Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 -version 20150831 +version 20150832 # # device classes Index: src/usr.bin/config/defs.h diff -u src/usr.bin/config/defs.h:1.71 src/usr.bin/config/defs.h:1.72 --- src/usr.bin/config/defs.h:1.71 Sun Aug 30 01:33:20 2015 +++ src/usr.bin/config/defs.h Sun Aug 30 05:12:00 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.71 2015/08/30 01:33:20 uebayasi Exp $ */ +/* $NetBSD: defs.h,v 1.72 2015/08/30 05:12:00 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -107,7 +107,7 @@ extern const char *progname; * The next two lines define the current version of the config(1) binary, * and the minimum version of the configuration files it supports. */ -#define CONFIG_VERSION 20150831 +#define CONFIG_VERSION 20150832 #define CONFIG_MINVERSION 0 /* Index: src/usr.bin/config/mkmakefile.c diff -u src/usr.bin/config/mkmakefile.c:1.47 src/usr.bin/config/mkmakefile.c:1.48 --- src/usr.bin/config/mkmakefile.c:1.47 Sat Aug 29 17:42:05 2015 +++ src/usr.bin/config/mkmakefile.c Sun Aug 30 05:12:00 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: mkmakefile.c,v 1.47 2015/08/29 17:42:05 uebayasi Exp $ */ +/* $NetBSD: mkmakefile.c,v 1.48 2015/08/30 05:12:00 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include sys/cdefs.h -__RCSID($NetBSD: mkmakefile.c,v 1.47 2015/08/29 17:42:05 uebayasi Exp $); +__RCSID($NetBSD: mkmakefile.c,v 1.48 2015/08/30 05:12:00 uebayasi Exp $); #include sys/param.h #include ctype.h @@ -445,13 +445,13 @@ emitsfiles(FILE *fp) } static void -emitxfiles(FILE *fp, int suffix, int upper_suffix, int normal) +emitfiles(FILE *fp, int suffix, int upper_suffix) { struct files *fi; struct config *cf; + char swapname[100]; - fprintf(fp, %cFILES.%snormal= \\\n, toupper(suffix), - normal ? : ab); + fprintf(fp, %cFILES= \\\n, toupper(suffix)); TAILQ_FOREACH(fi, allfiles, fi_next) { const char *prefix, *sep; @@ -465,25 +465,10 @@ emitxfiles(FILE *fp, int suffix, int upp } else { prefix = sep = ; } - if (((fi-fi_mkrule == NULL) normal) || - ((fi-fi_mkrule != NULL) !normal)) - fprintf(fp, \t%s%s%s%s \\\n, $S/, prefix, sep, - fi-fi_path); + fprintf(fp, \t%s%s%s%s \\\n, $S/, prefix, sep, + fi-fi_path); } - putc('\n', fp); -} - -static void -emitfiles(FILE *fp, int suffix, int upper_suffix) -{ - struct files *fi; - struct config *cf; - char swapname[100]; - emitxfiles(fp, suffix, upper_suffix, 1); - emitxfiles(fp, suffix, upper_suffix, 0); - fprintf(fp, %cFILES= ${%cFILES.normal} ${%cFILES.abnormal} \\\n, - toupper(suffix), toupper(suffix), toupper(suffix)); /* * The allfiles list does not include the configuration-specific * C source files. These files should be eliminated someday, but @@ -503,26 +488,10 @@ emitfiles(FILE *fp, int suffix, int uppe * Emit the make-rules.
CVS commit: src/sys/arch/acorn26/ioc
Module Name:src Committed By: dholland Date: Sun Aug 30 04:16:18 UTC 2015 Modified Files: src/sys/arch/acorn26/ioc: arcpp.c Log Message: Restore interrupts on error paths. From maxv's brainy list. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/acorn26/ioc/arcpp.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/acorn26/ioc/arcpp.c diff -u src/sys/arch/acorn26/ioc/arcpp.c:1.14 src/sys/arch/acorn26/ioc/arcpp.c:1.15 --- src/sys/arch/acorn26/ioc/arcpp.c:1.14 Fri Jul 25 08:10:31 2014 +++ src/sys/arch/acorn26/ioc/arcpp.c Sun Aug 30 04:16:18 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: arcpp.c,v 1.14 2014/07/25 08:10:31 dholland Exp $ */ +/* $NetBSD: arcpp.c,v 1.15 2015/08/30 04:16:18 dholland Exp $ */ /*- * Copyright (c) 2001 Ben Harris @@ -52,7 +52,7 @@ #include sys/param.h -__KERNEL_RCSID(0, $NetBSD: arcpp.c,v 1.14 2014/07/25 08:10:31 dholland Exp $); +__KERNEL_RCSID(0, $NetBSD: arcpp.c,v 1.15 2015/08/30 04:16:18 dholland Exp $); #include sys/conf.h #include sys/device.h @@ -217,10 +217,12 @@ arcppopen(dev_t dev, int flag, int mode, error = tsleep((void *)sc, ARCPPPRI | PCATCH, arcppopen, TIMEOUT); if (error == EWOULDBLOCK) { sc-sc_state = 0; + splx(s); return EBUSY; } if (error) { sc-sc_state = 0; + splx(s); return error; }
CVS commit: src/sys/dev/ic
Module Name:src Committed By: dholland Date: Sun Aug 30 04:17:48 UTC 2015 Modified Files: src/sys/dev/ic: gem.c Log Message: Restore interrupts on error path. From maxv's brainy list. To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.103 src/sys/dev/ic/gem.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/gem.c diff -u src/sys/dev/ic/gem.c:1.102 src/sys/dev/ic/gem.c:1.103 --- src/sys/dev/ic/gem.c:1.102 Sun Aug 10 16:44:35 2014 +++ src/sys/dev/ic/gem.c Sun Aug 30 04:17:48 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: gem.c,v 1.102 2014/08/10 16:44:35 tls Exp $ */ +/* $NetBSD: gem.c,v 1.103 2015/08/30 04:17:48 dholland Exp $ */ /* * @@ -37,7 +37,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: gem.c,v 1.102 2014/08/10 16:44:35 tls Exp $); +__KERNEL_RCSID(0, $NetBSD: gem.c,v 1.103 2015/08/30 04:17:48 dholland Exp $); #include opt_inet.h @@ -1149,8 +1149,10 @@ gem_init(struct ifnet *ifp) (*sc-sc_hwreset)(sc); /* step 3. Setup data structures in host memory */ - if (gem_meminit(sc) != 0) + if (gem_meminit(sc) != 0) { + splx(s); return 1; + } /* step 4. TX MAC registers counters */ gem_init_regs(sc);
CVS commit: src/usr.bin/config
Module Name:src Committed By: uebayasi Date: Sun Aug 30 01:33:20 UTC 2015 Modified Files: src/usr.bin/config: config.5 defs.h main.c Log Message: Define `makeoptions' values as parameters with makeoptions_ prefix too. C sources are encouraged to include relevant opt_*.h files rather than relying on -DXXX passed via makefiles. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/usr.bin/config/config.5 cvs rdiff -u -r1.70 -r1.71 src/usr.bin/config/defs.h cvs rdiff -u -r1.79 -r1.80 src/usr.bin/config/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/config/config.5 diff -u src/usr.bin/config/config.5:1.28 src/usr.bin/config/config.5:1.29 --- src/usr.bin/config/config.5:1.28 Sat Aug 29 02:54:07 2015 +++ src/usr.bin/config/config.5 Sun Aug 30 01:33:20 2015 @@ -1,4 +1,4 @@ -.\ $NetBSD: config.5,v 1.28 2015/08/29 02:54:07 uebayasi Exp $ +.\ $NetBSD: config.5,v 1.29 2015/08/30 01:33:20 uebayasi Exp $ .\ .\ Copyright (c) 2006, 2007 The NetBSD Foundation. .\ All rights reserved. @@ -24,7 +24,7 @@ .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\ POSSIBILITY OF SUCH DAMAGE. .\ -.Dd August 28, 2015 +.Dd August 31, 2015 .Dt CONFIG 5 .Os .Sh NAME @@ -551,10 +551,6 @@ indicates when the relevant line should and works just like the .Ic file statement. -.It Ic makeoptions Ar condition name Ns += Ns Ar value Op , Ar condition \ -name Ns += Ns Ar value -Appends to a definition in the generated -.Pa Makefile . .El .Ss OPTIONS SELECTION .Bl -ohang @@ -703,6 +699,17 @@ Adds or appends to a definition in the g .Pa Makefile . A definition cannot be overriden, it must be removed before it can be added again. +Optionally, if an option +.Pa makeoptions_\*[Lt]name\*[Gt] +is defined with +.Ic defparam , +the +Ns value +is defined as an option too. +.It Ic makeoptions Ar condition name Ns += Ns Ar value Op , Ar condition \ +name Ns += Ns Ar value +Appends to a definition in the generated +.Pa Makefile . .It Ic no makeoptions Ar name Op , Ar name Op , Ar ... Removes one or more definitions from the generated .Pa Makefile . Index: src/usr.bin/config/defs.h diff -u src/usr.bin/config/defs.h:1.70 src/usr.bin/config/defs.h:1.71 --- src/usr.bin/config/defs.h:1.70 Sat Aug 29 14:07:45 2015 +++ src/usr.bin/config/defs.h Sun Aug 30 01:33:20 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.70 2015/08/29 14:07:45 uebayasi Exp $ */ +/* $NetBSD: defs.h,v 1.71 2015/08/30 01:33:20 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -107,7 +107,7 @@ extern const char *progname; * The next two lines define the current version of the config(1) binary, * and the minimum version of the configuration files it supports. */ -#define CONFIG_VERSION 20150830 +#define CONFIG_VERSION 20150831 #define CONFIG_MINVERSION 0 /* @@ -610,6 +610,7 @@ int devbase_has_instances(struct devbase int is_declared_option(const char *); int deva_has_instances(struct deva *, int); void setupdirs(void); +void fixmkoption(void); const char *strtolower(const char *); /* tests on option types */ Index: src/usr.bin/config/main.c diff -u src/usr.bin/config/main.c:1.79 src/usr.bin/config/main.c:1.80 --- src/usr.bin/config/main.c:1.79 Sat Aug 29 13:34:21 2015 +++ src/usr.bin/config/main.c Sun Aug 30 01:33:20 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.79 2015/08/29 13:34:21 uebayasi Exp $ */ +/* $NetBSD: main.c,v 1.80 2015/08/30 01:33:20 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include sys/cdefs.h -__RCSID($NetBSD: main.c,v 1.79 2015/08/29 13:34:21 uebayasi Exp $); +__RCSID($NetBSD: main.c,v 1.80 2015/08/30 01:33:20 uebayasi Exp $); #ifndef MAKE_BOOTSTRAP #include sys/cdefs.h @@ -429,6 +429,12 @@ main(int argc, char **argv) stop(); /* + * Copy makeoptions to params + */ + yyfile = fixmkoption; + fixmkoption(); + + /* * If working on an ioconf-only config, process here and exit */ if (ioconfname) { @@ -1098,6 +1104,25 @@ appendcondmkoption(struct condexpr *cond } /* + * Copy makeoptions to params with makeoptions_ prefix. + */ +void +fixmkoption(void) +{ + struct nvlist *nv; + char buf[100]; + const char *name; + + for (nv = mkoptions; nv != NULL; nv = nv-nv_next) { + snprintf(buf, sizeof(buf), makeoptions_%s, nv-nv_name); + name = intern(buf); + if (!DEFINED_OPTION(name) || !OPT_DEFPARAM(name)) + continue; + addoption(name, intern(nv-nv_str)); + } +} + +/* * Add a name=value pair to an option list. The value may be NULL. */ static int