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);
// 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) {
&dmaReadWaitEvent, dataBuffer + dmaReadCG->complete());
dmaReadBytes += dmaReadCG->size();
dmaReadTxs++;
- if (dmaReadCG->size() == pageBytes)
+ if (dmaReadCG->size() == chunkBytes)
dmaReadFullPages++;
dmaReadCG->next();
} else {
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);
curPrd.getByteCount(), curPrd.getEOT());
dmaWriteBytes += dmaWriteCG->size();
dmaWriteTxs++;
- if (dmaWriteCG->size() == pageBytes)
+ if (dmaWriteCG->size() == chunkBytes)
dmaWriteFullPages++;
dmaWriteCG->next();
} else {
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 */
* @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