svn commit: r346811 - stable/11/sys/kern

Dmitry Chagin dchagin at FreeBSD.org
Sun Apr 28 09:49:32 UTC 2019


Author: dchagin
Date: Sun Apr 28 09:49:30 2019
New Revision: 346811
URL: https://svnweb.freebsd.org/changeset/base/346811

Log:
  MFC r328598 (by emaste@):
  
  makesyscalls: permit a range of syscall numbers for UNIMPL
  
  Some ABIs have large gaps in syscall numbers.  Allow gaps to be filled
  as ranges of UNIMPL, with an entry like:
  
  248-1023	AUE_NULL	UNIMPL	unimplemented

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

Modified: stable/11/sys/kern/makesyscalls.sh
==============================================================================
--- stable/11/sys/kern/makesyscalls.sh	Sun Apr 28 09:47:33 2019	(r346810)
+++ stable/11/sys/kern/makesyscalls.sh	Sun Apr 28 09:49:30 2019	(r346811)
@@ -243,13 +243,6 @@ sed -e '
 		print > systraceret
 		next
 	}
-	syscall != $1 {
-		printf "%s: line %d: syscall number out of sync at %d\n",
-		    infile, NR, syscall
-		printf "line is:\n"
-		print
-		exit 1
-	}
 	# Returns true if the type "name" is the first flag in the type field
 	function type(name, flags, n) {
 		n = split($3, flags, /\|/)
@@ -263,6 +256,29 @@ sed -e '
 				return 1
 		return 0
 	}
+	{
+		n = split($1, syscall_range, /-/)
+		if (n == 1) {
+			syscall_range[2] = syscall_range[1]
+		} else if (n == 2) {
+			if (!type("UNIMPL")) {
+				printf "%s: line %d: range permitted only with UNIMPL\n",
+				    infile, NR
+				exit 1
+			}
+		} else {
+			printf "%s: line %d: invalid syscall number or range %s\n",
+			    infile, NR, $1
+			exit 1
+		}
+	}
+	syscall != syscall_range[1] {
+		printf "%s: line %d: syscall number out of sync at %d\n",
+		    infile, NR, syscall
+		printf "line is:\n"
+		print
+		exit 1
+	}
 	function align_sysent_comment(column) {
 		printf("\t") > sysent
 		column = column + 8 - column % 8
@@ -593,11 +609,13 @@ sed -e '
 		next
 	}
 	type("UNIMPL") {
-		printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },\t\t\t/* %d = %s */\n",
-		    syscall, comment) > sysent
-		printf("\t\"#%d\",\t\t\t/* %d = %s */\n",
-		    syscall, syscall, comment) > sysnames
-		syscall++
+		while (syscall <= syscall_range[2]) {
+			printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },\t\t\t/* %d = %s */\n",
+			    syscall, comment) > sysent
+			printf("\t\"#%d\",\t\t\t/* %d = %s */\n",
+			    syscall, syscall, comment) > sysnames
+			syscall++
+		}
 		next
 	}
 	{


More information about the svn-src-all mailing list