Message passing / mail system
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m20s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m20s
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user