| OLD | NEW |
| 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 * Minimal ARM sandbox constants. | 8 * Minimal ARM sandbox constants. |
| 9 * | 9 * |
| 10 * These constants are used in C code as well as assembly, hence the use of | 10 * These constants are used in C code as well as assembly, hence the use of |
| 11 * the preprocessor. | 11 * the preprocessor. |
| 12 */ | 12 */ |
| 13 | 13 |
| 14 #ifndef NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ | 14 #ifndef NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ |
| 15 #define NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ 1 | 15 #define NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ 1 |
| 16 | 16 |
| 17 /* | 17 /* |
| 18 * Specially chosen BKPT and UDF instructions that also correspond to | 18 * Specially chosen BKPT and UDF instructions that also correspond to |
| 19 * BKPT and UDF when decoded as Thumb instructions. | 19 * BKPT and UDF when decoded as Thumb instructions. |
| 20 * All other BKPT/UDF values are disallowed by the validator out of paranoia. | 20 * All other BKPT/UDF values are disallowed by the validator out of paranoia. |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 /* | 23 /* |
| 24 * BKPT #0x5BE0: literal pool head. | 24 * BKPT #0x5BE0: literal pool head. |
| 25 * | 25 * |
| 26 * Treated as a roadblock by the validator: all words that follow it in | 26 * Treated as a roadblock by the validator: all words that follow it in |
| 27 * a bundle aren't validated and can't be branched to. | 27 * a bundle aren't validated and can't be branched to. |
| 28 */ | 28 */ |
| 29 #define NACL_INSTR_LITERAL_POOL_HEAD 0xE125BE70 | 29 #define NACL_INSTR_ARM_LITERAL_POOL_HEAD 0xE125BE70 |
| 30 | 30 |
| 31 /* | 31 /* |
| 32 * NACL_INSTR_BREAKPOINT, NACL_INSTR_HALT_FILL and NACL_INSTR_ABORT_NOW | 32 * NACL_INSTR_ARM_BREAKPOINT, NACL_INSTR_ARM_HALT_FILL and |
| 33 * are intended to be equivalent from a security point of view. We | 33 * NACL_INSTR_ARM_ABORT_NOW are intended to be equivalent from a |
| 34 * provide the distinction between them just for debugging | 34 * security point of view. We provide the distinction between them just |
| 35 * purposes. They might also generate different POSIX signals. In | 35 * for debugging purposes. They might also generate different POSIX |
| 36 * principle it should be safe for a debugger to skip past one of these | 36 * signals. In principle it should be safe for a debugger to skip past |
| 37 * (unlike NACL_INSTR_POOL_HEAD), because the validator validates the | 37 * one of these (unlike NACL_INSTR_ARM_POOL_HEAD), because the validator |
| 38 * instructions that follow. | 38 * validates the instructions that follow. |
| 39 */ | 39 */ |
| 40 | 40 |
| 41 /* | 41 /* |
| 42 * BKPT #0x5BEF: generic breakpoint. | 42 * BKPT #0x5BEF: generic breakpoint. |
| 43 * | 43 * |
| 44 * Usable statically by users or dynamically by the runtime. | 44 * Usable statically by users or dynamically by the runtime. |
| 45 */ | 45 */ |
| 46 #define NACL_INSTR_BREAKPOINT 0xE125BE7F | 46 #define NACL_INSTR_ARM_BREAKPOINT 0xE125BE7F |
| 47 | 47 |
| 48 /* | 48 /* |
| 49 * UDF #0xEDEF: halt-fill. | 49 * UDF #0xEDEF: halt-fill. |
| 50 * | 50 * |
| 51 * Generated at load time. | 51 * Generated at load time. |
| 52 */ | 52 */ |
| 53 #define NACL_INSTR_HALT_FILL 0xE7FEDEFF | 53 #define NACL_INSTR_ARM_HALT_FILL 0xE7FEDEFF |
| 54 | 54 |
| 55 /* | 55 /* |
| 56 * UDF #0xEDE0: abort-now. | 56 * UDF #0xEDE0: abort-now. |
| 57 * | 57 * |
| 58 * Required by some language constructs such as __builtin_trap. | 58 * Required by some language constructs such as __builtin_trap. |
| 59 */ | 59 */ |
| 60 #define NACL_INSTR_ABORT_NOW 0xE7FEDEF0 | 60 #define NACL_INSTR_ARM_ABORT_NOW 0xE7FEDEF0 |
| 61 | 61 |
| 62 /* | 62 /* |
| 63 * UDF #0xEDE1: always fail validation. | 63 * UDF #0xEDE1: always fail validation. |
| 64 * | 64 * |
| 65 * It's guaranteed to always fail, and can be used to initialize buffers | 65 * It's guaranteed to always fail, and can be used to initialize buffers |
| 66 * that are expected to be filled later. | 66 * that are expected to be filled later. |
| 67 */ | 67 */ |
| 68 #define NACL_INSTR_FAIL_VALIDATION 0xE7FEDEF1 | 68 #define NACL_INSTR_ARM_FAIL_VALIDATION 0xE7FEDEF1 |
| 69 | 69 |
| 70 #endif /* NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ */ | 70 #endif /* NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ */ |
| OLD | NEW |