#ifndef _KERNEL_PROC_PROC_H #define _KERNEL_PROC_PROC_H #include #include #include #include #if defined(__x86_64__) #include /* KSTACK_SIZE */ #include /* USTACK_SIZE */ #endif /// Process is ready to run #define PROC_READY 0 /// Process marked garbage collection #define PROC_DEAD 1 struct cpu; struct proc_mapping { struct proc_mapping* next; uintptr_t paddr; uintptr_t vaddr; size_t size; } PACKED; struct procw; struct proc { struct proc* next; struct proc_mapping* mappings; /* pd.lock implicitly protects this field */ struct proc_platformdata pdata; struct pd pd; spin_lock_t lock; struct cpu* cpu; struct procw* procw; /* link to it's global struct */ atomic_int state; }; /* * struct proc is a member of a CPU's proc_run_q. * struct procw is a process wrapper that is a member of * a global process list. */ struct procw { struct procw* next; struct proc* proc; }; void proc_sched (void); void proc_kill (struct proc* proc); void proc_init (void); #endif // _KERNEL_PROC_PROC_H