Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/umtx.h
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | |||||
#define UMTX_SHM_ALIVE 0x0008 | #define UMTX_SHM_ALIVE 0x0008 | ||||
struct umtx_robust_lists_params { | struct umtx_robust_lists_params { | ||||
uintptr_t robust_list_offset; | uintptr_t robust_list_offset; | ||||
uintptr_t robust_priv_list_offset; | uintptr_t robust_priv_list_offset; | ||||
uintptr_t robust_inact_offset; | uintptr_t robust_inact_offset; | ||||
}; | }; | ||||
#ifndef _KERNEL | |||||
__BEGIN_DECLS | __BEGIN_DECLS | ||||
int _umtx_op(void *obj, int op, u_long val, void *uaddr, void *uaddr2); | int _umtx_op(void *obj, int op, u_long val, void *uaddr, void *uaddr2); | ||||
__END_DECLS | __END_DECLS | ||||
#else | |||||
/* | |||||
* The umtx_key structure is used by both the Linux futex code and the | |||||
* umtx implementation to map userland addresses to unique keys. | |||||
*/ | |||||
enum { | |||||
TYPE_SIMPLE_WAIT, | |||||
TYPE_CV, | |||||
TYPE_SEM, | |||||
TYPE_SIMPLE_LOCK, | |||||
TYPE_NORMAL_UMUTEX, | |||||
TYPE_PI_UMUTEX, | |||||
TYPE_PP_UMUTEX, | |||||
TYPE_RWLOCK, | |||||
TYPE_FUTEX, | |||||
TYPE_SHM, | |||||
TYPE_PI_ROBUST_UMUTEX, | |||||
TYPE_PP_ROBUST_UMUTEX, | |||||
}; | |||||
/* Key to represent a unique userland synchronous object */ | |||||
struct umtx_key { | |||||
int hash; | |||||
int type; | |||||
int shared; | |||||
union { | |||||
struct { | |||||
struct vm_object *object; | |||||
uintptr_t offset; | |||||
} shared; | |||||
struct { | |||||
struct vmspace *vs; | |||||
uintptr_t addr; | |||||
} private; | |||||
struct { | |||||
void *a; | |||||
uintptr_t b; | |||||
} both; | |||||
} info; | |||||
}; | |||||
#define THREAD_SHARE 0 | |||||
#define PROCESS_SHARE 1 | |||||
#define AUTO_SHARE 2 | |||||
struct thread; | |||||
static inline int | |||||
umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2) | |||||
{ | |||||
return (k1->type == k2->type && | |||||
k1->info.both.a == k2->info.both.a && | |||||
k1->info.both.b == k2->info.both.b); | |||||
} | |||||
int umtx_copyin_timeout(const void *, struct timespec *); | |||||
void umtx_exec(struct proc *p); | |||||
int umtx_key_get(const void *, int, int, struct umtx_key *); | |||||
void umtx_key_release(struct umtx_key *); | |||||
struct umtx_q *umtxq_alloc(void); | |||||
void umtxq_free(struct umtx_q *); | |||||
int kern_umtx_wake(struct thread *, void *, int, int); | |||||
void umtx_pi_adjust(struct thread *, u_char); | |||||
void umtx_thread_init(struct thread *); | |||||
void umtx_thread_fini(struct thread *); | |||||
void umtx_thread_alloc(struct thread *); | |||||
void umtx_thread_exit(struct thread *); | |||||
#endif /* !_KERNEL */ | |||||
#endif /* !_SYS_UMTX_H_ */ | #endif /* !_SYS_UMTX_H_ */ |