42 #include "debug/VIOConsole.hh"
43 #include "params/VirtIOConsole.hh"
48 qRecv(params->
system->physProxy, params->qRecvSize, *this),
49 qTrans(params->
system->physProxy, params->qTransSize, *this),
50 term(*params->terminal), callbackDataAvail(qRecv)
78 DPRINTF(VIOConsole,
"trySend\n");
85 DPRINTF(VIOConsole,
"Got descriptor (len: %i)\n", d->
size());
102 DPRINTF(VIOConsole,
"Got input data descriptor (len: %i)\n",
110 for (
int i = 0;
i < desc->
size(); ++
i)
111 parent.term.out(data[
i]);
114 produceDescriptor(desc, 0);
119 VirtIOConsoleParams::create()
Base class for all VirtIO-based devices.
VirtIOConsole(Params *params)
void regDataAvailCallback(Callback *c)
Register a data available callback into the transport layer.
Console configuration structure.
Config config
Currently active configuration (host byte order)
TermTransQueue qTrans
Transmit queue for port 0.
VirtDescriptor * consumeDescriptor()
Get an incoming descriptor chain from the queue.
void produceDescriptor(VirtDescriptor *desc, uint32_t len)
Send a descriptor chain to the guest.
T htov_legacy(T v)
Convert host endianness to legacy VirtIO endianness.
void readConfig(PacketPtr pkt, Addr cfgOffset)
Read from the configuration space of a device.
void chainRead(size_t offset, uint8_t *dst, size_t size) const
Read the contents of a descriptor chain.
void kick()
Inform the guest of available buffers.
void onNotifyDescriptor(VirtDescriptor *desc)
Notify queue of pending incoming descriptor.
void chainWrite(size_t offset, const uint8_t *src, size_t size)
Write to a descriptor chain.
VirtIO descriptor (chain) wrapper.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
size_t size() const
Retrieve the size of this descriptor.
void registerQueue(VirtQueue &queue)
Register a new VirtQueue with the device model.
TermRecvQueue qRecv
Receive queue for port 0.
MakeCallback< VirtIOConsole::TermRecvQueue,&VirtIOConsole::TermRecvQueue::trySend > callbackDataAvail
void trySend()
Try to send data pending data from the terminal.
size_t chainSize() const
Retrieve the size of this descriptor chain.
VirtIOConsoleParams Params
void readConfigBlob(PacketPtr pkt, Addr cfgOffset, const uint8_t *cfg)
Read configuration data from a device structure.