diff options
Diffstat (limited to 'src/sys/include')
-rw-r--r-- | src/sys/include/os/sched.h | 8 | ||||
-rw-r--r-- | src/sys/include/sys/proc.h | 14 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/sys/include/os/sched.h b/src/sys/include/os/sched.h index b393395..1850366 100644 --- a/src/sys/include/os/sched.h +++ b/src/sys/include/os/sched.h @@ -35,6 +35,7 @@ #include <sys/proc.h> #include <os/spinlock.h> +#define SCHED_QUANTUM 10000 #define SCHED_NQUEUES 4 /* @@ -50,6 +51,13 @@ struct sched_queue { }; /* + * Context switch to another process + * + * @tf: Current CPU context frame + */ +void md_sched_switch(struct trapframe *tf); + +/* * Enqueue a new process to a queue * * @q: Queue to target diff --git a/src/sys/include/sys/proc.h b/src/sys/include/sys/proc.h index d09e459..59d47ec 100644 --- a/src/sys/include/sys/proc.h +++ b/src/sys/include/sys/proc.h @@ -31,6 +31,7 @@ #define _SYS_PROC_H_ #include <sys/types.h> +#include <sys/cdefs.h> #include <sys/queue.h> #include <machine/pcb.h> /* standard */ @@ -87,4 +88,17 @@ int md_proc_init(struct proc *procp, int flags); */ int md_set_ip(struct proc *procp, uintptr_t ip); +/* + * Put the current process into a halt loop + * until the next one runs. + */ +__dead void md_proc_yield(void); + +/* + * Kick a process into a user context + * + * @procp: Process pointer + */ +__dead void md_proc_kick(struct proc *procp); + #endif /* !_SYS_PROC_H_ */ |