Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Unified Diff: src/trusted/validator_arm/baseline_classes.cc

Issue 11194045: Change BKPT and UDF encodings on ARM. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Update copyright. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/validator_arm/armv7.table ('k') | src/trusted/validator_arm/gen/arm32_decode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator_arm/baseline_classes.cc
diff --git a/src/trusted/validator_arm/baseline_classes.cc b/src/trusted/validator_arm/baseline_classes.cc
index 253384f20975bcf57a49234f10b3bc12783ca649..f43a774c9e54d2132f8321630912ed4eb28d4cf2 100644
--- a/src/trusted/validator_arm/baseline_classes.cc
+++ b/src/trusted/validator_arm/baseline_classes.cc
@@ -90,13 +90,18 @@ int32_t BranchImmediate24::branch_target_offset(Instruction i) const {
// BreakPointAndConstantPoolHead
SafetyLevel BreakPointAndConstantPoolHead::safety(const Instruction i) const {
- return i.GetCondition() == Instruction::AL
- ? MAY_BE_SAFE
- : UNPREDICTABLE;
+ if (i.GetCondition() != Instruction::AL)
+ return UNPREDICTABLE;
+ // Restrict BKPT's encoding to values we've chosen as safe.
+ if ((i.Bits(31, 0) == kLiteralPoolHead) ||
+ (i.Bits(31, 0) == kBreakpoint))
+ return MAY_BE_SAFE;
+ return FORBIDDEN_OPERANDS;
}
+
bool BreakPointAndConstantPoolHead::
is_literal_pool_head(const Instruction i) const {
- return i.Bits(31, 0) == kLiteralPoolHeadInstruction;
+ return i.Bits(31, 0) == kLiteralPoolHead;
}
// BranchToRegister
« no previous file with comments | « src/trusted/validator_arm/armv7.table ('k') | src/trusted/validator_arm/gen/arm32_decode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698