diff --git a/src/dev/storage/ide_ctrl.cc b/src/dev/storage/ide_ctrl.cc index 47cdd10278..5efa42b186 100644 --- a/src/dev/storage/ide_ctrl.cc +++ b/src/dev/storage/ide_ctrl.cc @@ -120,7 +120,8 @@ IdeController::IdeController(Params *p) panic("IDE controllers support a maximum " "of 4 devices attached!\n"); } - params()->disks[i]->setController(this, sys->getPageBytes()); + // Arbitrarily set the chunk size to 4K. + params()->disks[i]->setController(this, 4 * 1024); } primary.select(false); diff --git a/src/dev/storage/ide_disk.cc b/src/dev/storage/ide_disk.cc index e97e23b8e4..57fa07632d 100644 --- a/src/dev/storage/ide_disk.cc +++ b/src/dev/storage/ide_disk.cc @@ -435,7 +435,7 @@ IdeDisk::doDmaRead() // clear out the data buffer memset(dataBuffer, 0, MAX_DMA_SIZE); dmaReadCG = new ChunkGenerator(curPrd.getBaseAddr(), - curPrd.getByteCount(), pageBytes); + curPrd.getByteCount(), chunkBytes); } if (ctrl->dmaPending() || ctrl->drainState() != DrainState::Running) { @@ -447,7 +447,7 @@ IdeDisk::doDmaRead() &dmaReadWaitEvent, dataBuffer + dmaReadCG->complete()); dmaReadBytes += dmaReadCG->size(); dmaReadTxs++; - if (dmaReadCG->size() == pageBytes) + if (dmaReadCG->size() == chunkBytes) dmaReadFullPages++; dmaReadCG->next(); } else { @@ -518,7 +518,7 @@ IdeDisk::doDmaWrite() if (!dmaWriteCG) { // clear out the data buffer dmaWriteCG = new ChunkGenerator(curPrd.getBaseAddr(), - curPrd.getByteCount(), pageBytes); + curPrd.getByteCount(), chunkBytes); } if (ctrl->dmaPending() || ctrl->drainState() != DrainState::Running) { schedule(dmaWriteWaitEvent, curTick() + DMA_BACKOFF_PERIOD); @@ -532,7 +532,7 @@ IdeDisk::doDmaWrite() curPrd.getByteCount(), curPrd.getEOT()); dmaWriteBytes += dmaWriteCG->size(); dmaWriteTxs++; - if (dmaWriteCG->size() == pageBytes) + if (dmaWriteCG->size() == chunkBytes) dmaWriteFullPages++; dmaWriteCG->next(); } else { diff --git a/src/dev/storage/ide_disk.hh b/src/dev/storage/ide_disk.hh index 9f42941798..90cbf57059 100644 --- a/src/dev/storage/ide_disk.hh +++ b/src/dev/storage/ide_disk.hh @@ -239,8 +239,8 @@ class IdeDisk : public SimObject DmaState_t dmaState; /** Dma transaction is a read */ bool dmaRead; - /** Size of OS pages. */ - Addr pageBytes; + /** Size of chunks to DMA. */ + Addr chunkBytes; /** PRD table base address */ uint32_t curPrdAddr; /** PRD entry */ @@ -283,11 +283,11 @@ class IdeDisk : public SimObject * @param c The IDE controller */ void - setController(IdeController *c, Addr page_bytes) + setController(IdeController *c, Addr chunk_bytes) { panic_if(ctrl, "Cannot change the controller once set!\n"); ctrl = c; - pageBytes = page_bytes; + chunkBytes = chunk_bytes; } // Device register read/write