forked from domspad/yehos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.h
More file actions
30 lines (20 loc) · 646 Bytes
/
task.h
File metadata and controls
30 lines (20 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef YEHOS_TASK_H
#define YEHOS_TASK_H
#include <asmhelpers.h>
#include <stdint.h>
typedef uint32_t reg_t;
typedef struct context_t {
reg_t ss, esp, cr3;
int ready;
} context_t;
extern int current_task;
int is_ready_task(int t);
void switch_executing_task(int newlyExecutingTask);
void switch_visible_task(int newlyVisibleTask);
void save_context(int tasknum, void *func);
extern void asm_swap_context(context_t *fromctx, context_t *toctx);
extern void asm_save_context(context_t *fromctx, void *eip);
void yield(void);
void dup_context(context_t *stale_ctx, context_t *new_ctx);
void test_clone_page_directory(void);
#endif