summaryrefslogtreecommitdiff
path: root/src/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-16 20:53:43 -0400
committerIan Moffett <ian@osmora.org>2025-09-16 21:39:51 -0400
commit0e3e85d8a8379794cff591da4bc701ba98a35d65 (patch)
tree764015c7295ce7540e9cc2035d81328c79aeba24 /src/sys/include
parent3ed526d5ae90130bcc8e12c53d970c503eab9004 (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.h18
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_ */