| 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 #include "native_client/tests/common/register_set.h" | 7 #include "native_client/tests/common/register_set.h" |
| 8 | 8 |
| 9 #include "native_client/src/include/nacl_assert.h" | 9 #include "native_client/src/include/nacl_assert.h" |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 CHECK_REG(r11); | 86 CHECK_REG(r11); |
| 87 CHECK_REG(r12); | 87 CHECK_REG(r12); |
| 88 CHECK_REG(stack_ptr); | 88 CHECK_REG(stack_ptr); |
| 89 CHECK_REG(lr); | 89 CHECK_REG(lr); |
| 90 #else | 90 #else |
| 91 # error Unsupported architecture | 91 # error Unsupported architecture |
| 92 #endif | 92 #endif |
| 93 | 93 |
| 94 #undef CHECK_REG | 94 #undef CHECK_REG |
| 95 } | 95 } |
| 96 |
| 97 void RegsUnsetNonCalleeSavedRegisters(struct NaClSignalContext *regs) { |
| 98 #if defined(__i386__) |
| 99 regs->eax = 0; |
| 100 regs->ecx = 0; |
| 101 regs->edx = 0; |
| 102 #elif defined(__x86_64__) |
| 103 regs->rax = 0; |
| 104 regs->rcx = 0; |
| 105 regs->rdx = 0; |
| 106 regs->rsi = 0; |
| 107 regs->rdi = 0; |
| 108 regs->r8 = 0; |
| 109 regs->r9 = 0; |
| 110 regs->r10 = 0; |
| 111 regs->r11 = 0; |
| 112 #elif defined(__arm__) |
| 113 regs->r0 = 0; |
| 114 regs->r1 = 0; |
| 115 regs->r2 = 0; |
| 116 regs->r3 = 0; |
| 117 regs->r12 = 0; |
| 118 regs->lr = 0; |
| 119 #else |
| 120 # error Unsupported architecture |
| 121 #endif |
| 122 } |
| OLD | NEW |