dev: Fix bifield definition in timer_cpulocal.hh
authorAli Saidi <Ali.Saidi@ARM.com>
Fri, 7 Sep 2012 19:20:53 +0000 (14:20 -0500)
committerAli Saidi <Ali.Saidi@ARM.com>
Fri, 7 Sep 2012 19:20:53 +0000 (14:20 -0500)
Bitfield definition in the local timer model for ARM had the bitfield
range numbers reversed which could lead to buggy behavior.

src/dev/arm/timer_cpulocal.hh

index 5357ac0eb2b1d4f9b459fd7bfb3d7e0c28a5d177..144e0b8070d4105bc938b1ac4ef709eaed21b42a 100644 (file)
@@ -77,8 +77,8 @@ class CpuLocalTimer : public BasicPioDevice
             Bitfield<0>   enable;
             Bitfield<1>   autoReload;
             Bitfield<2>   intEnable;
-            Bitfield<3,7> reserved;
-            Bitfield<8,15> prescalar;
+            Bitfield<7,3> reserved;
+            Bitfield<15,8> prescalar;
         EndBitUnion(TimerCtrl)
 
         BitUnion32(WatchdogCtrl)
@@ -86,8 +86,8 @@ class CpuLocalTimer : public BasicPioDevice
             Bitfield<1>   autoReload;
             Bitfield<2>   intEnable;
             Bitfield<3>   watchdogMode;
-            Bitfield<4,7> reserved;
-            Bitfield<8,15> prescalar;
+            Bitfield<7,4> reserved;
+            Bitfield<15,8> prescalar;
         EndBitUnion(WatchdogCtrl)
 
       protected: