summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-17 23:48:03 -0400
committerIan Moffett <ian@osmora.org>2024-03-17 23:48:03 -0400
commitc489b2e5f072d73d0cf17d555c6483da55718235 (patch)
tree88b686a625ef59a0a517cfe67beef38d96a0fc69 /sys/include
parent3be9e31b6fd78b4a63b13f8a1562be78050774a0 (diff)
kernel: loader: Keep track of program addr range
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/loader.h3
-rw-r--r--sys/include/sys/proc.h8
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/include/sys/loader.h b/sys/include/sys/loader.h
index 74a325c..b1f06c1 100644
--- a/sys/include/sys/loader.h
+++ b/sys/include/sys/loader.h
@@ -32,6 +32,7 @@
#include <sys/types.h>
#include <vm/pmap.h>
+#include <vm/vm.h>
/* DANGER!: DO NOT CHANGE THESE DEFINES */
#define AT_NULL 0
@@ -61,7 +62,7 @@ struct auxval {
#if defined(_KERNEL)
int loader_load(struct vas vas, const void *dataptr, struct auxval *auxv,
- size_t load_base, char **ld_path);
+ size_t load_base, char **ld_path, struct vm_range *prog_range);
#endif /* defined(_KERNEL) */
#endif /* !_SYS_LOADER_H_ */
diff --git a/sys/include/sys/proc.h b/sys/include/sys/proc.h
index c6046d7..75a5c1b 100644
--- a/sys/include/sys/proc.h
+++ b/sys/include/sys/proc.h
@@ -39,6 +39,12 @@
#include <vm/vm.h>
#define PROC_MAX_FDS 256
+#define PROC_MAX_ADDR_RANGE 4
+
+enum {
+ ADDR_RANGE_EXEC = 0, /* Program address range */
+ ADDR_RANGE_STACK /* Stack address range */
+};
/*
* A task running on the CPU e.g., a process or
@@ -50,7 +56,7 @@ struct proc {
struct trapframe *tf;
struct pcb pcb;
struct vas addrsp;
- uintptr_t stack_base;
+ struct vm_range addr_range[PROC_MAX_ADDR_RANGE];
uint8_t is_user;
struct filedesc *fds[PROC_MAX_FDS];
TAILQ_ENTRY(proc) link;