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

Unified Diff: tests/thread_suspension/suspend_test_guest.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, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/syscall_return_regs/syscall_return_regs_test.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/thread_suspension/suspend_test_guest.c
diff --git a/tests/thread_suspension/suspend_test_guest.c b/tests/thread_suspension/suspend_test_guest.c
index 21a1abde296945a1f36c85722d7dd5743d1e56c4..4f47015c0e769a7ed3f5c13175f26c2bfc750651 100644
--- a/tests/thread_suspension/suspend_test_guest.c
+++ b/tests/thread_suspension/suspend_test_guest.c
@@ -109,33 +109,6 @@ static void ContinueAfterSyscall(void) {
longjmp(return_jmp_buf, 1);
}
-static void UnsetNonCalleeSavedRegisters(struct NaClSignalContext *regs) {
-#if defined(__i386__)
- regs->eax = 0;
- regs->ecx = 0;
- regs->edx = 0;
-#elif defined(__x86_64__)
- regs->rax = 0;
- regs->rcx = 0;
- regs->rdx = 0;
- regs->rsi = 0;
- regs->rdi = 0;
- regs->r8 = 0;
- regs->r9 = 0;
- regs->r10 = 0;
- regs->r11 = 0;
-#elif defined(__arm__)
- regs->r0 = 0;
- regs->r1 = 0;
- regs->r2 = 0;
- regs->r3 = 0;
- regs->r12 = 0;
- regs->lr = 0;
-#else
-# error Unsupported architecture
-#endif
-}
-
/* Set registers to known values and enter a NaCl syscall. */
static void SyscallRegisterSetterThread(struct SuspendTestShm *test_shm) {
struct NaClSignalContext call_regs;
@@ -154,7 +127,7 @@ static void SyscallRegisterSetterThread(struct SuspendTestShm *test_shm) {
* as call_regs but with various registers zeroed out.
*/
test_shm->expected_regs = call_regs;
- UnsetNonCalleeSavedRegisters(&test_shm->expected_regs);
+ RegsUnsetNonCalleeSavedRegisters(&test_shm->expected_regs);
uintptr_t syscall_addr = (uintptr_t) NACL_SYSCALL(test_syscall_1);
if (!setjmp(return_jmp_buf)) {
« no previous file with comments | « tests/syscall_return_regs/syscall_return_regs_test.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698