Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2012 The Native Client Authors. All rights reserved. | |
| 3 * Use of this source code is governed by a BSD-style license that can | |
| 4 * be found in the LICENSE file. | |
| 5 */ | |
| 6 | |
| 7 /* | |
| 8 * NaCl Secure Runtime | |
| 9 */ | |
| 10 | |
| 11 #ifndef __NATIVE_CLIENT_SERVICE_RUNTIME_ARCH_MIPS_SEL_RT_H__ | |
| 12 #define __NATIVE_CLIENT_SERVICE_RUNTIME_ARCH_MIPS_SEL_RT_H__ 1 | |
| 13 | |
| 14 #if !defined(__ASSEMBLER__) | |
| 15 | |
| 16 #include "native_client/src/include/portability.h" | |
| 17 | |
| 18 uint32_t NaClGetStackPtr(void); | |
| 19 uint32_t NaClGetGlobalPtr(void); | |
| 20 | |
| 21 typedef uint32_t nacl_reg_t; | |
| 22 | |
| 23 #define NACL_PRIdNACL_REG NACL_PRId32 | |
| 24 #define NACL_PRIiNACL_REG NACL_PRIi32 | |
| 25 #define NACL_PRIoNACL_REG NACL_PRIo32 | |
| 26 #define NACL_PRIuNACL_REG NACL_PRIu32 | |
| 27 #define NACL_PRIxNACL_REG NACL_PRIx32 | |
| 28 #define NACL_PRIXNACL_REG NACL_PRIX32 | |
| 29 | |
| 30 /* | |
| 31 * NOTE: This struct needs to be synchronized with NACL_CALLEE_SAVE_LIST | |
| 32 */ | |
| 33 | |
| 34 struct NaClThreadContext { | |
| 35 nacl_reg_t t6, t7, s0, s1, s2, s3, s4, s5, s6, s7, t8, | |
| 36 /* 0 4 8 c 10 14 18 1c 20 24 28 */ | |
| 37 | |
| 38 global_ptr, stack_ptr, frame_ptr, prog_ctr; | |
|
Mark Seaborn
2012/09/13 19:44:36
Nit: start this with nacl_reg_t so that we don't h
petarj
2012/09/18 00:22:15
Done.
| |
| 39 /* 2c 30 34 38 */ | |
| 40 | |
| 41 /* | |
| 42 * sys_ret and new_prog_ctr are not a part of the thread's register set, | |
| 43 * but are needed by NaClSwitch. By including them here, the two | |
| 44 * use the same interface. | |
| 45 */ | |
| 46 uint32_t sysret; | |
| 47 /* 3c */ | |
| 48 uint32_t new_prog_ctr; | |
| 49 /* 40 */ | |
| 50 uint32_t trusted_stack_ptr; | |
| 51 /* 44 */ | |
| 52 uint32_t tls_idx; | |
| 53 /* 48 */ | |
| 54 }; | |
| 55 | |
| 56 #endif /* !defined(__ASSEMBLER__) */ | |
| 57 | |
| 58 #define NACL_THREAD_CONTEXT_OFFSET_T6 0x00 | |
| 59 #define NACL_THREAD_CONTEXT_OFFSET_T7 0x04 | |
| 60 #define NACL_THREAD_CONTEXT_OFFSET_S0 0x08 | |
| 61 #define NACL_THREAD_CONTEXT_OFFSET_S1 0x0c | |
| 62 #define NACL_THREAD_CONTEXT_OFFSET_S2 0x10 | |
| 63 #define NACL_THREAD_CONTEXT_OFFSET_S3 0x14 | |
| 64 #define NACL_THREAD_CONTEXT_OFFSET_S4 0x18 | |
| 65 #define NACL_THREAD_CONTEXT_OFFSET_S5 0x1c | |
| 66 #define NACL_THREAD_CONTEXT_OFFSET_S6 0x20 | |
| 67 #define NACL_THREAD_CONTEXT_OFFSET_S7 0x24 | |
| 68 #define NACL_THREAD_CONTEXT_OFFSET_T8 0x28 | |
| 69 #define NACL_THREAD_CONTEXT_OFFSET_GP 0x2c | |
|
Mark Seaborn
2012/09/13 19:44:36
Can you make the #define names match the field nam
petarj
2012/09/18 00:22:15
Done.
| |
| 70 #define NACL_THREAD_CONTEXT_OFFSET_SP 0x30 | |
| 71 #define NACL_THREAD_CONTEXT_OFFSET_FP 0x34 | |
| 72 | |
| 73 #endif /* __NATIVE_CLIENT_SERVICE_RUNTIME_ARCH_MIPS_SEL_RT_H___ */ | |
| OLD | NEW |