linux/arch/m68k/include/asm
Mikael Pettersson e4f2dfbb5e m68k: implement futex.h to support userspace robust futexes and PI mutexes
Linux/M68K currently doesn't support robust futexes or PI mutexes.
The problem is that the futex code needs to perform certain ops
(cmpxchg, set, add, or, andn, xor) atomically on user-space
addresses, and M68K's lack of a futex.h causes those operations
to be unsupported and disabled.

This patch adds that support, but only for uniprocessor machines,
which is adequate for M68K.  For UP it's enough to disable preemption
to ensure mutual exclusion (futexes don't need to care about other
hardware agents), and the mandatory pagefault_disable() does just that.

This patch is closely based on the one I co-wrote for UP ARM back
in August 2008.  The main change is that this patch uses the C
get_user/put_user accessors instead of inline assembly code with
exception table fixups.

For non-MMU machines the new futex.h simply redirects to the generic
futex.h, so there is no functional change for them.

Tested on aranym with the glibc-2.17 test suite: no regressions, and
a number of mutex/condvar test cases went from failing to succeeding
(tst-mutexpi{5,5a,6,9}, tst-cond2[45], tst-robust[1-9], tst-robustpi[1-8]).
Also tested with glibc-2.18 HEAD and a local glibc patch to enable PI
mutexes: no regressions.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Acked-by: Andreas Schwab <schwab@linux-m68k.org>
[geert: Added removal of ""generic-y += futex.h"]
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-05-21 21:29:13 +02:00
..
Kbuild m68k: implement futex.h to support userspace robust futexes and PI mutexes 2013-05-21 21:29:13 +02:00
MC68EZ328.h
MC68VZ328.h
MC68328.h m68knommu: fix MC68328.h defines 2013-03-04 11:08:50 +10:00
a.out-core.h
adb_iop.h
amigahw.h
amigaints.h
amigayle.h
amipcmcia.h
apollohw.h m68k/apollo: Remove disabled definitions in apollohw.h 2012-08-18 15:15:56 +02:00
asm-offsets.h
atafd.h
atafdreg.h
atari_joystick.h
atari_stdma.h
atari_stram.h
atarihw.h m68k/atari: EtherNAT - platform device and IRQ support code 2013-04-16 21:18:29 +02:00
atariints.h m68k/atari: EtherNAT - platform device and IRQ support code 2013-04-16 21:18:29 +02:00
atarikb.h
atomic.h m68k: include asm/cmpxchg.h in our m68k atomic.h 2012-04-01 22:57:49 +02:00
barrier.h Disintegrate asm/system.h for M68K 2012-03-28 18:30:02 +01:00
bitops.h
blinken.h
bootinfo.h
bootstd.h
bug.h
bugs.h
bvme6000hw.h
cache.h
cacheflush.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
cacheflush_mm.h m68k: fix ColdFire clear cache operation 2012-07-17 15:49:34 +10:00
cacheflush_no.h m68knommu: use "r", not "i" constraint in cacheflush asm's 2012-09-27 23:28:40 +10:00
checksum.h
cmpxchg.h m68k: Add missing cmpxchg64() if CONFIG_RMW_INSNS=y 2013-04-16 21:08:09 +02:00
coldfire.h
commproc.h m68k: remove rpxlite stuff 2013-04-05 13:28:27 +01:00
contregs.h
current.h
delay.h m68k: Implement ndelay() based on the existing udelay() logic 2013-04-16 21:35:40 +02:00
div64.h
dma-mapping.h m68k: Sort out !CONFIG_MMU_SUN3 vs. CONFIG_HAS_DMA 2013-02-09 14:23:36 +01:00
dma.h m68knommu: create and use a common M53xx ColdFire class of CPUs 2013-04-29 09:17:58 +10:00
dsp56k.h
dvma.h
elf.h default SET_PERSONALITY() in linux/elf.h 2013-02-26 02:46:08 -05:00
entry.h m68k: Correct the Atari ALLOWINT definition 2012-04-22 20:16:50 +02:00
fb.h
fbio.h
flat.h m68k: fix compiler warning by properly inlining flat_set_persistent() 2012-05-20 21:21:33 +10:00
floppy.h
fpu.h
ftrace.h
futex.h m68k: implement futex.h to support userspace robust futexes and PI mutexes 2013-05-21 21:29:13 +02:00
gpio.h m68k: define a local gpio_request_one() function 2013-04-09 15:15:31 +10:00
hardirq.h
hp300hw.h
hwtest.h
ide.h
idprom.h
intersil.h
io.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
io_mm.h m68k/atari: ROM port ISA adapter support 2013-04-16 21:08:11 +02:00
io_no.h
irq.h m68k/atari: EtherNAT - platform device and IRQ support code 2013-04-16 21:18:29 +02:00
irqflags.h
linkage.h
m52xxacr.h
m53xxacr.h m68knommu: create and use a common M53xx ColdFire class of CPUs 2013-04-29 09:17:58 +10:00
m53xxsim.h m68knommu: fix ColdFire 5373/5329 QSPI base address 2013-04-29 09:17:59 +10:00
m54xxacr.h m68k: Set ColdFire ACR1 cache mode depending on kernel configuration 2013-04-29 09:17:57 +10:00
m54xxgpt.h m68knommu: clean up ColdFire 54xx General Timer definitions 2012-09-27 23:34:03 +10:00
m54xxpci.h m68k: add PCI bus support definitions for the ColdFire M54xx SoC family 2012-07-17 15:49:42 +10:00
m54xxsim.h m68knommu: clean up Pin Assignment definitions for the 54xx ColdFire CPU 2012-09-27 23:34:02 +10:00
m520xsim.h m68knommu: Add clk definitions for m520x. 2012-07-16 09:59:22 +10:00
m523xsim.h m68knommu: fix inconsistent formating in ColdFire 523x definitions 2012-09-27 23:34:04 +10:00
m525xsim.h m68knommu: merge ColdFire 5249 and 525x definitions 2012-12-05 10:51:21 +10:00
m527xsim.h m68knommu: fix inconsistent formating in ColdFire 527x definitions 2012-09-27 23:34:06 +10:00
m528xsim.h m68knommu: remove unused ColdFire 5282 register definitions 2012-09-27 23:33:55 +10:00
m5206sim.h m68knommu: make ColdFire Chip Select register definitions absolute addresses 2012-09-27 23:33:51 +10:00
m5272sim.h m68knommu: fix inconsistent formating in ColdFire 5272 definitions 2012-09-27 23:34:05 +10:00
m5307sim.h m68knommu: fix inconsistent formating in ColdFire 5307 definitions 2012-09-27 23:34:07 +10:00
m5407sim.h m68knommu: fix inconsistent formating in ColdFire 5407 definitions 2012-09-27 23:34:08 +10:00
m5441xsim.h m68knommu: Add rtc device for m5441x. 2012-07-16 09:59:21 +10:00
m68360.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
m68360_enet.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
m68360_pram.h
m68360_quicc.h
m68360_regs.h
mac_asc.h
mac_baboon.h
mac_iop.h
mac_oss.h
mac_psc.h
mac_via.h
machdep.h m68k: set arch_gettimeoffset directly 2012-12-24 09:36:34 -07:00
machines.h
machw.h
macintosh.h
macints.h
math-emu.h
mc146818rtc.h
mcf8390.h net: add support for NS8390 based eth controllers on some ColdFire CPU boards 2012-07-12 07:54:45 -07:00
mcf_pgalloc.h
mcf_pgtable.h
mcfclk.h m68knommu: add clock creation support macro for other ColdFire CPUs 2012-12-05 10:51:24 +10:00
mcfdma.h
mcfgpio.h m68knommu: create and use a common M53xx ColdFire class of CPUs 2013-04-29 09:17:58 +10:00
mcfintc.h
mcfmmu.h
mcfpit.h
mcfqspi.h m68knommu: make 532x QSPI platform addressing consistent 2012-03-05 09:43:09 +10:00
mcfsim.h m68knommu: create and use a common M53xx ColdFire class of CPUs 2013-04-29 09:17:58 +10:00
mcfslt.h m68knommu: move ColdFire slice timer address defiens to 54xx header 2012-09-27 23:34:01 +10:00
mcftimer.h m68knommu: create and use a common M53xx ColdFire class of CPUs 2013-04-29 09:17:58 +10:00
mcfuart.h m68knommu: Add support for the Coldfire 5251/5253 2012-07-16 09:59:21 +10:00
mcfwdebug.h
mmu.h
mmu_context.h
mmzone.h
module.h Make most arch asm/module.h files use asm-generic/module.h 2012-09-28 14:31:03 +09:30
motorola_pgalloc.h
motorola_pgtable.h
movs.h
mvme16xhw.h
mvme147hw.h
natfeat.h
nettel.h m68knommu: fix wrong register offsets used for ColdFire 5272 multi-function pins 2012-09-27 23:33:54 +10:00
nubus.h
openprom.h
oplib.h
page.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
page_mm.h
page_no.h m68knommu: make non-MMU page_to_virt() return a void * 2012-12-05 10:51:22 +10:00
page_offset.h
parport.h ARCH: drivers remove __dev* attributes. 2013-01-03 15:57:13 -08:00
pci.h m68k: common PCI support definitions and code 2012-07-17 15:49:41 +10:00
pgalloc.h
pgtable.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
pgtable_mm.h
pgtable_no.h m68knommu: add KMAP definitions for non-MMU definitions 2013-01-07 11:46:25 +10:00
processor.h m68knommu: fix trap on execing /bin/init 2013-02-06 11:13:23 +10:00
ptrace.h new helper: current_user_stack_pointer() 2012-12-19 18:07:39 -05:00
q40_master.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
q40ints.h
quicc_simple.h
raw_io.h m68k/atari: ROM port ISA adapter support 2013-04-16 21:08:11 +02:00
rtc.h
segment.h
serial.h
setup.h UAPI: (Scripted) Disintegrate arch/m68k/include/asm 2012-10-09 09:47:06 +01:00
signal.h m68k: switch to generic old sigaction() 2013-02-03 18:16:00 -05:00
smp.h
string.h m68k: Remove inline strlen() implementation 2013-04-16 21:35:43 +02:00
sun3-head.h
sun3_pgalloc.h
sun3_pgtable.h
sun3ints.h
sun3mmu.h
sun3x.h
sun3xflop.h Disintegrate asm/system.h for M68K 2012-03-28 18:30:02 +01:00
sun3xprom.h
switch_to.h Disintegrate asm/system.h for M68K 2012-03-28 18:30:02 +01:00
thread_info.h m68k: add TIF_NOTIFY_RESUME and handle it. 2012-05-21 23:59:47 -04:00
timex.h
tlb.h
tlbflush.h
traps.h
uaccess.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
uaccess_mm.h m68k: Use generic strncpy_from_user(), strlen_user(), and strnlen_user() 2012-06-06 15:31:28 +02:00
uaccess_no.h
ucontext.h
unaligned.h m68k: Introduce config option CPU_HAS_NO_UNALIGNED 2012-06-10 10:18:32 +02:00
unistd.h consolidate cond_syscall and SYSCALL_ALIAS declarations 2013-03-03 22:55:19 -05:00
user.h
vga.h m68k/video: Create <asm/vga.h> 2012-04-22 20:16:50 +02:00
virtconvert.h
zorro.h