summaryrefslogtreecommitdiffstats
path: root/proc/scheduler.h
blob: 9b11688a655cdb89ee1c61055aba3be459e78102 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef _JOVE_PROC_SCHEDULER_H
#define _JOVE_PROC_SCHEDULER_H 1

#include "process.h"

void scheduler_init(jove_owned_obj_t *pcb_obj, void *process_main);

void scheduler_savestate(void);
void scheduler_restorestate(void);

void scheduler_switch(void *this_sp, void *other_sp, void *other_cr3);
void _scheduler_switch_pcb_arch(pcb_t *target);

int scheduler_make_ready(jove_owned_obj_t *pcb_obj);
int scheduler_yield(pid_t target);
int scheduler_stop(jove_owned_obj_t *pcb_obj, int stop_code);

void scheduler_tick(void);

void scheduler_block_for_mail(struct pcb_header *pcb, size_t timeout, pid_t yield_target);

#endif