Go to the documentation of this file.
38 #ifndef __DEV_VIRTIO_FS9P_HH__
39 #define __DEV_VIRTIO_FS9P_HH__
48 struct VirtIO9PBaseParams;
63 template <
typename T>
inline T
67 template <
typename T>
inline T
203 struct VirtIO9PProxyParams;
223 size_t size)
override;
237 virtual ssize_t
read(uint8_t *
data,
size_t len) = 0;
247 virtual ssize_t
write(
const uint8_t *
data,
size_t len) = 0;
284 struct VirtIO9PDiodParams;
336 struct VirtIO9PSocketParams;
384 #endif // __DEV_VIRTIO_FS9P_HH__
virtual ssize_t write(const uint8_t *data, size_t len)=0
Write data to the server behind the proxy.
void dumpMsg(const P9MsgHeader &header, const uint8_t *data, size_t size)
Dump a 9p RPC message on the debug output.
bool deviceUsed
Bool to track if the device has been used or not.
VirtIO9PDiodParams Params
Base wrapper around a virtqueue.
std::unique_ptr< SocketDataEvent > dataEvent
VirtIO9PBase(Params *params)
void recvTMsg(const P9MsgHeader &header, const uint8_t *data, size_t size) override
Handle incoming 9p RPC message.
void readConfig(PacketPtr pkt, Addr cfgOffset)
Read from the configuration space of a device.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
ssize_t read(uint8_t *data, size_t len)
Read data from the server behind the proxy.
void serverDataReady()
Notification of pending data from server.
VirtIO9PSocketParams Params
Base class for all VirtIO-based devices.
void readAll(uint8_t *data, size_t len)
Convenience function that reads exactly len bytes.
int fd_to_diod
fd for data pipe going to diod (write end)
VirtIO9PDiod(Params *params)
uint16_t DeviceId
Device Type (sometimes known as subsystem ID)
VirtIO 9p proxy that communicates with the diod 9p server using pipes.
int fd_from_diod
fd for data pipe coming from diod (read end)
std::map< P9Tag, VirtDescriptor * > pendingTransactions
Map between 9p transaction tags and descriptors where they appeared.
VirtIO9PSocket(Params *params)
T htop9(T v)
Convert host byte order to p9 byte order (LE)
virtual ~VirtIO9PSocket()
void terminateDiod()
Kill the diod child process at the end of the simulation.
SocketDataEvent(VirtIO9PSocket &_parent, int fd, int event)
VirtIO9PProxy(Params *params)
std::unique_ptr< DiodDataEvent > dataEvent
virtual ssize_t read(uint8_t *data, size_t len)=0
Read data from the server behind the proxy.
void startDiod()
Start diod and setup the communication pipes.
ssize_t write(const uint8_t *data, size_t len)
Write data to the server behind the proxy.
void startup()
startup() is the final initialization call before simulation.
void writeAll(const uint8_t *data, size_t len)
Convenience function that writes exactly len bytes.
int fdSocket
Socket connected to the 9p server.
struct VirtIO9PBase::Config M5_ATTR_PACKED
VirtIO9PBaseParams Params
This class implements a VirtIO transport layer for the 9p network file system.
void sendRMsg(const P9MsgHeader &header, const uint8_t *data, size_t size)
Send a 9p RPC message reply.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const Params * params() const
T p9toh(T v)
Convert p9 byte order (LE) to host byte order.
virtual ~SocketDataEvent()
FSQueue(PortProxy &proxy, ByteOrder bo, uint16_t size, VirtIO9PBase &_parent)
void onNotifyDescriptor(VirtDescriptor *desc)
Notify queue of pending incoming descriptor.
Virtqueue for 9p requests.
VirtIO 9p proxy base class.
virtual const std::string name() const
void socketDisconnect()
9p server disconnect notification
This object is a proxy for a port or other object which implements the functional response protocol,...
DiodDataEvent(VirtIO9PDiod &_parent, int fd, int event)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
struct P9MsgHeader M5_ATTR_PACKED
int diod_pid
PID of diod process.
VirtIO 9p proxy that communicates with a 9p server over tcp sockets.
virtual void recvTMsg(const P9MsgHeader &header, const uint8_t *data, size_t size)=0
Handle incoming 9p RPC message.
std::ostream CheckpointOut
void serialize(CheckpointOut &cp) const override
Serialize an object.
ssize_t write(const uint8_t *data, size_t len)
Write data to the server behind the proxy.
void startup()
startup() is the final initialization call before simulation.
VirtIO 9p configuration structure.
void connectSocket()
Try to resolve the server name and connect to the 9p server.
static const FeatureBits F_MOUNT_TAG
Device provides a name of the resource in its configuration.
ssize_t read(uint8_t *data, size_t len)
Read data from the server behind the proxy.
std::unique_ptr< Config > config
Currently active configuration (host byte order)
VirtIO descriptor (chain) wrapper.
VirtIO9PProxyParams Params
static const DeviceId ID_9P
VirtIO device ID.
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17