40#include "debug/VIOConsole.hh"
41#include "params/VirtIOConsole.hh"
59 device.regInterfaceCallback([
this]() {
qRecv.trySend(); });
79 DPRINTF(VIOConsole,
"trySend\n");
86 DPRINTF(VIOConsole,
"Got descriptor (len: %i)\n",
d->size());
89 uint8_t in(
parent.device.readData());
90 d->chainWrite(
len, &in,
sizeof(uint8_t));
103 DPRINTF(VIOConsole,
"Got input data descriptor (len: %i)\n",
109 auto data = std::make_unique<uint8_t[]>(size);
111 for (
int i = 0;
i < desc->
size(); ++
i)
VirtIO descriptor (chain) wrapper.
size_t size() const
Retrieve the size of this descriptor.
void chainRead(size_t offset, uint8_t *dst, size_t size) const
Read the contents of a descriptor chain.
size_t chainSize() const
Retrieve the size of this descriptor chain.
void trySend()
Try to send data pending data from the terminal.
void onNotifyDescriptor(VirtDescriptor *desc)
Notify queue of pending incoming descriptor.
VirtIOConsole(const Params ¶ms)
VirtIOConsoleParams Params
TermRecvQueue qRecv
Receive queue for port 0.
Config config
Currently active configuration (host byte order)
static const FeatureBits F_SIZE
Provides the size information.
void readConfig(PacketPtr pkt, Addr cfgOffset)
Read from the configuration space of a device.
static const DeviceId ID_CONSOLE
VirtIO device ID.
TermTransQueue qTrans
Transmit queue for port 0.
ByteOrder byteOrder
The byte order of the queues, descriptors, etc.
void readConfigBlob(PacketPtr pkt, Addr cfgOffset, const uint8_t *cfg)
Read configuration data from a device structure.
VirtIODeviceBase(const Params ¶ms, DeviceId id, size_t config_size, FeatureBits features)
void registerQueue(VirtQueue &queue)
Register a new VirtQueue with the device model.
void produceDescriptor(VirtDescriptor *desc, uint32_t len)
Send a descriptor chain to the guest.
VirtDescriptor * consumeDescriptor()
Get an incoming descriptor chain from the queue.
const Params & params() const
Copyright (c) 2024 Arm Limited All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
T htog(T value, ByteOrder guest_byte_order)
Console configuration structure.