Organize resources into process groups
This commit is contained in:
38
kernel/proc/procgroup.h
Normal file
38
kernel/proc/procgroup.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef _KERNEL_PROC_PROCGROUP_H
|
||||
#define _KERNEL_PROC_PROCGROUP_H
|
||||
|
||||
#include <libk/list.h>
|
||||
#include <libk/rbtree.h>
|
||||
#include <libk/std.h>
|
||||
#include <proc/resource.h>
|
||||
#include <sync/spin_lock.h>
|
||||
#include <sys/mm.h>
|
||||
|
||||
struct proc;
|
||||
|
||||
struct proc_mapping {
|
||||
struct list_node_link proc_mappings_link;
|
||||
|
||||
uintptr_t paddr;
|
||||
uintptr_t vaddr;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
struct procgroup {
|
||||
int pgid;
|
||||
struct rb_node_link procgroup_tree_link;
|
||||
struct rb_node_link* memb_proc_tree;
|
||||
spin_lock_t lock;
|
||||
atomic_int refs;
|
||||
struct rb_node_link* resource_tree;
|
||||
atomic_int sys_rids;
|
||||
struct pd pd;
|
||||
struct list_node_link* mappings; /* protected by pd.lock */
|
||||
};
|
||||
|
||||
struct procgroup* procgroup_create (void);
|
||||
void procgroup_attach (struct procgroup* procgroup, struct proc* proc);
|
||||
void procgroup_detach (struct procgroup* procgroup, struct proc* proc);
|
||||
int procgroup_get_sys_rid (struct procgroup* procgroup);
|
||||
|
||||
#endif // _KERNEL_PROC_PROCGROUP_H
|
||||
Reference in New Issue
Block a user