Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linux/linux_futex.c
Show First 20 Lines • Show All 983 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
handle_futex_death(struct thread *td, struct linux_emuldata *em, uint32_t *uaddr, | handle_futex_death(struct thread *td, struct linux_emuldata *em, uint32_t *uaddr, | ||||
unsigned int pi) | unsigned int pi) | ||||
{ | { | ||||
uint32_t uval, nval, mval; | uint32_t uval, nval, mval; | ||||
int error; | int error; | ||||
/* Check that futex address is a 32bit aligned. */ | |||||
if (!__is_aligned(uaddr, sizeof(uint32_t))) | |||||
return (EINVAL); | |||||
retry: | retry: | ||||
error = fueword32(uaddr, &uval); | error = fueword32(uaddr, &uval); | ||||
if (error != 0) | if (error != 0) | ||||
return (EFAULT); | return (EFAULT); | ||||
if ((uval & FUTEX_TID_MASK) == em->em_tid) { | if ((uval & FUTEX_TID_MASK) == em->em_tid) { | ||||
mval = (uval & FUTEX_WAITERS) | FUTEX_OWNER_DIED; | mval = (uval & FUTEX_WAITERS) | FUTEX_OWNER_DIED; | ||||
error = casueword32(uaddr, uval, &nval, mval); | error = casueword32(uaddr, uval, &nval, mval); | ||||
if (error == -1) | if (error == -1) | ||||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |