The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/kern/makesyscalls.sh

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #! /bin/sh -
    2 #       @(#)makesyscalls.sh     8.1 (Berkeley) 6/10/93
    3 # $FreeBSD$
    4 
    5 set -e
    6 
    7 # name of compat options:
    8 compat=COMPAT_43
    9 compat4=COMPAT_FREEBSD4
   10 compat6=COMPAT_FREEBSD6
   11 
   12 # output files:
   13 sysnames="syscalls.c"
   14 sysproto="../sys/sysproto.h"
   15 sysproto_h=_SYS_SYSPROTO_H_
   16 syshdr="../sys/syscall.h"
   17 sysmk="../sys/syscall.mk"
   18 syssw="init_sysent.c"
   19 syscallprefix="SYS_"
   20 switchname="sysent"
   21 namesname="syscallnames"
   22 systrace="systrace_args.c"
   23 
   24 # tmp files:
   25 sysaue="sysent.aue.$$"
   26 sysdcl="sysent.dcl.$$"
   27 syscompat="sysent.compat.$$"
   28 syscompatdcl="sysent.compatdcl.$$"
   29 syscompat4="sysent.compat4.$$"
   30 syscompat4dcl="sysent.compat4dcl.$$"
   31 syscompat6="sysent.compat6.$$"
   32 syscompat6dcl="sysent.compat6dcl.$$"
   33 sysent="sysent.switch.$$"
   34 sysinc="sysinc.switch.$$"
   35 sysarg="sysarg.switch.$$"
   36 sysprotoend="sysprotoend.$$"
   37 systracetmp="systrace.$$"
   38 
   39 trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp" 0
   40 
   41 touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp
   42 
   43 case $# in
   44     0)  echo "usage: $0 input-file <config-file>" 1>&2
   45         exit 1
   46         ;;
   47 esac
   48 
   49 if [ -n "$2" -a -f "$2" ]; then
   50         . $2
   51 fi
   52 
   53 sed -e '
   54 s/\$//g
   55 :join
   56         /\\$/{a\
   57 
   58         N
   59         s/\\\n//
   60         b join
   61         }
   62 2,${
   63         /^#/!s/\([{}()*,]\)/ \1 /g
   64 }
   65 ' < $1 | awk "
   66         BEGIN {
   67                 sysaue = \"$sysaue\"
   68                 sysdcl = \"$sysdcl\"
   69                 sysproto = \"$sysproto\"
   70                 sysprotoend = \"$sysprotoend\"
   71                 sysproto_h = \"$sysproto_h\"
   72                 syscompat = \"$syscompat\"
   73                 syscompatdcl = \"$syscompatdcl\"
   74                 syscompat4 = \"$syscompat4\"
   75                 syscompat4dcl = \"$syscompat4dcl\"
   76                 syscompat6 = \"$syscompat6\"
   77                 syscompat6dcl = \"$syscompat6dcl\"
   78                 sysent = \"$sysent\"
   79                 syssw = \"$syssw\"
   80                 sysinc = \"$sysinc\"
   81                 sysarg = \"$sysarg\"
   82                 sysnames = \"$sysnames\"
   83                 syshdr = \"$syshdr\"
   84                 sysmk = \"$sysmk\"
   85                 systrace = \"$systrace\"
   86                 systracetmp = \"$systracetmp\"
   87                 compat = \"$compat\"
   88                 compat4 = \"$compat4\"
   89                 compat6 = \"$compat6\"
   90                 syscallprefix = \"$syscallprefix\"
   91                 switchname = \"$switchname\"
   92                 namesname = \"$namesname\"
   93                 infile = \"$1\"
   94                 "'
   95 
   96                 printf "/*\n * System call switch table.\n *\n" > syssw
   97                 printf " * DO NOT EDIT-- this file is automatically generated.\n" > syssw
   98                 printf " * $%s$\n", "FreeBSD" > syssw
   99 
  100                 printf "/*\n * System call prototypes.\n *\n" > sysarg
  101                 printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysarg
  102                 printf " * $%s$\n", "FreeBSD" > sysarg
  103 
  104                 printf "\n#ifdef %s\n\n", compat > syscompat
  105                 printf "\n#ifdef %s\n\n", compat4 > syscompat4
  106                 printf "\n#ifdef %s\n\n", compat6 > syscompat6
  107 
  108                 printf "/*\n * System call names.\n *\n" > sysnames
  109                 printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames
  110                 printf " * $%s$\n", "FreeBSD" > sysnames
  111 
  112                 printf "/*\n * System call numbers.\n *\n" > syshdr
  113                 printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshdr
  114                 printf " * $%s$\n", "FreeBSD" > syshdr
  115                 printf "# FreeBSD system call names.\n" > sysmk
  116                 printf "# DO NOT EDIT-- this file is automatically generated.\n" > sysmk
  117                 printf "# $%s$\n", "FreeBSD" > sysmk
  118 
  119                 printf "/*\n * System call argument to DTrace register array converstion.\n *\n" > systrace
  120                 printf " * DO NOT EDIT-- this file is automatically generated.\n" > systrace
  121                 printf " * $%s$\n", "FreeBSD" > systrace
  122         }
  123         NR == 1 {
  124                 gsub("[$]FreeBSD: ", "", $0)
  125                 gsub(" [$]", "", $0)
  126 
  127                 printf " * created from%s\n */\n\n", $0 > syssw
  128 
  129                 printf "\n/* The casts are bogus but will do for now. */\n" > sysent
  130                 printf "struct sysent %s[] = {\n",switchname > sysent
  131 
  132                 printf " * created from%s\n */\n\n", $0 > sysarg
  133                 printf "#ifndef %s\n", sysproto_h > sysarg
  134                 printf "#define\t%s\n\n", sysproto_h > sysarg
  135                 printf "#include <sys/signal.h>\n" > sysarg
  136                 printf "#include <sys/acl.h>\n" > sysarg
  137                 printf "#include <sys/cpuset.h>\n" > sysarg
  138                 printf "#include <sys/_semaphore.h>\n" > sysarg
  139                 printf "#include <sys/ucontext.h>\n\n" > sysarg
  140                 printf "#include <bsm/audit_kevents.h>\n\n" > sysarg
  141                 printf "struct proc;\n\n" > sysarg
  142                 printf "struct thread;\n\n" > sysarg
  143                 printf "#define\tPAD_(t)\t(sizeof(register_t) <= sizeof(t) ? \\\n" > sysarg
  144                 printf "\t\t0 : sizeof(register_t) - sizeof(t))\n\n" > sysarg
  145                 printf "#if BYTE_ORDER == LITTLE_ENDIAN\n"> sysarg
  146                 printf "#define\tPADL_(t)\t0\n" > sysarg
  147                 printf "#define\tPADR_(t)\tPAD_(t)\n" > sysarg
  148                 printf "#else\n" > sysarg
  149                 printf "#define\tPADL_(t)\tPAD_(t)\n" > sysarg
  150                 printf "#define\tPADR_(t)\t0\n" > sysarg
  151                 printf "#endif\n\n" > sysarg
  152 
  153                 printf " * created from%s\n */\n\n", $0 > sysnames
  154                 printf "const char *%s[] = {\n", namesname > sysnames
  155 
  156                 printf " * created from%s\n */\n\n", $0 > syshdr
  157 
  158                 printf "# created from%s\nMIASM = ", $0 > sysmk
  159 
  160                 printf " * This file is part of the DTrace syscall provider.\n */\n\n" > systrace
  161                 printf "static void\nsystrace_args(int sysnum, void *params, u_int64_t *uarg, int *n_args)\n{\n" > systrace
  162                 printf "\tint64_t *iarg  = (int64_t *) uarg;\n" > systrace
  163                 printf "\tswitch (sysnum) {\n" > systrace
  164 
  165                 printf "static void\nsystrace_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)\n{\n\tconst char *p = NULL;\n" > systracetmp
  166                 printf "\tswitch (sysnum) {\n" > systracetmp
  167 
  168                 next
  169         }
  170         NF == 0 || $1 ~ /^;/ {
  171                 next
  172         }
  173         $1 ~ /^#[       ]*include/ {
  174                 print > sysinc
  175                 next
  176         }
  177         $1 ~ /^#[       ]*if/ {
  178                 print > sysent
  179                 print > sysdcl
  180                 print > sysarg
  181                 print > syscompat
  182                 print > syscompat4
  183                 print > syscompat6
  184                 print > sysnames
  185                 savesyscall = syscall
  186                 next
  187         }
  188         $1 ~ /^#[       ]*else/ {
  189                 print > sysent
  190                 print > sysdcl
  191                 print > sysarg
  192                 print > syscompat
  193                 print > syscompat4
  194                 print > syscompat6
  195                 print > sysnames
  196                 syscall = savesyscall
  197                 next
  198         }
  199         $1 ~ /^#/ {
  200                 print > sysent
  201                 print > sysdcl
  202                 print > sysarg
  203                 print > syscompat
  204                 print > syscompat4
  205                 print > syscompat6
  206                 print > sysnames
  207                 next
  208         }
  209         syscall != $1 {
  210                 printf "%s: line %d: syscall number out of sync at %d\n",
  211                     infile, NR, syscall
  212                 printf "line is:\n"
  213                 print
  214                 exit 1
  215         }
  216         # Returns true if the type "name" is the first flag in the type field
  217         function type(name, flags, n) {
  218                 n = split($3, flags, /\|/)
  219                 return (n > 0 && flags[1] == name)
  220         }
  221         # Returns true if the flag "name" is set in the type field
  222         function flag(name, flags, i, n) {
  223                 n = split($3, flags, /\|/)
  224                 for (i = 1; i <= n; i++)
  225                         if (flags[i] == name)
  226                                 return 1
  227                 return 0
  228         }
  229         function align_sysent_comment(column) {
  230                 printf("\t") > sysent
  231                 column = column + 8 - column % 8
  232                 while (column < 56) {
  233                         printf("\t") > sysent
  234                         column = column + 8
  235                 }
  236         }
  237         function parserr(was, wanted) {
  238                 printf "%s: line %d: unexpected %s (expected %s)\n",
  239                     infile, NR, was, wanted
  240                 exit 1
  241         }
  242         function parseline() {
  243                 f=4                     # toss number, type, audit event
  244                 argc= 0;
  245                 argssize = "0"
  246                 if ($NF != "}") {
  247                         funcalias=$(NF-2)
  248                         argalias=$(NF-1)
  249                         rettype=$NF
  250                         end=NF-3
  251                 } else {
  252                         funcalias=""
  253                         argalias=""
  254                         rettype="int"
  255                         end=NF
  256                 }
  257                 if (flag("NODEF")) {
  258                         auditev="AUE_NULL"
  259                         funcname=$4
  260                         argssize = "AS(" $6 ")"
  261                         return
  262                 }
  263                 if ($f != "{")
  264                         parserr($f, "{")
  265                 f++
  266                 if ($end != "}")
  267                         parserr($end, "}")
  268                 end--
  269                 if ($end != ";")
  270                         parserr($end, ";")
  271                 end--
  272                 if ($end != ")")
  273                         parserr($end, ")")
  274                 end--
  275 
  276                 f++     #function return type
  277 
  278                 funcname=$f
  279                 if (funcalias == "")
  280                         funcalias = funcname
  281                 if (argalias == "") {
  282                         argalias = funcname "_args"
  283                         if (flag("COMPAT"))
  284                                 argalias = "o" argalias
  285                         if (flag("COMPAT4"))
  286                                 argalias = "freebsd4_" argalias
  287                         if (flag("COMPAT6"))
  288                                 argalias = "freebsd6_" argalias
  289                 }
  290                 f++
  291 
  292                 if ($f != "(")
  293                         parserr($f, ")")
  294                 f++
  295 
  296                 if (f == end) {
  297                         if ($f != "void")
  298                                 parserr($f, "argument definition")
  299                         return
  300                 }
  301 
  302                 while (f <= end) {
  303                         argc++
  304                         argtype[argc]=""
  305                         oldf=""
  306                         while (f < end && $(f+1) != ",") {
  307                                 if (argtype[argc] != "" && oldf != "*")
  308                                         argtype[argc] = argtype[argc]" ";
  309                                 argtype[argc] = argtype[argc]$f;
  310                                 oldf = $f;
  311                                 f++
  312                         }
  313                         if (argtype[argc] == "")
  314                                 parserr($f, "argument definition")
  315                         argname[argc]=$f;
  316                         f += 2;                 # skip name, and any comma
  317                 }
  318                 if (argc != 0)
  319                         argssize = "AS(" argalias ")"
  320         }
  321         {       comment = $4
  322                 if (NF < 7)
  323                         for (i = 5; i <= NF; i++)
  324                                 comment = comment " " $i
  325         }
  326 
  327         #
  328         # The AUE_ audit event identifier.
  329         #
  330         {
  331                 auditev = $2;
  332         }
  333 
  334         type("STD") || type("NODEF") || type("NOARGS") || type("NOPROTO") \
  335             || type("NOSTD") {
  336                 parseline()
  337                 printf("\t/* %s */\n\tcase %d: {\n", funcname, syscall) > systrace
  338                 printf("\t/* %s */\n\tcase %d:\n", funcname, syscall) > systracetmp
  339                 if (argc > 0) {
  340                         printf("\t\tswitch(ndx) {\n") > systracetmp
  341                         printf("\t\tstruct %s *p = params;\n", argalias) > systrace
  342                         for (i = 1; i <= argc; i++) {
  343                                 printf("\t\tcase %d:\n\t\t\tp = \"%s\";\n\t\t\tbreak;\n", i - 1, argtype[i]) > systracetmp
  344                                 if (index(argtype[i], "*") > 0 || argtype[i] == "caddr_t" || argtype[i] == "l_handler_t")
  345                                         printf("\t\tuarg[%d] = (intptr_t) p->%s; /* %s */\n", \
  346                                              i - 1, \
  347                                              argname[i], argtype[i]) > systrace
  348                                 else if (substr(argtype[i], 1, 1) == "u" || argtype[i] == "size_t")
  349                                         printf("\t\tuarg[%d] = p->%s; /* %s */\n", \
  350                                              i - 1, \
  351                                              argname[i], argtype[i]) > systrace
  352                                 else
  353                                         printf("\t\tiarg[%d] = p->%s; /* %s */\n", \
  354                                              i - 1, \
  355                                              argname[i], argtype[i]) > systrace
  356                         }
  357                         printf("\t\tdefault:\n\t\t\tbreak;\n\t\t};\n") > systracetmp
  358                 }
  359                 printf("\t\t*n_args = %d;\n\t\tbreak;\n\t}\n", argc) > systrace
  360                 printf("\t\tbreak;\n") > systracetmp
  361                 if (argc != 0 && !flag("NOARGS") && !flag("NOPROTO") && \
  362                     !flag("NODEF")) {
  363                         printf("struct %s {\n", argalias) > sysarg
  364                         for (i = 1; i <= argc; i++)
  365                                 printf("\tchar %s_l_[PADL_(%s)]; " \
  366                                     "%s %s; char %s_r_[PADR_(%s)];\n",
  367                                     argname[i], argtype[i],
  368                                     argtype[i], argname[i],
  369                                     argname[i], argtype[i]) > sysarg
  370                         printf("};\n") > sysarg
  371                 }
  372                 else if (!flag("NOARGS") && !flag("NOPROTO") && !flag("NODEF"))
  373                         printf("struct %s {\n\tregister_t dummy;\n};\n",
  374                             argalias) > sysarg
  375                 if (!flag("NOPROTO") && !flag("NODEF")) {
  376                         printf("%s\t%s(struct thread *, struct %s *)",
  377                             rettype, funcname, argalias) > sysdcl
  378                         printf(";\n") > sysdcl
  379                         printf("#define\t%sAUE_%s\t%s\n", syscallprefix,
  380                             funcalias, auditev) > sysaue
  381                 }
  382                 printf("\t{ %s, (sy_call_t *)", argssize) > sysent
  383                 column = 8 + 2 + length(argssize) + 15
  384                 if (flag("NOSTD")) {
  385                         printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0") > sysent
  386                         column = column + length("lkmressys") + 3
  387                 } else {
  388                         printf("%s, %s, NULL, 0, 0 },", funcname, auditev) > sysent
  389                         column = column + length(funcname) + length(auditev) + 3
  390                 } 
  391                 align_sysent_comment(column)
  392                 printf("/* %d = %s */\n", syscall, funcalias) > sysent
  393                 printf("\t\"%s\",\t\t\t/* %d = %s */\n",
  394                     funcalias, syscall, funcalias) > sysnames
  395                 if (!flag("NODEF")) {
  396                         printf("#define\t%s%s\t%d\n", syscallprefix,
  397                             funcalias, syscall) > syshdr
  398                         printf(" \\\n\t%s.o", funcalias) > sysmk
  399                 }
  400                 syscall++
  401                 next
  402         }
  403         type("COMPAT") || type("COMPAT4") || type("COMPAT6") {
  404                 if (flag("COMPAT")) {
  405                         ncompat++
  406                         out = syscompat
  407                         outdcl = syscompatdcl
  408                         wrap = "compat"
  409                         prefix = "o"
  410                         descr = "old"
  411                 } else if (flag("COMPAT4")) {
  412                         ncompat4++
  413                         out = syscompat4
  414                         outdcl = syscompat4dcl
  415                         wrap = "compat4"
  416                         prefix = "freebsd4_"
  417                         descr = "freebsd4"
  418                 } else if (flag("COMPAT6")) {
  419                         ncompat6++
  420                         out = syscompat6
  421                         outdcl = syscompat6dcl
  422                         wrap = "compat6"
  423                         prefix = "freebsd6_"
  424                         descr = "freebsd6"
  425                 }
  426                 parseline()
  427                 if (argc != 0 && !flag("NOARGS") && !flag("NOPROTO") && \
  428                     !flag("NODEF")) {
  429                         printf("struct %s {\n", argalias) > out
  430                         for (i = 1; i <= argc; i++)
  431                                 printf("\tchar %s_l_[PADL_(%s)]; %s %s; " \
  432                                     "char %s_r_[PADR_(%s)];\n",
  433                                     argname[i], argtype[i],
  434                                     argtype[i], argname[i],
  435                                     argname[i], argtype[i]) > out
  436                         printf("};\n") > out
  437                 }
  438                 else if (!flag("NOARGS") && !flag("NOPROTO") && !flag("NODEF"))
  439                         printf("struct %s {\n\tregister_t dummy;\n};\n",
  440                             argalias) > sysarg
  441                 if (!flag("NOPROTO") && !flag("NODEF")) {
  442                         printf("%s\t%s%s(struct thread *, struct %s *);\n",
  443                             rettype, prefix, funcname, argalias) > outdcl
  444                         printf("#define\t%sAUE_%s%s\t%s\n", syscallprefix,
  445                             prefix, funcname, auditev) > sysaue
  446                 }
  447                 if (flag("NOSTD")) {
  448                         printf("\t{ %s, (sy_call_t *)%s, %s, NULL, 0, 0 },",
  449                             "0", "lkmressys", "AUE_NULL") > sysent
  450                         align_sysent_comment(8 + 2 + length("0") + 15 + \
  451                             length("lkmressys") + 3)
  452                 } else {
  453                         printf("\t{ %s(%s,%s), %s, NULL, 0, 0 },",
  454                             wrap, argssize, funcname, auditev) > sysent
  455                         align_sysent_comment(8 + 9 + length(argssize) + 1 + \
  456                             length(funcname) + length(auditev) + 4)
  457                 }
  458                 printf("/* %d = %s %s */\n", syscall, descr, funcalias) > sysent
  459                 printf("\t\"%s.%s\",\t\t/* %d = %s %s */\n",
  460                     wrap, funcalias, syscall, descr, funcalias) > sysnames
  461                 if (flag("COMPAT")) {
  462                         printf("\t\t\t\t/* %d is old %s */\n",
  463                             syscall, funcalias) > syshdr
  464                 } else if (!flag("NODEF")) {
  465                         printf("#define\t%s%s%s\t%d\n", syscallprefix,
  466                             prefix, funcalias, syscall) > syshdr
  467                         printf(" \\\n\t%s%s.o", prefix, funcalias) > sysmk
  468                 }
  469                 syscall++
  470                 next
  471         }
  472         type("LIBCOMPAT") {
  473                 ncompat++
  474                 parseline()
  475                 printf("%s\to%s();\n", rettype, funcname) > syscompatdcl
  476                 printf("\t{ compat(%s,%s), %s, NULL, 0, 0 },",
  477                     argssize, funcname, auditev) > sysent
  478                 align_sysent_comment(8 + 9 + \
  479                     length(argssize) + 1 + length(funcname) + length(auditev) + 4)
  480                 printf("/* %d = old %s */\n", syscall, funcalias) > sysent
  481                 printf("\t\"old.%s\",\t\t/* %d = old %s */\n",
  482                     funcalias, syscall, funcalias) > sysnames
  483                 printf("#define\t%s%s\t%d\t/* compatibility; still used by libc */\n",
  484                     syscallprefix, funcalias, syscall) > syshdr
  485                 printf(" \\\n\t%s.o", funcalias) > sysmk
  486                 syscall++
  487                 next
  488         }
  489         type("OBSOL") {
  490                 printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },") > sysent
  491                 align_sysent_comment(34)
  492                 printf("/* %d = obsolete %s */\n", syscall, comment) > sysent
  493                 printf("\t\"obs_%s\",\t\t\t/* %d = obsolete %s */\n",
  494                     $4, syscall, comment) > sysnames
  495                 printf("\t\t\t\t/* %d is obsolete %s */\n",
  496                     syscall, comment) > syshdr
  497                 syscall++
  498                 next
  499         }
  500         type("UNIMPL") {
  501                 printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },\t\t\t/* %d = %s */\n",
  502                     syscall, comment) > sysent
  503                 printf("\t\"#%d\",\t\t\t/* %d = %s */\n",
  504                     syscall, syscall, comment) > sysnames
  505                 syscall++
  506                 next
  507         }
  508         {
  509                 printf "%s: line %d: unrecognized keyword %s\n", infile, NR, $3
  510                 exit 1
  511         }
  512         END {
  513                 printf "\n#define AS(name) (sizeof(struct name) / sizeof(register_t))\n" > sysinc
  514 
  515                 if (ncompat != 0 || ncompat4 != 0 || ncompat6 != 0)
  516                         printf "#include \"opt_compat.h\"\n\n" > syssw
  517 
  518                 if (ncompat != 0) {
  519                         printf "\n#ifdef %s\n", compat > sysinc
  520                         printf "#define compat(n, name) n, (sy_call_t *)__CONCAT(o,name)\n" > sysinc
  521                         printf "#else\n" > sysinc
  522                         printf "#define compat(n, name) 0, (sy_call_t *)nosys\n" > sysinc
  523                         printf "#endif\n" > sysinc
  524                 }
  525 
  526                 if (ncompat4 != 0) {
  527                         printf "\n#ifdef %s\n", compat4 > sysinc
  528                         printf "#define compat4(n, name) n, (sy_call_t *)__CONCAT(freebsd4_,name)\n" > sysinc
  529                         printf "#else\n" > sysinc
  530                         printf "#define compat4(n, name) 0, (sy_call_t *)nosys\n" > sysinc
  531                         printf "#endif\n" > sysinc
  532                 }
  533 
  534                 if (ncompat6 != 0) {
  535                         printf "\n#ifdef %s\n", compat6 > sysinc
  536                         printf "#define compat6(n, name) n, (sy_call_t *)__CONCAT(freebsd6_,name)\n" > sysinc
  537                         printf "#else\n" > sysinc
  538                         printf "#define compat6(n, name) 0, (sy_call_t *)nosys\n" > sysinc
  539                         printf "#endif\n" > sysinc
  540                 }
  541 
  542                 printf("\n#endif /* %s */\n\n", compat) > syscompatdcl
  543                 printf("\n#endif /* %s */\n\n", compat4) > syscompat4dcl
  544                 printf("\n#endif /* %s */\n\n", compat6) > syscompat6dcl
  545 
  546                 printf("\n#undef PAD_\n") > sysprotoend
  547                 printf("#undef PADL_\n") > sysprotoend
  548                 printf("#undef PADR_\n") > sysprotoend
  549                 printf("\n#endif /* !%s */\n", sysproto_h) > sysprotoend
  550 
  551                 printf("\n") > sysmk
  552                 printf("};\n") > sysent
  553                 printf("};\n") > sysnames
  554                 printf("#define\t%sMAXSYSCALL\t%d\n", syscallprefix, syscall) \
  555                     > syshdr
  556                 printf "\tdefault:\n\t\t*n_args = 0;\n\t\tbreak;\n\t};\n}\n" > systrace
  557                 printf "\tdefault:\n\t\tbreak;\n\t};\n\tif (p != NULL)\n\t\tstrlcpy(desc, p, descsz);\n}\n" > systracetmp
  558         } '
  559 
  560 cat $sysinc $sysent >> $syssw
  561 cat $sysarg $sysdcl \
  562         $syscompat $syscompatdcl \
  563         $syscompat4 $syscompat4dcl \
  564         $syscompat6 $syscompat6dcl \
  565         $sysaue $sysprotoend > $sysproto
  566 cat $systracetmp >> $systrace
  567 

Cache object: 8f75c7cab4bdd256a81a1790169d577d


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.