arch: Clean up asm/barrier.h implementations using asm-generic/barrier.h
We're going to be adding a few new barrier primitives, and in order to avoid endless duplication make more agressive use of asm-generic/barrier.h. Change the asm-generic/barrier.h such that it allows partial barrier definitions and fills out the rest with defaults. There are a few architectures (m32r, m68k) that could probably do away with their barrier.h file entirely but are kept for now due to their unconventional nop() implementation. Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Michael Ellerman <michael@ellerman.id.au> Cc: Michael Neuling <mikey@neuling.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Victor Kaplansky <VICTORK@il.ibm.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/r/20131213150640.846368594@infradead.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
このコミットが含まれているのは:
@@ -5,3 +5,4 @@ generic-y += word-at-a-time.h auxvec.h user.h cputime.h emergency-restart.h \
|
||||
poll.h xor.h clkdev.h exec.h
|
||||
generic-y += trace_clock.h
|
||||
generic-y += preempt.h
|
||||
generic-y += barrier.h
|
||||
|
@@ -1,35 +0,0 @@
|
||||
#ifndef __PARISC_BARRIER_H
|
||||
#define __PARISC_BARRIER_H
|
||||
|
||||
/*
|
||||
** This is simply the barrier() macro from linux/kernel.h but when serial.c
|
||||
** uses tqueue.h uses smp_mb() defined using barrier(), linux/kernel.h
|
||||
** hasn't yet been included yet so it fails, thus repeating the macro here.
|
||||
**
|
||||
** PA-RISC architecture allows for weakly ordered memory accesses although
|
||||
** none of the processors use it. There is a strong ordered bit that is
|
||||
** set in the O-bit of the page directory entry. Operating systems that
|
||||
** can not tolerate out of order accesses should set this bit when mapping
|
||||
** pages. The O-bit of the PSW should also be set to 1 (I don't believe any
|
||||
** of the processor implemented the PSW O-bit). The PCX-W ERS states that
|
||||
** the TLB O-bit is not implemented so the page directory does not need to
|
||||
** have the O-bit set when mapping pages (section 3.1). This section also
|
||||
** states that the PSW Y, Z, G, and O bits are not implemented.
|
||||
** So it looks like nothing needs to be done for parisc-linux (yet).
|
||||
** (thanks to chada for the above comment -ggg)
|
||||
**
|
||||
** The __asm__ op below simple prevents gcc/ld from reordering
|
||||
** instructions across the mb() "call".
|
||||
*/
|
||||
#define mb() __asm__ __volatile__("":::"memory") /* barrier() */
|
||||
#define rmb() mb()
|
||||
#define wmb() mb()
|
||||
#define smp_mb() mb()
|
||||
#define smp_rmb() mb()
|
||||
#define smp_wmb() mb()
|
||||
#define smp_read_barrier_depends() do { } while(0)
|
||||
#define read_barrier_depends() do { } while(0)
|
||||
|
||||
#define set_mb(var, value) do { var = value; mb(); } while (0)
|
||||
|
||||
#endif /* __PARISC_BARRIER_H */
|
新しいイシューから参照
ユーザーをブロックする