40#include "debug/VIOConsole.hh"
41#include "params/VirtIOConsole.hh"
51 device(*params.device)
79 DPRINTF(VIOConsole,
"trySend\n");
86 DPRINTF(VIOConsole,
"Got descriptor (len: %i)\n",
d->size());
90 d->chainWrite(
len, &in,
sizeof(uint8_t));
103 DPRINTF(VIOConsole,
"Got input data descriptor (len: %i)\n",
111 for (
int i = 0;
i < desc->
size(); ++
i)
112 parent.device.writeData(
data[
i]);
115 produceDescriptor(desc, 0);
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
virtual uint8_t readData()=0
Read a character from the device.
void regInterfaceCallback(const std::function< void()> &callback)
Register a data available callback into the host interface layer.
virtual bool dataAvailable() const =0
Check if there is pending data from the serial device.
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)
void readConfig(PacketPtr pkt, Addr cfgOffset)
Read from the configuration space of a device.
TermTransQueue qTrans
Transmit queue for port 0.
Base class for all VirtIO-based devices.
void kick()
Inform the guest of available buffers.
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.
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.
ByteOrder byteOrder(const ThreadContext *tc)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria 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.