Module Name:    src
Committed By:   tls
Date:           Sun Aug 10 06:54:36 UTC 2014

Modified Files:
        src/sys/conf [tls-earlyentropy]: Makefile.kern.inc files newvers.sh

Log Message:
Rebase.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.167.2.1 src/sys/conf/Makefile.kern.inc
cvs rdiff -u -r1.1090.2.2 -r1.1090.2.3 src/sys/conf/files
cvs rdiff -u -r1.57 -r1.57.36.1 src/sys/conf/newvers.sh

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.167 src/sys/conf/Makefile.kern.inc:1.167.2.1
--- src/sys/conf/Makefile.kern.inc:1.167	Mon Mar 10 02:36:50 2014
+++ src/sys/conf/Makefile.kern.inc	Sun Aug 10 06:54:36 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.167 2014/03/10 02:36:50 ozaki-r Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.167.2.1 2014/08/10 06:54:36 tls Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -17,6 +17,11 @@
 #
 # all ports are expected to include bsd.own.mk for toolchain settings
 
+# Default DEBUG to -g if kernel debug info is requested by MKKDEBUG=yes
+.if defined(MKKDEBUG) && ${MKKDEBUG} == "yes"
+DEBUG?=-g
+.endif
+
 ##
 ## (0) toolchain settings for things that aren't part of the standard
 ## toolchain
@@ -111,13 +116,6 @@ COPTS.kern_ssp.c+=	-fno-stack-protector 
 COPTS.cpu.c+=		-fno-stack-protector
 .endif
 
-# If we want the bpendtsleep: label in kern_synch.c, we need to use
-# -fno-reorder-blocks.  Don't make this a config(1) defflag without
-# making sure this fragment remains valid.
-.if defined(HAVE_GCC) && !empty(${CFLAGS:M-DKERN_SYNCH_BPENDTSLEEP_LABEL})
-COPTS.kern_synch.c+=	-fno-reorder-blocks
-.endif
-
 # Use the per-source COPTS variables to add -g to just those
 # files that match the shell patterns given in ${DEBUGLIST}
 #

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1090.2.2 src/sys/conf/files:1.1090.2.3
--- src/sys/conf/files:1.1090.2.2	Sat Aug  9 06:19:50 2014
+++ src/sys/conf/files	Sun Aug 10 06:54:36 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1090.2.2 2014/08/09 06:19:50 tls Exp $
+#	$NetBSD: files,v 1.1090.2.3 2014/08/10 06:54:36 tls Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20100430
@@ -1231,6 +1231,10 @@ file	dev/usb/ehci.c			ehci			needs-flag
 device	xhci: usbus, usbroothub, usb_dma
 file	dev/usb/xhci.c			xhci			needs-flag
 
+# Mentor graphics OTG IP
+device	motg: usbus, usbroothub, usb_dma
+file	dev/usb/motg.c			motg			needs-flag
+
 # SL811HS/T USB controller
 defflag	opt_slhci.h	SLHCI_DEBUG SLHCI_TRY_LSVH SLHCI_PROFILE_TRANSFER
 device	slhci: usbus, usbroothub
@@ -1601,6 +1605,7 @@ file	kern/subr_extent.c
 file	kern/subr_hash.c
 file	kern/subr_humanize.c
 file	kern/subr_iostat.c
+file	kern/subr_ipi.c
 file	kern/subr_kcpuset.c
 file	kern/subr_kmem.c
 file	kern/subr_kobj.c
@@ -1706,7 +1711,7 @@ file	net/bridgestp.c			bridge
 file	net/if_ecosubr.c		eco
 file	net/if_etherip.c		etherip			needs-flag
 file	net/if_ethersubr.c		ether | fddi | netatalk | token |
-					    wlan
+					    wlan		needs-flag
 file	net/if_faith.c			faith & (inet | inet6)	needs-flag
 file	net/if_fddisubr.c		fddi			needs-flag
 file	net/if_gif.c			gif			needs-flag
