summaryrefslogtreecommitdiff
path: root/dev/ide_disk.cc
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2005-04-14 16:06:34 -0400
committerKevin Lim <ktlim@umich.edu>2005-04-14 16:06:34 -0400
commit26d6d97f5d46bfe2cc5734eb632bec0bc67aed19 (patch)
treeed8a33f234ee4d85bc79f6179ea8907976ee3e70 /dev/ide_disk.cc
parentdcedd7866e35adc1e0fbc081188b259ffc7bbdf5 (diff)
parent5e67b78af7f74d7223ced5b54978ca9fa29606c5 (diff)
downloadgem5-26d6d97f5d46bfe2cc5734eb632bec0bc67aed19.tar.xz
Merge ktlim@zizzer.eecs.umich.edu:/bk/m5
into zamp.eecs.umich.edu:/z/ktlim2/m5 --HG-- extra : convert_revision : 0baadd8d68bfa6f8e96307eb2d4426b0d9e0b8b4
Diffstat (limited to 'dev/ide_disk.cc')
-rw-r--r--dev/ide_disk.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/dev/ide_disk.cc b/dev/ide_disk.cc
index 213fc6a97..90a57bd2f 100644
--- a/dev/ide_disk.cc
+++ b/dev/ide_disk.cc
@@ -55,8 +55,8 @@
using namespace std;
IdeDisk::IdeDisk(const string &name, DiskImage *img, PhysicalMemory *phys,
- int id, int delay)
- : SimObject(name), ctrl(NULL), image(img), physmem(phys),
+ int id, Tick delay)
+ : SimObject(name), ctrl(NULL), image(img), physmem(phys), diskDelay(delay),
dmaTransferEvent(this), dmaReadWaitEvent(this),
dmaWriteWaitEvent(this), dmaPrdReadEvent(this),
dmaReadEvent(this), dmaWriteEvent(this)
@@ -64,9 +64,6 @@ IdeDisk::IdeDisk(const string &name, DiskImage *img, PhysicalMemory *phys,
// Reset the device state
reset(id);
- // calculate disk delay in microseconds
- diskDelay = (delay * ticksPerSecond / 100000);
-
// fill out the drive ID structure
memset(&driveID, 0, sizeof(struct hd_driveid));
@@ -354,8 +351,11 @@ IdeDisk::dmaPrdReadDone()
void
IdeDisk::doDmaRead()
{
+ /** @TODO we need to figure out what the delay actually will be */
Tick totalDiskDelay = diskDelay + (curPrd.getByteCount() / SectorSize);
+ DPRINTF(IdeDisk, "doDmaRead, diskDelay: %d totalDiskDelay: %d\n",
+ diskDelay, totalDiskDelay);
if (dmaInterface) {
if (dmaInterface->busy()) {
// reschedule after waiting period
@@ -455,8 +455,12 @@ IdeDisk::dmaReadDone()
void
IdeDisk::doDmaWrite()
{
+ /** @TODO we need to figure out what the delay actually will be */
Tick totalDiskDelay = diskDelay + (curPrd.getByteCount() / SectorSize);
+ DPRINTF(IdeDisk, "doDmaWrite, diskDelay: %d totalDiskDelay: %d\n",
+ diskDelay, totalDiskDelay);
+
if (dmaInterface) {
if (dmaInterface->busy()) {
// reschedule after waiting period