Organize resources into process groups
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <libk/list.h>
|
||||
#include <libk/rbtree.h>
|
||||
#include <libk/std.h>
|
||||
#include <proc/procgroup.h>
|
||||
#include <proc/resource.h>
|
||||
#include <proc/suspension_q.h>
|
||||
#include <sync/rw_spin_lock.h>
|
||||
@@ -23,25 +24,11 @@
|
||||
#define PROC_SUSPENDED 2
|
||||
#define PROC_PSEUDO 3
|
||||
|
||||
/* process flags */
|
||||
#define PROC_USTK_PREALLOC (1 << 0)
|
||||
|
||||
struct cpu;
|
||||
|
||||
struct proc_mapping {
|
||||
struct list_node_link proc_mappings_link;
|
||||
|
||||
uintptr_t paddr;
|
||||
uintptr_t vaddr;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
struct proc_resources {
|
||||
atomic_int refs;
|
||||
atomic_int sys_rids;
|
||||
struct rb_node_link* tree;
|
||||
rw_spin_lock_t lock;
|
||||
};
|
||||
|
||||
struct proc_sq_entry {
|
||||
struct list_node_link sq_link;
|
||||
struct list_node_link proc_link;
|
||||
@@ -52,18 +39,16 @@ struct proc_sq_entry {
|
||||
struct proc {
|
||||
int pid;
|
||||
struct rb_node_link proc_tree_link;
|
||||
struct rb_node_link procgroup_memb_tree_link;
|
||||
struct list_node_link cpu_run_q_link;
|
||||
struct list_node_link reap_link;
|
||||
struct list_node_link* sq_entries;
|
||||
|
||||
struct list_node_link* mappings; /* pd.lock implicitly protects this field */
|
||||
struct procgroup* procgroup;
|
||||
struct proc_platformdata pdata;
|
||||
uint32_t flags;
|
||||
struct pd* pd;
|
||||
spin_lock_t lock;
|
||||
struct cpu* cpu;
|
||||
atomic_int state;
|
||||
struct proc_resources* resources;
|
||||
};
|
||||
|
||||
void proc_sched (void);
|
||||
|
||||
Reference in New Issue
Block a user