diff options
author | Anton Ivanov <anton.ivanov@cambridgegreys.com> | 2021-03-12 16:16:09 +0100 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2021-06-17 22:01:45 +0200 |
commit | dd3035a21ba7ccaa883d7107d357ad06320d78fc (patch) | |
tree | 70f67dc7aa7933b22aa2a38eea3bd5dddd006fb4 /arch/um/include | |
parent | um: enable the use of optimized xor routines in UML (diff) | |
download | linux-dd3035a21ba7ccaa883d7107d357ad06320d78fc.tar.xz linux-dd3035a21ba7ccaa883d7107d357ad06320d78fc.zip |
um: add a UML specific futex implementation
The generic asm futex implementation emulates atomic access to
memory by doing a get_user followed by put_user. These translate
to two mapping operations on UML with paging enabled in the
meantime. This, in turn may end up changing interrupts,
invoking the signal loop, etc.
This replaces the generic implementation by a mapping followed
by an operation on the mapped segment.
Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/include')
-rw-r--r-- | arch/um/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/um/include/asm/futex.h | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild index 0c31d19a7a9c..e5a7b552bb38 100644 --- a/arch/um/include/asm/Kbuild +++ b/arch/um/include/asm/Kbuild @@ -9,7 +9,6 @@ generic-y += exec.h generic-y += extable.h generic-y += fb.h generic-y += ftrace.h -generic-y += futex.h generic-y += hw_irq.h generic-y += irq_regs.h generic-y += irq_work.h diff --git a/arch/um/include/asm/futex.h b/arch/um/include/asm/futex.h new file mode 100644 index 000000000000..780aa6bfc050 --- /dev/null +++ b/arch/um/include/asm/futex.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_UM_FUTEX_H +#define _ASM_UM_FUTEX_H + +#include <linux/futex.h> +#include <linux/uaccess.h> +#include <asm/errno.h> + + +int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr); +int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, + u32 oldval, u32 newval); + +#endif |