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

Unified Diff: src/trusted/service_runtime/posix/nacl_signal.c

Issue 12460003: [MIPS] Leave room for frame header on stack for MIPS arch (Closed) Base URL: http://git.chromium.org/native_client/src/native_client.git@master
Patch Set: Rename NACL_STACK_ARG_SIZE to NACL_STACK_ARGS_SIZE. 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 | « src/trusted/service_runtime/nacl_syscall_common.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/service_runtime/posix/nacl_signal.c
diff --git a/src/trusted/service_runtime/posix/nacl_signal.c b/src/trusted/service_runtime/posix/nacl_signal.c
index 4ce545deaf9afa0778a68d7593158ace3708b712..8bced2e0059ae0c42fea4aa0c79a29bfad0003de 100644
--- a/src/trusted/service_runtime/posix/nacl_signal.c
+++ b/src/trusted/service_runtime/posix/nacl_signal.c
@@ -223,6 +223,7 @@ static int DispatchToUntrustedHandler(struct NaClAppThread *natp,
new_stack_ptr -=
sizeof(struct NaClExceptionFrame) - NACL_STACK_PAD_BELOW_ALIGN;
new_stack_ptr = new_stack_ptr & ~NACL_STACK_ALIGN_MASK;
+ new_stack_ptr -= NACL_STACK_ARGS_SIZE;
new_stack_ptr -= NACL_STACK_PAD_BELOW_ALIGN;
frame_addr = NaClUserToSysAddrRange(nap, new_stack_ptr,
sizeof(struct NaClExceptionFrame));
@@ -272,6 +273,11 @@ static int DispatchToUntrustedHandler(struct NaClAppThread *natp,
regs->a0 = context_user_addr;
regs->prog_ctr = NaClUserToSys(nap, nap->exception_handler);
regs->stack_ptr = NaClUserToSys(nap, new_stack_ptr);
+ /*
+ * Per Linux/MIPS convention, PIC functions assume that t9 holds
+ * the function's address on entry.
+ */
+ regs->t9 = regs->prog_ctr;
#else
# error Unsupported architecture
#endif
« no previous file with comments | « src/trusted/service_runtime/nacl_syscall_common.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698