40 #ifndef __DEV_VIRTIO_FS9P_HH__
41 #define __DEV_VIRTIO_FS9P_HH__
50 struct VirtIO9PBaseParams;
65 template <
typename T>
inline T
69 template <
typename T>
inline T
204 struct VirtIO9PProxyParams;
224 size_t size)
override;
238 virtual ssize_t
read(uint8_t *
data,
size_t len) = 0;
248 virtual ssize_t
write(
const uint8_t *
data,
size_t len) = 0;
285 struct VirtIO9PDiodParams;
335 struct VirtIO9PSocketParams;
383 #endif // __DEV_VIRTIO_FS9P_HH__
void startup()
startup() is the final initialization call before simulation.
ssize_t read(uint8_t *data, size_t len)
Read data from the server behind the proxy.
This class implements a VirtIO transport layer for the 9p network file system.
Base class for all VirtIO-based devices.
ssize_t read(uint8_t *data, size_t len)
Read data from the server behind the proxy.
VirtIO 9p proxy that communicates with a 9p server over tcp sockets.
struct P9MsgHeader M5_ATTR_PACKED
FSQueue(PortProxy &proxy, uint16_t size, VirtIO9PBase &_parent)
void socketDisconnect()
9p server disconnect notification
std::unique_ptr< DiodDataEvent > dataEvent
virtual ssize_t read(uint8_t *data, size_t len)=0
Read data from the server behind the proxy.
VirtIO9PSocketParams Params
void serialize(CheckpointOut &cp) const override
Serialize an object.
const Params * params() const
virtual ~SocketDataEvent()
static const DeviceId ID_9P
VirtIO device ID.
std::map< P9Tag, VirtDescriptor * > pendingTransactions
Map between 9p transaction tags and descriptors where they appeared.
T p9toh(T v)
Convert p9 byte order (LE) to host byte order.
int fd_to_diod
fd for data pipe going to diod (write end)
void readConfig(PacketPtr pkt, Addr cfgOffset)
Read from the configuration space of a device.
void sendRMsg(const P9MsgHeader &header, const uint8_t *data, size_t size)
Send a 9p RPC message reply.
VirtIO9PProxyParams Params
virtual void recvTMsg(const P9MsgHeader &header, const uint8_t *data, size_t size)=0
Handle incoming 9p RPC message.
virtual ssize_t write(const uint8_t *data, size_t len)=0
Write data to the server behind the proxy.
int fd_from_diod
fd for data pipe coming from diod (read end)
void writeAll(const uint8_t *data, size_t len)
Convenience function that writes exactly len bytes.
std::unique_ptr< SocketDataEvent > dataEvent
virtual ~VirtIO9PSocket()
void startup()
startup() is the final initialization call before simulation.
VirtIO9PDiod(Params *params)
void serverDataReady()
Notification of pending data from server.
VirtIO9PSocket(Params *params)
static const FeatureBits F_MOUNT_TAG
Device provides a name of the resource in its configuration.
bool deviceUsed
Bool to track if the device has been used or not.
void onNotifyDescriptor(VirtDescriptor *desc)
Notify queue of pending incoming descriptor.
VirtIO descriptor (chain) wrapper.
ssize_t write(const uint8_t *data, size_t len)
Write data to the server behind the proxy.
void recvTMsg(const P9MsgHeader &header, const uint8_t *data, size_t size) override
Handle incoming 9p RPC message.
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...
VirtIO9PBaseParams Params
void startDiod()
Start diod and setup the communication pipes.
This object is a proxy for a structural port, to be used for debug accesses.
virtual const std::string name() const
uint16_t DeviceId
Device Type (sometimes known as subsystem ID)
VirtIO9PDiodParams Params
void readAll(uint8_t *data, size_t len)
Convenience function that reads exactly len bytes.
T htop9(T v)
Convert host byte order to p9 byte order (LE)
std::ostream CheckpointOut
VirtIO 9p configuration structure.
VirtIO9PBase(Params *params)
int diod_pid
PID of diod process.
SocketDataEvent(VirtIO9PSocket &_parent, int fd, int event)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void connectSocket()
Try to resolve the server name and connect to the 9p server.
Base wrapper around a virtqueue.
void dumpMsg(const P9MsgHeader &header, const uint8_t *data, size_t size)
Dump a 9p RPC message on the debug output.
VirtIO 9p proxy that communicates with the diod 9p server using pipes.
DiodDataEvent(VirtIO9PDiod &_parent, int fd, int event)
Virtqueue for 9p requests.
std::unique_ptr< Config > config
Currently active configuration (host byte order)
VirtIO9PProxy(Params *params)
int fdSocket
Socket connected to the 9p server.
struct VirtIO9PBase::Config M5_ATTR_PACKED
VirtIO 9p proxy base class.
ssize_t write(const uint8_t *data, size_t len)
Write data to the server behind the proxy.