From e3fba3a2fc865a5b4d6fa622fd383b6d612e8c85 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 16 Sep 2025 20:53:43 -0400 Subject: kern: proc: Add initialization code for ring 3 This commit introduces several new functions for switching the processor into a ring three context along with its task's respective process descriptors to be implemented correctly. - Add md_set_ip() to update proc instruction pointer - Add stack definitions - Add stack mapping logic ... Signed-off-by: Ian Moffett --- src/sys/include/sys/proc.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/sys/include') diff --git a/src/sys/include/sys/proc.h b/src/sys/include/sys/proc.h index deed09b..d09e459 100644 --- a/src/sys/include/sys/proc.h +++ b/src/sys/include/sys/proc.h @@ -34,6 +34,12 @@ #include #include /* standard */ +/* + * The stack starts here and grows down + */ +#define STACK_TOP 0xBFFFFFFF +#define STACK_LEN 4096 + /* * A process describes a running program image * on the system. @@ -69,4 +75,16 @@ int proc_init(struct proc *procp, int flags); */ int md_proc_init(struct proc *procp, int flags); +/* + * Set the instruction pointer field of a specific + * process + * + * @procp: Process to update + * @ip: Instruction pointer to write + * + * Returns zero on success, otherwise a less than + * zero value to indicate failure. + */ +int md_set_ip(struct proc *procp, uintptr_t ip); + #endif /* !_SYS_PROC_H_ */ -- cgit v1.2.3