MOS Source Code
Loading...
Searching...
No Matches
process.h File Reference
#include "mos/io/io.h"
#include <mos/tasks/task_types.h>
+ Include dependency graph for process.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  stdio_t
 A wrapper type for the standard I/O streams. More...
 

Macros

#define PROCESS_MAGIC_PROC   MOS_FOURCC('P', 'R', 'O', 'C')
 

Typedefs

typedef struct _hashmap hashmap_t
 

Functions

should_inline bool process_is_valid (const process_t *process)
 
should_inline stdio_t current_stdio (void)
 
process_tprocess_allocate (process_t *parent, const char *name)
 
void process_destroy (process_t *process)
 
process_tprocess_new (process_t *parent, const char *name, const stdio_t *ios)
 
process_tprocess_get (pid_t pid)
 
fd_t process_attach_ref_fd (process_t *process, io_t *file, fd_flags_t flags)
 
io_tprocess_get_fd (process_t *process, fd_t fd)
 
bool process_detach_fd (process_t *process, fd_t fd)
 
pid_t process_wait_for_pid (pid_t pid, u32 *exit_code, u32 flags)
 
void process_exit (process_t *process, u8 exit_code, signal_t signal)
 
void process_dump_mmaps (const process_t *process)
 
bool process_register_signal_handler (process_t *process, signal_t sig, const sigaction_t *sigaction)
 
process_tprocess_do_fork (process_t *process)
 
long process_do_execveat (process_t *process, fd_t dirfd, const char *path, const char *const argv[], const char *const envp[], int flags)
 

Variables

hashmap_t process_table
 

Macro Definition Documentation

◆ PROCESS_MAGIC_PROC

#define PROCESS_MAGIC_PROC   MOS_FOURCC('P', 'R', 'O', 'C')

Definition at line 9 of file process.h.

Referenced by process_allocate(), and process_is_valid().

Typedef Documentation

◆ hashmap_t

typedef struct _hashmap hashmap_t

Definition at line 11 of file process.h.

Function Documentation

◆ process_is_valid()

◆ current_stdio()

should_inline stdio_t current_stdio ( void )

Definition at line 28 of file process.h.

Referenced by MOS_STATIC_ASSERT().

◆ process_allocate()

process_t * process_allocate ( process_t * parent,
const char * name )

Definition at line 55 of file process.c.

Referenced by kthread_init(), process_do_fork(), and process_new().

+ Here is the call graph for this function:

◆ process_destroy()

void process_destroy ( process_t * process)

Definition at line 107 of file process.c.

Referenced by process_wait_for_pid().

+ Here is the call graph for this function:

◆ process_new()

process_t * process_new ( process_t * parent,
const char * name,
const stdio_t * ios )

Definition at line 143 of file process.c.

Referenced by elf_create_process().

+ Here is the call graph for this function:

◆ process_get()

process_t * process_get ( pid_t pid)

Definition at line 162 of file process.c.

Referenced by mmstat_sysfs_pagetable_show(), mmstat_sysfs_vmaps_show(), MOS_STATIC_ASSERT(), and process_wait_for_pid().

+ Here is the call graph for this function:

◆ process_attach_ref_fd()

fd_t process_attach_ref_fd ( process_t * process,
io_t * file,
fd_flags_t flags )

Definition at line 171 of file process.c.

Referenced by fd_manipulate(), io_dup(), ipc_accept(), ipc_connect(), ipc_create(), memfd_create(), MOS_STATIC_ASSERT(), MOS_STATIC_ASSERT(), process_new(), and vfs_ipc_file_read().

+ Here is the call graph for this function:

◆ process_get_fd()

io_t * process_get_fd ( process_t * process,
fd_t fd )

Definition at line 192 of file process.c.

Referenced by dentry_from_fd(), io_dup(), io_pread(), io_read(), io_readv(), io_seek(), io_tell(), io_write(), ipc_accept(), mmap_file(), MOS_STATIC_ASSERT(), MOS_STATIC_ASSERT(), and vfs_fstatat().

+ Here is the call graph for this function:

◆ process_detach_fd()

bool process_detach_fd ( process_t * process,
fd_t fd )

Definition at line 200 of file process.c.

Referenced by io_close(), io_dup2(), and process_do_execveat().

+ Here is the call graph for this function:

◆ process_wait_for_pid()

pid_t process_wait_for_pid ( pid_t pid,
u32 * exit_code,
u32 flags )

Definition at line 215 of file process.c.

Referenced by MOS_STATIC_ASSERT().

+ Here is the call graph for this function:

◆ process_exit()

void process_exit ( process_t * process,
u8 exit_code,
signal_t signal )

Definition at line 281 of file process.c.

Referenced by elf_create_process(), exit(), process_do_execveat(), signal_do_coredump(), and signal_do_terminate().

+ Here is the call graph for this function:

◆ process_dump_mmaps()

void process_dump_mmaps ( const process_t * process)

Definition at line 365 of file process.c.

Referenced by dump_process(), and invalid_page_fault().

◆ process_register_signal_handler()

bool process_register_signal_handler ( process_t * process,
signal_t sig,
const sigaction_t * sigaction )

Definition at line 380 of file process.c.

Referenced by MOS_STATIC_ASSERT().

◆ process_do_fork()

process_t * process_do_fork ( process_t * process)

Definition at line 26 of file fork.c.

Referenced by fork().

+ Here is the call graph for this function:

◆ process_do_execveat()

long process_do_execveat ( process_t * process,
fd_t dirfd,
const char * path,
const char *const argv[],
const char *const envp[],
int flags )

Definition at line 18 of file execve.c.

Referenced by execveat().

+ Here is the call graph for this function:

Variable Documentation

◆ process_table