aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/makesyscalls.sh
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2017-05-23 09:29:05 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2017-05-23 09:29:05 +0000
commit69921123490b99c2588b0c743bc4af32bbe6601c (patch)
tree4828066c23bd9bbd1672af14fbf0a9e31e47f4a0 /sys/kern/makesyscalls.sh
parent5f7c516f216995249523ed43e57e3f91bd8f5ff0 (diff)
downloadsrc-69921123490b99c2588b0c743bc4af32bbe6601c.tar.gz
src-69921123490b99c2588b0c743bc4af32bbe6601c.zip
Commit the 64-bit inode project.
Extend the ino_t, dev_t, nlink_t types to 64-bit ints. Modify struct dirent layout to add d_off, increase the size of d_fileno to 64-bits, increase the size of d_namlen to 16-bits, and change the required alignment. Increase struct statfs f_mntfromname[] and f_mntonname[] array length MNAMELEN to 1024. ABI breakage is mitigated by providing compatibility using versioned symbols, ingenious use of the existing padding in structures, and by employing other tricks. Unfortunately, not everything can be fixed, especially outside the base system. For instance, third-party APIs which pass struct stat around are broken in backward and forward incompatible ways. Kinfo sysctl MIBs ABI is changed in backward-compatible way, but there is no general mechanism to handle other sysctl MIBS which return structures where the layout has changed. It was considered that the breakage is either in the management interfaces, where we usually allow ABI slip, or is not important. Struct xvnode changed layout, no compat shims are provided. For struct xtty, dev_t tty device member was reduced to uint32_t. It was decided that keeping ABI compat in this case is more useful than reporting 64-bit dev_t, for the sake of pstat. Update note: strictly follow the instructions in UPDATING. Build and install the new kernel with COMPAT_FREEBSD11 option enabled, then reboot, and only then install new world. Credits: The 64-bit inode project, also known as ino64, started life many years ago as a project by Gleb Kurtsou (gleb). Kirk McKusick (mckusick) then picked up and updated the patch, and acted as a flag-waver. Feedback, suggestions, and discussions were carried by Ed Maste (emaste), John Baldwin (jhb), Jilles Tjoelker (jilles), and Rick Macklem (rmacklem). Kris Moore (kris) performed an initial ports investigation followed by an exp-run by Antoine Brodin (antoine). Essential and all-embracing testing was done by Peter Holm (pho). The heavy lifting of coordinating all these efforts and bringing the project to completion were done by Konstantin Belousov (kib). Sponsored by: The FreeBSD Foundation (emaste, kib) Differential revision: https://reviews.freebsd.org/D10439
Notes
Notes: svn path=/head/; revision=318736
Diffstat (limited to 'sys/kern/makesyscalls.sh')
-rw-r--r--sys/kern/makesyscalls.sh37
1 files changed, 33 insertions, 4 deletions
diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh
index f220554ab04e..7ea37de6e53c 100644
--- a/sys/kern/makesyscalls.sh
+++ b/sys/kern/makesyscalls.sh
@@ -10,6 +10,7 @@ compat4=COMPAT_FREEBSD4
compat6=COMPAT_FREEBSD6
compat7=COMPAT_FREEBSD7
compat10=COMPAT_FREEBSD10
+compat11=COMPAT_FREEBSD11
# output files:
sysnames="syscalls.c"
@@ -36,6 +37,8 @@ syscompat7="sysent.compat7.$$"
syscompat7dcl="sysent.compat7dcl.$$"
syscompat10="sysent.compat10.$$"
syscompat10dcl="sysent.compat10dcl.$$"
+syscompat11="sysent.compat11.$$"
+syscompat11dcl="sysent.compat11dcl.$$"
sysent="sysent.switch.$$"
sysinc="sysinc.switch.$$"
sysarg="sysarg.switch.$$"
@@ -50,9 +53,9 @@ else
capenabled=""
fi
-trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret" 0
+trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $syscompat11 $syscompat11dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret" 0
-touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret
+touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $syscompat11 $syscompat11dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret
case $# in
0) echo "usage: $0 input-file <config-file>" 1>&2
@@ -92,6 +95,8 @@ sed -e '
syscompat7dcl = \"$syscompat7dcl\"
syscompat10 = \"$syscompat10\"
syscompat10dcl = \"$syscompat10dcl\"
+ syscompat11 = \"$syscompat11\"
+ syscompat11dcl = \"$syscompat11dcl\"
sysent = \"$sysent\"
syssw = \"$syssw\"
sysinc = \"$sysinc\"
@@ -107,6 +112,7 @@ sed -e '
compat6 = \"$compat6\"
compat7 = \"$compat7\"
compat10 = \"$compat10\"
+ compat11 = \"$compat11\"
syscallprefix = \"$syscallprefix\"
switchname = \"$switchname\"
namesname = \"$namesname\"
@@ -155,6 +161,7 @@ sed -e '
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#ifdef %s\n\n", compat11 > syscompat11
printf "/*\n * System call names.\n *\n" > sysnames
printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames
@@ -205,6 +212,7 @@ sed -e '
print > syscompat6
print > syscompat7
print > syscompat10
+ print > syscompat11
print > sysnames
print > systrace
print > systracetmp
@@ -221,6 +229,7 @@ sed -e '
print > syscompat6
print > syscompat7
print > syscompat10
+ print > syscompat11
print > sysnames
print > systrace
print > systracetmp
@@ -237,6 +246,7 @@ sed -e '
print > syscompat6
print > syscompat7
print > syscompat10
+ print > syscompat11
print > sysnames
print > systrace
print > systracetmp
@@ -345,6 +355,8 @@ sed -e '
argalias = "freebsd7_" argalias
if (flag("COMPAT10"))
argalias = "freebsd10_" argalias
+ if (flag("COMPAT11"))
+ argalias = "freebsd11_" argalias
}
f++
@@ -497,7 +509,7 @@ sed -e '
next
}
type("COMPAT") || type("COMPAT4") || type("COMPAT6") || \
- type("COMPAT7") || type("COMPAT10") {
+ type("COMPAT7") || type("COMPAT10") || type("COMPAT11") {
if (flag("COMPAT")) {
ncompat++
out = syscompat
@@ -533,6 +545,13 @@ sed -e '
wrap = "compat10"
prefix = "freebsd10_"
descr = "freebsd10"
+ } else if (flag("COMPAT11")) {
+ ncompat11++
+ out = syscompat11
+ outdcl = syscompat11dcl
+ wrap = "compat11"
+ prefix = "freebsd11_"
+ descr = "freebsd11"
}
parseline()
if (argc != 0 && !flag("NOARGS") && !flag("NOPROTO") && \
@@ -608,7 +627,7 @@ sed -e '
END {
printf "\n#define AS(name) (sizeof(struct name) / sizeof(register_t))\n" > sysinc
- if (ncompat != 0 || ncompat4 != 0 || ncompat6 != 0 || ncompat7 != 0 || ncompat10 != 0)
+ if (ncompat != 0 || ncompat4 != 0 || ncompat6 != 0 || ncompat7 != 0 || ncompat10 != 0 || ncompat11 != 0)
printf "#include \"opt_compat.h\"\n\n" > syssw
if (ncompat != 0) {
@@ -649,11 +668,20 @@ sed -e '
printf "#define compat10(n, name) 0, (sy_call_t *)nosys\n" > sysinc
printf "#endif\n" > sysinc
}
+ if (ncompat11 != 0) {
+ printf "\n#ifdef %s\n", compat11 > sysinc
+ printf "#define compat11(n, name) n, (sy_call_t *)__CONCAT(freebsd11_,name)\n" > sysinc
+ printf "#else\n" > sysinc
+ printf "#define compat11(n, name) 0, (sy_call_t *)nosys\n" > sysinc
+ printf "#endif\n" > sysinc
+ }
+
printf("\n#endif /* %s */\n\n", compat) > syscompatdcl
printf("\n#endif /* %s */\n\n", compat4) > syscompat4dcl
printf("\n#endif /* %s */\n\n", compat6) > syscompat6dcl
printf("\n#endif /* %s */\n\n", compat7) > syscompat7dcl
printf("\n#endif /* %s */\n\n", compat10) > syscompat10dcl
+ printf("\n#endif /* %s */\n\n", compat11) > syscompat11dcl
printf("\n#undef PAD_\n") > sysprotoend
printf("#undef PADL_\n") > sysprotoend
@@ -677,6 +705,7 @@ cat $sysarg $sysdcl \
$syscompat6 $syscompat6dcl \
$syscompat7 $syscompat7dcl \
$syscompat10 $syscompat10dcl \
+ $syscompat11 $syscompat11dcl \
$sysaue $sysprotoend > $sysproto
cat $systracetmp >> $systrace
cat $systraceret >> $systrace