Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182052
b: refs/heads/master
c: 6b07d38
h: refs/heads/master
v: v3
  • Loading branch information
David Daney authored and Ralf Baechle committed Feb 27, 2010
1 parent 588d2ba commit 5d677f3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f252ffd50c97dae87b45f1dbad24f71358ccfbd6
refs/heads/master: 6b07d38aaa520cee922fadfeaf90c97faf217045
1 change: 0 additions & 1 deletion trunk/arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,6 @@ config CPU_CAVIUM_OCTEON
select SYS_SUPPORTS_SMP
select NR_CPUS_DEFAULT_16
select WEAK_ORDERING
select WEAK_REORDERING_BEYOND_LLSC
select CPU_SUPPORTS_HIGHMEM
select CPU_SUPPORTS_HUGEPAGES
help
Expand Down
43 changes: 31 additions & 12 deletions trunk/arch/mips/include/asm/barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,20 @@
: /* no output */ \
: "m" (*(int *)CKSEG1) \
: "memory")

#define fast_wmb() __sync()
#define fast_rmb() __sync()
#define fast_mb() __sync()
#ifdef CONFIG_SGI_IP28
#define fast_iob() \
#ifdef CONFIG_CPU_CAVIUM_OCTEON
# define OCTEON_SYNCW_STR ".set push\n.set arch=octeon\nsyncw\nsyncw\n.set pop\n"
# define __syncw() __asm__ __volatile__(OCTEON_SYNCW_STR : : : "memory")

# define fast_wmb() __syncw()
# define fast_rmb() barrier()
# define fast_mb() __sync()
# define fast_iob() do { } while (0)
#else /* ! CONFIG_CPU_CAVIUM_OCTEON */
# define fast_wmb() __sync()
# define fast_rmb() __sync()
# define fast_mb() __sync()
# ifdef CONFIG_SGI_IP28
# define fast_iob() \
__asm__ __volatile__( \
".set push\n\t" \
".set noreorder\n\t" \
Expand All @@ -104,13 +112,14 @@
: /* no output */ \
: "m" (*(int *)CKSEG1ADDR(0x1fa00004)) \
: "memory")
#else
#define fast_iob() \
# else
# define fast_iob() \
do { \
__sync(); \
__fast_iob(); \
} while (0)
#endif
# endif
#endif /* CONFIG_CPU_CAVIUM_OCTEON */

#ifdef CONFIG_CPU_HAS_WB

Expand All @@ -131,9 +140,15 @@
#endif /* !CONFIG_CPU_HAS_WB */

#if defined(CONFIG_WEAK_ORDERING) && defined(CONFIG_SMP)
#define smp_mb() __asm__ __volatile__("sync" : : :"memory")
#define smp_rmb() __asm__ __volatile__("sync" : : :"memory")
#define smp_wmb() __asm__ __volatile__("sync" : : :"memory")
# ifdef CONFIG_CPU_CAVIUM_OCTEON
# define smp_mb() __sync()
# define smp_rmb() barrier()
# define smp_wmb() __syncw()
# else
# define smp_mb() __asm__ __volatile__("sync" : : :"memory")
# define smp_rmb() __asm__ __volatile__("sync" : : :"memory")
# define smp_wmb() __asm__ __volatile__("sync" : : :"memory")
# endif
#else
#define smp_mb() barrier()
#define smp_rmb() barrier()
Expand All @@ -151,6 +166,10 @@

#define smp_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")

#ifdef CONFIG_CPU_CAVIUM_OCTEON
#define smp_mb__before_llsc() smp_wmb()
#else
#define smp_mb__before_llsc() smp_llsc_mb()
#endif

#endif /* __ASM_BARRIER_H */

0 comments on commit 5d677f3

Please sign in to comment.