14#define USER_ARG_MAX (128u * 1024u)
uintptr_t addr_space_t
an address space handle.
Definition arch.h:105
uintptr_t usermode_get_brk(void)
get the current program break (end of the user heap).
Definition brk.c:5
void usermode_set_brk(uintptr_t brk)
set the program break.
Definition brk.c:15
kerr_t
unified kernel error codes.
Definition error.h:14
void usermode_kill(int signal)
end the current process (every thread) as killed by a signal: the wait status names the signal (SIGSE...
Definition exec.c:600
kerr_t exec_replace(struct registers *regs, const char *path, const char **argv, const char **envp)
replace the current process's program (execve).
Definition exec.c:362
void usermode_exit(int exit_code)
called by SYS_exit: end the current thread, and never run again.
Definition exec.c:590
int exec_program(const char *path, const char **argv)
start a program as a new process.
Definition exec.c:105
void usermode_end_thread(void)
end the current thread because its process is ending (exit_group or a fatal signal in another thread)...
Definition exec.c:605
void usermode_exit_group(int exit_code)
called by SYS_exit_group (and so by exit()): end every thread of the current process,...
Definition exec.c:595
sighandler_t signal(int sig, sighandler_t handler)
set a handler (with SA_RESTART, as BSD signal() does).
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:19
struct process process_t
process control block.
ELF32 file header.
Definition elf.h:51
process control block.
Definition process.h:69
saved register state pushed onto the stack by ISR stubs.
Definition isr.h:41
void setup_child_stack(process_t *child, uintptr_t entry)
set up a child process's kernel stack so that when arch_context_switch switches to it,...
Definition trampoline.c:42
void usermode_reset_frame(struct registers *regs, uintptr_t entry, uintptr_t user_esp)
make a syscall frame return into a fresh program: clear the general registers and set the user entry ...
Definition usermode_arch.c:124
uintptr_t usermode_build_stack(addr_space_t as, const char **argv, const char **envp)
back the first pages of the user stack in an address space and put a new program's arguments on it,...
Definition usermode_arch.c:57
void jump_to_usermode(uintptr_t entry, addr_space_t as, const char **argv, const char **envp) __attribute__((noreturn))
start a new process's program: build its user stack (usermode_build_stack), point the TSS at the curr...
Definition usermode_arch.c:106