Go to the documentation of this file.
40 #include "debug/VIOBlock.hh"
41 #include "params/VirtIOBlock.hh"
47 params->queueSize, *this),
71 size_t off_data,
size_t size)
74 uint64_t sector(req.
sector);
76 DPRINTF(VIOBlock,
"Read request starting @ sector %i (size: %i)\n",
80 panic(
"Unexpected request/sector size relationship\n");
84 warn(
"Failed to read sector %i\n", sector);
97 size_t off_data,
size_t size)
100 uint64_t sector(req.
sector);
102 DPRINTF(VIOBlock,
"Write request starting @ sector %i (size: %i)\n",
106 panic(
"Unexpected request/sector size relationship\n");
113 warn(
"Failed to write sector %i\n", sector);
126 DPRINTF(VIOBlock,
"Got input data descriptor (len: %i)\n",
133 desc->
chainRead(0, (uint8_t *)&req,
sizeof(req));
155 warn(
"Unsupported IO request: %i\n", req.type);
169 VirtIOBlockParams::create()
size_t size() const
Retrieve the size of this descriptor.
VirtIOBlock(Params *params)
Block device configuration structure.
virtual std::streampos write(const uint8_t *data, std::streampos offset)=0
static const Status S_OK
Request succeeded.
void produceDescriptor(VirtDescriptor *desc, uint32_t len)
Send a descriptor chain to the guest.
RequestQueue qRequests
Device I/O request queue.
Status read(const BlkRequest &req, VirtDescriptor *desc_chain, size_t off_data, size_t size)
Device read request.
VirtIO block device request as sent by guest.
ByteOrder byteOrder(const ThreadContext *tc)
static const RequestType T_FLUSH
Flush device buffers.
void registerQueue(VirtQueue &queue)
Register a new VirtQueue with the device model.
Base class for all VirtIO-based devices.
DiskImage & image
Image backing this device.
virtual std::streampos size() const =0
Status write(const BlkRequest &req, VirtDescriptor *desc_chain, size_t off_data, size_t size)
Device write request.
static const RequestType T_IN
Read request.
static const RequestType T_OUT
Write request.
T htog(T value, ByteOrder guest_byte_order)
void readConfigBlob(PacketPtr pkt, Addr cfgOffset, const uint8_t *cfg)
Read configuration data from a device structure.
void readConfig(PacketPtr pkt, Addr cfgOffset)
Read from the configuration space of a device.
ByteOrder byteOrder
Byte order in this queue.
void chainWrite(size_t offset, const uint8_t *src, size_t size)
Write to a descriptor chain.
size_t chainSize() const
Retrieve the size of this descriptor chain.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void chainRead(size_t offset, uint8_t *dst, size_t size) const
Read the contents of a descriptor chain.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
static const Status S_UNSUPP
Request not supported.
void onNotifyDescriptor(VirtDescriptor *desc)
Notify queue of pending incoming descriptor.
virtual std::streampos read(uint8_t *data, std::streampos offset) const =0
static const Status S_IOERR
Request failed due to a device error.
void kick()
Inform the guest of available buffers.
ByteOrder byteOrder
The byte order of the queues, descriptors, etc.
VirtIO descriptor (chain) wrapper.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17