OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 # | 5 # |
6 # This script produces wrapped versions of syscall implementation | 6 # This script produces wrapped versions of syscall implementation |
7 # functions. The wrappers extract syscall arguments from where the | 7 # functions. The wrappers extract syscall arguments from where the |
8 # syscall trampoline saves them. | 8 # syscall trampoline saves them. |
9 # | 9 # |
10 # Note that NaCl modules are always ILP32 and compiled with a | 10 # Note that NaCl modules are always ILP32 and compiled with a |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 ['struct nacl_abi_timespec *req', 'struct nacl_abi_timespec *rem']), | 145 ['struct nacl_abi_timespec *req', 'struct nacl_abi_timespec *rem']), |
146 ('NACL_sys_clock_getres', 'NaClSysClockGetRes', | 146 ('NACL_sys_clock_getres', 'NaClSysClockGetRes', |
147 ['int clk_id', 'uint32_t tsp']), | 147 ['int clk_id', 'uint32_t tsp']), |
148 ('NACL_sys_clock_gettime', 'NaClSysClockGetTime', | 148 ('NACL_sys_clock_gettime', 'NaClSysClockGetTime', |
149 ['int clk_id', 'uint32_t tsp']), | 149 ['int clk_id', 'uint32_t tsp']), |
150 ('NACL_sys_mkdir', 'NaClSysMkdir', ['uint32_t path', 'int mode']), | 150 ('NACL_sys_mkdir', 'NaClSysMkdir', ['uint32_t path', 'int mode']), |
151 ('NACL_sys_rmdir', 'NaClSysRmdir', ['uint32_t path']), | 151 ('NACL_sys_rmdir', 'NaClSysRmdir', ['uint32_t path']), |
152 ('NACL_sys_chdir', 'NaClSysChdir', ['uint32_t path']), | 152 ('NACL_sys_chdir', 'NaClSysChdir', ['uint32_t path']), |
153 ('NACL_sys_getcwd', 'NaClSysGetcwd', ['uint32_t buffer', 'int len']), | 153 ('NACL_sys_getcwd', 'NaClSysGetcwd', ['uint32_t buffer', 'int len']), |
154 ('NACL_sys_unlink', 'NaClSysUnlink', ['uint32_t path']), | 154 ('NACL_sys_unlink', 'NaClSysUnlink', ['uint32_t path']), |
| 155 ('NACL_sys_truncate', 'NaClSysTruncate', |
| 156 ['uint32_t path', 'nacl_abi_off_t len']), |
| 157 ('NACL_sys_lstat', 'NaClSysLstat', |
| 158 ['uint32_t path', 'struct nacl_abi_stat *buf']), |
| 159 ('NACL_sys_link', 'NaClSysLink', ['uint32_t oldpath', 'uint32_t newpath']), |
| 160 ('NACL_sys_chmod', 'NaClSysChmod', ['uint32_t pathname', 'int mode']), |
| 161 ('NACL_sys_access', 'NaClSysAccess', ['uint32_t pathname', 'int mode']), |
| 162 ('NACL_sys_rename', 'NaClSysRename', |
| 163 ['uint32_t oldpath', 'uint32_t newpath']), |
| 164 ('NACL_sys_readlink', 'NaClSysReadlink', |
| 165 ['uint32_t path', 'uint32_t buf', 'size_t bufsiz']), |
| 166 ('NACL_sys_symlink', 'NaClSysSymlink', |
| 167 ['uint32_t oldpath', 'uint32_t newpath']), |
| 168 ('NACL_sys_utimes', 'NaClSysUtimes', |
| 169 ['uint32_t filename', 'uint32_t times']), |
| 170 ('NACL_sys_fchdir', 'NaClSysFchdir', ['int d']), |
| 171 ('NACL_sys_fchmod', 'NaClSysFchmod', ['int d', 'int mode']), |
| 172 ('NACL_sys_fsync', 'NaClSysFsync', ['int d']), |
| 173 ('NACL_sys_fdatasync', 'NaClSysFdatasync', ['int d']), |
| 174 ('NACL_sys_ftruncate', 'NaClSysFtruncate', |
| 175 ['int d', 'nacl_abi_off_t length']), |
155 ('NACL_sys_imc_makeboundsock', 'NaClSysImcMakeBoundSock', | 176 ('NACL_sys_imc_makeboundsock', 'NaClSysImcMakeBoundSock', |
156 ['int32_t *sap']), | 177 ['int32_t *sap']), |
157 ('NACL_sys_imc_accept', 'NaClSysImcAccept', ['int d']), | 178 ('NACL_sys_imc_accept', 'NaClSysImcAccept', ['int d']), |
158 ('NACL_sys_imc_connect', 'NaClSysImcConnect', ['int d']), | 179 ('NACL_sys_imc_connect', 'NaClSysImcConnect', ['int d']), |
159 ('NACL_sys_imc_sendmsg', 'NaClSysImcSendmsg', | 180 ('NACL_sys_imc_sendmsg', 'NaClSysImcSendmsg', |
160 ['int d', 'struct NaClAbiNaClImcMsgHdr *nanimhp', 'int flags']), | 181 ['int d', 'struct NaClAbiNaClImcMsgHdr *nanimhp', 'int flags']), |
161 ('NACL_sys_imc_recvmsg', 'NaClSysImcRecvmsg', | 182 ('NACL_sys_imc_recvmsg', 'NaClSysImcRecvmsg', |
162 ['int d', 'struct NaClAbiNaClImcMsgHdr *nanimhp', 'int flags']), | 183 ['int d', 'struct NaClAbiNaClImcMsgHdr *nanimhp', 'int flags']), |
163 ('NACL_sys_imc_mem_obj_create', 'NaClSysImcMemObjCreate', | 184 ('NACL_sys_imc_mem_obj_create', 'NaClSysImcMemObjCreate', |
164 ['size_t size']), | 185 ['size_t size']), |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 protos = SYSCALL_LIST | 377 protos = SYSCALL_LIST |
357 print >>output_dst, data | 378 print >>output_dst, data |
358 PrintImplSkel(arch, protos, output_dst) | 379 PrintImplSkel(arch, protos, output_dst) |
359 PrintSyscallTableInitializer(protos, output_dst) | 380 PrintSyscallTableInitializer(protos, output_dst) |
360 | 381 |
361 return 0 | 382 return 0 |
362 | 383 |
363 | 384 |
364 if __name__ == '__main__': | 385 if __name__ == '__main__': |
365 sys.exit(main(sys.argv)) | 386 sys.exit(main(sys.argv)) |
OLD | NEW |