diff options
author | Ian Moffett <ian@osmora.org> | 2025-09-16 20:53:43 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-09-16 20:53:43 -0400 |
commit | e3fba3a2fc865a5b4d6fa622fd383b6d612e8c85 (patch) | |
tree | 36a0309a727b315a912e771d71a3a06b40a3e395 /src/sys/include | |
parent | 3ed526d5ae90130bcc8e12c53d970c503eab9004 (diff) |
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 <ian@osmora.org>
Diffstat (limited to 'src/sys/include')
-rw-r--r-- | src/sys/include/sys/proc.h | 18 |
1 files changed, 18 insertions, 0 deletions
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 @@ -35,6 +35,12 @@ #include <machine/pcb.h> /* 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_ */ |