From aa35a77f3b06a1cae94e840759c9546bf4a0dc51 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Tue, 28 Jul 2020 22:13:50 +0900 Subject: [PATCH] include/corax: Add IPC message definitions for IO process --- include/corax/ipc/io.h | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 include/corax/ipc/io.h diff --git a/include/corax/ipc/io.h b/include/corax/ipc/io.h new file mode 100644 index 0000000..01ad326 --- /dev/null +++ b/include/corax/ipc/io.h @@ -0,0 +1,57 @@ +#ifndef __CORAX_IPC_IO_H +#define __CORAX_IPC_IO_H + +#include +#include + +#define CXIO_RESPONSE 0 +#define CXIO_READ 1 +#define CXIO_WRITE 2 +#define CXIO_OPEN 3 +#define CXIO_CLOSE 4 +#define CXIO_FORK 5 +#define CXIO_PIPE 6 + +struct cxio_fork { + pid_t parent; + pid_t child; +}; + +struct cxio_pipe { + int flags; +}; + +struct cxio_read { + int fd; + size_t n; +}; + +struct cxio_write { + int fd; + size_t datalen; + u8_t data[]; +}; + +struct cxio_open { + int flags; + int mode; + size_t pathlen; + char path[]; +}; + +struct cxio_close { + int fd; + int how; /* for shutdown() */ +}; + +struct cxio_response { + int fd; + int retval; + int error; + size_t extralen; + u8_t extradata[]; +}; + +#define CXIO_EXTRADATA_MAX (CONFIG_IPC_MSGSIZE - sizeof(struct cxio_response)) + +#endif /* __CORAX_IPC_IO_H */ -- 2.47.3