From 70b046a032404d0fc7dc27e761b6ee7e693afb5f Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 26 Apr 2024 22:34:38 -0400 Subject: kernel: sched: Move sched stack macros to sched.h Signed-off-by: Ian Moffett --- sys/include/sys/proc.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sys/include') diff --git a/sys/include/sys/proc.h b/sys/include/sys/proc.h index 8c1b959..85dd912 100644 --- a/sys/include/sys/proc.h +++ b/sys/include/sys/proc.h @@ -44,6 +44,23 @@ #define PROC_MAX_FDS 256 #define PROC_MAX_ADDR_RANGE 4 +#define PROC_STACK_PAGES 8 +#define PROC_STACK_SIZE (PROC_STACK_PAGES*vm_get_page_size()) + +/* + * The PHYS_TO_VIRT/VIRT_TO_PHYS macros convert + * addresses to lower and higher half addresses. + * Userspace addresses are on the lower half, + * therefore, we can just wrap over these to + * keep things simple. + * + * XXX: TODO: This won't work when not identity mapping + * lowerhalf addresses. Once that is updated, + * get rid of this. + */ +#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; -- cgit v1.2.3