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

Unified Diff: src/trusted/service_runtime/arch/x86_32/nacl_tls_32.c

Issue 12218089: Remove nacl_user[] array lookup from syscall code path on x86-64 and MIPS (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 7 years, 10 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
Index: src/trusted/service_runtime/arch/x86_32/nacl_tls_32.c
diff --git a/src/trusted/service_runtime/arch/x86_32/nacl_tls_32.c b/src/trusted/service_runtime/arch/x86_32/nacl_tls_32.c
index 7ad0be42ada941b26fff298c2be9fa0557754951..140e6af72c6b5ead420df6ab6b245b11b9c0d506 100644
--- a/src/trusted/service_runtime/arch/x86_32/nacl_tls_32.c
+++ b/src/trusted/service_runtime/arch/x86_32/nacl_tls_32.c
@@ -70,7 +70,7 @@ uint32_t NaClGetThreadIdx(struct NaClAppThread *natp) {
#if NACL_LINUX
/*
- * This TLS variable mirrors nacl_thread_index in the x86-64 sandbox,
+ * This TLS variable mirrors nacl_current_thread in the x86-64 sandbox,
* except that, on x86-32, we only use it for getting the identity of
* the interrupted thread in a signal handler in the Linux
* implementation of thread suspension.
@@ -79,14 +79,14 @@ uint32_t NaClGetThreadIdx(struct NaClAppThread *natp) {
* not work inside dynamically-loaded DLLs -- such as chrome.dll -- on
* Windows XP.
*/
-THREAD uint32_t nacl_thread_index;
+static THREAD struct NaClThreadContext *nacl_current_thread;
-void NaClTlsSetIdx(uint32_t tls_idx) {
- nacl_thread_index = tls_idx;
+void NaClTlsSetCurrentThread(struct NaClAppThread *natp) {
+ nacl_current_thread = &natp->user;
}
-uint32_t NaClTlsGetIdx(void) {
- return nacl_thread_index;
+struct NaClAppThread *NaClTlsGetCurrentThread(void) {
+ return NaClAppThreadFromThreadContext(nacl_current_thread);
}
#else
@@ -97,8 +97,8 @@ uint32_t NaClTlsGetIdx(void) {
* to the per-thread data, and the segment selector itself tells us
* the thread's identity.
*/
-void NaClTlsSetIdx(uint32_t tls_idx) {
- UNREFERENCED_PARAMETER(tls_idx);
+void NaClTlsSetCurrentThread(struct NaClAppThread *natp) {
+ UNREFERENCED_PARAMETER(natp);
}
#endif

Powered by Google App Engine
This is Rietveld 408576698