MOS Source Code
|
#include "mos/tasks/process.h"
#include "mos/filesystem/sysfs/sysfs.h"
#include "mos/filesystem/sysfs/sysfs_autoinit.h"
#include "mos/io/io.h"
#include "mos/mm/mm.h"
#include "mos/tasks/signal.h"
#include <abi-bits/wait.h>
#include <errno.h>
#include <limits.h>
#include <mos/filesystem/dentry.h>
#include <mos/filesystem/fs_types.h>
#include <mos/filesystem/vfs.h>
#include <mos/lib/structures/hashmap.h>
#include <mos/lib/structures/hashmap_common.h>
#include <mos/lib/structures/list.h>
#include <mos/lib/sync/spinlock.h>
#include <mos/misc/panic.h>
#include <mos/mm/cow.h>
#include <mos/mm/paging/paging.h>
#include <mos/platform/platform.h>
#include <mos/syslog/printk.h>
#include <mos/tasks/schedule.h>
#include <mos/tasks/task_types.h>
#include <mos/tasks/thread.h>
#include <mos/tasks/wait.h>
#include <mos_stdio.h>
#include <mos_stdlib.h>
#include <mos_string.h>
Go to the source code of this file.
Macros | |
#define | do_print(fmt, name, item) |
#define | stat_line(fmt) |
Functions | |
static pid_t | new_process_id (void) |
process_t * | process_allocate (process_t *parent, const char *name) |
void | process_destroy (process_t *process) |
process_t * | process_new (process_t *parent, const char *name, const stdio_t *ios) |
process_t * | process_get (pid_t pid) |
fd_t | process_attach_ref_fd (process_t *process, io_t *file, fd_flags_t flags) |
io_t * | process_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) |
static bool | process_sysfs_process_stat (sysfs_file_t *f) |
static bool | process_sysfs_thread_stat (sysfs_file_t *f) |
static bool | process_sysfs_vmap_stat (sysfs_file_t *f) |
SYSFS_AUTOREGISTER (current, process_sysfs_items) | |
Variables | |
hashmap_t | process_table = { 0 } |
static const char * | vmap_content_str [] |
const char * | vmap_type_str [] |
static sysfs_item_t | process_sysfs_items [] |
Definition at line 394 of file process.c.
Referenced by process_sysfs_process_stat(), and process_sysfs_thread_stat().
#define stat_line | ( | fmt | ) |
Referenced by process_sysfs_vmap_stat().
Definition at line 49 of file process.c.
Referenced by process_allocate().
Definition at line 55 of file process.c.
Referenced by kthread_init(), process_do_fork(), and process_new().
Definition at line 107 of file process.c.
Referenced by process_wait_for_pid().
Definition at line 143 of file process.c.
Referenced by elf_create_process().
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().
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().
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().
Definition at line 200 of file process.c.
Referenced by io_close(), io_dup2(), and process_do_execveat().
Definition at line 215 of file process.c.
Referenced by MOS_STATIC_ASSERT().
Definition at line 281 of file process.c.
Referenced by elf_create_process(), exit(), process_do_execveat(), signal_do_coredump(), and signal_do_terminate().
Definition at line 365 of file process.c.
Referenced by dump_process(), and invalid_page_fault().
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().
|
static |
|
static |
|
static |
SYSFS_AUTOREGISTER | ( | current | , |
process_sysfs_items | ) |
hashmap_t process_table = { 0 } |
Definition at line 34 of file process.c.
Referenced by kthread_init(), process_destroy(), process_do_fork(), process_get(), process_new(), tasks_init(), and tasks_sysfs_process_list().
|
static |
Definition at line 36 of file process.c.
Referenced by process_dump_mmaps(), and process_sysfs_vmap_stat().
const char* vmap_type_str[] |
Definition at line 44 of file process.c.
Referenced by process_do_fork(), process_dump_mmaps(), and process_sysfs_vmap_stat().
|
static |