|
PatchworkOS
|
#include <kernel/proc/process.h>#include <kernel/cpu/cpu.h>#include <kernel/cpu/smp.h>#include <kernel/fs/file.h>#include <kernel/fs/path.h>#include <kernel/fs/sysfs.h>#include <kernel/fs/vfs.h>#include <kernel/log/log.h>#include <kernel/log/panic.h>#include <kernel/mem/vmm.h>#include <kernel/sched/thread.h>#include <kernel/sched/timer.h>#include <kernel/sched/wait.h>#include <kernel/sync/lock.h>#include <kernel/sync/rwlock.h>#include <assert.h>#include <stdatomic.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <sys/io.h>#include <sys/list.h>#include <sys/math.h>#include <sys/proc.h>Go to the source code of this file.
Variables | |
| static process_t | kernelProcess |
| static bool | kernelProcessInitalized = false |
| static file_ops_t | prioOps |
| static file_ops_t | cwdOps |
| static file_ops_t | cmdlineOps |
| static file_ops_t | noteOps |
| static file_ops_t | waitOps |
| static inode_ops_t | inodeOps |
|
static |
Definition at line 176 of file process.c.
References process_t::argv, argv_get_strings(), buffer, BUFFER_READ, count, ERR, file, NULL, and process_file_get_process().
|
static |
Definition at line 147 of file process.c.
References buffer, BUFFER_READ, count, ERR, file, NULL, PATH_DEFER, PATH_EMPTY, path_to_name(), process_file_get_process(), pathname_t::string, strlen(), vfs_ctx_get_cwd(), and process_t::vfsCtx.
Definition at line 281 of file process.c.
References process_t::cmdlineFile, cmdlineOps, process_t::cwdFile, cwdOps, DEREF, process_t::dir, ERR, inodeOps, namespace_bind(), process_t::noteFile, noteOps, NULL, PATH_CREATE, path_put(), process_t::prioFile, prioOps, REF, mount_t::root, process_t::self, sysfs_dir_new(), sysfs_file_new(), process_t::waitFile, and waitOps.
Referenced by process_new(), and process_procfs_init().
Definition at line 72 of file process.c.
References EACCES, EINVAL, errno, file, dentry_t::inode, kernelProcess, LOG_DEBUG, NULL, and inode_t::private.
Referenced by process_cmdline_read(), process_cwd_read(), process_note_write(), process_prio_read(), process_prio_write(), process_wait_poll(), and process_wait_read().
|
static |
Definition at line 339 of file process.c.
References process_t::argv, argv_deinit(), assert, atomic_load, process_t::children, process_t::childrenLock, DEREF, process_t::dyingWaitQueue, EXIT_SUCCESS, free(), futex_ctx_deinit(), process_t::futexCtx, process_t::id, process_t::isDying, process_threads_t::list, list_is_empty(), list_remove(), LOG_DEBUG, NULL, panic(), process_t::parent, process_kill(), rwlock_write_acquire(), rwlock_write_release(), RWLOCK_WRITE_SCOPE, process_t::siblingEntry, process_t::space, space_deinit(), process_t::threads, and wait_queue_deinit().
Referenced by process_init().
|
static |
Definition at line 371 of file process.c.
References process_t::argv, argv_deinit(), argv_init(), assert, atomic_fetch_add, atomic_init, process_t::children, process_t::childrenLock, process_t::cmdlineFile, process_t::cwdFile, process_t::dir, process_t::dyingWaitQueue, ERR, EXIT_SUCCESS, futex_ctx_init(), process_t::futexCtx, process_t::id, process_t::isDying, kernelProcess, process_threads_t::list, list_entry_init(), list_init(), list_push(), process_threads_t::lock, lock_init(), LOG_DEBUG, namespace_deinit(), namespace_init(), process_threads_t::newTid, process_t::noteFile, NULL, process_t::parent, PATH_EMPTY, path_put(), process_t::prioFile, process_free(), process_is_child(), process_t::ref, REF, ref_init(), rwlock_init(), RWLOCK_WRITE_SCOPE, process_t::self, process_t::siblingEntry, process_t::space, space_deinit(), space_init(), SPACE_MAP_IDENTITY, SPACE_MAP_KERNEL_BINARY, SPACE_MAP_KERNEL_HEAP, process_t::threads, vfs_ctx_get_cwd(), vfs_ctx_init(), process_t::vfsCtx, VMM_USER_SPACE_MAX, VMM_USER_SPACE_MIN, wait_queue_init(), process_t::waitFile, and process_t::zombieEntry.
Referenced by process_get_kernel(), and process_new().
|
static |
Definition at line 271 of file process.c.
References DEREF, and inode_t::private.
|
static |
Definition at line 193 of file process.c.
References buffer, CONTAINER_OF_SAFE, count, EINVAL, ERR, errno, file, process_threads_t::list, list_first(), process_threads_t::lock, LOCK_SCOPE, NULL, process_file_get_process(), thread_send_note(), and process_t::threads.
|
static |
Definition at line 91 of file process.c.
References atomic_load, buffer, BUFFER_READ, count, ERR, file, MAX_NAME, NULL, process_file_get_process(), and snprintf().
|
static |
Definition at line 249 of file process.c.
References atomic_load, process_t::dyingWaitQueue, file, process_t::isDying, NULL, POLLIN, and process_file_get_process().
|
static |
Definition at line 229 of file process.c.
References atomic_load, buffer, BUFFER_READ, count, process_t::dyingWaitQueue, ERR, file, process_t::isDying, MAX_PATH, NULL, process_file_get_process(), snprintf(), and WAIT_BLOCK.
| SYSCALL_DEFINE | ( | SYS_GETPID | , |
| pid_t | |||
| ) |
Definition at line 609 of file process.c.
References process_t::id, and sched_process().
|
static |
Definition at line 189 of file process.c.
Referenced by process_dir_init().
|
static |
Definition at line 172 of file process.c.
Referenced by process_dir_init().
|
static |
Definition at line 277 of file process.c.
Referenced by process_dir_init().
|
static |
Definition at line 28 of file process.c.
Referenced by namespace_bind(), namespace_get_root_path(), namespace_mount(), process_file_get_process(), process_get_kernel(), process_init(), process_procfs_init(), and sysfs_mount_new().
Definition at line 29 of file process.c.
Referenced by process_get_kernel(), and process_procfs_init().
|
static |
Definition at line 225 of file process.c.
Referenced by process_dir_init().
|
static |
Definition at line 142 of file process.c.
Referenced by process_dir_init().
|
static |
Definition at line 266 of file process.c.
Referenced by process_dir_init().