#ifndef _KERNEL_PROC_PROC_H #define _KERNEL_PROC_PROC_H #include #include #include #include #include #include #include #include #include #include #if defined(__x86_64__) #include /* KSTACK_SIZE */ #include /* USTACK_SIZE */ #endif #define PROC_NEED_RESCHEDULE true #define PROC_NO_RESCHEDULE false /* process states */ #define PROC_READY 0 #define PROC_DEAD 1 #define PROC_SUSPENDED 2 /* process flags */ #define PROC_USTK_PREALLOC (1 << 0) struct cpu; 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 procgroup* procgroup; struct proc_platformdata pdata; uint32_t flags; spin_lock_t lock; struct cpu* cpu; atomic_int state; uintptr_t uvaddr_argument; }; void proc_sched (void); void proc_kill (struct proc* proc); struct elf_aux proc_load_segments (struct proc* proc, uint8_t* elf); void proc_register (struct proc* proc, struct cpu* cpu); struct proc* proc_find_pid (int pid); struct proc* proc_spawn_rd (char* name); void proc_init (void); #endif // _KERNEL_PROC_PROC_H