diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-05-24 23:28:37 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-05-24 23:28:37 +0300 |
| commit | 018624dd5b1692b88f7b2e85652ea7b898043b6d (patch) | |
| tree | 0aa018640dc6bd5ebca7120df95dca4269be61d6 /include | |
| parent | 4123ec776d3769728e1e12379887da34c12ee8f8 (diff) | |
| download | kmi-018624dd5b1692b88f7b2e85652ea7b898043b6d.tar.gz kmi-018624dd5b1692b88f7b2e85652ea7b898043b6d.zip | |
make process loading more generic
Diffstat (limited to 'include')
| -rw-r--r-- | include/apos/conf.h | 2 | ||||
| -rw-r--r-- | include/apos/mem_regions.h | 1 | ||||
| -rw-r--r-- | include/apos/proc.h | 4 | ||||
| -rw-r--r-- | include/apos/tcb.h | 8 | ||||
| -rw-r--r-- | include/arch/proc.h | 20 | ||||
| -rw-r--r-- | include/arch/vmem.h | 1 |
6 files changed, 27 insertions, 9 deletions
diff --git a/include/apos/conf.h b/include/apos/conf.h index 2b861dc..c2653cd 100644 --- a/include/apos/conf.h +++ b/include/apos/conf.h @@ -9,7 +9,7 @@ #include <apos/types.h> -extern size_t __proc_stack_size; +extern size_t __thread_stack_size; extern size_t __call_stack_size; #endif /* APOS_CONF_H */ diff --git a/include/apos/mem_regions.h b/include/apos/mem_regions.h index c9c4a5c..54e4e2b 100644 --- a/include/apos/mem_regions.h +++ b/include/apos/mem_regions.h @@ -21,7 +21,6 @@ struct mem_region_root { struct sp_root free_regions; struct sp_root used_regions; - struct mem_region *first; }; struct mem_region { diff --git a/include/apos/proc.h b/include/apos/proc.h index 6b4044d..182ae16 100644 --- a/include/apos/proc.h +++ b/include/apos/proc.h @@ -10,7 +10,7 @@ #include <apos/tcb.h> #include <apos/vmem.h> -stat_t jump_to_userspace(struct tcb *t, int argc, char **argv); -stat_t init_proc(void *fdt, struct vmem *b); +stat_t prepare_proc(struct tcb *t, vm_t bin, vm_t interp); +stat_t init_proc(void *fdt); #endif /* APOS_PROC_H */ diff --git a/include/apos/tcb.h b/include/apos/tcb.h index 572041d..2b602f6 100644 --- a/include/apos/tcb.h +++ b/include/apos/tcb.h @@ -32,15 +32,12 @@ struct tcb { vm_t callback; - vm_t proc_stack; - vm_t proc_stack_top; + vm_t thread_stack; + vm_t thread_stack_top; vm_t call_stack; vm_t call_stack_top; - /* entry point */ - vm_t entry; - /* vm root branch */ struct vmem *b_r; @@ -63,5 +60,6 @@ void use_tcb(struct tcb *); struct tcb *get_tcb(id_t tid); stat_t clone_tcb_maps(struct tcb *); +stat_t alloc_stacks(struct tcb *); #endif /* APOS_TCB_H */ diff --git a/include/arch/proc.h b/include/arch/proc.h new file mode 100644 index 0000000..1dcb0af --- /dev/null +++ b/include/arch/proc.h @@ -0,0 +1,20 @@ +#ifndef APOS_ARCH_PROC_H +#define APOS_ARCH_PROC_H + +/** + * @file proc.h + * Arch-specific process related stuff. + */ + +#if defined(riscv64) +#include "../../arch/riscv64/include/proc.h" +#elif defined(riscv32) +#include "../../arch/riscv32/include/proc.h" +#endif + +stat_t set_return(vm_t r); +/*TODO: should this be in arch/tcb.h or something? */ +stat_t prepare_thread(struct tcb *t); +stat_t run_init(struct tcb *t, void *fdt); + +#endif /* APOS_ARCH_PROC_H */ diff --git a/include/arch/vmem.h b/include/arch/vmem.h index 29dab99..b39d905 100644 --- a/include/arch/vmem.h +++ b/include/arch/vmem.h @@ -33,6 +33,7 @@ vm_t setup_kernel_io(struct vmem *b, vm_t paddr); #endif struct vmem *create_vmem(); +stat_t use_vmem(struct vmem *); stat_t destroy_vmem(struct vmem *); stat_t clone_uvmem(struct vmem *, struct vmem *); |
