build: fix compile problems pointed out by gcc 4.4
authorNathan Binkert <nate@binkert.org>
Thu, 5 Nov 2009 00:57:01 +0000 (16:57 -0800)
committerNathan Binkert <nate@binkert.org>
Thu, 5 Nov 2009 00:57:01 +0000 (16:57 -0800)
22 files changed:
src/arch/arm/insts/static_inst.cc
src/arch/mips/dsp.cc
src/arch/x86/interrupts.cc
src/arch/x86/isa.cc
src/arch/x86/system.cc
src/base/bigint.cc
src/base/bigint.hh
src/base/inet.cc
src/base/remote_gdb.cc
src/base/types.hh
src/cpu/inorder/resource.hh
src/cpu/inst_seq.hh
src/cpu/legiontrace.cc
src/dev/sparc/iob.cc
src/dev/x86/i82094aa.cc
src/kern/linux/linux.cc
src/mem/physical.cc
src/mem/ruby/common/Address.hh
src/mem/ruby/network/orion/power_utils.cc
src/sim/eventq.hh
src/sim/process.cc
src/sim/syscall_emul.cc

index df2d5de251a2ec61de0a762b421636026599a336..5181041d03f7b4b3eacd8611c0d9824143949f7b 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "arch/arm/insts/static_inst.hh"
 #include "base/condcodes.hh"
+#include "base/cprintf.hh"
 #include "base/loader/symtab.hh"
 
 namespace ArmISA
@@ -62,7 +63,7 @@ ArmStaticInst::shift_rm_imm(uint32_t base, uint32_t shamt,
         else
             return (base << (32 - shamt)) | (base >> shamt);
       default:
-        fprintf(stderr, "Unhandled shift type\n");
+        ccprintf(std::cerr, "Unhandled shift type\n");
         exit(1);
         break;
     }
@@ -101,7 +102,7 @@ ArmStaticInst::shift_rm_rs(uint32_t base, uint32_t shamt,
         else
             return (base << (32 - shamt)) | (base >> shamt);
       default:
-        fprintf(stderr, "Unhandled shift type\n");
+        ccprintf(std::cerr, "Unhandled shift type\n");
         exit(1);
         break;
     }
@@ -141,7 +142,7 @@ ArmStaticInst::shift_carry_imm(uint32_t base, uint32_t shamt,
         else
             return (base >> (shamt - 1)) & 1;
       default:
-        fprintf(stderr, "Unhandled shift type\n");
+        ccprintf(std::cerr, "Unhandled shift type\n");
         exit(1);
         break;
     }
@@ -182,7 +183,7 @@ ArmStaticInst::shift_carry_rs(uint32_t base, uint32_t shamt,
             shamt = 32;
         return (base >> (shamt - 1)) & 1;
       default:
-        fprintf(stderr, "Unhandled shift type\n");
+        ccprintf(std::cerr, "Unhandled shift type\n");
         exit(1);
         break;
     }
index 6e4f7afeadf2aefa838da5168984a38e04296ab6..b8b02ae9e1345f050121dc53201a8a45b8aae1a1 100755 (executable)
@@ -463,6 +463,8 @@ MipsISA::dspMuleq(int32_t a, int32_t b, int32_t mode, uint32_t *dspctl)
     uint64_t b_values[SIMD_MAX_VALS];
     uint64_t c_values[SIMD_MAX_VALS];
 
+    memset(c_values, 0, sizeof(c_values));
+
     simdUnpack(a, a_values, SIMD_FMT_PH, SIGNED);
     simdUnpack(b, b_values, SIMD_FMT_PH, SIGNED);
 
