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

Unified Diff: tests/exception_test/exception_crash_test.c

Issue 12256018: [MIPS] Add remaining parts for building tests for MIPS (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Minor cleanup. Created 7 years, 9 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/data_not_executable/nacl.scons ('k') | tests/exception_test/exception_test.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/exception_test/exception_crash_test.c
diff --git a/tests/exception_test/exception_crash_test.c b/tests/exception_test/exception_crash_test.c
index 57f31a4bebfeff9cb73542204800953fedc0cde2..425bfe4ea0836c233040e89a98dc9addfcff4eb8 100644
--- a/tests/exception_test/exception_crash_test.c
+++ b/tests/exception_test/exception_crash_test.c
@@ -76,6 +76,25 @@ void error_exit(void) {
_exit(1);
}
+#elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_mips
+
+char recovery_stack[0x1000] __attribute__((aligned(8)));
+
+void bad_stack_exception_handler(struct NaClExceptionContext *context);
+__asm__(".pushsection .text, \"ax\", @progbits\n"
+ ".global bad_stack_exception_handler\n"
+ "bad_stack_exception_handler:\n"
+ "lui $t9, %hi(recovery_stack)\n"
+ "addiu $sp, $t9, %lo(recovery_stack)\n"
+ "and $sp, $sp, $t7\n"
+ "j error_exit\n"
+ "nop\n"
+ ".popsection\n");
+
+void error_exit() {
+ _exit(1);
+}
+
#else
/* TODO(mseaborn): Implement a stack switcher, like the one above, for ARM. */
« no previous file with comments | « tests/data_not_executable/nacl.scons ('k') | tests/exception_test/exception_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698