MOS Source Code
Loading...
Searching...
No Matches
ipc.cpp File Reference
Include dependency graph for ipc.cpp:

Go to the source code of this file.

Classes

struct  IpcDescriptor
struct  IPCServer

Macros

#define IPC_SERVER_MAGIC   MOS_FOURCC('I', 'P', 'C', 'S')

Functions

void ipc_server_close (IPCServer *server)
size_t ipc_client_read (IpcDescriptor *ipc, void *buf, size_t size)
size_t ipc_client_write (IpcDescriptor *ipc, const void *buf, size_t size)
size_t ipc_server_read (IpcDescriptor *ipc, void *buf, size_t size)
size_t ipc_server_write (IpcDescriptor *ipc, const void *buf, size_t size)
void ipc_client_close_channel (IpcDescriptor *ipc)
void ipc_server_close_channel (IpcDescriptor *ipc)
void ipc_init (void)
static inode_tipc_sysfs_create_ino (IPCServer *ipc_server)
PtrResult< IPCServeripc_server_create (mos::string_view name, size_t max_pending)
PtrResult< IPCServeripc_get_server (mos::string_view name)
PtrResult< IpcDescriptoripc_server_accept (IPCServer *ipc_server)
PtrResult< IpcDescriptoripc_connect_to_server (mos::string_view name, size_t buffer_size)
static bool ipc_sysfs_servers (sysfs_file_t *f)
static void ipc_sysfs_list_ipcs (sysfs_item_t *item, dentry_t *d, vfs_listdir_state_t *state, dentry_iterator_op add_record)
static bool ipc_sysfs_lookup_ipc (inode_t *parent_dir, dentry_t *dentry)
static bool ipc_sysfs_create_server (inode_t *dir, dentry_t *dentry, file_type_t type, file_perm_t perm)
static bool ipc_dump_name_waitlist (uintn key, void *value, void *data)
static bool ipc_sysfs_dump_name_waitlist (sysfs_file_t *f)
 SYSFS_AUTOREGISTER (ipc, ipc_sysfs_items)
dentry_tipc_get_sysfs_dir ()

Variables

static list_head ipc_servers
static hashmap_t name_waitlist
 waitlist for an IPC server, key = name, value = waitlist_t *
static spinlock_t ipc_lock
 protects ipc_servers and name_waitlist
static sysfs_item_t ipc_sysfs_items []

Macro Definition Documentation

◆ IPC_SERVER_MAGIC

#define IPC_SERVER_MAGIC   MOS_FOURCC('I', 'P', 'C', 'S')

Definition at line 26 of file ipc.cpp.

Function Documentation

◆ ipc_server_close()

void ipc_server_close ( IPCServer * server)

Definition at line 87 of file ipc.cpp.

Referenced by ipc_create(), IPC_ControlIO::on_closed(), and vfs_ipc_file_release().

Here is the call graph for this function:

◆ ipc_client_read()

size_t ipc_client_read ( IpcDescriptor * ipc,
void * buf,
size_t size )

Definition at line 143 of file ipc.cpp.

Referenced by IpcClientIO::on_read(), and vfs_ipc_file_read().

Here is the call graph for this function:

◆ ipc_client_write()

size_t ipc_client_write ( IpcDescriptor * ipc,
const void * buf,
size_t size )

Definition at line 148 of file ipc.cpp.

Referenced by IpcClientIO::on_write(), and vfs_ipc_file_write().

Here is the call graph for this function:

◆ ipc_server_read()

size_t ipc_server_read ( IpcDescriptor * ipc,
void * buf,
size_t size )

Definition at line 153 of file ipc.cpp.

Referenced by IpcServerIO::on_read().

Here is the call graph for this function:

◆ ipc_server_write()

size_t ipc_server_write ( IpcDescriptor * ipc,
const void * buf,
size_t size )

Definition at line 158 of file ipc.cpp.

Referenced by IpcServerIO::on_write().

Here is the call graph for this function:

◆ ipc_client_close_channel()

void ipc_client_close_channel ( IpcDescriptor * ipc)

Definition at line 163 of file ipc.cpp.

Referenced by IpcClientIO::on_closed(), and vfs_ipc_file_release().

Here is the call graph for this function:

◆ ipc_server_close_channel()

void ipc_server_close_channel ( IpcDescriptor * ipc)

Definition at line 177 of file ipc.cpp.

Referenced by IpcServerIO::on_closed().

Here is the call graph for this function:

◆ ipc_init()

void ipc_init ( void )

Definition at line 191 of file ipc.cpp.

Referenced by mos_start_kernel().

Here is the call graph for this function:

◆ ipc_sysfs_create_ino()

inode_t * ipc_sysfs_create_ino ( IPCServer * ipc_server)
static

Definition at line 432 of file ipc.cpp.

