arch-arm: HLT using immediate when checking for semihosting
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 14 Feb 2018 18:42:19 +0000 (18:42 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 20 Feb 2018 13:30:02 +0000 (13:30 +0000)
HLT can use the immediate field when checking for semihosting,
rather than re-parsing it from the machInst variable.

Change-Id: I072cb100029da34d129b90c5d17e1728f9016c88
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8369
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/arch/arm/isa/insts/misc64.isa

index cf82ea3e478bd0559f9cc83f8b624c2b7aee4f4c..17d8df10d4131f9aba720d0405ed1df05a7fb0bf 100644 (file)
@@ -177,7 +177,7 @@ let {{
 
     hltCode = '''
     ThreadContext *tc = xc->tcBase();
-    if (ArmSystem::haveSemihosting(tc) && bits(machInst, 20, 5) == 0xF000) {
+    if (ArmSystem::haveSemihosting(tc) && imm == 0xF000) {
         X0 = ArmSystem::callSemihosting64(tc, X0 & mask(32), X1);
     } else {
         // HLT instructions aren't implemented, so treat them as undefined