Chromium Code Reviews| Index: src/trusted/service_runtime/arch/mips/nacl_tls.c |
| diff --git a/src/trusted/service_runtime/arch/arm/nacl_tls.c b/src/trusted/service_runtime/arch/mips/nacl_tls.c |
| similarity index 90% |
| copy from src/trusted/service_runtime/arch/arm/nacl_tls.c |
| copy to src/trusted/service_runtime/arch/mips/nacl_tls.c |
| index 5db5c0fead71675d09478d1288dff37022c827f9..1dce8f586caaf4d13c953cbcd41844e75bdba270 100644 |
| --- a/src/trusted/service_runtime/arch/arm/nacl_tls.c |
| +++ b/src/trusted/service_runtime/arch/mips/nacl_tls.c |
| @@ -9,7 +9,7 @@ |
| #include "native_client/src/include/portability.h" |
| #include "native_client/src/shared/platform/nacl_check.h" |
| #include "native_client/src/shared/platform/nacl_sync_checked.h" |
| -#include "native_client/src/trusted/service_runtime/arch/arm/sel_ldr_arm.h" |
| +#include "native_client/src/trusted/service_runtime/arch/mips/sel_ldr_mips.h" |
| #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" |
| #include "native_client/src/trusted/service_runtime/nacl_globals.h" |
| #include "native_client/src/trusted/service_runtime/nacl_tls.h" |
| @@ -37,7 +37,6 @@ uint32_t NaClGetThreadIdx(struct NaClAppThread *natp) { |
| return natp->user.tls_idx; |
| } |
|
Mark Seaborn
2012/09/08 02:43:14
Since this file shows up as a comparison against t
petarj
2012/09/11 16:58:13
Sure, I have just done that. Note that this file i
|
| - |
| int NaClTlsInit() { |
| size_t i; |
| @@ -55,7 +54,6 @@ int NaClTlsInit() { |
| return 1; |
| } |
| - |
| void NaClTlsFini() { |
| NaClLog(2, "NaClTlsFini\n"); |
| NaClMutexDtor(&gNaClTlsMu); |
| @@ -81,7 +79,6 @@ static int NaClThreadIdxAllocate() { |
| return -1; |
| } |
| - |
| /* |
| * Allocation does not mean we can set gNaClThreadIdx, since we are not |
| * that thread. Setting it must wait until the thread actually launches. |
| @@ -89,14 +86,14 @@ static int NaClThreadIdxAllocate() { |
| uint32_t NaClTlsAllocate(struct NaClAppThread *natp) { |
| int idx = NaClThreadIdxAllocate(); |
| - NaClLog(2, "NaClTlsAllocate: $tp %x idx %d\n", natp->tls_values.tls1, idx); |
| + NaClLog(2, "NaClTlsAllocate: $tp %x idx %d\n", natp->tls_values.tls1, idx); |
| if (-1 == idx) { |
| NaClLog(LOG_FATAL, |
| "NaClTlsAllocate: thread limit reached\n"); |
| return NACL_TLS_INDEX_INVALID; |
| } |
| - natp->user.r9 = natp->tls_values.tls1; |
| + natp->user.t8 = natp->tls_values.tls1; |
| /* |
| * Bias by 1: successful return value is never 0. |
| @@ -109,18 +106,17 @@ void NaClTlsFree(struct NaClAppThread *natp) { |
| uint32_t idx = NaClGetThreadIdx(natp); |
| NaClLog(2, |
| "NaClTlsFree: old idx %d $tp %x\n", |
| - idx, natp->user.r9); |
| + idx, natp->user.t8); |
| NaClXMutexLock(&gNaClTlsMu); |
| gNaClThreadIdxInUse[idx - 1] = 0; |
| NaClXMutexUnlock(&gNaClTlsMu); |
| - natp->user.r9 = 0; |
| + natp->user.t8 = 0; |
| } |
| - |
| void NaClTlsChange(struct NaClAppThread *natp) { |
| NaClLog(2, "NaClTlsChange: $tp %x\n", natp->tls_values.tls1); |
| - natp->user.r9 = natp->tls_values.tls1; |
| + natp->user.t8 = (uint32_t) natp->tls_values.tls1; |
|
Mark Seaborn
2012/09/08 02:43:14
Isn't the cast unnecessary? This is already uint3
petarj
2012/09/11 16:58:13
Not needed (anymore). Done.
|
| } |