| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * be found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 * Copyright 2009, Google Inc. | |
| 6 */ | 5 */ |
| 7 | 6 |
| 8 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_VALIDATOR_H | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_VALIDATOR_H |
| 9 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_VALIDATOR_H | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_VALIDATOR_H |
| 10 | 9 |
| 11 /* | 10 /* |
| 12 * The SFI validator, and some utility classes it uses. | 11 * The SFI validator, and some utility classes it uses. |
| 13 */ | 12 */ |
| 14 | 13 |
| 15 #include <stdint.h> | 14 #include <stdint.h> |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } | 252 } |
| 254 | 253 |
| 255 uint32_t branch_target() const { | 254 uint32_t branch_target() const { |
| 256 return vaddr_ + decoder_->branch_target_offset(inst_); | 255 return vaddr_ + decoder_->branch_target_offset(inst_); |
| 257 } | 256 } |
| 258 | 257 |
| 259 const nacl_arm_dec::Register base_address_register() const { | 258 const nacl_arm_dec::Register base_address_register() const { |
| 260 return decoder_->base_address_register(inst_); | 259 return decoder_->base_address_register(inst_); |
| 261 } | 260 } |
| 262 | 261 |
| 262 bool offset_is_immediate() const { |
| 263 return decoder_->offset_is_immediate(inst_); |
| 264 } |
| 265 |
| 263 bool clears_bits(uint32_t mask) const { | 266 bool clears_bits(uint32_t mask) const { |
| 264 return decoder_->clears_bits(inst_, mask); | 267 return decoder_->clears_bits(inst_, mask); |
| 265 } | 268 } |
| 266 | 269 |
| 267 bool sets_Z_if_bits_clear(nacl_arm_dec::Register r, uint32_t mask) const { | 270 bool sets_Z_if_bits_clear(nacl_arm_dec::Register r, uint32_t mask) const { |
| 268 return decoder_->sets_Z_if_bits_clear(inst_, r, mask); | 271 return decoder_->sets_Z_if_bits_clear(inst_, r, mask); |
| 269 } | 272 } |
| 270 | 273 |
| 271 nacl_arm_dec::RegisterList immediate_addressing_defs() const { | 274 nacl_arm_dec::RegisterList immediate_addressing_defs() const { |
| 272 return decoder_->immediate_addressing_defs(inst_); | 275 return decoder_->immediate_addressing_defs(inst_); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 * process them into localized messages without needing to pull in the whole | 380 * process them into localized messages without needing to pull in the whole |
| 378 * validator...we'll see. | 381 * validator...we'll see. |
| 379 */ | 382 */ |
| 380 | 383 |
| 381 // An instruction is unsafe -- more information in the SafetyLevel. | 384 // An instruction is unsafe -- more information in the SafetyLevel. |
| 382 const char * const kProblemUnsafe = "kProblemUnsafe"; | 385 const char * const kProblemUnsafe = "kProblemUnsafe"; |
| 383 // A branch would break a pseudo-operation pattern. | 386 // A branch would break a pseudo-operation pattern. |
| 384 const char * const kProblemBranchSplitsPattern = "kProblemBranchSplitsPattern"; | 387 const char * const kProblemBranchSplitsPattern = "kProblemBranchSplitsPattern"; |
| 385 // A branch targets an invalid code address (out of segment). | 388 // A branch targets an invalid code address (out of segment). |
| 386 const char * const kProblemBranchInvalidDest = "kProblemBranchInvalidDest"; | 389 const char * const kProblemBranchInvalidDest = "kProblemBranchInvalidDest"; |
| 387 // A store uses an unsafe (non-masked) base address. | 390 // A load/store uses an unsafe (non-masked) base address. |
| 388 const char * const kProblemUnsafeStore = "kProblemUnsafeStore"; | 391 const char * const kProblemUnsafeLoadStore = "kProblemUnsafeLoadStore"; |
| 389 // A branch uses an unsafe (non-masked) destination address. | 392 // A branch uses an unsafe (non-masked) destination address. |
| 390 const char * const kProblemUnsafeBranch = "kProblemUnsafeBranch"; | 393 const char * const kProblemUnsafeBranch = "kProblemUnsafeBranch"; |
| 391 // An instruction updates a data-address register (e.g. SP) without masking. | 394 // An instruction updates a data-address register (e.g. SP) without masking. |
| 392 const char * const kProblemUnsafeDataWrite = "kProblemUnsafeDataWrite"; | 395 const char * const kProblemUnsafeDataWrite = "kProblemUnsafeDataWrite"; |
| 393 // An instruction updates a read-only register (e.g. r9). | 396 // An instruction updates a read-only register (e.g. r9). |
| 394 const char * const kProblemReadOnlyRegister = "kProblemReadOnlyRegister"; | 397 const char * const kProblemReadOnlyRegister = "kProblemReadOnlyRegister"; |
| 395 // A pseudo-op pattern crosses a bundle boundary. | 398 // A pseudo-op pattern crosses a bundle boundary. |
| 396 const char * const kProblemPatternCrossesBundle = | 399 const char * const kProblemPatternCrossesBundle = |
| 397 "kProblemPatternCrossesBundle"; | 400 "kProblemPatternCrossesBundle"; |
| 398 // A linking branch instruction is not in the last bundle slot. | 401 // A linking branch instruction is not in the last bundle slot. |
| 399 const char * const kProblemMisalignedCall = "kProblemMisalignedCall"; | 402 const char * const kProblemMisalignedCall = "kProblemMisalignedCall"; |
| 400 | 403 |
| 401 } // namespace | 404 } // namespace |
| 402 | 405 |
| 403 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_VALIDATOR_H | 406 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_VALIDATOR_H |
| OLD | NEW |