@@ -743,7 +745,7 @@ MipsISA::dspMulsaq(int64_t dspac, int32_t a, int32_t b, int32_t ac,
     int nvals = SIMD_NVALS[fmt];
     uint64_t a_values[SIMD_MAX_VALS];
     uint64_t b_values[SIMD_MAX_VALS];
-    int64_t temp[2];
+    int64_t temp[2] = {0, 0};
     uint32_t ouflag = 0;
 
     simdUnpack(a, a_values, fmt, SIGNED);
index 1b7933036a87ac99439a1125355de55fc46cfda0..1b83c66495f220d2e7f861c0520c274a696a8416 100644 (file)
@@ -500,7 +500,7 @@ X86ISA::Interrupts::setReg(ApicRegIndex reg, uint32_t val)
             InterruptCommandRegHigh high = regs[APIC_INTERRUPT_COMMAND_HIGH];
             // Record that an IPI is being sent.
             low.deliveryStatus = 1;
-            TriggerIntMessage message;
+            TriggerIntMessage message = 0;
             message.destination = high.destination;
             message.vector = low.vector;
             message.deliveryMode = low.deliveryMode;
index 06a656efc02927b4829235dd463eae2b015aeb42..47d24ed1e6ccf9eb386f2db643587ae562a56340 100644 (file)
@@ -41,7 +41,7 @@ void
 ISA::updateHandyM5Reg(Efer efer, CR0 cr0,
                       SegAttr csAttr, SegAttr ssAttr, RFLAGS rflags)
 {
-    HandyM5Reg m5reg;
+    HandyM5Reg m5reg = 0;
     if (efer.lma) {
         m5reg.mode = LongMode;
         if (csAttr.longMode)
index 1594cc3752d0e6949c531a3aacebdc55fc5cff84..31183f2f90dd80bc18ff5bfb7a317aec9f5b2235 100644 (file)
@@ -211,7 +211,7 @@ X86System::startup()
 
     numGDTEntries++;
 
-    SegSelector ds;
+    SegSelector ds = 0;
     ds.si = numGDTEntries - 1;
 
     tc->setMiscReg(MISCREG_DS, (MiscReg)ds);
index ce9942c9ce67d62f72c07d2f7ee7c332bc268815..d741e1f7bbfb766177987671c9e5dc4a24a2cf88 100644 (file)
  * Authors: Gabe Black
  */
 
-#include "base/bigint.hh"
-
 #include <iostream>
 
+#include "base/bigint.hh"
+
 using namespace std;
 
 ostream & operator << (ostream & os, const Twin64_t & t)
index d6068423144d690e5504d9448be1e9f2edef423d..a4e8738d304749b364a2074dd27a5c0e7c1fc97e 100644 (file)
  * Authors: Ali Saidi
  */
 
-#include "base/misc.hh"
-
 #include <iostream>
 
+#include "base/misc.hh"
+#include "base/types.hh"
+
 #ifndef __BASE_BIGINT_HH__
 #define __BASE_BIGINT_HH__
 // Create a couple of large int types for atomic reads
index 898a189ef648825f6c19d4a25c51b859c47be2da..1a280e993041159894544d1345c3f0395dd7d026 100644 (file)
@@ -28,6 +28,7 @@
  * Authors: Nathan Binkert
  */
 
+#include <cstdio>
 #include <sstream>
 #include <string>
 
index c54379c23a27fd1765fccbfe16318c16251c5771..68747b3d1ddb0dba2417dbcdbe2f692b19c1db95 100644 (file)
 
 #include <sys/signal.h>
 
+#include <cstdio>
 #include <string>
 #include <unistd.h>
 
index 1a6db9fbba2cb53e71e530b74a4917641268a45b..0c10fac64e1f15d384edd474a39224c9db809a03 100644 (file)
@@ -55,6 +55,7 @@ typedef int64_t Counter;
  * @note using an unsigned breaks the cache.
  */
 typedef int64_t Tick;
+typedef uint64_t UTick;
 
 const Tick MaxTick = LL(0x7fffffffffffffff);
 
index 7935e55170ee4243c2427a031f32763deae44d8e..605b7f690e994b3234f256066c8ff0484b3687fe 100644 (file)
@@ -36,6 +36,7 @@
 #include <list>
 #include <string>
 
+#include "base/types.hh"
 #include "cpu/inst_seq.hh"
 #include "cpu/inorder/inorder_dyn_inst.hh"
 #include "cpu/inorder/pipeline_traits.hh"
index 21e04ed251e7bd379e31d890c4ea058b37e27483..b5feaf5849818c97ff9e473bb38e17230d788529 100644 (file)
@@ -32,6 +32,8 @@
 #ifndef __STD_TYPES_HH__
 #define __STD_TYPES_HH__
 
+#include "base/types.hh"
+
 // inst sequence type, used to order instructions in the ready list,
 // if this rolls over the ready list order temporarily will get messed
 // up, but execution will continue and complete correctly
index f1980c713b10de1f99d86fd30482efdd2def2a11..1390d0807fad07624d8514f0cfe22836e7e46f83 100644 (file)
     #error Legion tracing only works in full system!
 #endif
 
-#include <iomanip>
 #include <sys/ipc.h>
 #include <sys/shm.h>
 
+#include <cstdio>
+#include <iomanip>
+
 #include "arch/sparc/predecoder.hh"
 #include "arch/sparc/registers.hh"
 #include "arch/sparc/utility.hh"
index 4543dd07b2e81cb4b49f398f633cde6c4abeb88f..40f856d8af2b2f8bb14063391acf8950e7408152 100644 (file)
@@ -90,20 +90,18 @@ void
 Iob::readIob(PacketPtr pkt)
 {
         Addr accessAddr = pkt->getAddr() - iobManAddr;
-        int index;
-        uint64_t data;
 
         if (accessAddr >= IntManAddr && accessAddr < IntManAddr + IntManSize) {
-            index = (accessAddr - IntManAddr) >> 3;
-            data = intMan[index].cpu << 8 | intMan[index].vector << 0;
+            int index = (accessAddr - IntManAddr) >> 3;
+            uint64_t data = intMan[index].cpu << 8 | intMan[index].vector << 0;
             pkt->set(data);
             return;
         }
 
         if (accessAddr >= IntCtlAddr && accessAddr < IntCtlAddr + IntCtlSize) {
-            index = (accessAddr - IntManAddr) >> 3;
-            data = intCtl[index].mask  ? 1 << 2 : 0 |
-                   intCtl[index].pend  ? 1 << 0 : 0;
+            int index = (accessAddr - IntCtlAddr) >> 3;
+            uint64_t data = intCtl[index].mask  ? 1 << 2 : 0 |
+                intCtl[index].pend  ? 1 << 0 : 0;
             pkt->set(data);
             return;
         }
@@ -199,7 +197,7 @@ Iob::writeIob(PacketPtr pkt)
         }
 
         if (accessAddr >= IntCtlAddr && accessAddr < IntCtlAddr + IntCtlSize) {
-            index = (accessAddr - IntManAddr) >> 3;
+            index = (accessAddr - IntCtlAddr) >> 3;
             data = pkt->get<uint64_t>();
             intCtl[index].mask = bits(data,2,2);
             if (bits(data,1,1))
index ed936d0cb7df17e8e001374fa73466d9141e40f1..591fee6a4d7d56926ed7a6373d758dfa88262f6b 100644 (file)
@@ -151,7 +151,7 @@ X86ISA::I82094AA::signalInterrupt(int line)
         DPRINTF(I82094AA, "Entry was masked.\n");
         return;
     } else {
-        TriggerIntMessage message;
+        TriggerIntMessage message = 0;
         message.destination = entry.dest;
         if (entry.deliveryMode == DeliveryMode::ExtInt) {
             assert(extIntPic);
index abe7c0b7521c4a02ca304d21b607baefc0c29cf4..72f1832b8e336cb1ef6c0974ff9b89df1f4d584c 100644 (file)
@@ -28,6 +28,7 @@
  * Authors: Ali Saidi
  */
 
+#include <cstdio>
 #include <string>
 
 #include "cpu/thread_context.hh"
index be4086cd90e958898207608f5bf145364a846e5b..121a6e447d8abf3c59d24e579587c1d0882f0c5b 100644 (file)
@@ -36,6 +36,7 @@
 #include <unistd.h>
 #include <zlib.h>
 
+#include <cstdio>
 #include <iostream>
 #include <string>
 
index c48152354cae509e1fb008bb69b6ba511b0a6ecd..88cd2668a0d4a2bbead46fcb069abe253d0dcbd1 100644 (file)
@@ -148,7 +148,7 @@ inline
 physical_address_t Address::bitSelect(int small, int big) const // rips bits inclusive
 {
   physical_address_t mask;
-  assert(big >= small);
+  assert((unsigned)big >= (unsigned)small);
 
   if (big >= ADDRESS_WIDTH - 1) {
     return (m_address >> small);
index bc69c3cc7f73971bf36520065d281d4ddf0c586b..358e13c6fc2f3344a3ddbaf052bd60891be26443 100644 (file)
@@ -30,6 +30,7 @@
 #include <cmath>
 #include <cstdio>
 
+#include "base/types.hh"
 #include "mem/ruby/network/orion/parm_technology.hh"
 #include "mem/ruby/network/orion/power_utils.hh"
 
 static char h_tab[256] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8};
 
 
-static unsigned SIM_power_Hamming_slow( unsigned long int old_val, unsigned long int new_val, unsigned long int mask )
+static uint32_t SIM_power_Hamming_slow( uint64_t old_val, uint64_t new_val, uint64_t mask )
 {
   /* old slow code, I don't understand the new fast code though */
-  /* unsigned long int dist;
-  unsigned Hamming = 0;
+  /* uint64_t dist;
+  uint32_t Hamming = 0;
 
   dist = ( old_val ^ new_val ) & mask;
   mask = (mask >> 1) + 1;
@@ -58,7 +59,7 @@ static unsigned SIM_power_Hamming_slow( unsigned long int old_val, unsigned long
 #define TWO(k) (BIGONE << (k))
 #define CYCL(k) (BIGNONE/(1 + (TWO(TWO(k)))))
 #define BSUM(x,k) ((x)+=(x) >> TWO(k), (x) &= CYCL(k))
-  unsigned long int x;
+  uint64_t x;
 
   x = (old_val ^ new_val) & mask;
   x = (x & CYCL(0)) + ((x>>TWO(0)) & CYCL(0));
@@ -74,7 +75,7 @@ static unsigned SIM_power_Hamming_slow( unsigned long int old_val, unsigned long
 
 int SIM_power_init(void)
 {
-  unsigned i;
+  uint32_t i;
 
   /* initialize Hamming distance table */
   for (i = 0; i < 256; i++)
@@ -84,14 +85,16 @@ int SIM_power_init(void)
 }
 
 
-/* assume unsigned long int is unsigned64_t */
-unsigned SIM_power_Hamming(unsigned long int old_val, unsigned long int new_val, unsigned long int mask)
+
+uint32_t
+SIM_power_Hamming(uint64_t old_val, uint64_t new_val, uint64_t mask)
 {
-  union {
-          unsigned long int x;
-          char id[8];
-        } u;
-  unsigned rval;
+    union {
+        uint64_t x;
+        uint64_t id[8];
+    } u;
+
+    uint32_t rval;
 
   u.x = (old_val ^ new_val) & mask;
 
@@ -108,10 +111,12 @@ unsigned SIM_power_Hamming(unsigned long int old_val, unsigned long int new_val,
 }
 
 
-unsigned SIM_power_Hamming_group(unsigned long int d1_new, unsigned long int d1_old, unsigned long int d2_new, unsigned long int d2_old, unsigned width, unsigned n_grp)
+uint32_t
+SIM_power_Hamming_group(uint64_t d1_new, uint64_t d1_old, uint64_t d2_new,
+                        uint64_t d2_old, uint32_t width, uint32_t n_grp)
 {
-  unsigned rval = 0;
-  unsigned long int g1_new, g1_old, g2_new, g2_old, mask;
+  uint32_t rval = 0;
+  uint64_t g1_new, g1_old, g2_new, g2_old, mask;
 
   mask = HAMM_MASK(width);
 
@@ -146,11 +151,12 @@ double logtwo(double x)
   return log10(x)/log10(2);
 }
 
-unsigned SIM_power_logtwo(unsigned long int x)
+uint32_t
+SIM_power_logtwo(uint64_t x)
 {
-  unsigned rval = 0;
+  uint32_t rval = 0;
 
-  while (x >> rval && rval < sizeof(unsigned long int) << 3) rval++;
+  while (x >> rval && rval < sizeof(uint64_t) << 3) rval++;
   if (x == (BIGONE << rval - 1)) rval--;
 
   return rval;
index 29efdeb6f0deda5135559215a16db18c0efdd5aa..92c38142c0758aaf9b7fe567da7e1fe0c4936bf8 100644 (file)
@@ -471,7 +471,7 @@ class EventWrapper : public Event
 inline void
 EventQueue::schedule(Event *event, Tick when)
 {
-    assert(when >= curTick);
+    assert((UTick)when >= (UTick)curTick);
     assert(!event->scheduled());
 #ifdef EVENTQ_DEBUG
     assert((event->flags & Event::Initialized) == Event::Initialized);
index e71d6441f968a7c8154c790e2fb5b76148f281c6..343d2ad5a659bba77b704cb3a9943319743a6b63 100644 (file)
@@ -32,6 +32,8 @@
 
 #include <unistd.h>
 #include <fcntl.h>
+
+#include <cstdio>
 #include <string>
 
 #include "arch/remote_gdb.hh"
index cc8d99bcdc3da2dcd77197c538686348a65eeea8..7cffffcf1c3b6fcf7649036d5276d15ed6dcae8a 100644 (file)
@@ -32,8 +32,9 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include <string>
+#include <cstdio>
 #include <iostream>
+#include <string>
 
 #include "sim/syscall_emul.hh"
 #include "base/chunk_generator.hh"