futex.h (b74b953b998bcc2db91b694446f3a2619ec32de6) | futex.h (247055aa21ffef1c49dd64710d5e94c2aee19b58) |
---|---|
1#ifndef _ASM_ARM_FUTEX_H 2#define _ASM_ARM_FUTEX_H 3 4#ifdef __KERNEL__ 5 6#ifdef CONFIG_SMP 7 8#include <asm-generic/futex.h> 9 10#else /* !SMP, we can work around lack of atomic ops by disabling preemption */ 11 12#include <linux/futex.h> 13#include <linux/preempt.h> 14#include <linux/uaccess.h> 15#include <asm/errno.h> | 1#ifndef _ASM_ARM_FUTEX_H 2#define _ASM_ARM_FUTEX_H 3 4#ifdef __KERNEL__ 5 6#ifdef CONFIG_SMP 7 8#include <asm-generic/futex.h> 9 10#else /* !SMP, we can work around lack of atomic ops by disabling preemption */ 11 12#include <linux/futex.h> 13#include <linux/preempt.h> 14#include <linux/uaccess.h> 15#include <asm/errno.h> |
16#include <asm/domain.h> |
|
16 17#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ 18 __asm__ __volatile__( \ | 17 18#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ 19 __asm__ __volatile__( \ |
19 "1: ldrt %1, [%2]\n" \ | 20 "1: " T(ldr) " %1, [%2]\n" \ |
20 " " insn "\n" \ | 21 " " insn "\n" \ |
21 "2: strt %0, [%2]\n" \ | 22 "2: " T(str) " %0, [%2]\n" \ |
22 " mov %0, #0\n" \ 23 "3:\n" \ 24 " .pushsection __ex_table,\"a\"\n" \ 25 " .align 3\n" \ 26 " .long 1b, 4f, 2b, 4f\n" \ 27 " .popsection\n" \ 28 " .pushsection .fixup,\"ax\"\n" \ 29 "4: mov %0, %4\n" \ --- 62 unchanged lines hidden (view full) --- 92 int val; 93 94 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) 95 return -EFAULT; 96 97 pagefault_disable(); /* implies preempt_disable() */ 98 99 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" | 23 " mov %0, #0\n" \ 24 "3:\n" \ 25 " .pushsection __ex_table,\"a\"\n" \ 26 " .align 3\n" \ 27 " .long 1b, 4f, 2b, 4f\n" \ 28 " .popsection\n" \ 29 " .pushsection .fixup,\"ax\"\n" \ 30 "4: mov %0, %4\n" \ --- 62 unchanged lines hidden (view full) --- 93 int val; 94 95 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) 96 return -EFAULT; 97 98 pagefault_disable(); /* implies preempt_disable() */ 99 100 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" |
100 "1: ldrt %0, [%3]\n" | 101 "1: " T(ldr) " %0, [%3]\n" |
101 " teq %0, %1\n" 102 " it eq @ explicit IT needed for the 2b label\n" | 102 " teq %0, %1\n" 103 " it eq @ explicit IT needed for the 2b label\n" |
103 "2: streqt %2, [%3]\n" | 104 "2: " T(streq) " %2, [%3]\n" |
104 "3:\n" 105 " .pushsection __ex_table,\"a\"\n" 106 " .align 3\n" 107 " .long 1b, 4f, 2b, 4f\n" 108 " .popsection\n" 109 " .pushsection .fixup,\"ax\"\n" 110 "4: mov %0, %4\n" 111 " b 3b\n" --- 14 unchanged lines hidden --- | 105 "3:\n" 106 " .pushsection __ex_table,\"a\"\n" 107 " .align 3\n" 108 " .long 1b, 4f, 2b, 4f\n" 109 " .popsection\n" 110 " .pushsection .fixup,\"ax\"\n" 111 "4: mov %0, %4\n" 112 " b 3b\n" --- 14 unchanged lines hidden --- |