Go to the documentation of this file.
45 #ifndef __DEV_STORAGE_IDE_DISK_HH__
46 #define __DEV_STORAGE_IDE_DISK_HH__
54 #include "params/IdeDisk.hh"
59 #define DMA_BACKOFF_PERIOD 200
61 #define MAX_DMA_SIZE 0x20000 // 128K
62 #define MAX_SINGLE_DMA_SIZE 0x10000
63 #define MAX_MULTSECT (128)
65 #define PRD_BASE_MASK 0xfffffffe
66 #define PRD_COUNT_MASK 0xfffe
67 #define PRD_EOT_MASK 0x8000
96 #define DATA_OFFSET (0)
97 #define ERROR_OFFSET (1)
98 #define FEATURES_OFFSET (1)
99 #define NSECTOR_OFFSET (2)
100 #define SECTOR_OFFSET (3)
101 #define LCYL_OFFSET (4)
102 #define HCYL_OFFSET (5)
103 #define SELECT_OFFSET (6)
104 #define DRIVE_OFFSET (6)
105 #define STATUS_OFFSET (7)
106 #define COMMAND_OFFSET (7)
108 #define CONTROL_OFFSET (2)
109 #define ALTSTAT_OFFSET (2)
111 #define SELECT_DEV_BIT 0x10
112 #define CONTROL_RST_BIT 0x04
113 #define CONTROL_IEN_BIT 0x02
114 #define STATUS_BSY_BIT 0x80
115 #define STATUS_DRDY_BIT 0x40
116 #define STATUS_DRQ_BIT 0x08
117 #define STATUS_SEEK_BIT 0x10
118 #define STATUS_DF_BIT 0x20
119 #define DRIVE_LBA_BIT 0x40
288 panic_if(
ctrl,
"Cannot change the controller once set!\n");
300 void startDma(
const uint32_t &prdTableBase);
370 #endif // __DEV_STORAGE_IDE_DISK_HH__
void serialize(CheckpointOut &cp) const override
Serialize an object.
Stats::Scalar dmaReadBytes
uint32_t curPrdAddr
PRD table base address.
uint8_t status
Status register.
Device model for an Intel PIIX4 IDE controller.
EventFunctionWrapper dmaPrdReadEvent
~IdeDisk()
Delete the data buffer.
void updateState(DevAction_t action)
void setController(IdeController *c, Addr page_bytes)
Set the controller for this device.
PrdTableEntry curPrd
PRD entry.
EventFunctionWrapper dmaReadWaitEvent
int diskDelay
The disk delay in microseconds.
void startDma(const uint32_t &prdTableBase)
Addr pageBytes
Size of OS pages.
ChunkGenerator * dmaReadCG
DevState_t devState
Device state.
#define MAX_SINGLE_DMA_SIZE
void writeDisk(uint32_t sector, uint8_t *data)
This is a simple scalar statistic, like a counter.
uint32_t cmdBytes
Number of bytes in command data transfer.
CommandReg_t cmdReg
Command block registers.
DmaState_t dmaState
Dma state.
void readControl(const Addr offset, int size, uint8_t *data)
struct CommandReg CommandReg_t
EventFunctionWrapper dmaWriteEvent
void regStats() override
Register Statistics.
Basic interface for accessing a disk image.
Addr pciToDma(Addr pciAddr)
void writeControl(const Addr offset, int size, const uint8_t *data)
Stats::Scalar dmaReadFullPages
uint32_t curSector
Current sector in access.
Stats::Scalar dmaWriteTxs
struct PrdEntry PrdEntry_t
void reset(int id)
Reset the device state.
bool dmaAborted
DMA Aborted.
EventFunctionWrapper dmaReadEvent
Stats::Scalar dmaWriteFullPages
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool intrPending
Interrupt pending.
struct ataparams driveID
Drive identification structure for this disk.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
IdeController * ctrl
The IDE controller for this disk.
int devID
Device ID (device0=0/device1=1)
DiskImage * image
The image that contains the data of this disk.
void readCommand(const Addr offset, int size, uint8_t *data)
enum DevAction DevAction_t
bool dmaRead
Dma transaction is a read.
std::ostream CheckpointOut
void unserialize(CheckpointIn &cp) override
Unserialize an object.
This class takes an arbitrary memory region (address/length pair) and generates a series of appropria...
bool nIENBit
Interrupt enable bit.
uint32_t cmdBytesLeft
Number of bytes left in command data transfer.
uint8_t * dataBuffer
Data buffer for transfers.
void writeCommand(const Addr offset, int size, const uint8_t *data)
uint32_t drqBytesLeft
Number of bytes left in DRQ block.
Stats::Scalar dmaWriteBytes
EventFunctionWrapper dmaTransferEvent
ChunkGenerator * dmaWriteCG
EventFunctionWrapper dmaWriteWaitEvent
void readDisk(uint32_t sector, uint8_t *data)
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17