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

Unified Diff: tests/thread_suspension/suspend_test_host.c

Issue 121833002: [MIPS] Add support for thread_suspension test (Closed) Base URL: http://git.chromium.org/native_client/src/native_client.git@master
Patch Set: Remove strayed backslashes. Created 7 years 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/thread_suspension/suspend_test_guest.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_host.c
diff --git a/tests/thread_suspension/suspend_test_host.c b/tests/thread_suspension/suspend_test_host.c
index 445ce8b6f6d731bdedc4e9640ba7b503fbec924b..aacd27258f7c1729607799ee80172ff7b4e1f5b4 100644
--- a/tests/thread_suspension/suspend_test_host.c
+++ b/tests/thread_suspension/suspend_test_host.c
@@ -339,6 +339,38 @@ static void TestGettingRegisterSnapshot(struct NaClApp *nap) {
regs.r12 = 0x1234000c;
/* Leave sp (r13) and lr (r14) alone for now. */
regs.prog_ctr = test_shm->continue_after_suspension_func;
+#elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_mips
+ /* Skip setting zero register because it's read-only. */
+ regs.at = 0x12340001;
+ regs.v0 = 0x12340002;
+ regs.v1 = 0x12340003;
+ regs.a0 = 0x12340004;
+ regs.a1 = 0x12340005;
+ regs.a2 = 0x12340006;
+ regs.a3 = 0x12340007;
+ regs.t0 = 0x12340008;
+ regs.t1 = 0x12340009;
+ regs.t2 = 0x12340010;
+ regs.t3 = 0x12340011;
+ regs.t4 = 0x12340012;
+ regs.t5 = 0x12340013;
+ /* Skip setting t6 and t7 because those are mask registers. */
+ regs.s0 = 0x12340014;
+ regs.s1 = 0x12340015;
+ regs.s2 = 0x12340016;
+ regs.s3 = 0x12340017;
+ regs.s4 = 0x12340018;
+ regs.s5 = 0x12340019;
+ regs.s6 = 0x12340020;
+ regs.s7 = 0x12340021;
+ /* Skip setting t8 because it holds thread pointer. */
+ regs.t9 = 0x12340022;
+ /* Skip setting k0 and k1 registers, they are used by kernel. */
+ regs.global_ptr = 0x12340023;
+ /* Skip setting sp also. */
+ regs.frame_ptr = 0x12340025;
+ regs.return_addr = 0x12340026;
+ regs.prog_ctr = test_shm->continue_after_suspension_func;
#else
# error Unsupported architecture
#endif
@@ -431,15 +463,7 @@ static void TestGettingRegisterSnapshotInSyscallContextSwitch(
regs.prog_ctr = test_shm->expected_regs.prog_ctr;
RegsUnsetNonCalleeSavedRegisters(&regs);
}
- /*
- * TODO(mseaborn): Enable the RegsAssertEqual() check for MIPS
- * once NaClGetRegistersForContextSwitch() is implemented for
- * MIPS.
- */
- if (NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86 ||
- NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm) {
- RegsAssertEqual(&regs, &test_shm->expected_regs);
- }
+ RegsAssertEqual(&regs, &test_shm->expected_regs);
NaClUntrustedThreadsResumeAll(nap);
}
« no previous file with comments | « tests/thread_suspension/suspend_test_guest.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698