summaryrefslogtreecommitdiff
path: root/src/arch/arm/utility.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:04 -0500
committerGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:04 -0500
commit89060f1fd80b032c92cf4f38c8459901c4f7a898 (patch)
treeab49cd165a37999c8b4e2c5d80ab8a5059718b6d /src/arch/arm/utility.hh
parentaa45fafb2e3667f907a2dcc491c57b9e83f8e940 (diff)
downloadgem5-89060f1fd80b032c92cf4f38c8459901c4f7a898.tar.xz
ARM: Rework how unrecognized/unimplemented instructions are handled.
Instead of panic immediately when these instructions are executed, an UndefinedInstruction fault is returned. In FS mode (not currently implemented), this is the fault that should, to my knowledge, be triggered in these situations and should be handled using the normal architected mechanisms. In SE mode, the fault causes a panic when it's invoked that gives the same information as the instruction did. When/if support for speculative execution of ARM is supported, this will allow a mispeculated and unrecognized and/or unimplemented instruction from causing a panic. Only once the instruction is going to be committed will the fault be invoked, triggering the panic.
Diffstat (limited to 'src/arch/arm/utility.hh')
-rw-r--r--src/arch/arm/utility.hh14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/arch/arm/utility.hh b/src/arch/arm/utility.hh
index 5739ba3cd..b2c678c46 100644
--- a/src/arch/arm/utility.hh
+++ b/src/arch/arm/utility.hh
@@ -146,6 +146,20 @@ namespace ArmISA {
return (tc->readMiscRegNoEffect(MISCREG_CPSR) & 0x1f) == MODE_USER;
}
+ static inline std::string
+ inst2string(MachInst machInst)
+ {
+ std::string str = "";
+ uint32_t mask = (1 << 31);
+
+ while (mask) {
+ str += ((machInst & mask) ? "1" : "0");
+ mask = mask >> 1;
+ }
+
+ return str;
+ }
+
uint64_t getArgument(ThreadContext *tc, int number, bool fp);
Fault setCp15Register(uint32_t &Rd, int CRn, int opc1, int CRm, int opc2);