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

Unified Diff: src/trusted/service_runtime/arch/mips/nacl_syscall.S

Issue 1536713003: [MIPS] Make $t8 point to the address of TLS pointers (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client@master
Patch Set: Move EditMipsCode() below EditArmCode(). Created 4 years, 11 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/tools/tls_edit/tls_edit.c ('k') | src/trusted/service_runtime/arch/mips/nacl_tls.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/service_runtime/arch/mips/nacl_syscall.S
diff --git a/src/trusted/service_runtime/arch/mips/nacl_syscall.S b/src/trusted/service_runtime/arch/mips/nacl_syscall.S
index 6dfc2bd7de7a6a2ba7f77eb822dfaef0a49ddad4..0ea6096258f8772c193ed8e6ece01a364b63eed7 100644
--- a/src/trusted/service_runtime/arch/mips/nacl_syscall.S
+++ b/src/trusted/service_runtime/arch/mips/nacl_syscall.S
@@ -86,17 +86,14 @@ DEFINE_GLOBAL_HIDDEN_FUNCTION(NaClSyscallSeg):
sw $ra, -4($sp)
/* Save return address that indicates which trampoline was called. */
sw $t5, -8($sp)
+ add $a0, $t8, -NACL_THREAD_CONTEXT_OFFSET_TLS_VALUE1
- /* Load the __thread variable's offset into a3. */
- lui $a3, %tprel_hi(nacl_current_thread)
- addiu $a3, $a3, %tprel_lo(nacl_current_thread)
-
- /* Fetch the thread-local variable: set a0 = nacl_current_thread */
- rdhwr $v1, $29
- addu $a3, $v1, $a3
- lw $a0, 0($a3)
+ lw $t2, NACL_THREAD_CONTEXT_OFFSET_GUARD_TOKEN($a0)
+ la $t3, nacl_guard_token
+ lw $t3, 0($t3)
+ bne $t2, $t3, NaClSyscallThreadCaptureFault
+ nop
-DEFINE_GLOBAL_HIDDEN_LOCATION(NaClSyscallThreadCaptureFault):
sw $s0, NACL_THREAD_CONTEXT_OFFSET_S0($a0)
sw $s1, NACL_THREAD_CONTEXT_OFFSET_S1($a0)
sw $s2, NACL_THREAD_CONTEXT_OFFSET_S2($a0)
@@ -132,5 +129,5 @@ DEFINE_GLOBAL_HIDDEN_LOCATION(NaClSyscallSegRegsSaved):
* If the thread returns, which must not happen, it will be halted
* by the following instruction.
*/
-
+DEFINE_GLOBAL_HIDDEN_LOCATION(NaClSyscallThreadCaptureFault):
.word NACL_HALT_WORD
« no previous file with comments | « src/tools/tls_edit/tls_edit.c ('k') | src/trusted/service_runtime/arch/mips/nacl_tls.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698