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/spinlock.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/spinlock.h')
| -rw-r--r-- | include/kernel/spinlock.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/kernel/spinlock.h b/include/kernel/spinlock.h new file mode 100644 index 0000000..aec4b6a --- /dev/null +++ b/include/kernel/spinlock.h @@ -0,0 +1,20 @@ +#pragma once +#include "common/types.h" + +struct spinlock +{ + uint locked; + + char *name; + int cpu_id; +}; + +namespace Spinlock +{ + void init(struct spinlock *lk, char *name); + void acquire(struct spinlock *lk); + void release(struct spinlock *lk); + int holding(struct spinlock *lk); + void push_off(); + void pop_off(); +}
\ No newline at end of file |
