blob: 7ed07c5bdd16f7f4395c4b4395c63cc0bd8cdc64 (
plain) (
blame)
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
31
32
33
34
35
36
37
38
39
40
|
#ifndef APOS_TCB_H
#define APOS_TCB_H
#include <apos/mem_regions.h>
#include <apos/types.h>
#include <tcb.h> /* arch-specific data */
struct tcb {
struct arch_tcbd tcbd;
/* mapping data
* TODO: should mem_region_root be renamed mem_root or something? feels
* kind of clunky */
struct mem_region_root sp_r;
id_t tid;
vm_t callback;
vm_t proc_stack;
vm_t call_stack;
/* entry point */
vm_t entry;
/* vm root branch */
struct vm_branch *b_r;
};
void init_tcbs();
void destroy_tcbs();
struct tcb *new_thread();
void destroy_thread(struct tcb *);
struct tcb *cur_tcb();
void use_tcb(struct tcb *);
struct tcb *get_tcb(id_t tid);
#endif /* APOS_TCB_H */
|