diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-12-27 20:40:44 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-12-27 20:40:44 +0200 |
| commit | a12e50e5a7dae52ed8bd5a24cc6576371e20985b (patch) | |
| tree | 70ddf625029dbe1ca4d38ec4f1819fe5fe7e4291 /common/tcb.c | |
| parent | d98ec57128628b81fcd32269a92742a037b7f713 (diff) | |
| download | kmi-a12e50e5a7dae52ed8bd5a24cc6576371e20985b.tar.gz kmi-a12e50e5a7dae52ed8bd5a24cc6576371e20985b.zip | |
Started work on syscalls
Diffstat (limited to 'common/tcb.c')
| -rw-r--r-- | common/tcb.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/tcb.c b/common/tcb.c index 5b00524..8a1e95e 100644 --- a/common/tcb.c +++ b/common/tcb.c @@ -3,6 +3,7 @@ #include <apos/sp_tree.h> static struct sp_root t_root = (struct sp_root){0}; +static struct tcb *__tcb_cache[MAX_CPUS] = {0}; #define tcb_container(x) \ container_of(x, struct tcb, sp_n) @@ -53,3 +54,18 @@ struct tcb *threads_find(id_t tid) return 0; } + +struct tcb *get_tcb(id_t pid) +{ + /* TODO: figure out how exactly thread IDs are related to process IDs, + * and figure out mapping between them. */ + return 0; +} + +struct tcb *cur_tcb() +{ + /* TODO: probably keep an array of processor ID's somewhere where each + * ID has a corresponding 'currently executing thread ID' field, and + * reutrn that. */ + return __tcb_cache[cpu_id()]; +} |
