From 53d21d1ccb75004d0085efedd688b695707a3138 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 6 May 2022 14:09:44 +0200 Subject: kernel/proc: reorganize the functions --- src/kernel/proc.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/kernel/proc.h') diff --git a/src/kernel/proc.h b/src/kernel/proc.h index 6266998..93044d2 100644 --- a/src/kernel/proc.h +++ b/src/kernel/proc.h @@ -56,27 +56,26 @@ struct process { extern struct process *process_first; extern struct process *process_current; -// creates the root process +/** Creates the root process. */ struct process *process_seed(struct kmain_info *info); struct process *process_fork(struct process *parent, int flags); -void process_forget(struct process *); // remove references to process +void process_kill(struct process *proc, int ret); +/** Tries to free a process / collect its return value. */ +int process_try2collect(struct process *dead); void process_free(struct process *); -_Noreturn void process_switch_any(void); // switches to any running process +/** Removes a process from the process tree. */ +void process_forget(struct process *); + +/** Switches execution to any running process. */ +_Noreturn void process_switch_any(void); /** Used for iterating over all processes */ struct process *process_next(struct process *); struct process *process_find(enum process_state); -size_t process_find_multiple(enum process_state, struct process **buf, size_t max); -handle_t process_find_handle(struct process *proc, handle_t start_at); // finds the first free handle +handle_t process_find_free_handle(struct process *proc, handle_t start_at); struct handle *process_handle_get(struct process *, handle_t, enum handle_type); void process_transition(struct process *, enum process_state); - -void process_kill(struct process *proc, int ret); - -/** Tries to transistion from PS_DEAD to PS_DEADER. - * @return a nonnegative length of the quit message if successful, a negative val otherwise*/ -int process_try2collect(struct process *dead); -- cgit v1.2.3