Use logical operator instead of bitwise operator for correctness.
authorNathan Binkert <nate@binkert.org>
Fri, 26 Sep 2008 15:18:56 +0000 (08:18 -0700)
committerNathan Binkert <nate@binkert.org>
Fri, 26 Sep 2008 15:18:56 +0000 (08:18 -0700)
src/arch/mips/mt.hh
src/kern/tru64/tru64.hh

index 6765c27a93b958ea664afd1adac7fb4e4764fb0c..20658df28920f89c5fc70f0d622f9fb38fc33105 100755 (executable)
@@ -220,7 +220,7 @@ yieldThread(TC *tc, Fault &fault, int src_reg, uint32_t yield_mask)
             warn("%i: Deactivating Hardware Thread Context #%i", curTick, tc->getThreadNum());
         }
     } else if (src_reg > 0) {
-        if (src_reg & !yield_mask != 0) {
+        if (src_reg && !yield_mask != 0) {
             unsigned vpe_control = tc->readMiscReg(VPEControl);
             tc->setMiscReg(VPEControl, insertBits(vpe_control, VPEC_EXCPT_HI, VPEC_EXCPT_LO, 2));
             fault = new ThreadFault();
index d0c359a1fc0a3204e8fc394812d1aa819c37b3f6..dfdb8524d6cc44fb7b5fb509cf7a0e466985d821 100644 (file)
@@ -723,7 +723,7 @@ class Tru64 : public OperatingSystem
             abort();
         }
 
-        if (thread_index < 0 | thread_index > process->numCpus()) {
+        if (thread_index < 0 || thread_index > process->numCpus()) {
             cerr << "nxm_thread_create: bad thread index " << thread_index
                  << endl;
             abort();