Referenced by ipc_server_create().

Here is the call graph for this function:

◆ ipc_server_create()

PtrResult< IPCServer > ipc_server_create ( mos::string_view name,
size_t max_pending )

Definition at line 198 of file ipc.cpp.

Referenced by ipc_create(), and ipc_sysfs_create_server().

Here is the call graph for this function:

◆ ipc_get_server()

PtrResult< IPCServer > ipc_get_server ( mos::string_view name)

Definition at line 234 of file ipc.cpp.

Referenced by vfs_open_ipc().

◆ ipc_server_accept()

PtrResult< IpcDescriptor > ipc_server_accept ( IPCServer * ipc_server)

Definition at line 246 of file ipc.cpp.

Referenced by ipc_accept(), and vfs_ipc_file_read().

Here is the call graph for this function:

◆ ipc_connect_to_server()

PtrResult< IpcDescriptor > ipc_connect_to_server ( mos::string_view name,
size_t buffer_size )

Definition at line 315 of file ipc.cpp.

Referenced by ipc_connect(), and vfs_open_ipc().

Here is the call graph for this function:

◆ ipc_sysfs_servers()

bool ipc_sysfs_servers ( sysfs_file_t * f)
static

Definition at line 421 of file ipc.cpp.

Here is the call graph for this function:

◆ ipc_sysfs_list_ipcs()

void ipc_sysfs_list_ipcs ( sysfs_item_t * item,
dentry_t * d,
vfs_listdir_state_t * state,
dentry_iterator_op add_record )
static

Definition at line 440 of file ipc.cpp.

◆ ipc_sysfs_lookup_ipc()

bool ipc_sysfs_lookup_ipc ( inode_t * parent_dir,
dentry_t * dentry )
static

Definition at line 452 of file ipc.cpp.

Here is the call graph for this function:

◆ ipc_sysfs_create_server()

bool ipc_sysfs_create_server ( inode_t * dir,
dentry_t * dentry,
file_type_t type,
file_perm_t perm )
static

Definition at line 474 of file ipc.cpp.

Here is the call graph for this function:

◆ ipc_dump_name_waitlist()

bool ipc_dump_name_waitlist ( uintn key,
void * value,
void * data )
static

Definition at line 490 of file ipc.cpp.

Referenced by ipc_sysfs_dump_name_waitlist().

Here is the call graph for this function:

◆ ipc_sysfs_dump_name_waitlist()

bool ipc_sysfs_dump_name_waitlist ( sysfs_file_t * f)
static

Definition at line 506 of file ipc.cpp.

Here is the call graph for this function:

◆ SYSFS_AUTOREGISTER()

SYSFS_AUTOREGISTER ( ipc ,
ipc_sysfs_items  )

◆ ipc_get_sysfs_dir()

dentry_t * ipc_get_sysfs_dir ( )

Definition at line 522 of file ipc.cpp.

Referenced by ipc_server_close().

Variable Documentation

◆ ipc_servers

◆ name_waitlist

hashmap_t name_waitlist
static

waitlist for an IPC server, key = name, value = waitlist_t *

Definition at line 84 of file ipc.cpp.

Referenced by ipc_connect_to_server(), ipc_init(), ipc_server_close(), ipc_server_create(), and ipc_sysfs_dump_name_waitlist().

◆ ipc_lock

spinlock_t ipc_lock
static

protects ipc_servers and name_waitlist

Definition at line 85 of file ipc.cpp.

Referenced by ipc_connect_to_server(), ipc_get_server(), ipc_server_close(), ipc_server_create(), and ipc_sysfs_dump_name_waitlist().

◆ ipc_sysfs_items

sysfs_item_t ipc_sysfs_items[]
static
Initial value:
= {
}
static bool ipc_sysfs_create_server(inode_t *dir, dentry_t *dentry, file_type_t type, file_perm_t perm)
Definition ipc.cpp:474
static bool ipc_sysfs_dump_name_waitlist(sysfs_file_t *f)
Definition ipc.cpp:506
static void ipc_sysfs_list_ipcs(sysfs_item_t *item, dentry_t *d, vfs_listdir_state_t *state, dentry_iterator_op add_record)
Definition ipc.cpp:440
static bool ipc_sysfs_servers(sysfs_file_t *f)
Definition ipc.cpp:421
static bool ipc_sysfs_lookup_ipc(inode_t *parent_dir, dentry_t *dentry)
Definition ipc.cpp:452
#define SYSFS_RO_ITEM(_name, _show_fn)
Definition sysfs.hpp:42
#define SYSFS_DYN_DIR(_name, _iterate_fn, _lookup_fn, _create_fn)
Definition sysfs.hpp:47

Definition at line 514 of file ipc.cpp.

Referenced by SYSFS_AUTOREGISTER().