| 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 Secure Runtime | 8 * NaCl Secure Runtime |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 /* | 85 /* |
| 86 * For DO_USING_ARG_IN_ECX get the thread context from ecx instead of the | 86 * For DO_USING_ARG_IN_ECX get the thread context from ecx instead of the |
| 87 * stack. | 87 * stack. |
| 88 */ | 88 */ |
| 89 .if MACROARG2 != DO_USING_ARG_IN_ECX | 89 .if MACROARG2 != DO_USING_ARG_IN_ECX |
| 90 /* do not leak info to app */ | 90 /* do not leak info to app */ |
| 91 xorl %ecx, %ecx | 91 xorl %ecx, %ecx |
| 92 /* xorl will leave eflags in a known state, so no info leaks */ | 92 /* xorl will leave eflags in a known state, so no info leaks */ |
| 93 popl %ecx | 93 popl %ecx |
| 94 .endif | 94 .endif |
| 95 movl 0x30(%ecx), %edx /* new_eip */ | 95 movl 0x30(%ecx), %edx /* new_prog_ctr */ |
| 96 movl 0x14(%ecx), %ebp /* frame_ptr.ptr_32.ptr */ | 96 movl 0x14(%ecx), %ebp /* frame_ptr.ptr_32.ptr */ |
| 97 movl 0x8(%ecx), %edi /* edi */ | 97 movl 0x8(%ecx), %edi /* edi */ |
| 98 movl 0x4(%ecx), %esi /* esi */ | 98 movl 0x4(%ecx), %esi /* esi */ |
| 99 movl 0(%ecx), %ebx /* ebx */ | 99 movl 0(%ecx), %ebx /* ebx */ |
| 100 | 100 |
| 101 movw 0x2e(%ecx), %gs /* gs */ | 101 movw 0x2e(%ecx), %gs /* gs */ |
| 102 movw 0x2c(%ecx), %fs /* fs */ | 102 movw 0x2c(%ecx), %fs /* fs */ |
| 103 movw 0x2a(%ecx), %es /* es */ | 103 movw 0x2a(%ecx), %es /* es */ |
| 104 | 104 |
| 105 /* | 105 /* |
| 106 * Clear the x87 state. Then restore the untrusted code's control word. | 106 * Clear the x87 state. Then restore the untrusted code's control word. |
| 107 */ | 107 */ |
| 108 fninit | 108 fninit |
| 109 fldcw 0x22(%ecx) | 109 fldcw 0x22(%ecx) |
| 110 | 110 |
| 111 ljmp *0x38(%ecx) /* springboard address */ | 111 ljmp *0x38(%ecx) /* springboard address */ |
| 112 ENDMACRO | 112 ENDMACRO |
| 113 | 113 |
| 114 switcher NaClSwitchNoSSE, DO_NONE | 114 switcher NaClSwitchNoSSE, DO_NONE |
| 115 switcher NaClSwitchSSE, DO_SSE | 115 switcher NaClSwitchSSE, DO_SSE |
| 116 switcher NaClSwitchAVX, DO_AVX | 116 switcher NaClSwitchAVX, DO_AVX |
| 117 | 117 |
| 118 /* Generate register only version on OSX. */ | 118 /* Generate register only version on OSX. */ |
| 119 #if NACL_OSX | 119 #if NACL_OSX |
| 120 switcher NaClSwitchNoSSEViaECX, DO_USING_ARG_IN_ECX | 120 switcher NaClSwitchNoSSEViaECX, DO_USING_ARG_IN_ECX |
| 121 #endif | 121 #endif |
| OLD | NEW |