diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2025-12-28 00:48:24 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2025-12-28 00:48:24 +0800 |
| commit | a82ab8ad6d277ededc128678aebabf5fbdb01c45 (patch) | |
| tree | 71d1d333d45e7272ba79a1868942dc710f673ff3 /include/kernel/proc.h | |
| parent | 7ececbe2818510a8acaa2a2e513085c768b14d15 (diff) | |
| download | lume-a82ab8ad6d277ededc128678aebabf5fbdb01c45.tar.gz lume-a82ab8ad6d277ededc128678aebabf5fbdb01c45.tar.xz | |
feat(syscall): Implement syscall dispatch and process lifecycle (exit/wait/sleep)
Diffstat (limited to 'include/kernel/proc.h')
| -rw-r--r-- | include/kernel/proc.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/kernel/proc.h b/include/kernel/proc.h index 559b137..b557267 100644 --- a/include/kernel/proc.h +++ b/include/kernel/proc.h @@ -1,6 +1,7 @@ #pragma once #include "common/types.h" #include "kernel/trap.h" +#include "kernel/spinlock.h" struct Context { @@ -44,7 +45,9 @@ struct Proc char name[16]; uint64 sz; - // + struct Proc *parent; + void *chan; + int xstate; }; @@ -57,8 +60,13 @@ namespace ProcManager void create_kernel_thread(void (*func)(), const char *name); void user_init(); + void exit(int status); + int wait(uint64 addr); + void sleep(void *chan, struct spinlock *lk); + void wakeup(void *chan); } void forkret(); struct Proc *myproc(); -void usertrapret();
\ No newline at end of file +void usertrapret(); +int fork();
\ No newline at end of file |
