OLD | NEW |
---|---|
1 #! /bin/sh | 1 #! /bin/sh |
2 | |
khim
2012/04/13 11:56:48
Please return these lines back, no need to create
| |
3 # Usage: make-syscalls.sh ../sysdeps/unix/common | 2 # Usage: make-syscalls.sh ../sysdeps/unix/common |
4 # Expects $sysdirs in environment. | 3 # Expects $sysdirs in environment. |
5 | |
khim
2012/04/13 11:56:48
Ditto.
| |
6 ############################################################################## | 4 ############################################################################## |
7 | 5 |
8 # Syscall Signature Key Letters for BP Thunks: | 6 # Syscall Signature Key Letters for BP Thunks: |
9 # | 7 # |
10 # a: unchecked address (e.g., 1st arg to mmap) | 8 # a: unchecked address (e.g., 1st arg to mmap) |
11 # b: non-NULL buffer (e.g., 2nd arg to read; return value from mmap) | 9 # b: non-NULL buffer (e.g., 2nd arg to read; return value from mmap) |
12 # B: optionally-NULL buffer (e.g., 4th arg to getsockopt) | 10 # B: optionally-NULL buffer (e.g., 4th arg to getsockopt) |
13 # f: buffer of 2 ints (e.g., 4th arg to socketpair) | 11 # f: buffer of 2 ints (e.g., 4th arg to socketpair) |
14 # F: 3rd arg to fcntl | 12 # F: 3rd arg to fcntl |
15 # i: scalar (any signedness & size: int, long, long long, enum, whatever) | 13 # i: scalar (any signedness & size: int, long, long long, enum, whatever) |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 echo " echo '#undef $base'; \\" | 201 echo " echo '#undef $base'; \\" |
204 done | 202 done |
205 echo "\ | 203 echo "\ |
206 echo '$frtn$strong ( ); /* $args */'; \\ | 204 echo '$frtn$strong ( ); /* $args */'; \\ |
207 echo 'libc_hidden_proto ($strong)'; \\" | 205 echo 'libc_hidden_proto ($strong)'; \\" |
208 echo -n " echo '$frtn$strong (" | 206 echo -n " echo '$frtn$strong (" |
209 sprtr= | 207 sprtr= |
210 for arg; do | 208 for arg; do |
211 echo -n "$sprtr" | 209 echo -n "$sprtr" |
212 case $arg in | 210 case $arg in |
213 [abIpP]*) echo -n "void *$arg";; | 211 [abIpPBN]*) echo -n "void *$arg";; |
214 f*) echo -n "int $arg[2]";; | 212 f*) echo -n "int $arg[2]";; |
215 i*) echo -n "int $arg";; | 213 i*) echo -n "int $arg";; |
216 n*) echo -n "size_t $arg";; | 214 n*) echo -n "size_t $arg";; |
217 [sS]*) echo -n "char *$arg";; | 215 [sS]*) echo -n "char *$arg";; |
218 V*) echo -n "unsigned char *$arg";; | 216 V*) echo -n "unsigned char *$arg";; |
219 W*) echo -n "int *$arg";; | 217 W*) echo -n "int *$arg";; |
220 esac | 218 esac |
221 sprtr=", " | 219 sprtr=", " |
222 done | 220 done |
223 echo ") {'; \\" | 221 echo ") {'; \\" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
399 ) | \$(COMPILE.c) -x c -o \$@ -" | 397 ) | \$(COMPILE.c) -x c -o \$@ -" |
400 ### Use this for debugging intermediate output: | 398 ### Use this for debugging intermediate output: |
401 ### ) >\$(@:.ob=.c) | 399 ### ) >\$(@:.ob=.c) |
402 ### \$(subst -c,-E,\$(COMPILE.c)) -o \$(@:.ob=.ib) \$(@:.ob=.c) | 400 ### \$(subst -c,-E,\$(COMPILE.c)) -o \$(@:.ob=.ib) \$(@:.ob=.c) |
403 ### \$(COMPILE.c) -x cpp-output -o \$@ \$(@:.ob=.ib)" | 401 ### \$(COMPILE.c) -x cpp-output -o \$@ \$(@:.ob=.ib)" |
404 echo endif | 402 echo endif |
405 ;; | 403 ;; |
406 esac | 404 esac |
407 | 405 |
408 done | 406 done |
OLD | NEW |