39#include "debug/IdeDisk.hh"
51 image(
p.image), curSector((off_t)-1), dirty(false)
91 case sizeof(uint16_t):
94 DPRINTF(
IdeDisk,
"reading word %#x value= %#x\n", accessAddr, d16);
96 case sizeof(uint32_t):
99 DPRINTF(
IdeDisk,
"reading dword %#x value= %#x\n", accessAddr, d32);
101 case sizeof(uint64_t):
104 DPRINTF(
IdeDisk,
"reading qword %#x value= %#x\n", accessAddr, d64);
107 panic(
"Invalid access size\n");
131 off_t bytes_written =
146 case sizeof(uint8_t):
151 case sizeof(uint16_t):
152 d16 = pkt->
getRaw<uint16_t>();
154 DPRINTF(
IdeDisk,
"writing word %#x value= %#x\n", accessAddr, d16);
156 case sizeof(uint32_t):
157 d32 = pkt->
getRaw<uint32_t>();
159 DPRINTF(
IdeDisk,
"writing dword %#x value= %#x\n", accessAddr, d32);
161 case sizeof(uint64_t):
162 d64 = pkt->
getRaw<uint64_t>();
164 DPRINTF(
IdeDisk,
"writing qword %#x value= %#x\n", accessAddr, d64);
167 panic(
"Invalid access size\n");
Addr pioAddr
Address that the device listens to.
Tick pioDelay
Delay that the device experinces on an access.
Addr pioSize
Size that the device's address range.
void serialize(CheckpointOut &cp) const override
Serialize an object.
virtual std::streampos write(const uint8_t *data, std::streampos offset)=0
virtual std::streampos read(uint8_t *data, std::streampos offset) const =0
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
uint8_t diskData[SectorSize]
void serialize(CheckpointOut &cp) const override
Serialize an object.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void setRaw(T v)
Set the value in the data pointer to v without byte swapping.
T getRaw() const
Get the data in the packet without byte swapping.
void makeAtomicResponse()
#define panic(...)
This implements a cprintf based panic() function.
This device acts as a disk similar to the memory mapped disk device in legion.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.