| 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_MIPS_MODEL_H | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_MODEL_H |
| 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_MODEL_H | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_MODEL_H |
| 9 | 9 |
| 10 /* | 10 /* |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 /* | 36 /* |
| 37 * Produces the bitmask used to represent this register. | 37 * Produces the bitmask used to represent this register. |
| 38 */ | 38 */ |
| 39 inline uint32_t Bitmask() const; | 39 inline uint32_t Bitmask() const; |
| 40 | 40 |
| 41 inline bool Equals(const Register &) const; | 41 inline bool Equals(const Register &) const; |
| 42 | 42 |
| 43 static const Number kJumpMask = 14; // $t6 = holds mask for jr. | 43 static const Number kJumpMask = 14; // $t6 = holds mask for jr. |
| 44 static const Number kLoadStoreMask = 15; // $t7 = holds mask for load/store. | 44 static const Number kLoadStoreMask = 15; // $t7 = holds mask for load/store. |
| 45 static const Number kTls = 24; // $t8 = holds tls index. | 45 static const Number kTls = 24; // $t8 = holds address of |
| 46 // tls_value1 in NaClThreadContext. |
| 46 static const Number kSp = 29; // Stack pointer. | 47 static const Number kSp = 29; // Stack pointer. |
| 47 | 48 |
| 48 static const Number kNone = 32; | 49 static const Number kNone = 32; |
| 49 | 50 |
| 50 /* | 51 /* |
| 51 * A special value used to indicate that a register field is not used. | 52 * A special value used to indicate that a register field is not used. |
| 52 * This is specially chosen to ensure that bitmask() == 0, so it can be added | 53 * This is specially chosen to ensure that bitmask() == 0, so it can be added |
| 53 * to any RegisterList with no effect. | 54 * to any RegisterList with no effect. |
| 54 */ | 55 */ |
| 55 static Register None() { return Register(kNone); } | 56 static Register None() { return Register(kNone); } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 uint32_t _bits; | 168 uint32_t _bits; |
| 168 }; | 169 }; |
| 169 | 170 |
| 170 uint32_t const kInstrSize = 4; | 171 uint32_t const kInstrSize = 4; |
| 171 uint32_t const kInstrAlign = 0xFFFFFFFC; | 172 uint32_t const kInstrAlign = 0xFFFFFFFC; |
| 172 uint32_t const kBundleAlign = 0xFFFFFFF0; | 173 uint32_t const kBundleAlign = 0xFFFFFFF0; |
| 173 | 174 |
| 174 // Opcode for nop instruction. | 175 // Opcode for nop instruction. |
| 175 uint32_t const kNop = 0x0; | 176 uint32_t const kNop = 0x0; |
| 176 | 177 |
| 177 } // namespace | 178 } // namespace nacl_mips_dec |
| 178 | 179 |
| 179 // Definitions for our inlined functions. | 180 // Definitions for our inlined functions. |
| 180 #include "native_client/src/trusted/validator_mips/model-inl.h" | 181 #include "native_client/src/trusted/validator_mips/model-inl.h" |
| 181 | 182 |
| 182 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_MODEL_H | 183 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_MODEL_H |
| OLD | NEW |