ARM: Fix incorrect use of not operators in arm devices
authorAli Saidi <Ali.Saidi@ARM.com>
Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)
committerAli Saidi <Ali.Saidi@ARM.com>
Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)
src/dev/arm/rtc_pl031.cc
src/dev/arm/timer_cpulocal.cc
src/dev/arm/timer_sp804.cc

index 8896b16ebc8ae9fa3de19ffc296b39817662ecdb..99436c280fff55042081b38e18373169cc92f6a3 100644 (file)
@@ -191,7 +191,7 @@ PL031::counterMatch()
     rawInt = true;
     bool old_pending = pendingInt;
     pendingInt = maskInt & rawInt;
-    if (pendingInt && ~old_pending) {
+    if (pendingInt && !old_pending) {
         DPRINTF(Timer, "-- Causing interrupt\n");
         gic->sendInt(intNum);
     }
index a3a126f2fe940392a227d211e71ae7c4703e52d0..97d3c5883a94de6f8d0ae60f424817849b39aba2 100644 (file)
@@ -291,7 +291,7 @@ CpuLocalTimer::Timer::timerAtZero()
     bool old_pending = pendingIntTimer;
     if (timerControl.intEnable)
         pendingIntTimer = true;
-    if (pendingIntTimer && ~old_pending) {
+    if (pendingIntTimer && !old_pending) {
         DPRINTF(Timer, "-- Causing interrupt\n");
         parent->gic->sendPPInt(intNumTimer, cpuNum);
     }
@@ -322,7 +322,7 @@ CpuLocalTimer::Timer::watchdogAtZero()
         //XXX: Should we ever support a true watchdog reset?
     }
 
-    if (pendingIntWatchdog && ~old_pending) {
+    if (pendingIntWatchdog && !old_pending) {
         DPRINTF(Timer, "-- Causing interrupt\n");
         parent->gic->sendPPInt(intNumWatchdog, cpuNum);
     }
index 323597a98aa4f4e60ae1e909b6408103264b3d8f..407f35b60574fe367e7e1a1fced93596b647fbe5 100644 (file)
@@ -205,7 +205,7 @@ Sp804::Timer::counterAtZero()
     bool old_pending = pendingInt;
     if (control.intEnable)
         pendingInt = true;
-    if (pendingInt && ~old_pending) {
+    if (pendingInt && !old_pending) {
         DPRINTF(Timer, "-- Causing interrupt\n");
         parent->gic->sendInt(intNum);
     }