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 bool process_is_valid (const Process *process)
 
should_inline stdio_t current_stdio (void)
 
void process_destroy (Process *process)
 
Processprocess_new (Process *parent, 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_t *file, fd_flags_t flags)
 
io_tprocess_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 51 of file process.cpp.

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

◆ process_is_valid()

◆ current_stdio()

should_inline stdio_t current_stdio ( void )

Definition at line 33 of file process.hpp.

Referenced by MOS_STATIC_ASSERT().

◆ process_destroy()

void process_destroy ( Process * process)

Definition at line 106 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 * parent,
mos::string_view name,
const stdio_t * ios )

Definition at line 137 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 161 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_t * file,
fd_flags_t flags )

Definition at line 172 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_t * process_get_fd ( Process * process,
fd_t fd )

Definition at line 193 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 201 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 216 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 284 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 368 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 383 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 18 of file execve.cpp.

Referenced by execveat().

+ Here is the call graph for this function:

Variable Documentation

◆ ProcessTable