summaryrefslogtreecommitdiff
path: root/sys/inc/os/process.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/inc/os/process.h')
-rw-r--r--sys/inc/os/process.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/inc/os/process.h b/sys/inc/os/process.h
index 753779a..24db3e1 100644
--- a/sys/inc/os/process.h
+++ b/sys/inc/os/process.h
@@ -31,21 +31,38 @@
#define _OS_PROCESS_H_ 1
#include <sys/types.h>
+#include <sys/param.h>
#include <sys/queue.h>
#include <md/pcb.h> /* shared */
+/* Flags for proc_init() */
+#define PROC_KERN BIT(0) /* Kernel thread */
+
/*
* Represents a running process on the
* system
*
* @pid: Process ID
+ * @affinity: Processor affinity
* @pcb: Process control block
* @link: Queue link
*/
struct process {
pid_t pid;
+ id_t affinity;
struct pcb pcb;
TAILQ_ENTRY(process) link;
};
+/*
+ * Initialize a process to a known state
+ *
+ * @process: Process to initialize
+ * @ip: Instruction pointer to jump to
+ * @flags: Optional flags
+ *
+ * Returns zero on success
+ */
+int process_init(struct process *process, uintptr_t ip, int flags);
+
#endif /* !_OS_PROCESS_H_ */