aboutsummaryrefslogtreecommitdiff
path: root/include/apos/tcb.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-04-16 20:27:46 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2022-04-16 20:27:46 +0300
commit67c9dc06ca0b5aec6430d50af9444bbe85b6deb5 (patch)
treed8f1d9b0b401f61312634b8e2d579249ea4dec34 /include/apos/tcb.h
parente71dd2d9fe1cc3a6d074f9c1894e2c5200cecdb1 (diff)
downloadkmi-67c9dc06ca0b5aec6430d50af9444bbe85b6deb5.tar.gz
kmi-67c9dc06ca0b5aec6430d50af9444bbe85b6deb5.zip
initial thread id handling
+ At least initial in the sense that this seems like the smartest way to handle things, that is.
Diffstat (limited to 'include/apos/tcb.h')
-rw-r--r--include/apos/tcb.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/apos/tcb.h b/include/apos/tcb.h
index b2e38a0..7ed07c5 100644
--- a/include/apos/tcb.h
+++ b/include/apos/tcb.h
@@ -6,24 +6,35 @@
#include <tcb.h> /* arch-specific data */
struct tcb {
- struct sp_node sp_n;
- struct mem_region_root sp_r;
struct arch_tcbd tcbd;
- id_t pid;
+ /* 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;
};
-stat_t threads_insert(struct tcb *t);
+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 */