]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/makesyscalls.sh
xnu-7195.81.3.tar.gz
[apple/xnu.git] / bsd / kern / makesyscalls.sh
index ffdacf957769351a6efd2f3cd3aed1a6d73c9d38..a8d67728a21846ed1e4e08dad8e81ef2df181534 100755 (executable)
@@ -157,6 +157,7 @@ s/\$//g
                switchname = \"$switchname\"
                namesname = \"$namesname\"
                infile = \"$input_file\"
+               infilepretty = \"${input_file#"$TARGET"}\"
                "'
 
                printf "/*\n" > syslegal
@@ -189,7 +190,7 @@ s/\$//g
                printf " * \n" > syslegal
                printf " * System call switch table.\n *\n" > syslegal
                printf " * DO NOT EDIT-- this file is automatically generated.\n" > syslegal
-               printf " * created from %s\n */\n\n", infile > syslegal
+               printf " * created from %s\n */\n\n", infilepretty > syslegal
        }
        NR == 1 {
                printf "\n/* The casts are bogus but will do for now. */\n" > sysent
@@ -516,15 +517,15 @@ s/\$//g
                                        else
                                                printf("\t\tcase %d:\n\t\t\tp = \"%s\";\n\t\t\tbreak;\n", i - 1, arg) > systraceargdesctempfile
                                        if (index(arg, "*") > 0 || arg == "caddr_t")
-                                               printf("\t\tuarg[%d] = (intptr_t) p->%s; /* %s */\n", \
+                        printf("\t\tuarg[%d] = (uint64_t) p->%s; /* %s */\n", \
                                                        i - 1, \
                                                        argname[i], arg) > systraceargstempfile
                                        else if (substr(arg, 1, 1) == "u" || arg == "size_t")
-                                               printf("\t\tuarg[%d] = p->%s; /* %s */\n", \
+                        printf("\t\tuarg[%d] = (uint64_t) p->%s; /* %s */\n", \
                                                        i - 1, \
                                                        argname[i], arg) > systraceargstempfile
                                        else
-                                               printf("\t\tiarg[%d] = p->%s; /* %s */\n", \
+                        printf("\t\tiarg[%d] = (int64_t) p->%s; /* %s */\n", \
                                                        i - 1, \
                                                        argname[i], arg) > systraceargstempfile
                                }
@@ -771,7 +772,7 @@ s/\$//g
                printf("\n#endif /* !%s */\n", sysproto_h) > sysprotoend
 
                printf("};\n") > sysent
-               printf("const unsigned int      nsysent = sizeof(sysent) / sizeof(sysent[0]);\n") > sysent
+               printf("const unsigned int nsysent = sizeof(sysent) / sizeof(sysent[0]);\n") > sysent
 
                printf("};\n") > syscallnamestempfile
                printf("#define\t%sMAXSYSCALL\t%d\n", syscallprefix, syscall_num) \
@@ -788,11 +789,8 @@ s/\$//g
                printf "\tdefault:\n\t\tbreak;\n\t};\n\tif (p != NULL)\n\t\tstrlcpy(desc, p, descsz);\n}\n" > systracerettempfile
        } '
 
-# define value in syscall table file to permit redifintion because of the way
-# __private_extern__ (doesn't) work.
 if [ $output_syscalltablefile -eq 1 ]; then
     cat $syslegal > $syscalltablefile
-    printf "#define __INIT_SYSENT_C__ 1\n" >> $syscalltablefile
     cat $sysinc $sysent >> $syscalltablefile
 fi