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

Unified Diff: src/trusted/service_runtime/arch/mips/sel_rt.h

Issue 10919162: [MIPS] Implementation of sel_ldr for MIPS architecture. (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Patch updated per Mark's comments. Created 8 years, 3 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/mips/sel_rt.h
diff --git a/src/trusted/service_runtime/arch/mips/sel_rt.h b/src/trusted/service_runtime/arch/mips/sel_rt.h
new file mode 100644
index 0000000000000000000000000000000000000000..ab106872879093339766f7d87cffab8629ce118f
--- /dev/null
+++ b/src/trusted/service_runtime/arch/mips/sel_rt.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2012 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the LICENSE file.
+ */
+
+/*
+ * NaCl Secure Runtime
+ */
+
+#ifndef __NATIVE_CLIENT_SERVICE_RUNTIME_ARCH_MIPS_SEL_RT_H__
+#define __NATIVE_CLIENT_SERVICE_RUNTIME_ARCH_MIPS_SEL_RT_H__ 1
+
+#if !defined(__ASSEMBLER__)
+
+#include "native_client/src/include/portability.h"
+
+uint32_t NaClGetStackPtr(void);
+uint32_t NaClGetGlobalPtr(void);
+
+typedef uint32_t nacl_reg_t;
+
+#define NACL_PRIdNACL_REG NACL_PRId32
+#define NACL_PRIiNACL_REG NACL_PRIi32
+#define NACL_PRIoNACL_REG NACL_PRIo32
+#define NACL_PRIuNACL_REG NACL_PRIu32
+#define NACL_PRIxNACL_REG NACL_PRIx32
+#define NACL_PRIXNACL_REG NACL_PRIX32
+
+/*
+ * NOTE: This struct needs to be synchronized with NACL_CALLEE_SAVE_LIST
+ */
+
+struct NaClThreadContext {
+ nacl_reg_t t6, t7, s0, s1, s2, s3, s4, s5, s6, s7, t8,
+ /* 0 4 8 c 10 14 18 1c 20 24 28 */
+
+ 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.
+ /* 2c 30 34 38 */
+
+ /*
+ * sys_ret and new_prog_ctr are not a part of the thread's register set,
+ * but are needed by NaClSwitch. By including them here, the two
+ * use the same interface.
+ */
+ uint32_t sysret;
+ /* 3c */
+ uint32_t new_prog_ctr;
+ /* 40 */
+ uint32_t trusted_stack_ptr;
+ /* 44 */
+ uint32_t tls_idx;
+ /* 48 */
+};
+
+#endif /* !defined(__ASSEMBLER__) */
+
+#define NACL_THREAD_CONTEXT_OFFSET_T6 0x00
+#define NACL_THREAD_CONTEXT_OFFSET_T7 0x04
+#define NACL_THREAD_CONTEXT_OFFSET_S0 0x08
+#define NACL_THREAD_CONTEXT_OFFSET_S1 0x0c
+#define NACL_THREAD_CONTEXT_OFFSET_S2 0x10
+#define NACL_THREAD_CONTEXT_OFFSET_S3 0x14
+#define NACL_THREAD_CONTEXT_OFFSET_S4 0x18
+#define NACL_THREAD_CONTEXT_OFFSET_S5 0x1c
+#define NACL_THREAD_CONTEXT_OFFSET_S6 0x20
+#define NACL_THREAD_CONTEXT_OFFSET_S7 0x24
+#define NACL_THREAD_CONTEXT_OFFSET_T8 0x28
+#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.
+#define NACL_THREAD_CONTEXT_OFFSET_SP 0x30
+#define NACL_THREAD_CONTEXT_OFFSET_FP 0x34
+
+#endif /* __NATIVE_CLIENT_SERVICE_RUNTIME_ARCH_MIPS_SEL_RT_H___ */

Powered by Google App Engine
This is Rietveld 408576698