aboutsummaryrefslogtreecommitdiff
path: root/include/apos/tcb.h
blob: f987b433907ff14e23066b0090d02ae3f7d80cfd (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
#ifndef APOS_TCB_H
#define APOS_TCB_H

struct tcb;
struct sp_reg_root;

#include <vmem.h>
#include <apos/vmem.h>
#include <apos/types.h>
#include <apos/sp_tree.h>

typedef size_t id_t;

struct sp_reg_root {
	struct sp_root free_regions;
	struct sp_root used_regions;
};

struct tcb {
	struct sp_node sp_n;

	id_t pid;
	id_t tid;

	vm_t stack;
	vm_t heap;
	vm_t bin;

	struct vm_branch_t *b_r;
	struct sp_reg_root sp_r;
};

void threads_insert(struct tcb *t);

#endif /* APOS_TCB_H */