Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jun 2009 16:13:06 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r193234 - in head/sys: kern sys
Message-ID:  <200906011613.n51GD6kZ083855@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rwatson
Date: Mon Jun  1 16:13:06 2009
New Revision: 193234
URL: http://svn.freebsd.org/changeset/base/193234

Log:
  Add 'sy_flags', a currently unused per-syscall entry flags field that will
  see future use in 9-CURRENT and 8-STABLE for features such as the
  capability-mode enable flag and pay-as-you-audit.
  
  Discussed with:	jhb, sson

Modified:
  head/sys/kern/makesyscalls.sh
  head/sys/sys/sysent.h

Modified: head/sys/kern/makesyscalls.sh
==============================================================================
--- head/sys/kern/makesyscalls.sh	Mon Jun  1 16:00:36 2009	(r193233)
+++ head/sys/kern/makesyscalls.sh	Mon Jun  1 16:13:06 2009	(r193234)
@@ -318,6 +318,13 @@ s/\$//g
 		auditev = $2;
 	}
 
+	#
+	# The currently-empty flags field.
+	#
+	{
+		flags = "0";
+	}
+
 	$3 == "STD" || $3 == "NODEF" || $3 == "NOARGS"  || $3 == "NOPROTO" \
 	    || $3 == "NOIMPL" || $3 == "NOSTD" {
 		parseline()
@@ -369,14 +376,14 @@ s/\$//g
 		printf("\t{ %s, (sy_call_t *)", argssize) > sysent
 		column = 8 + 2 + length(argssize) + 15
 		if ($3 == "NOIMPL") {
-			printf("%s },", "nosys, AUE_NULL, NULL, 0, 0") > sysent
-			column = column + length("nosys") + 3
+			printf("%s },", "nosys, AUE_NULL, NULL, 0, 0, 0") > sysent
+			column = column + length("nosys") + length("AUE_NULL") + 3
 		} else if ($3 == "NOSTD") {
-			printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0") > sysent
-			column = column + length("lkmressys") + 3
+			printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0, 0") > sysent
+			column = column + length("lkmressys") + length("AUE_NULL") + 3
 		} else {
-			printf("%s, %s, NULL, 0, 0 },", funcname, auditev) > sysent
-			column = column + length(funcname) + length(auditev) + 3
+			printf("%s, %s, NULL, 0, 0, %s },", funcname, auditev, flags) > sysent
+			column = column + length(funcname) + length(auditev) + length(flags) + 3
 		} 
 		align_sysent_comment(column)
 		printf("/* %d = %s */\n", syscall, funcalias) > sysent
@@ -426,10 +433,10 @@ s/\$//g
 			    argalias) > sysarg
 		printf("%s\t%s%s(struct thread *, struct %s *);\n",
 		    rettype, prefix, funcname, argalias) > outdcl
-		printf("\t{ %s(%s,%s), %s, NULL, 0, 0 },",
-		    wrap, argssize, funcname, auditev) > sysent
+		printf("\t{ %s(%s,%s), %s, NULL, 0, 0, %s },",
+		    wrap, argssize, funcname, auditev, flags) > sysent
 		align_sysent_comment(8 + 9 + \
-		    length(argssize) + 1 + length(funcname) + length(auditev) + 4)
+		    length(argssize) + 1 + length(funcname) + length(auditev) + length(flags) + 4)
 		printf("/* %d = old %s */\n", syscall, funcalias) > sysent
 		printf("\t\"%s.%s\",\t\t/* %d = old %s */\n",
 		    wrap, funcalias, syscall, funcalias) > sysnames
@@ -448,10 +455,10 @@ s/\$//g
 		ncompat++
 		parseline()
 		printf("%s\to%s();\n", rettype, funcname) > syscompatdcl
-		printf("\t{ compat(%s,%s), %s, NULL, 0, 0 },",
-		    argssize, funcname, auditev) > sysent
+		printf("\t{ compat(%s,%s), %s, NULL, 0, 0, %s },",
+		    argssize, funcname, auditev, flags) > sysent
 		align_sysent_comment(8 + 9 + \
-		    length(argssize) + 1 + length(funcname) + length(auditev) + 4)
+		    length(argssize) + 1 + length(funcname) + length(auditev) + length(flags) + 4)
 		printf("/* %d = old %s */\n", syscall, funcalias) > sysent
 		printf("\t\"old.%s\",\t\t/* %d = old %s */\n",
 		    funcalias, syscall, funcalias) > sysnames
@@ -462,7 +469,7 @@ s/\$//g
 		next
 	}
 	$3 == "OBSOL" {
-		printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },") > sysent
+		printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },") > sysent
 		align_sysent_comment(34)
 		printf("/* %d = obsolete %s */\n", syscall, comment) > sysent
 		printf("\t\"obs_%s\",\t\t\t/* %d = obsolete %s */\n",
@@ -473,7 +480,7 @@ s/\$//g
 		next
 	}
 	$3 == "UNIMPL" {
-		printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },\t\t\t/* %d = %s */\n",
+		printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },\t\t\t/* %d = %s */\n",
 		    syscall, comment) > sysent
 		printf("\t\"#%d\",\t\t\t/* %d = %s */\n",
 		    syscall, syscall, comment) > sysnames

Modified: head/sys/sys/sysent.h
==============================================================================
--- head/sys/sys/sysent.h	Mon Jun  1 16:00:36 2009	(r193233)
+++ head/sys/sys/sysent.h	Mon Jun  1 16:13:06 2009	(r193234)
@@ -60,6 +60,7 @@ struct sysent {			/* system call table *
 				/* optional argument conversion function. */
 	u_int32_t sy_entry;	/* DTrace entry ID for systrace. */
 	u_int32_t sy_return;	/* DTrace return ID for systrace. */
+	u_int32_t sy_flags;	/* General flags for system calls. */
 };
 
 struct image_params;



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