@@ -1718,7 +1723,7 @@ file	net/if_media.c
 file	net/if_mpls.c			ifmpls			needs-flag
 file	net/if_ppp.c			ppp			needs-flag
 file	net/if_srt.c			srt
-file	net/if_stf.c			stf & (inet | inet6)	needs-flag
+file	net/if_stf.c			stf & inet & inet6	needs-flag
 file	net/if_sl.c			sl			needs-flag
 file	net/if_spppsubr.c		sppp
 file	net/if_strip.c			strip			needs-flag
@@ -1730,6 +1735,7 @@ file	net/if_pppoe.c			pppoe			needs-flag
 file	net/pfil.c
 file	net/ppp-deflate.c		ppp & ppp_deflate
 file	net/ppp_tty.c			ppp
+file	net/pktqueue.c
 file	net/net_stats.c
 file	net/radix.c
 file	net/raw_cb.c

Index: src/sys/conf/newvers.sh
diff -u src/sys/conf/newvers.sh:1.57 src/sys/conf/newvers.sh:1.57.36.1
--- src/sys/conf/newvers.sh:1.57	Sun Jan 10 23:55:03 2010
+++ src/sys/conf/newvers.sh	Sun Aug 10 06:54:36 2014
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#	$NetBSD: newvers.sh,v 1.57 2010/01/10 23:55:03 snj Exp $
+#	$NetBSD: newvers.sh,v 1.57.36.1 2014/08/10 06:54:36 tls Exp $
 #
 # Copyright (c) 1984, 1986, 1990, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -31,6 +31,115 @@
 #
 #	@(#)newvers.sh	8.1 (Berkeley) 4/20/94
 
+# newvers.sh -- Create a "vers.c" file containing version information.
+#
+# The "vers.c" file in the current directory is the primary output.  It
+# contains C source code with several variables containing information
+# about the build.  This file is expected to be incorporated into a
+# kernel, and when that kernel is booted then the information can be
+# queried by the uname(8) command.
+#
+# Command line options:
+#
+#     -r                Reproducible build: Do not embed directory
+#                       names, user names, time stamps, or other dynamic
+#                       information into the output file.  This intended
+#                       to allow two builds done at different times and
+#                       even by different people on different hosts to
+#                       produce identical output.
+#
+#     -i <id>           Use the specified string as the value of the
+#                       kernel_ident variable
+#
+#     -n                Do not include an ELF note section in the output
+#                       file.
+# Environment variables:
+#
+#     BUILDID		If defined, ${BUILDID} is appended to the
+#			default value of the kernel_ident string.
+#			(If the -i command line option is used, then
+#			BUILDID is not appended.)
+#
+#     BUILDINFO		A string to be stored in the kernel's buildinfo
+#			variable.  ${BUILDINFO} may be a multi-line string,
+#			and may use C-style backslash escapes.
+#			Lines may be separated by either literal newlines
+#			or "\n" escape sequences.
+#
+# Output files:
+#
+#     vers.c            The "vers.c" file in the current directory is
+#                       the primary output.
+#
+#     version           The "version" file in the current directory
+#                       is both an input and an output.  See the
+#                       description under "Input files".
+#
+# Input files:
+#
+#     version           The "version" file in the current directory
+#                       contains an integer counter, representing the
+#                       number of times this script has been executed in
+#                       this directory, starting with "0" if the file
+#                       does not exist.  The serial number in the file
+#                       is incremented after the file is read. so that
+#                       the incremented serial number is an output from
+#                       the present build and an input to the next build
+#                       that is performed in the same directory.
+#
+#     copyright         The "copyright" file (in the same directory as
+#                       this script itself) contains a copyright notice,
+#                       which is embedded in the copyright variable in
+#                       the output file.
+#
+#     ident             The "ident" file in the current directory is optional.
+#			If this file exists, then its contents override the
+#			default value of the kernel_ident string.
+#
+# Input from external commands:
+#
+#     osrelease.sh      This script is expected to print the OS revision.
+#                       The result is stored in the osrelease variable.
+#
+
+# FUNCTIONS
+
+# source_lines [input] --
+#
+# Convert a multi-line string to a format that's suitable for inclusion in
+# C source code.  The result should look like this:
+#
+# "first line\n"
+# "second line\n"
+#
+# with <backslash><letter n> inside the quotes for each line,
+# literal quotation marks around each line,
+# and a literal newline separating one line from the next.
+#
+# Input is from "$1" if that is defined, or from stdin if $1 is not defined.
+#
+source_lines()
+{
+	if [ -n "${1+set}" ]; then
+		printf "%s" "$1"
+	else
+		cat
+	fi \
+	| awk '{
+		# awk does not care about whether or not the last line
+		# of input ends with a newline.
+		# Convert <backslash> to <backslash><backslash>.
+		gsub("\\\\","\\\\");
+		# Convert <quote> to <backslash><quote>
+		gsub("\"","\\\"");
+		# Add <backslash><letter n> to the end of each line,
+		# and wrap each line in double quotes.
+		printf("\"%s\\n\"\n", $0);
+	}'
+}
+
+# MAIN PROGRAM
+
 if [ ! -e version ]; then
 	echo 0 > version
 fi
@@ -41,18 +150,23 @@ u=${USER-root}
 h=$(hostname)
 d=$(pwd)
 cwd=$(dirname $0)
-copyright=$(awk '{ printf("\"%s\\n\"", $0); }' ${cwd}/copyright)
+copyright="$(cat "${cwd}/copyright")"
 
 while [ $# -gt 0 ]; do
 	case "$1" in
 	-r)
+		# -r: Reproducible build
 		rflag=true
 		;;
 	-i)
+		# -i <id>: Use the secified string as the
+		# value of the kernel_ident variable
 		id="$2"
 		shift
 		;;
 	-n)
+		# -n: Do not include a ELF note section
+		# in the output file.
 		nflag=true
 		;;
 	esac
@@ -65,6 +179,13 @@ if [ -z "${id}" ]; then
 	else
 		id=$(basename ${d})
 	fi
+	# Append ".${BUILDID}" to the default value of <id>.
+	# If the "-i <id>" command line option was used then this
+	# branch is not taken, so the command-line value of <id>
+	# is used without change.
+	if [ -n "${BUILDID}" ]; then
+		id="${id}.${BUILDID}"
+	fi
 fi
 
 osrelcmd=${cwd}/osrelease.sh
@@ -78,8 +199,19 @@ else
 	fullversion="${ost} ${osr} (${id}) #${v}: ${t}\n\t${u}@${h}:${d}\n"
 fi
 
+# Convert multi-line strings to C source code.
+# Also add an extra blank line to copyright.
+#
+copyright_source="$(printf "%s\n\n" "${copyright}" | source_lines)"
+fullversion_source="$(printf "%b" "${fullversion}" | source_lines)"
+buildinfo_source="$(printf "%b" "${BUILDINFO}" | source_lines)"
+
+# Increment the serial number in the version file
 echo $(expr ${v} + 1) > version
 
+# work around escaping issues with different shells
+emptyq='""'
+
 cat << _EOF > vers.c
 /*
  * Automatically generated file from $0
@@ -93,12 +225,11 @@ cat << _EOF > vers.c
 
 const char ostype[] = "${ost}";
 const char osrelease[] = "${osr}";
-const char sccs[] = "@(#)${fullversion}";
-const char version[] = "${fullversion}";
+const char sccs[] = "@(#)" ${fullversion_source};
+const char version[] = ${fullversion_source};
+const char buildinfo[] = ${buildinfo_source:-${emptyq}};
 const char kernel_ident[] = "${id}";
-const char copyright[] =
-${copyright}
-"\n";
+const char copyright[] = ${copyright_source};
 _EOF
 
 [ ! -z "${nflag}" ] && exit 0

Reply via email to