summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-04-26 22:34:38 -0400
committerIan Moffett <ian@osmora.org>2024-04-26 22:34:38 -0400
commit70b046a032404d0fc7dc27e761b6ee7e693afb5f (patch)
treeba256cb57e2f2847036f5d0906c80f4498aa9a13 /sys/include
parent00f779ab42468ce761d65a44f61c3e28212ef4d2 (diff)
kernel: sched: Move sched stack macros to sched.h
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/proc.h17
1 files changed, 17 insertions, 0 deletions
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;