ARM: Make various bits of the FP control registers read only.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:15 +0000 (12:58 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:15 +0000 (12:58 -0500)
src/arch/arm/isa.hh

index 1dad823979fb68c50866a5a7dd20f91231504706..f2d913ac4dd786b1f3ebf83c61d40025f4755991 100644 (file)
@@ -295,10 +295,43 @@ namespace ArmISA
               case MISCREG_CSSELR:
                 warn("The csselr register isn't implemented.\n");
                 break;
+              case MISCREG_FPSCR:
+                {
+                    const uint32_t ones = (uint32_t)(-1);
+                    FPSCR fpscrMask = 0;
+                    fpscrMask.ioc = ones;
+                    fpscrMask.dzc = ones;
+                    fpscrMask.ofc = ones;
+                    fpscrMask.ufc = ones;
+                    fpscrMask.ixc = ones;
+                    fpscrMask.idc = ones;
+                    fpscrMask.len = ones;
+                    fpscrMask.stride = ones;
+                    fpscrMask.rMode = ones;
+                    fpscrMask.fz = ones;
+                    fpscrMask.dn = ones;
+                    fpscrMask.ahp = ones;
+                    fpscrMask.qc = ones;
+                    fpscrMask.v = ones;
+                    fpscrMask.c = ones;
+                    fpscrMask.z = ones;
+                    fpscrMask.n = ones;
+                    newVal = (newVal & (uint32_t)fpscrMask) |
+                             (miscRegs[MISCREG_FPSCR] & ~(uint32_t)fpscrMask);
+                }
+                break;
+              case MISCREG_FPEXC:
+                {
+                    const uint32_t fpexcMask = 0x60000000;
+                    newVal = (newVal & fpexcMask) |
+                             (miscRegs[MISCREG_FPEXC] & ~fpexcMask);
+                }
+                break;
               case MISCREG_TLBTR:
               case MISCREG_MVFR0:
               case MISCREG_MVFR1:
               case MISCREG_MPIDR:
+              case MISCREG_FPSID:
                 return;
             }
             return setMiscRegNoEffect(misc_reg, newVal);