Changed the hello_sparc executable back to the cross compiled one
[gem5.git] / dev / etherdump.cc
index 3de417bdc2200d9210aa3788d3f7818172f21b1b..d8a51fc5b88164e423a4f93169f85e9ce8014cb2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002-2004 The Regents of The University of Michigan
+ * Copyright (c) 2002-2005 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
 #include "base/output.hh"
 #include "dev/etherdump.hh"
 #include "sim/builder.hh"
-#include "sim/universe.hh"
+#include "sim/root.hh"
 
 using std::string;
 
@@ -74,9 +74,6 @@ void
 EtherDump::init()
 {
     curtime = time(NULL);
-    s_freq = ticksPerSecond;
-    us_freq = ticksPerSecond / ULL(1000000);
-
     struct pcap_file_header hdr;
     hdr.magic = TCPDUMP_MAGIC;
     hdr.version_major = PCAP_VERSION_MAJOR;
@@ -108,8 +105,8 @@ void
 EtherDump::dumpPacket(PacketPtr &packet)
 {
     pcap_pkthdr pkthdr;
-    pkthdr.seconds = curtime + (curTick / s_freq);
-    pkthdr.microseconds = (curTick / us_freq) % ULL(1000000);
+    pkthdr.seconds = curtime + (curTick / Clock::Int::s);
+    pkthdr.microseconds = (curTick / Clock::Int::us) % ULL(1000000);
     pkthdr.caplen = std::min(packet->length, maxlen);
     pkthdr.len = packet->length;
     stream.write(reinterpret_cast<char *>(&pkthdr), sizeof(pkthdr));
@@ -126,8 +123,8 @@ END_DECLARE_SIM_OBJECT_PARAMS(EtherDump)
 
 BEGIN_INIT_SIM_OBJECT_PARAMS(EtherDump)
 
-    INIT_PARAM_DFLT(file, "file to dump packets to", "etherdump"),
-    INIT_PARAM_DFLT(maxlen, "max portion of packet data to dump", 96)
+    INIT_PARAM(file, "file to dump packets to"),
+    INIT_PARAM(maxlen, "max portion of packet data to dump")
 
 END_INIT_SIM_OBJECT_PARAMS(EtherDump)