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
152 :
VirtQueue(proxy, bo, size), parent(_parent) {}
157 std::string
name()
const {
return parent.name() +
".queue"; }
205 struct VirtIO9PProxyParams;
225 size_t size)
override;
228 void serverDataReady();
239 virtual ssize_t read(uint8_t *
data,
size_t len) = 0;
249 virtual ssize_t write(
const uint8_t *
data,
size_t len) = 0;
261 void readAll(uint8_t *
data,
size_t len);
272 void writeAll(
const uint8_t *
data,
size_t len);
286 struct VirtIO9PDiodParams;
307 ssize_t read(uint8_t *
data,
size_t len);
308 ssize_t write(
const uint8_t *
data,
size_t len);
310 void terminateDiod();
317 :
PollEvent(fd, event), parent(_parent) {}
321 void process(
int revent);
338 struct VirtIO9PSocketParams;
357 void connectSocket();
360 void socketDisconnect();
362 ssize_t read(uint8_t *
data,
size_t len);
363 ssize_t write(
const uint8_t *
data,
size_t len);
370 :
PollEvent(fd, event), parent(_parent) {}
374 void process(
int revent);
386 #endif // __DEV_VIRTIO_FS9P_HH__ This class implements a VirtIO transport layer for the 9p network file system.
Base class for all VirtIO-based devices.
VirtIO 9p proxy that communicates with a 9p server over tcp sockets.
struct P9MsgHeader M5_ATTR_PACKED
std::unique_ptr< DiodDataEvent > dataEvent
VirtIO9PSocketParams Params
virtual ~SocketDataEvent()
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)
VirtIO9PProxyParams Params
int fd_from_diod
fd for data pipe coming from diod (read end)
std::unique_ptr< SocketDataEvent > dataEvent
bool deviceUsed
Bool to track if the device has been used or not.
void serialize(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
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...
VirtIO9PBaseParams Params
This object is a proxy for a port or other object which implements the functional response protocol...
uint16_t DeviceId
Device Type (sometimes known as subsystem ID)
VirtIO9PDiodParams Params
T htop9(T v)
Convert host byte order to p9 byte order (LE)
std::ostream CheckpointOut
VirtIO 9p configuration structure.
int diod_pid
PID of diod process.
FSQueue(PortProxy &proxy, ByteOrder bo, uint16_t size, VirtIO9PBase &_parent)
SocketDataEvent(VirtIO9PSocket &_parent, int fd, int event)
void unserialize(ThreadContext &tc, CheckpointIn &cp)
Base wrapper around a virtqueue.
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)
int fdSocket
Socket connected to the 9p server.
VirtIO 9p proxy base class.