Go to the documentation of this file.
40 #include "debug/VIOIface.hh"
43 #include "params/MmioVirtIO.hh"
50 hostFeaturesSelect(0), guestFeaturesSelect(0), pageSize(0),
51 interruptStatus(0), vio(*params.vio),
52 interrupt(params.interrupt->get())
67 const unsigned size(pkt->
getSize());
69 DPRINTF(VIOIface,
"Reading %u bytes @ 0x%x:\n", size,
offset);
77 panic_if(size != 4,
"Unexpected read size: %u\n", size);
80 DPRINTF(VIOIface,
" value: 0x%x\n", value);
82 pkt->
setLE<uint32_t>(value);
152 warn(
"Guest is trying to read to write-only register 0x%\n",
165 const unsigned size(pkt->
getSize());
167 DPRINTF(VIOIface,
"Writing %u bytes @ 0x%x:\n", size,
offset);
175 panic_if(size != 4,
"Unexpected write size @ 0x%x: %u\n",
offset, size);
176 DPRINTF(VIOIface,
" value: 0x%x\n", pkt->
getLE<uint32_t>());
193 }
else if (value != 0) {
194 warn(
"Setting unimplemented guest features register %u: %u\n",
206 "Unhandled VirtIO page size: %u", value);
216 warn_once(
"Ignoring queue resize hint. Requested size: %u\n", value);
223 "Unhandled VirtIO alignment size: %u", value);
239 panic_if(value > 0xff,
"Unexpected status: 0x%x\n", value);
251 warn(
"Guest is trying to write to read-only register 0x%\n",
263 DPRINTF(VIOIface,
"kick(): Sending interrupt...\n");
Addr pioAddr
Address that the device listens to.
ArmInterruptPin *const interrupt
MmioVirtIO(const MmioVirtIOParams ¶ms)
virtual void writeConfig(PacketPtr pkt, Addr cfgOffset)
Write to the configuration space of a device.
void setGuestFeatures(FeatureBits features)
Set feature bits accepted by the guest driver.
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.
uint16_t getQueueSize() const
Get the size (descriptors) of the currently active queue.
void setInterrupts(uint32_t value)
void setQueueSelect(QueueID idx)
Change currently active queue.
void registerKickCallback(const std::function< void()> &callback)
Register a callback to kick the guest through the transport interface.
uint32_t guestFeaturesSelect
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void setQueueAddress(uint32_t address)
Change the host physical address of the currently active queue.
const DeviceId deviceId
Device ID (sometimes known as subsystem ID)
uint64_t Tick
Tick count type.
virtual void clear()=0
Clear a signalled interrupt.
const FeatureBits deviceFeatures
Feature set offered by the device.
void onNotify(QueueID index)
Driver is requesting service.
@ OFF_GUEST_FEATURES_SELECT
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
@ OFF_HOST_FEATURES_SELECT
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
DeviceStatus getDeviceStatus() const
Retrieve the device status.
static const Addr ALIGN_SIZE
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
QueueID getQueueSelect() const
Get the currently active queue.
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
FeatureBits getGuestFeatures() const
Get features accepted by the guest driver.
static const uint32_t MAGIC
virtual void raise()=0
Signal an interrupt.
void setLE(T v)
Set the value in the data pointer to v as little endian.
uint32_t getQueueAddress() const
Get the host physical address of the currently active queue.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
static const uint32_t VENDOR_ID
virtual void readConfig(PacketPtr pkt, Addr cfgOffset)
Read from the configuration space of a device.
static const uint32_t VERSION
#define panic(...)
This implements a cprintf based panic() function.
void setDeviceStatus(DeviceStatus status)
Update device status and optionally reset device.
uint32_t hostFeaturesSelect
Generated on Sun Jul 30 2023 01:56:55 for gem5 by doxygen 1.8.17