From d94ffac4a584dc7a4f6f2ec567b8caab05ce9253 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 6 May 2020 19:04:05 +0200 Subject: New build parameters and shared includes This changes many files but I've just applied some replace commands.. So - nothing special! --- src/kernel/tasks/process.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/kernel/tasks/process.c') diff --git a/src/kernel/tasks/process.c b/src/kernel/tasks/process.c index 87a6ec9..efacc1f 100644 --- a/src/kernel/tasks/process.c +++ b/src/kernel/tasks/process.c @@ -1,22 +1,22 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -uint32_t pid = 0; +#include +#include +#include +#include +#include +#include +#include +#include +#include + +u32 pid = 0; struct process *root; struct process *current_proc = NULL; struct regs hold_root; -extern uint32_t stack_hold; +extern u32 stack_hold; void scheduler(struct regs *regs) { @@ -54,7 +54,7 @@ void process_init(struct process *proc) userspace_enter(proc); } -void process_kill(uint32_t pid) +void process_kill(u32 pid) { struct process *proc = process_from_pid(pid); @@ -71,7 +71,7 @@ void process_kill(uint32_t pid) } } -uint32_t process_spawn(struct process *process) +u32 process_spawn(struct process *process) { process->next = root->next; root->next = process; @@ -84,7 +84,7 @@ uint32_t process_spawn(struct process *process) return process->pid; } -int process_wait_gid(uint32_t gid, int *status) +int process_wait_gid(u32 gid, int *status) { struct process *i = root; @@ -101,7 +101,7 @@ int process_wait_gid(uint32_t gid, int *status) return WAIT_OKAY; } -int process_wait_pid(uint32_t pid, int *status) +int process_wait_pid(u32 pid, int *status) { struct process *i = current_proc->next; @@ -120,7 +120,7 @@ int process_wait_pid(uint32_t pid, int *status) return WAIT_ERROR; } -void process_suspend(uint32_t pid) +void process_suspend(u32 pid) { struct process *proc = process_from_pid(pid); @@ -132,7 +132,7 @@ void process_suspend(uint32_t pid) proc->state = PROC_ASLEEP; } -void process_wake(uint32_t pid) +void process_wake(u32 pid) { struct process *proc = process_from_pid(pid); @@ -142,7 +142,7 @@ void process_wake(uint32_t pid) proc->state = PROC_RUNNING; } -uint32_t process_child(struct process *child, uint32_t pid) +u32 process_child(struct process *child, u32 pid) { process_suspend(pid); @@ -157,7 +157,7 @@ uint32_t process_child(struct process *child, uint32_t pid) return process_spawn(child); } -uint32_t process_fork(uint32_t pid) +u32 process_fork(u32 pid) { warn("Fork is not implemented"); @@ -173,7 +173,7 @@ uint32_t process_fork(uint32_t pid) return 0; //pid++; } -struct process *process_from_pid(uint32_t pid) +struct process *process_from_pid(u32 pid) { struct process *proc = root; @@ -205,7 +205,7 @@ struct process *process_make_new() return proc; } -uint32_t kexec(char *path) +u32 kexec(char *path) { struct process *proc = elf_load(path); if (proc == NULL) @@ -219,7 +219,7 @@ uint32_t kexec(char *path) return 0; } -uint32_t uexec(char *path) +u32 uexec(char *path) { process_suspend(current_proc->pid); -- cgit v1.2.3