MOS Source Code
Loading...
Searching...
No Matches
process.hpp File Reference
#include "mos/io/io.hpp"
#include <mos/hashmap.hpp>
#include <mos/tasks/task_types.hpp>
#include <optional>
Include dependency graph for process.hpp:
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...

Typedefs

typedef struct _hashmap hashmap_t

Functions

const char * get_vmap_type_str (vmap_type_t type)
should_inline stdio_t current_stdio (void)
void process_destroy (Process *process)
Processprocess_new (Process *parelagsnt, mos::string_view name, const stdio_t *ios)
std::optional< Process * > process_get (pid_t pid)
fd_t process_attach_ref_fd (Process *process, IO *file, FDFlags flags)
IOprocess_get_fd (Process *process, fd_t fd)
bool process_detach_fd (Process *process, fd_t fd)
pid_t process_wait_for_pid (pid_t pid, u32 *exit_code, u32 flags)
void process_exit (Process *&&proc, u8 exit_code, signal_t signal)
void process_dump_mmaps (const Process *process)
bool process_register_signal_handler (Process *process, signal_t sig, const sigaction_t *sigaction)
Processprocess_do_fork (Process *process)
long process_do_execveat (fd_t dirfd, const char *path, const char *const argv[], const char *const envp[], int flags)

Variables

mos::HashMap< pid_t, Process * > ProcessTable

Typedef Documentation

◆ hashmap_t

typedef struct _hashmap hashmap_t

Definition at line 11 of file process.hpp.

Function Documentation

◆ get_vmap_type_str()

const char * get_vmap_type_str ( vmap_type_t type)

Definition at line 52 of file process.cpp.

Referenced by process_do_fork(), process_dump_mmaps(), and process_sysfs_vmap_stat().

◆ current_stdio()

should_inline stdio_t current_stdio ( void )

Definition at line 25 of file process.hpp.

Referenced by MOS_STATIC_ASSERT().

◆ process_destroy()

void process_destroy ( Process * process)

Definition at line 107 of file process.cpp.

Referenced by process_new(), and process_wait_for_pid().

Here is the call graph for this function:

◆ process_new()

Process * process_new ( Process * parelagsnt,
mos::string_view name,
const stdio_t * ios )

Definition at line 141 of file process.cpp.

Referenced by elf_create_process().

Here is the call graph for this function:

◆ process_get()

std::optional< Process * > process_get ( pid_t pid)

Definition at line 166 of file process.cpp.

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 * process,
IO * file,
FDFlags flags )

Definition at line 177 of file process.cpp.

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 * process_get_fd ( Process * process,
fd_t fd )

Definition at line 198 of file process.cpp.

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 * process,
fd_t fd )

Definition at line 206 of file process.cpp.

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 221 of file process.cpp.

Referenced by MOS_STATIC_ASSERT().

Here is the call graph for this function:

◆ process_exit()

void process_exit ( Process *&& proc,
u8 exit_code,
signal_t signal )

Definition at line 289 of file process.cpp.

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 * process)

Definition at line 373 of file process.cpp.

Referenced by dump_process(), and invalid_page_fault().

Here is the call graph for this function:

◆ process_register_signal_handler()

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

Definition at line 388 of file process.cpp.

Referenced by MOS_STATIC_ASSERT().

◆ process_do_fork()

Process * process_do_fork ( Process * process)

Definition at line 24 of file fork.cpp.

Referenced by fork().

Here is the call graph for this function:

◆ process_do_execveat()

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

Definition at line 19 of file execve.cpp.

Referenced by execveat().

Here is the call graph for this function:

Variable Documentation

◆ ProcessTable