summaryrefslogtreecommitdiff
path: root/src/dev
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-12-13 11:49:27 -0800
committerNathan Binkert <nate@binkert.org>2011-12-13 11:49:27 -0800
commit6ef9691035623ba6945e237a41f0dca04db637bb (patch)
tree94a81d0d368991f4ed657e1849ed1e10b96eca2b /src/dev
parent9b52717a92ed9592bd98a41683509f538262a5c7 (diff)
downloadgem5-6ef9691035623ba6945e237a41f0dca04db637bb.tar.xz
gcc: fix unused variable warnings from GCC 4.6.1
--HG-- extra : rebase_source : f9e22de341493a25ac6106c16ac35c61c128a080
Diffstat (limited to 'src/dev')
-rw-r--r--src/dev/i8254xGBe.cc7
-rw-r--r--src/dev/ide_ctrl.cc2
-rw-r--r--src/dev/sinic.cc5
-rw-r--r--src/dev/sparc/mm_disk.cc32
-rw-r--r--src/dev/terminal.cc8
5 files changed, 34 insertions, 20 deletions
diff --git a/src/dev/i8254xGBe.cc b/src/dev/i8254xGBe.cc
index d26bbf4ba..957aca19c 100644
--- a/src/dev/i8254xGBe.cc
+++ b/src/dev/i8254xGBe.cc
@@ -2118,11 +2118,12 @@ IGbE::txStateMachine()
// iteration we'll get the rest of the data
if (txPacket && txDescCache.packetAvailable()
&& !txDescCache.packetMultiDesc() && txPacket->length) {
- bool success;
-
anQ("TXS", "TX FIFO Q");
DPRINTF(EthernetSM, "TXS: packet placed in TX FIFO\n");
- success = txFifo.push(txPacket);
+#ifndef NDEBUG
+ bool success =
+#endif
+ txFifo.push(txPacket);
txFifoTick = true && !drainEvent;
assert(success);
txPacket = NULL;
diff --git a/src/dev/ide_ctrl.cc b/src/dev/ide_ctrl.cc
index 291ce1389..5a663bac9 100644
--- a/src/dev/ide_ctrl.cc
+++ b/src/dev/ide_ctrl.cc
@@ -490,6 +490,7 @@ IdeController::dispatchAccess(PacketPtr pkt, bool read)
panic("IDE controller access to invalid address: %#x\n", addr);
}
+#ifndef NDEBUG
uint32_t data;
if (pkt->getSize() == 1)
data = pkt->get<uint8_t>();
@@ -499,6 +500,7 @@ IdeController::dispatchAccess(PacketPtr pkt, bool read)
data = pkt->get<uint32_t>();
DPRINTF(IdeCtrl, "%s from offset: %#x size: %#x data: %#x\n",
read ? "Read" : "Write", pkt->getAddr(), pkt->getSize(), data);
+#endif
pkt->makeAtomicResponse();
}
diff --git a/src/dev/sinic.cc b/src/dev/sinic.cc
index 1c7e1694a..b87dfa704 100644
--- a/src/dev/sinic.cc
+++ b/src/dev/sinic.cc
@@ -33,6 +33,7 @@
#include <string>
#include "arch/vtophys.hh"
+#include "base/compiler.hh"
#include "base/debug.hh"
#include "base/inet.hh"
#include "base/types.hh"
@@ -404,7 +405,7 @@ Device::read(PacketPtr pkt)
prepareRead(cpu, index);
- uint64_t value = 0;
+ uint64_t value M5_VAR_USED = 0;
if (pkt->getSize() == 4) {
uint32_t reg = regData32(raddr);
pkt->set(reg);
@@ -916,6 +917,7 @@ Device::rxKick()
VirtualReg *vn = &virtualRegs[i];
bool busy = Regs::get_RxDone_Busy(vn->RxDone);
if (vn->rxIndex != end) {
+#ifndef NDEBUG
bool dirty = vn->rxPacketOffset > 0;
const char *status;
@@ -933,6 +935,7 @@ Device::rxKick()
i, status, vn->rxUnique,
rxFifo.countPacketsBefore(vn->rxIndex),
vn->rxIndex->slack);
+#endif
} else if (busy) {
DPRINTF(EthernetSM, "vnic %d unmapped (rxunique %d)\n",
i, vn->rxUnique);
diff --git a/src/dev/sparc/mm_disk.cc b/src/dev/sparc/mm_disk.cc
index 1921f6d96..0095d9f1d 100644
--- a/src/dev/sparc/mm_disk.cc
+++ b/src/dev/sparc/mm_disk.cc
@@ -56,7 +56,6 @@ MmDisk::read(PacketPtr pkt)
{
Addr accessAddr;
off_t sector;
- off_t bytes_read;
uint16_t d16;
uint32_t d32;
uint64_t d64;
@@ -68,10 +67,16 @@ MmDisk::read(PacketPtr pkt)
if (sector != curSector) {
if (dirty) {
- bytes_read = image->write(diskData, curSector);
- assert(bytes_read == SectorSize);
+#ifndef NDEBUG
+ off_t bytes_written =
+#endif
+ image->write(diskData, curSector);
+ assert(bytes_written == SectorSize);
}
- bytes_read = image->read(diskData, sector);
+#ifndef NDEBUG
+ off_t bytes_read =
+#endif
+ image->read(diskData, sector);
assert(bytes_read == SectorSize);
curSector = sector;
}
@@ -109,7 +114,6 @@ MmDisk::write(PacketPtr pkt)
{
Addr accessAddr;
off_t sector;
- off_t bytes_read;
uint16_t d16;
uint32_t d32;
uint64_t d64;
@@ -121,10 +125,16 @@ MmDisk::write(PacketPtr pkt)
if (sector != curSector) {
if (dirty) {
- bytes_read = image->write(diskData, curSector);
- assert(bytes_read == SectorSize);
+#ifndef NDEBUG
+ off_t bytes_written =
+#endif
+ image->write(diskData, curSector);
+ assert(bytes_written == SectorSize);
}
- bytes_read = image->read(diskData, sector);
+#ifndef NDEBUG
+ off_t bytes_read =
+#endif
+ image->read(diskData, sector);
assert(bytes_read == SectorSize);
curSector = sector;
}
@@ -164,9 +174,11 @@ MmDisk::serialize(std::ostream &os)
{
// just write any dirty changes to the cow layer it will take care of
// serialization
- int bytes_read;
if (dirty) {
- bytes_read = image->write(diskData, curSector);
+#ifndef NDEBUG
+ int bytes_read =
+#endif
+ image->write(diskData, curSector);
assert(bytes_read == SectorSize);
}
}
diff --git a/src/dev/terminal.cc b/src/dev/terminal.cc
index 74d5ddde7..a11d45554 100644
--- a/src/dev/terminal.cc
+++ b/src/dev/terminal.cc
@@ -259,17 +259,13 @@ Terminal::write(const uint8_t *buf, size_t len)
uint8_t
Terminal::in()
{
- bool empty;
uint8_t c;
- empty = rxbuf.empty();
- assert(!empty);
+ assert(!rxbuf.empty());
rxbuf.read((char *)&c, 1);
- empty = rxbuf.empty();
-
DPRINTF(TerminalVerbose, "in: \'%c\' %#02x more: %d\n",
- isprint(c) ? c : ' ', c, !empty);
+ isprint(c) ? c : ' ', c, !rxbuf.empty());
return c;
}