41 #include "debug/IdeDisk.hh"
50 image(p->image), curSector((off_t)-1), dirty(false)
90 case sizeof(uint16_t):
91 memcpy(&d16,
diskData + (accessAddr % SectorSize), 2);
93 DPRINTF(
IdeDisk,
"reading word %#x value= %#x\n", accessAddr, d16);
95 case sizeof(uint32_t):
96 memcpy(&d32,
diskData + (accessAddr % SectorSize), 4);
98 DPRINTF(
IdeDisk,
"reading dword %#x value= %#x\n", accessAddr, d32);
100 case sizeof(uint64_t):
101 memcpy(&d64,
diskData + (accessAddr % SectorSize), 8);
103 DPRINTF(
IdeDisk,
"reading qword %#x value= %#x\n", accessAddr, d64);
106 panic(
"Invalid access size\n");
130 off_t bytes_written =
145 case sizeof(uint8_t):
150 case sizeof(uint16_t):
152 memcpy(
diskData + (accessAddr % SectorSize), &d16, 2);
153 DPRINTF(
IdeDisk,
"writing word %#x value= %#x\n", accessAddr, d16);
155 case sizeof(uint32_t):
157 memcpy(
diskData + (accessAddr % SectorSize), &d32, 4);
158 DPRINTF(
IdeDisk,
"writing dword %#x value= %#x\n", accessAddr, d32);
160 case sizeof(uint64_t):
162 memcpy(
diskData + (accessAddr % SectorSize), &d64, 8);
163 DPRINTF(
IdeDisk,
"writing qword %#x value= %#x\n", accessAddr, d64);
166 panic(
"Invalid access size\n");
188 MmDiskParams::create()
void set(T v, ByteOrder endian)
Set the value in the data pointer to v using the specified endianness.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void serialize(CheckpointOut &cp) const override
Serialize an object.
This device acts as a disk similar to the memory mapped disk device in legion.
T get(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness.
Addr pioSize
Size that the device's address range.
void makeAtomicResponse()
uint64_t Tick
Tick count type.
virtual std::streampos write(const uint8_t *data, std::streampos offset)=0
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
uint8_t diskData[SectorSize]
std::ostream CheckpointOut
virtual std::streampos read(uint8_t *data, std::streampos offset) const =0
Tick pioDelay
Delay that the device experinces on an access.
Addr pioAddr
Address that the device listens to.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.