| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 'x86-64': [], | 76 'x86-64': [], |
| 77 # 'x86-64': ['rdi', 'rsi', 'rdx', 'rcx', 'r8', 'r9'], | 77 # 'x86-64': ['rdi', 'rsi', 'rdx', 'rcx', 'r8', 'r9'], |
| 78 'arm-32': [], | 78 'arm-32': [], |
| 79 # 'arm-32': [ 'r0', 'r1', 'r2', 'r3'], | 79 # 'arm-32': [ 'r0', 'r1', 'r2', 'r3'], |
| 80 # while the arm calling convention passes arguments in registers, | 80 # while the arm calling convention passes arguments in registers, |
| 81 # the arm trampoline code pushes them onto the untrusted stack first | 81 # the arm trampoline code pushes them onto the untrusted stack first |
| 82 # before transferring control to trusted code. this uses up some | 82 # before transferring control to trusted code. this uses up some |
| 83 # more untrusted stack space / memory/cache bandwidth, but we had | 83 # more untrusted stack space / memory/cache bandwidth, but we had |
| 84 # to save these arguments somewhere, either in a processor context | 84 # to save these arguments somewhere, either in a processor context |
| 85 # or on-stack, anyway. | 85 # or on-stack, anyway. |
| 86 'mips-32': [], |
| 87 # 'mips-32': [ 'a0', 'a1', 'a2', 'a3'], |
| 86 } | 88 } |
| 87 | 89 |
| 88 # Our syscall handling code, in nacl_syscall.S, always pushes the | 90 # Our syscall handling code, in nacl_syscall.S, always pushes the |
| 89 # syscall arguments onto the untrusted user stack. The syscall | 91 # syscall arguments onto the untrusted user stack. The syscall |
| 90 # arguments get snapshotted from there into a per-syscall structure, | 92 # arguments get snapshotted from there into a per-syscall structure, |
| 91 # to eliminate time-of-check vs time-of-use issues -- we always only | 93 # to eliminate time-of-check vs time-of-use issues -- we always only |
| 92 # refer to syscall arguments from this snapshot, rather than from the | 94 # refer to syscall arguments from this snapshot, rather than from the |
| 93 # untrusted memory locations. | 95 # untrusted memory locations. |
| 94 | 96 |
| 95 | 97 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 protos = SYSCALL_LIST | 331 protos = SYSCALL_LIST |
| 330 print >>output_dst, data | 332 print >>output_dst, data |
| 331 PrintImplSkel(arch, protos, output_dst) | 333 PrintImplSkel(arch, protos, output_dst) |
| 332 PrintSyscallTableInitializer(protos, output_dst) | 334 PrintSyscallTableInitializer(protos, output_dst) |
| 333 | 335 |
| 334 return 0 | 336 return 0 |
| 335 | 337 |
| 336 | 338 |
| 337 if __name__ == '__main__': | 339 if __name__ == '__main__': |
| 338 sys.exit(main(sys.argv)) | 340 sys.exit(main(sys.argv)) |
| OLD | NEW |