ARM: Ignore writing a bad mode to CPSR with MSR.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:11 +0000 (12:58 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:11 +0000 (12:58 -0500)
src/arch/arm/insts/static_inst.hh

index c26053cefc0e2d124288ee10c405c928c9ae9bec..33453bec681b404f6a14cae7fa940c69b022164d 100644 (file)
@@ -177,7 +177,11 @@ class ArmStaticInst : public StaticInst
         if (bits(byteMask, 0)) {
             if (privileged) {
                 bitMask = bitMask | mask(7, 6);
-                bitMask = bitMask | mask(5);
+                if (!badMode((OperatingMode)(val & mask(5)))) {
+                    bitMask = bitMask | mask(5);
+                } else {
+                    warn_once("Ignoring write of bad mode to CPSR.\n");
+                }
             }
             if (affectState)
                 bitMask = bitMask | (1 << 5);