40 #include "debug/VIOConsole.hh" 41 #include "params/VirtIOConsole.hh" 47 qTrans(params->
system->physProxy,
byteOrder, params->qTransSize, *this),
48 device(*params->device), callbackDataAvail(qRecv)
76 DPRINTF(VIOConsole,
"trySend\n");
82 while (parent.device.dataAvailable() && (d = consumeDescriptor())) {
83 DPRINTF(VIOConsole,
"Got descriptor (len: %i)\n", d->
size());
85 while (parent.device.dataAvailable() && len < d->
size()) {
86 uint8_t in(parent.device.readData());
92 produceDescriptor(d, len);
100 DPRINTF(VIOConsole,
"Got input data descriptor (len: %i)\n",
108 for (
int i = 0;
i < desc->
size(); ++
i)
109 parent.device.writeData(data[
i]);
112 produceDescriptor(desc, 0);
117 VirtIOConsoleParams::create()
Base class for all VirtIO-based devices.
VirtIOConsole(Params *params)
void regInterfaceCallback(Callback *c)
Register a data available callback into the host interface layer.
Console configuration structure.
Config config
Currently active configuration (host byte order)
TermTransQueue qTrans
Transmit queue for port 0.
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.
ByteOrder byteOrder
The byte order of the queues, descriptors, etc.
void readConfig(PacketPtr pkt, Addr cfgOffset)
Read from the configuration space of a device.
T htog(T value, ByteOrder guest_byte_order)
size_t chainSize() const
Retrieve the size of this descriptor chain.
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...
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.
VirtIOConsoleParams Params
void readConfigBlob(PacketPtr pkt, Addr cfgOffset, const uint8_t *cfg)
Read configuration data from a device structure.
ByteOrder byteOrder(const ThreadContext *tc)