kernel: add thread_wait, thread_block and mtx
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
071a5651e0
commit
9c50a1df92
6 changed files with 49 additions and 3 deletions
|
|
@ -46,4 +46,7 @@ void enter_userspace_init(struct thread *thread, uaddr_t entry);
|
|||
struct pt_regs *current_pt_regs();
|
||||
u32 cpu_id();
|
||||
|
||||
void thread_wait();
|
||||
void thread_block();
|
||||
|
||||
#endif /* _ARCH_PROC_H_ */
|
||||
|
|
|
|||
10
amd64/include/kernel/mtx.h
Normal file
10
amd64/include/kernel/mtx.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _MTX_H_
|
||||
#define _MTX_H_
|
||||
|
||||
#include <kernel/spinlock.h>
|
||||
|
||||
void mtx_lock(mtx_t *l);
|
||||
void mtx_unlock(mtx_t *l);
|
||||
|
||||
#endif /* _MTX_H_ */
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
#define CLEANUP_SLOCK CLEANUP(cleanup_spinlock)
|
||||
|
||||
typedef u32 spinlock_t;
|
||||
typedef spinlock_t mtx_t;
|
||||
|
||||
void spinlock_acquire(spinlock_t *lock);
|
||||
void spinlock_release(spinlock_t *lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue