MOS Source Code
Loading...
Searching...
No Matches
ipc.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
5#include <mos/types.h>
6
7#ifdef __MOS_KERNEL__
8typedef struct _io io_t;
9typedef io_t *ipcfd_t;
10#else
11typedef fd_t ipcfd_t;
12#endif
13
18typedef struct
19{
20 size_t size;
21 char data[];
22} ipc_msg_t;
23
31
38
46
57size_t ipc_read_as_msg(ipcfd_t fd, char *buffer, size_t buffer_size);
58bool ipc_write_as_msg(ipcfd_t fd, const char *data, size_t size);
ipc_msg_t * ipc_read_msg(ipcfd_t fd)
Read an IPC message.
Definition libipc.c:38
bool ipc_write_as_msg(ipcfd_t fd, const char *data, size_t size)
Definition libipc.c:86
bool ipc_write_msg(ipcfd_t fd, ipc_msg_t *buffer)
Write an IPC message.
Definition libipc.c:67
ipc_msg_t * ipc_msg_create(size_t size)
Create a new IPC message.
Definition libipc.c:26
size_t ipc_read_as_msg(ipcfd_t fd, char *buffer, size_t buffer_size)
Definition libipc.c:105
fd_t ipcfd_t
Definition ipc.h:11
void ipc_msg_destroy(ipc_msg_t *buffer)
Destroy an IPC message.
Definition libipc.c:33
size_t size
Definition slab.c:30
Definition io.h:46
An IPC message.
Definition ipc.h:19
size_t size
Definition ipc.h:20
static char buffer[2048]
Definition test_printf.c:7
s32 fd_t
Definition types.h:81