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

Unified Diff: src/include/arm_sandbox.h

Issue 11194045: Change BKPT and UDF encodings on ARM. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Clarify comments. Fix unaligned_data_irt.nexe, it had a hard-coded BKPT #0x7777. Created 8 years, 2 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
« no previous file with comments | « no previous file | src/include/nacl_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/include/arm_sandbox.h
diff --git a/src/include/arm_sandbox.h b/src/include/arm_sandbox.h
new file mode 100644
index 0000000000000000000000000000000000000000..b7c1fdf7cd014428ecb86b7849193644015c5be6
--- /dev/null
+++ b/src/include/arm_sandbox.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * Minimal ARM sandbox constants.
+ *
+ * These constants are used in C code as well as assembly, hence the use of
+ * the preprocessor.
+ */
+
+#ifndef NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_
+#define NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ 1
+
+/*
+ * Specially chosen BKPT and UDF instructions that also correspond to
+ * BKPT and UDF when decoded as Thumb instructions.
+ * All other BKPT/UDF values are disallowed by the validator out of paranoia.
+ */
+
+/*
+ * BKPT #0x5BE0: literal pool head.
+ *
+ * Treated as a roadblock by the validator: all words that follow it in
+ * a bundle aren't validated and can't be branched to.
+ */
+#define NACL_INSTR_LITERAL_POOL_HEAD 0xE125BE70
+
+/*
+ * BREAKPOINT, HALT_FILL and ABORT_NOW are intended to be equivalent
Mark Seaborn 2012/10/19 22:53:17 Please expand to "NACL_INSTR_BREAKPOINT, NACL_INST
+ * from a security point of view. We provide the distinction between
+ * them just for debugging purposes. They might also generate different
+ * POSIX signals. In principle it should be safe for a debugger to skip
+ * past one of these (unlike POOL_HEAD), because the validator validates
Mark Seaborn 2012/10/19 22:53:17 Please expand to "NACL_INSTR_POOL_HEAD"
+ * the instructions that follow.
+ */
+
+/*
+ * BKPT #0x5BEF: generic breakpoint.
+ *
+ * Usable statically by users or dynamically by the runtime.
+ */
+#define NACL_INSTR_BREAKPOINT 0xE125BE7F
+
+/*
+ * UDF #0xEDEF: halt-fill.
+ *
+ * Generated at load time.
+ */
+#define NACL_INSTR_HALT_FILL 0xE7FEDEFF
+
+/*
+ * UDF #0xEDE0: abort-now.
+ *
+ * Required by some language constructs such as __builtin_trap.
+ */
+#define NACL_INSTR_ABORT_NOW 0xE7FEDEF0
+
+/*
+ * UDF #0xEDE1: always fail validation.
+ *
+ * It's guaranteed to always fail, and can be used to initialize buffers
+ * that are expected to be filled later.
+ */
+#define NACL_INSTR_FAIL_VALIDATION 0xE7FEDEF1
+
+#endif /* NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ */
« no previous file with comments | « no previous file | src/include/nacl_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698