| OLD | NEW |
| 1 /* | 1 /* |
| 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 | 6 |
| 7 /* | 7 /* |
| 8 * NaCl Simple/secure ELF loader (NaCl SEL). | 8 * NaCl Simple/secure ELF loader (NaCl SEL). |
| 9 */ | 9 */ |
| 10 #include "native_client/src/trusted/service_runtime/nacl_config.h" | 10 #include "native_client/src/trusted/service_runtime/nacl_config.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * to do an upcall into NaCl application. | 22 * to do an upcall into NaCl application. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 DEFINE_GLOBAL_HIDDEN_IDENTIFIER(NaCl_springboard): | 25 DEFINE_GLOBAL_HIDDEN_IDENTIFIER(NaCl_springboard): |
| 26 hlt /* one byte */ | 26 hlt /* one byte */ |
| 27 /* Restore state from struct NaClThreadContext. */ | 27 /* Restore state from struct NaClThreadContext. */ |
| 28 /* syscall return value, if any, from trusted stack */ | 28 /* syscall return value, if any, from trusted stack */ |
| 29 mov NACL_THREAD_CONTEXT_OFFSET_SYSRET(%ecx), %eax | 29 mov NACL_THREAD_CONTEXT_OFFSET_SYSRET(%ecx), %eax |
| 30 lss NACL_THREAD_CONTEXT_OFFSET_STACK_PTR(%ecx), %esp | 30 lss NACL_THREAD_CONTEXT_OFFSET_STACK_PTR(%ecx), %esp |
| 31 movw NACL_THREAD_CONTEXT_OFFSET_DS(%ecx), %ds | 31 movw NACL_THREAD_CONTEXT_OFFSET_DS(%ecx), %ds |
| 32 /* Set %ecx to zero to avoid leaking the NaClThreadContext address */ |
| 33 xorl %ecx, %ecx |
| 32 jmp *%edx | 34 jmp *%edx |
| 33 DEFINE_GLOBAL_HIDDEN_IDENTIFIER(NaCl_springboard_end): | 35 DEFINE_GLOBAL_HIDDEN_IDENTIFIER(NaCl_springboard_end): |
| 34 | 36 |
| 35 | 37 |
| 36 DEFINE_GLOBAL_HIDDEN_IDENTIFIER(NaCl_springboard_all_regs): | 38 DEFINE_GLOBAL_HIDDEN_IDENTIFIER(NaCl_springboard_all_regs): |
| 37 hlt /* one byte */ | 39 hlt /* one byte */ |
| 38 /* Restore state from struct NaClSwitchAllRegsState. */ | 40 /* Restore state from struct NaClSwitchAllRegsState. */ |
| 39 lss 0(%ecx), %esp /* stack_ptr */ | 41 lss 0(%ecx), %esp /* stack_ptr */ |
| 40 movw 0x10(%ecx), %ds /* ds */ | 42 movw 0x10(%ecx), %ds /* ds */ |
| 41 movl %gs:0xc, %ecx /* new_ecx from NaClTlsSegment */ | 43 movl %gs:0xc, %ecx /* new_ecx from NaClTlsSegment */ |
| 42 jmp *%gs:8 /* new_prog_ctr from NaClTlsSegment */ | 44 jmp *%gs:8 /* new_prog_ctr from NaClTlsSegment */ |
| 43 DEFINE_GLOBAL_HIDDEN_IDENTIFIER(NaCl_springboard_all_regs_end): | 45 DEFINE_GLOBAL_HIDDEN_IDENTIFIER(NaCl_springboard_all_regs_end): |
| OLD | NEW |