aboutsummaryrefslogtreecommitdiff
path: root/common/tcb.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-05-21 21:02:17 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2022-05-21 21:02:17 +0300
commit8da0171e5ca3492cdb34422184a1c96acd0b5165 (patch)
treec125b7286f929c8ff7f8a2b938cec84328e99de4 /common/tcb.c
parent836026dbba64793afc0d2591ffdb6fb39b696977 (diff)
downloadkmi-8da0171e5ca3492cdb34422184a1c96acd0b5165.tar.gz
kmi-8da0171e5ca3492cdb34422184a1c96acd0b5165.zip
add status info to memory mappings
+ next up would probably be to start working on process/thread relationships, largely as documented. Still not entirely sure about how I want to handle fork, but I suppose I might figure it out at some point.
Diffstat (limited to 'common/tcb.c')
-rw-r--r--common/tcb.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/tcb.c b/common/tcb.c
index bb1bcec..212e20f 100644
--- a/common/tcb.c
+++ b/common/tcb.c
@@ -4,7 +4,9 @@
#include <apos/pmem.h>
#include <apos/nodes.h>
#include <apos/types.h>
+#include <apos/assert.h>
#include <apos/string.h>
+#include <arch/vmem.h>
/* arguably exessively many globals... */
static id_t start_tid;
@@ -98,3 +100,16 @@ struct tcb *get_tcb(id_t tid)
return tcbs[tid];
}
+
+stat_t clone_tcb_maps(struct tcb *r)
+{
+ hard_assert(r && !r->parent, ERR_INVAL);
+ struct tcb *t = r;
+ while ((t = t->next)) {
+ stat_t ret = clone_vmbranch(r->b_r, t->b_r);
+ if (ret)
+ return ret;
+ }
+
+ return OK;
+}