Chromium Code Reviews| Index: src/trusted/validator_mips/inst_classes.h |
| diff --git a/src/trusted/validator_mips/inst_classes.h b/src/trusted/validator_mips/inst_classes.h |
| index ef8b27b9b88ec82a94ddfa9065d0f72d328e7188..4012cc658080741b5da1eefd03c64634c28a98df 100644 |
| --- a/src/trusted/validator_mips/inst_classes.h |
| +++ b/src/trusted/validator_mips/inst_classes.h |
| @@ -136,6 +136,13 @@ class ClassDecoder { |
| } |
| /* |
| + * For lw instruction. |
| + */ |
|
Mark Seaborn
2015/12/27 03:46:35
Nit: Fix indentation here
petarj
2015/12/28 14:07:00
Done.
|
| + virtual bool IsLoadWord() const { |
| + return false; |
| + } |
| + |
| + /* |
| * For direct jumps, returning the destination address. |
| */ |
| virtual uint32_t DestAddr(const Instruction instr, uint32_t addr) const { |
| @@ -171,12 +178,12 @@ class ClassDecoder { |
| * Current MIPS NaCl halt (break). |
| */ |
| class NaClHalt : public ClassDecoder { |
| - public: |
| - virtual ~NaClHalt() {} |
| - virtual SafetyLevel safety(const Instruction instr) const { |
| - UNREFERENCED_PARAMETER(instr); |
| - return MAY_BE_SAFE; |
| - } |
| + public: |
| + virtual ~NaClHalt() {} |
| + virtual SafetyLevel safety(const Instruction instr) const { |
| + UNREFERENCED_PARAMETER(instr); |
| + return MAY_BE_SAFE; |
| + } |
| }; |
| /* |
| @@ -288,6 +295,9 @@ class AbstractLoadStore : public ClassDecoder { |
| virtual Register BaseAddressRegister(const Instruction instr) const { |
| return instr.Reg(25, 21); |
| } |
| + virtual uint32_t GetImm(const Instruction instr) const { |
| + return instr.Bits(15, 0); |
| + } |
| }; |
| /* |
| @@ -310,6 +320,17 @@ class Load : public AbstractLoadStore { |
| }; |
| /* |
| + * Load word instruction, for loading thread pointer. |
| + */ |
| +class LoadWord : public Load { |
| + public: |
| + virtual ~LoadWord() {} |
| + virtual bool IsLoadWord() const { |
| + return true; |
| + } |
| +}; |
| + |
| + /* |
| * Floating point load and store instructions. |
| */ |
| class FPLoadStore : public AbstractLoadStore { |
| @@ -432,6 +453,6 @@ class Unrecognized : public ClassDecoder { |
| return FORBIDDEN; |
| } |
| }; |
| -} // namespace |
| +} // namespace nacl_mips_dec |
| #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_INST_CLASSES_H |