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 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H |
8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H |
9 | 9 |
10 /* | 10 /* |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 // The number of bits in a word of a THUMB instruction. | 279 // The number of bits in a word of a THUMB instruction. |
280 static const int kThumbWordSize = 16; | 280 static const int kThumbWordSize = 16; |
281 | 281 |
282 // Special ARM instructions for sandboxing. | 282 // Special ARM instructions for sandboxing. |
283 static const uint32_t kLiteralPoolHead = NACL_INSTR_ARM_LITERAL_POOL_HEAD; | 283 static const uint32_t kLiteralPoolHead = NACL_INSTR_ARM_LITERAL_POOL_HEAD; |
284 static const uint32_t kBreakpoint = NACL_INSTR_ARM_BREAKPOINT; | 284 static const uint32_t kBreakpoint = NACL_INSTR_ARM_BREAKPOINT; |
285 static const uint32_t kHaltFill = NACL_INSTR_ARM_HALT_FILL; | 285 static const uint32_t kHaltFill = NACL_INSTR_ARM_HALT_FILL; |
286 static const uint32_t kAbortNow = NACL_INSTR_ARM_ABORT_NOW; | 286 static const uint32_t kAbortNow = NACL_INSTR_ARM_ABORT_NOW; |
287 static const uint32_t kFailValidation = NACL_INSTR_ARM_FAIL_VALIDATION; | 287 static const uint32_t kFailValidation = NACL_INSTR_ARM_FAIL_VALIDATION; |
288 | 288 |
| 289 // Not-so-special instructions. |
| 290 static const uint32_t kNop = NACL_INSTR_ARM_NOP; |
| 291 |
289 // Models an instruction, either a 32-bit ARM instruction of unspecified type, | 292 // Models an instruction, either a 32-bit ARM instruction of unspecified type, |
290 // or one word (16-bit) and two word (32-bit) THUMB instructions. | 293 // or one word (16-bit) and two word (32-bit) THUMB instructions. |
291 // | 294 // |
292 // This class is designed for efficiency: | 295 // This class is designed for efficiency: |
293 // - Its public methods for bitfield extraction are short and inline. | 296 // - Its public methods for bitfield extraction are short and inline. |
294 // - It has no vtable, so on 32-bit platforms it's exactly the size of the | 297 // - It has no vtable, so on 32-bit platforms it's exactly the size of the |
295 // instruction it models. | 298 // instruction it models. |
296 // - API's exist for accessing both ARM (32-bit) instructions and | 299 // - API's exist for accessing both ARM (32-bit) instructions and |
297 // THUMB instructions (which are 1 or two (16-bit) words). | 300 // THUMB instructions (which are 1 or two (16-bit) words). |
298 class Instruction { | 301 class Instruction { |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 } | 520 } |
518 | 521 |
519 private: | 522 private: |
520 uint32_t bits_; | 523 uint32_t bits_; |
521 Instruction& operator=(const Instruction& insn); // Disallow assignment. | 524 Instruction& operator=(const Instruction& insn); // Disallow assignment. |
522 }; | 525 }; |
523 | 526 |
524 } // namespace nacl_arm_dec | 527 } // namespace nacl_arm_dec |
525 | 528 |
526 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H | 529 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H |
OLD | NEW |