| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 /* | 73 /* |
| 74 * A special value used in some cases to indicate that a register field | 74 * A special value used in some cases to indicate that a register field |
| 75 * is not used. This is specially chosen to ensure that bitmask() == 0, so | 75 * is not used. This is specially chosen to ensure that bitmask() == 0, so |
| 76 * it can be added to any RegisterList with no effect. | 76 * it can be added to any RegisterList with no effect. |
| 77 * | 77 * |
| 78 * Note that -1 or 32 can't be used here because C++ doesn't define a portable | 78 * Note that -1 or 32 can't be used here because C++ doesn't define a portable |
| 79 * meaning for such shift distances. | 79 * meaning for such shift distances. |
| 80 */ | 80 */ |
| 81 const Register kRegisterNone(31); | 81 const Register kRegisterNone(31); |
| 82 | 82 |
| 83 // The APSR (flags register) is modeled as r16. | 83 // The conditions (i.e. APSR N, Z, C, and V) are collectively modeled as r16. |
| 84 const Register kRegisterFlags(16); | 84 // These bits of the APSR register are separately tracked, so we can |
| 85 // test when any of the 4 bits (and hence conditional execution) is |
| 86 // affected. If you need to track other bits in the APSR, add them as |
| 87 // a separate register. |
| 88 const Register kConditions(16); |
| 85 | 89 |
| 86 // Registers with special meaning in our model: | 90 // Registers with special meaning in our model: |
| 87 const Register kRegisterPc(15); | 91 const Register kRegisterPc(15); |
| 88 const Register kRegisterLink(14); | 92 const Register kRegisterLink(14); |
| 89 const Register kRegisterStack(13); | 93 const Register kRegisterStack(13); |
| 90 | 94 |
| 91 | |
| 92 /* | 95 /* |
| 93 * A collection of Registers. Used to describe the side effects of operations. | 96 * A collection of Registers. Used to describe the side effects of operations. |
| 94 * | 97 * |
| 95 * Note that this is technically a set, not a list -- but RegisterSet is a | 98 * Note that this is technically a set, not a list -- but RegisterSet is a |
| 96 * well-known term that means something else. | 99 * well-known term that means something else. |
| 97 */ | 100 */ |
| 98 class RegisterList { | 101 class RegisterList { |
| 99 public: | 102 public: |
| 100 /* | 103 /* |
| 101 * Produces a RegisterList that contains the registers specified in the | 104 * Produces a RegisterList that contains the registers specified in the |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 private: | 317 private: |
| 315 uint32_t bits_; | 318 uint32_t bits_; |
| 316 }; | 319 }; |
| 317 | 320 |
| 318 } // namespace | 321 } // namespace |
| 319 | 322 |
| 320 // Definitions for our inlined functions. | 323 // Definitions for our inlined functions. |
| 321 #include "native_client/src/trusted/validator_arm/model-inl.h" | 324 #include "native_client/src/trusted/validator_arm/model-inl.h" |
| 322 | 325 |
| 323 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H | 326 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H |
| OLD | NEW |