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_ACTUAL_CLASSES_H_ | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ |
8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ |
9 | 9 |
10 #include "native_client/src/trusted/validator_arm/inst_classes.h" | 10 #include "native_client/src/trusted/validator_arm/inst_classes.h" |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 class EffectiveNoOp : public OldClassDecoder { | 711 class EffectiveNoOp : public OldClassDecoder { |
712 public: | 712 public: |
713 EffectiveNoOp() {} | 713 EffectiveNoOp() {} |
714 virtual SafetyLevel safety(Instruction i) const; | 714 virtual SafetyLevel safety(Instruction i) const; |
715 virtual RegisterList defs(Instruction i) const; | 715 virtual RegisterList defs(Instruction i) const; |
716 | 716 |
717 private: | 717 private: |
718 NACL_DISALLOW_COPY_AND_ASSIGN(EffectiveNoOp); | 718 NACL_DISALLOW_COPY_AND_ASSIGN(EffectiveNoOp); |
719 }; | 719 }; |
720 | 720 |
721 // Models all instructions that reliably trap, preventing execution from falling | 721 // UDF |
722 // through to the next instruction. Note that roadblocks currently have no | 722 // Permanently undefined in the ARM ISA. |
723 // special role in the SFI model, so Breakpoints are distinguished below. | 723 class PermanentlyUndefined : public OldClassDecoder { |
724 class Roadblock : public OldClassDecoder { | |
725 public: | 724 public: |
726 Roadblock() {} | 725 PermanentlyUndefined() {} |
727 virtual SafetyLevel safety(Instruction i) const; | 726 virtual SafetyLevel safety(Instruction i) const; |
728 virtual RegisterList defs(Instruction i) const; | 727 virtual RegisterList defs(Instruction i) const; |
729 | 728 |
730 private: | 729 private: |
731 NACL_DISALLOW_COPY_AND_ASSIGN(Roadblock); | 730 NACL_DISALLOW_COPY_AND_ASSIGN(PermanentlyUndefined); |
732 }; | 731 }; |
733 | 732 |
734 // BKPT | 733 // BKPT |
735 // We model this mostly so we can use it to recognize literal pools -- untrusted | 734 // We model this mostly so we can use it to recognize literal pools -- untrusted |
736 // code isn't expected to use it, but it's not unsafe, and there are cases where | 735 // code isn't expected to use it, but it's not unsafe, and there are cases where |
737 // we may generate it. | 736 // we may generate it. |
738 class Breakpoint : public Roadblock { | 737 class Breakpoint : public OldClassDecoder { |
739 public: | 738 public: |
740 Breakpoint() {} | 739 Breakpoint() {} |
741 virtual SafetyLevel safety(Instruction i) const; | 740 virtual SafetyLevel safety(Instruction i) const; |
| 741 virtual RegisterList defs(Instruction i) const; |
742 virtual bool is_literal_pool_head(Instruction i) const; | 742 virtual bool is_literal_pool_head(Instruction i) const; |
743 | 743 |
744 private: | 744 private: |
745 NACL_DISALLOW_COPY_AND_ASSIGN(Breakpoint); | 745 NACL_DISALLOW_COPY_AND_ASSIGN(Breakpoint); |
746 }; | 746 }; |
747 | 747 |
748 // Models the Pack/Saturate/Reverse instructions, which | 748 // Models the Pack/Saturate/Reverse instructions, which |
749 // - Write a register identified by 15:12, | 749 // - Write a register identified by 15:12, |
750 // - Are not permitted to affect r15, | 750 // - Are not permitted to affect r15, |
751 // - Always set flags. | 751 // - Always set flags. |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 virtual RegisterList defs(Instruction i) const; | 1146 virtual RegisterList defs(Instruction i) const; |
1147 virtual bool clears_bits(Instruction i, uint32_t mask) const; | 1147 virtual bool clears_bits(Instruction i, uint32_t mask) const; |
1148 | 1148 |
1149 private: | 1149 private: |
1150 NACL_DISALLOW_COPY_AND_ASSIGN(Unary1RegisterBitRangeMsbGeLsb); | 1150 NACL_DISALLOW_COPY_AND_ASSIGN(Unary1RegisterBitRangeMsbGeLsb); |
1151 }; | 1151 }; |
1152 | 1152 |
1153 } // namespace nacl_arm_dec | 1153 } // namespace nacl_arm_dec |
1154 | 1154 |
1155 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ | 1155 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ |
OLD | NEW |