Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: tests/common/register_set.c

Issue 10829110: Fix two register leaks in the trusted->untrusted context switch (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Fix comment Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/common/register_set.h ('k') | tests/syscall_return_regs/nacl.scons » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « tests/common/register_set.h ('k') | tests/syscall_return_regs/nacl.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698