Message passing / mail system
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m20s

This commit is contained in:
2026-02-18 17:18:03 +01:00
parent 35454a087e
commit ae0a6024da
19 changed files with 340 additions and 66 deletions

View File

@@ -14,6 +14,16 @@ static struct rb_node_link* procgroup_tree = NULL;
static spin_lock_t procgroup_tree_lock = SPIN_LOCK_INIT;
static atomic_int pgids = 0;
struct procgroup* procgroup_find (int pgid) {
struct procgroup* procgroup = NULL;
spin_lock (&procgroup_tree_lock);
rbtree_find (struct procgroup, &procgroup_tree, pgid, procgroup, procgroup_tree_link, pgid);
spin_unlock (&procgroup_tree_lock);
return procgroup;
}
uintptr_t procgroup_map (struct procgroup* procgroup, uintptr_t vaddr, size_t pages, uint32_t flags,
uintptr_t* out_paddr) {
spin_lock (&procgroup->lock);
@@ -141,6 +151,11 @@ struct procgroup* procgroup_create (void) {
procgroup->pd.cr3_paddr = mm_alloc_user_pd_phys ();
procgroup->map_base = PROC_MAP_BASE;
if (proc_create_resource_mail (procgroup, 1) == NULL) {
free (procgroup);
return NULL;
}
spin_lock (&procgroup_tree_lock);
rbtree_insert (struct procgroup, &procgroup_tree, &procgroup->procgroup_tree_link,
procgroup_tree_link, pgid);