gem5  v20.1.0.0
base.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014, 2016-2017 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef __DEV_VIRTIO_BASE_HH__
39 #define __DEV_VIRTIO_BASE_HH__
40 
41 #include <functional>
42 
43 #include "base/bitunion.hh"
44 #include "dev/virtio/virtio_ring.h"
45 #include "mem/port_proxy.hh"
46 #include "sim/sim_object.hh"
47 
48 struct VirtIODeviceBaseParams;
49 struct VirtIODummyDeviceParams;
50 
51 class VirtQueue;
52 
67 template <> inline vring_used_elem
69  v.id = swap_byte(v.id);
70  v.len = swap_byte(v.len);
71  return v;
72 }
73 
74 template <> inline vring_desc
76  v.addr = swap_byte(v.addr);
77  v.len = swap_byte(v.len);
78  v.flags = swap_byte(v.flags);
79  v.next = swap_byte(v.next);
80  return v;
81 }
82 
107 {
108  public:
110  typedef uint16_t Index;
111 
122  VirtDescriptor(PortProxy &memProxy, ByteOrder bo,
124  // WORKAROUND: The noexcept declaration works around a bug where
125  // gcc 4.7 tries to call the wrong constructor when emplacing
126  // something into a vector.
127  VirtDescriptor(VirtDescriptor &&other) noexcept;
128  ~VirtDescriptor() noexcept;
129 
130  VirtDescriptor &operator=(VirtDescriptor &&rhs) noexcept;
131 
133  Index index() const { return _index; }
134 
136  void update();
137 
139  void updateChain();
148  void dump() const;
153  void dumpChain() const;
174  void read(size_t offset, uint8_t *dst, size_t size) const;
189  void write(size_t offset, const uint8_t *src, size_t size);
202  size_t size() const { return desc.len; }
203 
209  bool hasNext() const { return desc.flags & VRING_DESC_F_NEXT; }
216  VirtDescriptor *next() const;
217 
219  bool isIncoming() const { return !isOutgoing(); }
221  bool isOutgoing() const { return desc.flags & VRING_DESC_F_WRITE; }
222 
223 
236  void chainRead(size_t offset, uint8_t *dst, size_t size) const;
249  void chainWrite(size_t offset, const uint8_t *src, size_t size);
258  size_t chainSize() const;
261  private:
262  // Remove default constructor
263  VirtDescriptor();
264  // Prevent copying
265  VirtDescriptor(const VirtDescriptor &other);
266 
271 
273  ByteOrder byteOrder;
274 
277 
280 };
281 
291 class VirtQueue : public Serializable {
292 public:
293  virtual ~VirtQueue() {};
294 
298  void serialize(CheckpointOut &cp) const override;
299  void unserialize(CheckpointIn &cp) override;
300 
309  void setAddress(Addr address);
315  Addr getAddress() const { return _address; }
316 
322  uint16_t getSize() const { return _size; }
323 
334  return &descriptors[index];
335  }
366  void produceDescriptor(VirtDescriptor *desc, uint32_t len);
384  virtual void onNotify();
395  virtual void onNotifyDescriptor(VirtDescriptor *desc) {};
402  void dump() const;
410  static const Addr ALIGN_BITS = 12;
411  static const Addr ALIGN_SIZE = 1 << ALIGN_BITS;
414  protected:
424  VirtQueue(PortProxy &proxy, ByteOrder bo, uint16_t size);
425 
427  ByteOrder byteOrder;
428 
429  private:
430  VirtQueue();
431 
433  const uint16_t _size;
438 
439  private:
447  template<typename T>
448  class VirtRing
449  {
450  public:
451  typedef uint16_t Flags;
452  typedef uint16_t Index;
453 
454  struct Header {
457  } M5_ATTR_PACKED;
458 
459  VirtRing<T>(PortProxy &proxy, ByteOrder bo, uint16_t size) :
460  header{0, 0}, ring(size), _proxy(proxy), _base(0), byteOrder(bo)
461  {}
462 
469 
471  void
473  {
474  assert(_base != 0);
475  _proxy.readBlob(_base, &header, sizeof(header));
478  }
479 
480  void
482  {
483  Header out;
484  assert(_base != 0);
485  out.flags = htog(header.flags, byteOrder);
486  out.index = htog(header.index, byteOrder);
487  _proxy.writeBlob(_base, &out, sizeof(out));
488  }
489 
490  void
492  {
493  readHeader();
494 
495  /* Read and byte-swap the elements in the ring */
496  T temp[ring.size()];
497  _proxy.readBlob(_base + sizeof(header),
498  temp, sizeof(T) * ring.size());
499  for (int i = 0; i < ring.size(); ++i)
500  ring[i] = gtoh(temp[i], byteOrder);
501  }
502 
503  void
505  {
506  assert(_base != 0);
507  /* Create a byte-swapped copy of the ring and write it to
508  * guest memory. */
509  T temp[ring.size()];
510  for (int i = 0; i < ring.size(); ++i)
511  temp[i] = htog(ring[i], byteOrder);
512  _proxy.writeBlob(_base + sizeof(header),
513  temp, sizeof(T) * ring.size());
514  writeHeader();
515  }
516 
518  Header header;
521 
522  private:
523  // Remove default constructor
524  VirtRing<T>();
525 
531  ByteOrder byteOrder;
532  };
533 
538 
541  uint16_t _last_avail;
542 
546 };
547 
559 {
560  public:
561  typedef uint16_t QueueID;
562  typedef uint32_t FeatureBits;
568  typedef uint16_t VirtAddress;
570  typedef uint16_t DeviceId;
571 
572  BitUnion8(DeviceStatus)
573  Bitfield<7> failed;
574  Bitfield<2> driver_ok;
575  Bitfield<1> driver;
576  Bitfield<0> acknowledge;
577  EndBitUnion(DeviceStatus)
578 
579  typedef VirtIODeviceBaseParams Params;
580  VirtIODeviceBase(Params *params, DeviceId id, size_t config_size,
581  FeatureBits features);
582  virtual ~VirtIODeviceBase();
583 
584  public:
588  void serialize(CheckpointOut &cp) const override;
589  void unserialize(CheckpointIn &cp) override;
593  protected:
608  void
610  {
611  assert(transKick);
612  transKick();
613  };
614 
626  void registerQueue(VirtQueue &queue);
627 
628 
642  public:
660  virtual void readConfig(PacketPtr pkt, Addr cfgOffset);
675  virtual void writeConfig(PacketPtr pkt, Addr cfgOffset);
676 
689  virtual void reset();
692  protected:
704  void readConfigBlob(PacketPtr pkt, Addr cfgOffset, const uint8_t *cfg);
705 
713  void writeConfigBlob(PacketPtr pkt, Addr cfgOffset, uint8_t *cfg);
714 
718  ByteOrder byteOrder;
719 
722  public:
732  void
733  registerKickCallback(const std::function<void()> &callback)
734  {
735  assert(!transKick);
736  transKick = callback;
737  }
738 
739 
749  void onNotify(QueueID index);
750 
751 
761  void setQueueSelect(QueueID idx) { _queueSelect = idx; }
771  QueueID getQueueSelect() const { return _queueSelect; }
772 
787  void setQueueAddress(uint32_t address);
801  uint32_t getQueueAddress() const;
802 
809  uint16_t getQueueSize() const { return getCurrentQueue().getSize(); }
810 
819  void setDeviceStatus(DeviceStatus status);
820 
826  DeviceStatus getDeviceStatus() const { return _deviceStatus; }
827 
834  void setGuestFeatures(FeatureBits features);
835 
842 
845 
847  const size_t configSize;
848 
853  private:
855  const VirtQueue &getCurrentQueue() const;
858 
865  DeviceStatus _deviceStatus;
866 
869 
872 
874  std::function<void()> transKick;
875 };
876 
878 {
879  public:
880  VirtIODummyDevice(VirtIODummyDeviceParams *params);
881 
882  protected:
884  static const DeviceId ID_INVALID = 0x00;
885 };
886 
887 #endif // __DEV_VIRTIO_BASE_HH__
VirtQueue::VirtRing::read
void read()
Definition: base.hh:491
VirtIODeviceBase::onNotify
void onNotify(QueueID index)
Driver is requesting service.
Definition: base.cc:372
VirtDescriptor::size
size_t size() const
Retrieve the size of this descriptor.
Definition: base.hh:202
ArmISA::status
Bitfield< 5, 0 > status
Definition: miscregs_types.hh:417
VirtIODeviceBase::EndBitUnion
EndBitUnion(DeviceStatus) typedef VirtIODeviceBaseParams Params
VirtIODeviceBase::_queueSelect
QueueID _queueSelect
Queue select register (set by guest)
Definition: base.hh:868
VirtDescriptor::memProxy
PortProxy * memProxy
Pointer to memory proxy.
Definition: base.hh:268
VirtDescriptor::VirtDescriptor
VirtDescriptor()
VirtQueue
Base wrapper around a virtqueue.
Definition: base.hh:291
VirtDescriptor::index
Index index() const
Get the descriptor's index into the virtqueue.
Definition: base.hh:133
SimObject::Params
SimObjectParams Params
Definition: sim_object.hh:113
VirtIODeviceBase::_queues
std::vector< VirtQueue * > _queues
List of virtual queues supported by this device.
Definition: base.hh:871
VirtIODeviceBase::driver_ok
Bitfield< 2 > driver_ok
Definition: base.hh:574
VirtQueue::produceDescriptor
void produceDescriptor(VirtDescriptor *desc, uint32_t len)
Send a descriptor chain to the guest.
Definition: base.cc:290
VirtQueue::VirtRing::byteOrder
ByteOrder byteOrder
Byte order in the ring.
Definition: base.hh:531
VirtQueue::onNotify
virtual void onNotify()
Notify queue of pending events.
Definition: base.cc:314
MipsISA::index
Bitfield< 30, 0 > index
Definition: pra_constants.hh:44
VirtIODeviceBase::readConfig
virtual void readConfig(PacketPtr pkt, Addr cfgOffset)
Read from the configuration space of a device.
Definition: base.cc:408
VirtIODeviceBase::guestFeatures
FeatureBits guestFeatures
Feature set accepted by the guest.
Definition: base.hh:639
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
VirtQueue::VirtRing::_proxy
PortProxy & _proxy
Guest physical memory proxy.
Definition: base.hh:527
VirtIODeviceBase::registerQueue
void registerQueue(VirtQueue &queue)
Register a new VirtQueue with the device model.
Definition: base.cc:477
VirtQueue::VirtRing::_base
Addr _base
Guest physical base address of the ring buffer.
Definition: base.hh:529
Flags
Definition: flags.hh:33
VirtIODeviceBase::getCurrentQueue
const VirtQueue & getCurrentQueue() const
Convenience method to get the currently selected queue.
Definition: base.cc:445
VirtIODummyDevice::ID_INVALID
static const DeviceId ID_INVALID
VirtIO device ID.
Definition: base.hh:884
Serializable
Basic support for object serialization.
Definition: serialize.hh:172
VirtQueue::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: base.cc:245
VirtIODeviceBase::getDeviceStatus
DeviceStatus getDeviceStatus() const
Retrieve the device status.
Definition: base.hh:826
VirtQueue::VirtRing::readHeader
void readHeader()
Update the ring buffer header with data from the guest.
Definition: base.hh:472
VirtDescriptor::dumpChain
void dumpChain() const
Dump the contents of a descriptor chain starting at this descriptor.
Definition: base.cc:122
VRING_DESC_F_NEXT
#define VRING_DESC_F_NEXT
Definition: virtio_ring.h:37
VirtQueue::_last_avail
uint16_t _last_avail
Offset of last consumed descriptor in the VirtQueue::avail ring.
Definition: base.hh:541
VirtIODeviceBase
Base class for all VirtIO-based devices.
Definition: base.hh:558
vring_desc::len
uint32_t len
Definition: virtio_ring.h:66
PowerISA::bo
Bitfield< 25, 21 > bo
Definition: types.hh:62
VirtIODeviceBase::getQueueAddress
uint32_t getQueueAddress() const
Get the host physical address of the currently active queue.
Definition: base.cc:469
std::vector
STL vector class.
Definition: stl.hh:37
VirtIODeviceBase::DeviceId
uint16_t DeviceId
Device Type (sometimes known as subsystem ID)
Definition: base.hh:570
VirtDescriptor::update
void update()
Populate this descriptor with data from the guest.
Definition: base.cc:74
VirtIODeviceBase::getGuestFeatures
FeatureBits getGuestFeatures() const
Get features accepted by the guest driver.
Definition: base.hh:841
VirtQueue::VirtQueue
VirtQueue()
VirtIODeviceBase::deviceFeatures
const FeatureBits deviceFeatures
Feature set offered by the device.
Definition: base.hh:850
VirtIODeviceBase::VirtIODeviceBase
VirtIODeviceBase(Params *params, DeviceId id, size_t config_size, FeatureBits features)
Definition: base.cc:325
VirtQueue::used
VirtRing< struct vring_used_elem > used
Ring of used (outgoing) descriptors.
Definition: base.hh:537
VirtIODeviceBase::setQueueAddress
void setQueueAddress(uint32_t address)
Change the host physical address of the currently active queue.
Definition: base.cc:463
VirtQueue::VirtRing::Header::flags
Flags flags
Definition: base.hh:455
VirtQueue::getSize
uint16_t getSize() const
Get the number of descriptors available in this queue.
Definition: base.hh:322
VirtIODeviceBase::getQueueSelect
QueueID getQueueSelect() const
Get the currently active queue.
Definition: base.hh:771
VirtQueue::setAddress
void setAddress(Addr address)
Set the base address of this queue.
Definition: base.cc:258
VirtDescriptor::hasNext
bool hasNext() const
Is this descriptor chained to another descriptor?
Definition: base.hh:209
PortProxy::writeBlob
void writeBlob(Addr addr, const void *p, int size) const
Same as tryWriteBlob, but insists on success.
Definition: port_proxy.hh:187
VirtDescriptor::byteOrder
ByteOrder byteOrder
The byte order the descriptor is stored in.
Definition: base.hh:273
VirtQueue::~VirtQueue
virtual ~VirtQueue()
Definition: base.hh:293
VirtQueue::descriptors
std::vector< VirtDescriptor > descriptors
Vector of pre-created descriptors indexed by their index into the queue.
Definition: base.hh:545
cp
Definition: cprintf.cc:40
VirtIODeviceBase::configSize
const size_t configSize
Size of the device's configuration space.
Definition: base.hh:847
VirtDescriptor::isIncoming
bool isIncoming() const
Check if this is a read-only descriptor (incoming data).
Definition: base.hh:219
VirtQueue::VirtRing::Header
Definition: base.hh:454
VirtQueue::dump
void dump() const
Dump the contents of a queue.
Definition: base.cc:304
sim_object.hh
VirtQueue::VirtRing::Flags
uint16_t Flags
Definition: base.hh:451
VirtQueue::ALIGN_SIZE
static const Addr ALIGN_SIZE
Definition: base.hh:411
VirtQueue::getAddress
Addr getAddress() const
Get the guest physical address of this queue.
Definition: base.hh:315
VirtDescriptor::queue
VirtQueue * queue
Pointer to virtqueue owning this descriptor.
Definition: base.hh:270
VirtDescriptor::dump
void dump() const
Dump the contents of a descriptor.
Definition: base.cc:105
VirtIODeviceBase::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: base.cc:351
VirtQueue::onNotifyDescriptor
virtual void onNotifyDescriptor(VirtDescriptor *desc)
Notify queue of pending incoming descriptor.
Definition: base.hh:395
htog
T htog(T value, ByteOrder guest_byte_order)
Definition: byteswap.hh:155
VirtQueue::getDescriptor
VirtDescriptor * getDescriptor(VirtDescriptor::Index index)
Get a pointer to a specific descriptor in the queue.
Definition: base.hh:333
VirtDescriptor::_index
Index _index
Index in virtqueue.
Definition: base.hh:276
VirtIODeviceBase::readConfigBlob
void readConfigBlob(PacketPtr pkt, Addr cfgOffset, const uint8_t *cfg)
Read configuration data from a device structure.
Definition: base.cc:420
bitunion.hh
port_proxy.hh
VirtQueue::avail
VirtRing< VirtDescriptor::Index > avail
Ring of available (incoming) descriptors.
Definition: base.hh:535
VirtIODeviceBase::VirtAddress
uint16_t VirtAddress
This is a VirtQueue address as exposed through the low-level interface. The address needs to be multi...
Definition: base.hh:568
VirtIODeviceBase::FeatureBits
uint32_t FeatureBits
Definition: base.hh:562
VirtIODeviceBase::QueueID
uint16_t QueueID
Definition: base.hh:561
VirtQueue::byteOrder
ByteOrder byteOrder
Byte order in this queue.
Definition: base.hh:427
swap_byte
vring_used_elem swap_byte(vring_used_elem v)
Definition: base.hh:68
VirtIODummyDevice
Definition: base.hh:877
VirtDescriptor::chainWrite
void chainWrite(size_t offset, const uint8_t *src, size_t size)
Write to a descriptor chain.
Definition: base.cc:191
VirtIODeviceBase::getQueueSize
uint16_t getQueueSize() const
Get the size (descriptors) of the currently active queue.
Definition: base.hh:809
VirtDescriptor::read
void read(size_t offset, uint8_t *dst, size_t size) const
Read the contents of a descriptor.
Definition: base.cc:144
VirtDescriptor::chainSize
size_t chainSize() const
Retrieve the size of this descriptor chain.
Definition: base.cc:214
VirtQueue::VirtRing::ring
std::vector< T > ring
Elements in ring in host byte order.
Definition: base.hh:520
VirtDescriptor::desc
vring_desc desc
Underlying descriptor.
Definition: base.hh:279
VirtQueue::VirtRing::write
void write()
Definition: base.hh:504
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
VirtQueue::VirtRing::Header::index
Index index
Definition: base.hh:456
VirtQueue::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: base.cc:238
VirtQueue::VirtRing::setAddress
void setAddress(Addr addr)
Set the base address of the VirtIO ring buffer.
Definition: base.hh:468
SimObject::params
const Params * params() const
Definition: sim_object.hh:119
VirtIODeviceBase::BitUnion8
BitUnion8(DeviceStatus) Bitfield< 7 > failed
VirtIODeviceBase::setGuestFeatures
void setGuestFeatures(FeatureBits features)
Set feature bits accepted by the guest driver.
Definition: base.cc:384
VirtDescriptor::Index
uint16_t Index
Descriptor index in virtqueue.
Definition: base.hh:110
vring_desc::flags
uint16_t flags
Definition: virtio_ring.h:68
vring_desc
Definition: virtio_ring.h:62
VirtIODeviceBase::setQueueSelect
void setQueueSelect(QueueID idx)
Change currently active queue.
Definition: base.hh:761
VirtIODeviceBase::deviceId
const DeviceId deviceId
Device ID (sometimes known as subsystem ID)
Definition: base.hh:844
VirtIODeviceBase::driver
Bitfield< 1 > driver
Definition: base.hh:575
VirtDescriptor::chainRead
void chainRead(size_t offset, uint8_t *dst, size_t size) const
Read the contents of a descriptor chain.
Definition: base.cc:168
PortProxy
This object is a proxy for a port or other object which implements the functional response protocol,...
Definition: port_proxy.hh:80
VirtDescriptor::updateChain
void updateChain()
Populate this descriptor chain with data from the guest.
Definition: base.cc:93
vring_used_elem
Definition: virtio_ring.h:80
VirtQueue::_size
const uint16_t _size
Queue size in terms of number of descriptors.
Definition: base.hh:433
VirtIODeviceBase::setDeviceStatus
void setDeviceStatus(DeviceStatus status)
Update device status and optionally reset device.
Definition: base.cc:398
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
ArmISA::len
Bitfield< 18, 16 > len
Definition: miscregs_types.hh:439
addr
ip6_addr_t addr
Definition: inet.hh:423
VirtQueue::ALIGN_BITS
static const Addr ALIGN_BITS
Page size used by VirtIO. It's hard-coded to 4096 bytes in the spec for historical reasons.
Definition: base.hh:410
VirtDescriptor::isOutgoing
bool isOutgoing() const
Check if this is a write-only descriptor (outgoing data).
Definition: base.hh:221
VirtQueue::VirtRing::header
Header header
Ring buffer header in host byte order.
Definition: base.hh:518
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:63
VirtIODummyDevice::VirtIODummyDevice
VirtIODummyDevice(VirtIODummyDeviceParams *params)
Definition: base.cc:483
VirtDescriptor::write
void write(size_t offset, const uint8_t *src, size_t size)
Write to the contents of a descriptor.
Definition: base.cc:156
VirtIODeviceBase::acknowledge
Bitfield< 0 > acknowledge
Definition: base.hh:576
VirtQueue::consumeDescriptor
VirtDescriptor * consumeDescriptor()
Get an incoming descriptor chain from the queue.
Definition: base.cc:271
gtoh
T gtoh(T value, ByteOrder guest_byte_order)
Definition: byteswap.hh:162
VRING_DESC_F_WRITE
#define VRING_DESC_F_WRITE
Definition: virtio_ring.h:39
VirtIODeviceBase::transKick
std::function< void()> transKick
Callbacks to kick the guest through the transport layer
Definition: base.hh:874
VirtQueue::VirtRing
VirtIO ring buffer wrapper.
Definition: base.hh:448
VirtIODeviceBase::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: base.cc:341
VirtIODeviceBase::~VirtIODeviceBase
virtual ~VirtIODeviceBase()
Definition: base.cc:336
virtio_ring.h
VirtIODeviceBase::_deviceStatus
DeviceStatus _deviceStatus
Status of the device.
Definition: base.hh:865
VirtQueue::_address
Addr _address
Base address of the queue.
Definition: base.hh:435
VirtQueue::VirtRing::M5_ATTR_PACKED
struct VirtQueue::VirtRing::Header M5_ATTR_PACKED
CheckpointIn
Definition: serialize.hh:67
PortProxy::readBlob
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
Definition: port_proxy.hh:177
VirtQueue::VirtRing::writeHeader
void writeHeader()
Definition: base.hh:481
VirtIODeviceBase::kick
void kick()
Inform the guest of available buffers.
Definition: base.hh:609
VirtDescriptor::~VirtDescriptor
~VirtDescriptor() noexcept
Definition: base.cc:57
VirtQueue::memProxy
PortProxy & memProxy
Guest physical memory proxy.
Definition: base.hh:437
ArmISA::v
Bitfield< 28 > v
Definition: miscregs_types.hh:51
VirtIODeviceBase::byteOrder
ByteOrder byteOrder
The byte order of the queues, descriptors, etc.
Definition: base.hh:718
VirtIODeviceBase::registerKickCallback
void registerKickCallback(const std::function< void()> &callback)
Register a callback to kick the guest through the transport interface.
Definition: base.hh:733
VirtDescriptor::next
VirtDescriptor * next() const
Get the pointer to the next descriptor in a chain.
Definition: base.cc:134
VirtQueue::VirtRing::Index
uint16_t Index
Definition: base.hh:452
VirtIODeviceBase::writeConfigBlob
void writeConfigBlob(PacketPtr pkt, Addr cfgOffset, uint8_t *cfg)
Write configuration data to a device structure.
Definition: base.cc:432
VirtDescriptor
VirtIO descriptor (chain) wrapper.
Definition: base.hh:106
ArmISA::offset
Bitfield< 23, 0 > offset
Definition: types.hh:153
VirtIODeviceBase::writeConfig
virtual void writeConfig(PacketPtr pkt, Addr cfgOffset)
Write to the configuration space of a device.
Definition: base.cc:414
VirtIODeviceBase::reset
virtual void reset()
Driver-request device reset.
Definition: base.cc:361
SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:92

Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17