kernel: finish implementation of private and shared futexes
This commit is contained in:
@@ -5,22 +5,30 @@
|
||||
#include <kernel/wait.h>
|
||||
#include <mango/types.h>
|
||||
|
||||
struct task;
|
||||
struct address_space;
|
||||
|
||||
typedef phys_addr_t futex_key_t;
|
||||
typedef uintptr_t futex_key_t;
|
||||
|
||||
struct futex {
|
||||
struct btree_node f_node;
|
||||
|
||||
futex_key_t f_key;
|
||||
struct waitqueue f_waiters;
|
||||
};
|
||||
|
||||
extern kern_status_t futex_init(void);
|
||||
extern kern_status_t futex_get(
|
||||
struct address_space *space,
|
||||
kern_futex_t *futex,
|
||||
futex_key_t *out);
|
||||
extern kern_status_t futex_wait(futex_key_t futex, kern_futex_t new_val);
|
||||
extern kern_status_t futex_wake(futex_key_t futex, size_t nwaiters);
|
||||
futex_key_t *out,
|
||||
unsigned int flags);
|
||||
extern kern_status_t futex_wait(
|
||||
futex_key_t futex,
|
||||
kern_futex_t new_val,
|
||||
unsigned int flags);
|
||||
extern kern_status_t futex_wake(
|
||||
futex_key_t futex,
|
||||
size_t nwaiters,
|
||||
unsigned int flags);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -197,6 +197,15 @@ extern kern_status_t sys_vm_controller_supply_pages(
|
||||
off_t src_offset,
|
||||
size_t count);
|
||||
|
||||
extern kern_status_t sys_futex_wait(
|
||||
kern_futex_t *futex,
|
||||
kern_futex_t new_val,
|
||||
unsigned int flags);
|
||||
extern kern_status_t sys_futex_wake(
|
||||
kern_futex_t *futex,
|
||||
unsigned int nr_waiters,
|
||||
unsigned int flags);
|
||||
|
||||
extern virt_addr_t syscall_get_function(unsigned int sysid);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,7 +27,7 @@ struct task {
|
||||
struct address_space *t_address_space;
|
||||
spin_lock_t t_handles_lock;
|
||||
struct handle_table *t_handles;
|
||||
struct btree b_channels;
|
||||
struct btree t_channels, t_futex;
|
||||
|
||||
struct btree_node t_tasklist;
|
||||
struct queue_entry t_child_entry;
|
||||
|
||||
Reference in New Issue
Block a user