Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 May 2017 04:29:21 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r318172 - in stable: 10/sys/kern 11/sys/kern
Message-ID:  <201705110429.v4B4TLCh025429@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu May 11 04:29:20 2017
New Revision: 318172
URL: https://svnweb.freebsd.org/changeset/base/318172

Log:
  MFC 313999: Consolidate statements to initialize files.
  
  Previously, the first lines of various generated files from system call
  tables were generated in two sections.  Some of the initialization was
  done in BEGIN, and the rest was done when the first line was encountered.
  The main reason for this split before r313564 was that most of the
  initialization done in the second section depended on the $FreeBSD$ tag
  extracted from the system call table.  Now that the $FreeBSD$ tag is no
  longer used, consolidate all of the file initialization in the BEGIN
  section.
  
  This change was tested by confirming that the content of generated files
  did not change.

Modified:
  stable/11/sys/kern/makesyscalls.sh
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/kern/makesyscalls.sh
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/kern/makesyscalls.sh
==============================================================================
--- stable/11/sys/kern/makesyscalls.sh	Thu May 11 03:47:58 2017	(r318171)
+++ stable/11/sys/kern/makesyscalls.sh	Thu May 11 04:29:20 2017	(r318172)
@@ -116,6 +116,9 @@ sed -e '
 
 		split(capenabled_string, capenabled, ",");
 
+		printf "\n/* The casts are bogus but will do for now. */\n" > sysent
+		printf "struct sysent %s[] = {\n",switchname > sysent
+
 		printf "/*\n * System call switch table.\n *\n" > syssw
 		printf " * DO NOT EDIT-- this file is automatically generated.\n" > syssw
 		printf " * $%s$\n", "FreeBSD" > syssw
@@ -125,35 +128,6 @@ sed -e '
 		printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysarg
 		printf " * $%s$\n", "FreeBSD" > sysarg
 		printf " */\n\n" > sysarg
-
-		printf "\n#ifdef %s\n\n", compat > syscompat
-		printf "\n#ifdef %s\n\n", compat4 > syscompat4
-		printf "\n#ifdef %s\n\n", compat6 > syscompat6
-		printf "\n#ifdef %s\n\n", compat7 > syscompat7
-		printf "\n#ifdef %s\n\n", compat10 > syscompat10
-
-		printf "/*\n * System call names.\n *\n" > sysnames
-		printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames
-		printf " * $%s$\n", "FreeBSD" > sysnames
-		printf " */\n\n" > sysnames
-
-		printf "/*\n * System call numbers.\n *\n" > syshdr
-		printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshdr
-		printf " * $%s$\n", "FreeBSD" > syshdr
-		printf " */\n\n" > syshdr
-
-		printf "# FreeBSD system call object files.\n" > sysmk
-		printf "# DO NOT EDIT-- this file is automatically generated.\n" > sysmk
-		printf "# $%s$\n", "FreeBSD" > sysmk
-
-		printf "/*\n * System call argument to DTrace register array converstion.\n *\n" > systrace
-		printf " * DO NOT EDIT-- this file is automatically generated.\n" > systrace
-		printf " * $%s$\n", "FreeBSD" > systrace
-	}
-	NR == 1 {
-		printf "\n/* The casts are bogus but will do for now. */\n" > sysent
-		printf "struct sysent %s[] = {\n",switchname > sysent
-
 		printf "#ifndef %s\n", sysproto_h > sysarg
 		printf "#define\t%s\n\n", sysproto_h > sysarg
 		printf "#include <sys/signal.h>\n" > sysarg
@@ -176,10 +150,31 @@ sed -e '
 		printf "#define\tPADR_(t)\t0\n" > sysarg
 		printf "#endif\n\n" > sysarg
 
+		printf "\n#ifdef %s\n\n", compat > syscompat
+		printf "\n#ifdef %s\n\n", compat4 > syscompat4
+		printf "\n#ifdef %s\n\n", compat6 > syscompat6
+		printf "\n#ifdef %s\n\n", compat7 > syscompat7
+		printf "\n#ifdef %s\n\n", compat10 > syscompat10
+
+		printf "/*\n * System call names.\n *\n" > sysnames
+		printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames
+		printf " * $%s$\n", "FreeBSD" > sysnames
+		printf " */\n\n" > sysnames
 		printf "const char *%s[] = {\n", namesname > sysnames
 
+		printf "/*\n * System call numbers.\n *\n" > syshdr
+		printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshdr
+		printf " * $%s$\n", "FreeBSD" > syshdr
+		printf " */\n\n" > syshdr
+
+		printf "# FreeBSD system call object files.\n" > sysmk
+		printf "# DO NOT EDIT-- this file is automatically generated.\n" > sysmk
+		printf "# $%s$\n", "FreeBSD" > sysmk
 		printf "MIASM = " > sysmk
 
+		printf "/*\n * System call argument to DTrace register array converstion.\n *\n" > systrace
+		printf " * DO NOT EDIT-- this file is automatically generated.\n" > systrace
+		printf " * $%s$\n", "FreeBSD" > systrace
 		printf " * This file is part of the DTrace syscall provider.\n */\n\n" > systrace
 		printf "static void\nsystrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)\n{\n" > systrace
 		printf "\tint64_t *iarg  = (int64_t *) uarg;\n" > systrace
@@ -190,7 +185,8 @@ sed -e '
 
 		printf "static void\nsystrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)\n{\n\tconst char *p = NULL;\n" > systraceret
 		printf "\tswitch (sysnum) {\n" > systraceret
-
+	}
+	NR == 1 {
 		next
 	}
 	NF == 0 || $1 ~ /^;/ {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705110429.v4B4TLCh025429>