From 4d82697cc521c42cfd51bf8d617802c698ce5e31 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 16 May 2024 00:13:02 -0400 Subject: kernel: sched: Move loader code away from sched Signed-off-by: Ian Moffett --- sys/include/sys/loader.h | 7 +++++++ sys/include/sys/proc.h | 6 ------ sys/include/sys/sched.h | 1 - 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sys/include') diff --git a/sys/include/sys/loader.h b/sys/include/sys/loader.h index 9b38a55..43ad36e 100644 --- a/sys/include/sys/loader.h +++ b/sys/include/sys/loader.h @@ -60,8 +60,15 @@ struct auxval { uint64_t at_phnum; }; +struct exec_args { + char **argp, **envp; + struct auxval auxv; + struct vas vas; +}; + #if defined(_KERNEL) +uintptr_t loader_init_stack(void *stack_top, struct exec_args args); int loader_unload(struct vas vas, struct vm_range *exec_range); int loader_load(struct vas vas, const void *dataptr, struct auxval *auxv, size_t load_base, char **ld_path, struct vm_range *prog_range); diff --git a/sys/include/sys/proc.h b/sys/include/sys/proc.h index 85dd912..ec7d25e 100644 --- a/sys/include/sys/proc.h +++ b/sys/include/sys/proc.h @@ -61,12 +61,6 @@ #define USER_TO_KERN(user) PHYS_TO_VIRT(user) #define KERN_TO_USER(kern) VIRT_TO_PHYS(kern) -struct exec_args { - char **argp, **envp; - struct auxval auxv; - struct vas vas; -}; - enum { ADDR_RANGE_EXEC = 0, /* Program address range */ ADDR_RANGE_STACK /* Stack address range */ diff --git a/sys/include/sys/sched.h b/sys/include/sys/sched.h index 01a58fe..8245120 100644 --- a/sys/include/sys/sched.h +++ b/sys/include/sys/sched.h @@ -43,7 +43,6 @@ void sched_init(void); void sched_exit(void); void sched_context_switch(struct trapframe *tf); void sched_rest(void); -uintptr_t sched_init_stack(void *stack_top, struct exec_args args); __noreturn uint64_t sys_exit(struct syscall_args *args); -- cgit v1.2.3