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

Side by Side Diff: src/trusted/service_runtime/arch/mips/sel_rt.h

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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * NaCl Secure Runtime 8 * NaCl Secure Runtime
9 */ 9 */
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 * use the same interface. 50 * use the same interface.
51 */ 51 */
52 uint32_t sysret; 52 uint32_t sysret;
53 /* 30 */ 53 /* 30 */
54 uint32_t new_prog_ctr; 54 uint32_t new_prog_ctr;
55 /* 34 */ 55 /* 34 */
56 uint32_t trusted_stack_ptr; 56 uint32_t trusted_stack_ptr;
57 /* 38 */ 57 /* 38 */
58 uint32_t tls_idx; 58 uint32_t tls_idx;
59 /* 3c */ 59 /* 3c */
60 uint32_t tls_value1;
61 /* 40 */
60 uint32_t tls_value2; 62 uint32_t tls_value2;
61 /* 40 */ 63 /* 44 */
64 uint32_t guard_token;
65 /* 48 */
62 }; 66 };
63 67
64 static INLINE uintptr_t NaClGetThreadCtxSp(struct NaClThreadContext *th_ctx) { 68 static INLINE uintptr_t NaClGetThreadCtxSp(struct NaClThreadContext *th_ctx) {
65 return th_ctx->stack_ptr; 69 return th_ctx->stack_ptr;
66 } 70 }
67 71
68 NORETURN void NaClStartSwitch(struct NaClThreadContext *); 72 NORETURN void NaClStartSwitch(struct NaClThreadContext *);
69 73
70 #endif /* !defined(__ASSEMBLER__) */ 74 #endif /* !defined(__ASSEMBLER__) */
71 75
72 #define NACL_THREAD_CONTEXT_OFFSET_S0 0x00 76 #define NACL_THREAD_CONTEXT_OFFSET_S0 0x00
73 #define NACL_THREAD_CONTEXT_OFFSET_S1 0x04 77 #define NACL_THREAD_CONTEXT_OFFSET_S1 0x04
74 #define NACL_THREAD_CONTEXT_OFFSET_S2 0x08 78 #define NACL_THREAD_CONTEXT_OFFSET_S2 0x08
75 #define NACL_THREAD_CONTEXT_OFFSET_S3 0x0c 79 #define NACL_THREAD_CONTEXT_OFFSET_S3 0x0c
76 #define NACL_THREAD_CONTEXT_OFFSET_S4 0x10 80 #define NACL_THREAD_CONTEXT_OFFSET_S4 0x10
77 #define NACL_THREAD_CONTEXT_OFFSET_S5 0x14 81 #define NACL_THREAD_CONTEXT_OFFSET_S5 0x14
78 #define NACL_THREAD_CONTEXT_OFFSET_S6 0x18 82 #define NACL_THREAD_CONTEXT_OFFSET_S6 0x18
79 #define NACL_THREAD_CONTEXT_OFFSET_S7 0x1c 83 #define NACL_THREAD_CONTEXT_OFFSET_S7 0x1c
80 #define NACL_THREAD_CONTEXT_OFFSET_T8 0x20 84 #define NACL_THREAD_CONTEXT_OFFSET_T8 0x20
81 #define NACL_THREAD_CONTEXT_OFFSET_STACK_PTR 0x24 85 #define NACL_THREAD_CONTEXT_OFFSET_STACK_PTR 0x24
82 #define NACL_THREAD_CONTEXT_OFFSET_FRAME_PTR 0x28 86 #define NACL_THREAD_CONTEXT_OFFSET_FRAME_PTR 0x28
83 #define NACL_THREAD_CONTEXT_OFFSET_PROG_CTR 0x2c 87 #define NACL_THREAD_CONTEXT_OFFSET_PROG_CTR 0x2c
84 #define NACL_THREAD_CONTEXT_OFFSET_SYSRET 0x30 88 #define NACL_THREAD_CONTEXT_OFFSET_SYSRET 0x30
85 #define NACL_THREAD_CONTEXT_OFFSET_NEW_PROG_CTR 0x34 89 #define NACL_THREAD_CONTEXT_OFFSET_NEW_PROG_CTR 0x34
86 #define NACL_THREAD_CONTEXT_OFFSET_TRUSTED_STACK_PTR 0x38 90 #define NACL_THREAD_CONTEXT_OFFSET_TRUSTED_STACK_PTR 0x38
87 #define NACL_THREAD_CONTEXT_OFFSET_TLS_IDX 0x3c 91 #define NACL_THREAD_CONTEXT_OFFSET_TLS_IDX 0x3c
88 #define NACL_THREAD_CONTEXT_OFFSET_TLS_VALUE2 0x40 92 #define NACL_THREAD_CONTEXT_OFFSET_TLS_VALUE1 0x40
93 #define NACL_THREAD_CONTEXT_OFFSET_TLS_VALUE2 0x44
94 #define NACL_THREAD_CONTEXT_OFFSET_GUARD_TOKEN 0x48
89 95
90 #if !defined(__ASSEMBLER__) 96 #if !defined(__ASSEMBLER__)
91 97
92 /* 98 /*
93 * This function exists as a function only because compile-time 99 * This function exists as a function only because compile-time
94 * assertions need to be inside a function. This function does not 100 * assertions need to be inside a function. This function does not
95 * need to be called for the assertions to be checked. 101 * need to be called for the assertions to be checked.
96 */ 102 */
97 static INLINE void NaClThreadContextOffsetCheck(void) { 103 static INLINE void NaClThreadContextOffsetCheck(void) {
98 int offset = 0; 104 int offset = 0;
(...skipping 14 matching lines...) Expand all
113 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_S7, s7); 119 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_S7, s7);
114 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_T8, t8); 120 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_T8, t8);
115 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_STACK_PTR, stack_ptr); 121 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_STACK_PTR, stack_ptr);
116 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_FRAME_PTR, frame_ptr); 122 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_FRAME_PTR, frame_ptr);
117 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_PROG_CTR, prog_ctr); 123 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_PROG_CTR, prog_ctr);
118 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_SYSRET, sysret); 124 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_SYSRET, sysret);
119 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_NEW_PROG_CTR, new_prog_ctr); 125 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_NEW_PROG_CTR, new_prog_ctr);
120 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_TRUSTED_STACK_PTR, 126 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_TRUSTED_STACK_PTR,
121 trusted_stack_ptr); 127 trusted_stack_ptr);
122 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_TLS_IDX, tls_idx); 128 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_TLS_IDX, tls_idx);
129 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_TLS_VALUE1, tls_value1);
123 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_TLS_VALUE2, tls_value2); 130 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_TLS_VALUE2, tls_value2);
131 NACL_CHECK_FIELD(NACL_THREAD_CONTEXT_OFFSET_GUARD_TOKEN, guard_token);
124 CHECK(offset == sizeof(struct NaClThreadContext)); 132 CHECK(offset == sizeof(struct NaClThreadContext));
125 133
126 #undef NACL_CHECK_FIELD 134 #undef NACL_CHECK_FIELD
127 } 135 }
128 136
129 EXTERN_C_END 137 EXTERN_C_END
130 138
131 #endif /* !defined(__ASSEMBLER__) */ 139 #endif /* !defined(__ASSEMBLER__) */
132 140
133 #endif /* __NATIVE_CLIENT_SERVICE_RUNTIME_ARCH_MIPS_SEL_RT_H___ */ 141 #endif /* __NATIVE_CLIENT_SERVICE_RUNTIME_ARCH_MIPS_SEL_RT_H___ */
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/arch/mips/nacl_tls.c ('k') | src/trusted/service_runtime/arch/mips/sel_rt.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698