ARM: Do something predictable for an UNPREDICTABLE branch.
authorAli Saidi <Ali.Saidi@ARM.com>
Mon, 15 Nov 2010 20:04:03 +0000 (14:04 -0600)
committerAli Saidi <Ali.Saidi@ARM.com>
Mon, 15 Nov 2010 20:04:03 +0000 (14:04 -0600)
src/arch/arm/types.hh

index a679686c7515c9a5b5e9ef68143830fa14f5220c..e270813ef12ca6c174c05d7ec1f1c752ca01e2a2 100644 (file)
@@ -333,6 +333,10 @@ namespace ArmISA
                     nextThumb(false);
                 } else {
                     warn("Bad interworking branch address %#x.\n", newPC);
+                    // This state is UNPREDICTABLE in the ARM architecture
+                    // The easy thing to do is just mask off the bit and
+                    // stay in the current mode, so we'll do that.
+                    newPC &= ~mask(2);
                 }
             }
             npc(newPC);