Skip to content

Commit 36a7eea

Browse files
chleroympe
authored andcommitted
powerpc/405: move PPC405_ERR77 in asm-405.h
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 8c58259 commit 36a7eea

11 files changed

Lines changed: 27 additions & 15 deletions

File tree

‎arch/powerpc/include/asm/asm-405.h‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#ifndef _ASM_POWERPC_ASM_405_H
2+
#define _ASM_POWERPC_ASM_405_H
3+
4+
#include <asm/asm-const.h>
5+
6+
#ifdef __KERNEL__
7+
#ifdef CONFIG_IBM405_ERR77
8+
/* Erratum #77 on the 405 means we need a sync or dcbt before every
9+
* stwcx. The old ATOMIC_SYNC_FIX covered some but not all of this.
10+
*/
11+
#define PPC405_ERR77(ra,rb) stringify_in_c(dcbt ra, rb;)
12+
#define PPC405_ERR77_SYNC stringify_in_c(sync;)
13+
#else
14+
#define PPC405_ERR77(ra,rb)
15+
#define PPC405_ERR77_SYNC
16+
#endif
17+
#endif
18+
19+
#endif /* _ASM_POWERPC_ASM_405_H */

‎arch/powerpc/include/asm/asm-compat.h‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,4 @@
7070

7171
#endif
7272

73-
#ifdef __KERNEL__
74-
#ifdef CONFIG_IBM405_ERR77
75-
/* Erratum #77 on the 405 means we need a sync or dcbt before every
76-
* stwcx. The old ATOMIC_SYNC_FIX covered some but not all of this.
77-
*/
78-
#define PPC405_ERR77(ra,rb) stringify_in_c(dcbt ra, rb;)
79-
#define PPC405_ERR77_SYNC stringify_in_c(sync;)
80-
#else
81-
#define PPC405_ERR77(ra,rb)
82-
#define PPC405_ERR77_SYNC
83-
#endif
84-
#endif
85-
8673
#endif /* _ASM_POWERPC_ASM_COMPAT_H */

‎arch/powerpc/include/asm/atomic.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/types.h>
1111
#include <asm/cmpxchg.h>
1212
#include <asm/barrier.h>
13+
#include <asm/asm-405.h>
1314

1415
#define ATOMIC_INIT(i) { (i) }
1516

‎arch/powerpc/include/asm/bitops.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <linux/compiler.h>
4646
#include <asm/asm-compat.h>
4747
#include <asm/synch.h>
48+
#include <asm/asm-405.h>
4849

4950
/* PPC bit number conversion */
5051
#define PPC_BITLSHIFT(be) (BITS_PER_LONG - 1 - (be))

‎arch/powerpc/include/asm/book3s/32/pgtable.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ static inline unsigned long pte_update(pte_t *p,
164164
1: lwarx %0,0,%3\n\
165165
andc %1,%0,%4\n\
166166
or %1,%1,%5\n"
167-
PPC405_ERR77(0,%3)
168167
" stwcx. %1,0,%3\n\
169168
bne- 1b"
170169
: "=&r" (old), "=&r" (tmp), "=m" (*p)
@@ -186,7 +185,6 @@ static inline unsigned long long pte_update(pte_t *p,
186185
lwzx %0,0,%3\n\
187186
andc %1,%L0,%5\n\
188187
or %1,%1,%6\n"
189-
PPC405_ERR77(0,%3)
190188
" stwcx. %1,0,%4\n\
191189
bne- 1b"
192190
: "=&r" (old), "=&r" (tmp), "=m" (*p)

‎arch/powerpc/include/asm/cmpxchg.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <asm/synch.h>
88
#include <asm/asm-compat.h>
99
#include <linux/bug.h>
10+
#include <asm/asm-405.h>
1011

1112
#ifdef __BIG_ENDIAN
1213
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)

‎arch/powerpc/include/asm/futex.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <asm/errno.h>
1010
#include <asm/synch.h>
1111
#include <asm/asm-compat.h>
12+
#include <asm/asm-405.h>
1213

1314
#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
1415
__asm__ __volatile ( \

‎arch/powerpc/include/asm/nohash/32/pgtable.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/sched.h>
1010
#include <linux/threads.h>
1111
#include <asm/io.h> /* For sub-arch specific PPC_PIN_SIZE */
12+
#include <asm/asm-405.h>
1213

1314
extern unsigned long ioremap_bot;
1415

‎arch/powerpc/include/asm/spinlock.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <asm/asm-compat.h>
2828
#include <asm/synch.h>
2929
#include <asm/ppc-opcode.h>
30+
#include <asm/asm-405.h>
3031

3132
#ifdef CONFIG_PPC64
3233
/* use 0x800000yy when locked, where yy == CPU number */

‎arch/powerpc/kernel/entry_32.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <asm/unistd.h>
3434
#include <asm/ptrace.h>
3535
#include <asm/export.h>
36+
#include <asm/asm-405.h>
3637

3738
/*
3839
* MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE.

0 commit comments

Comments
 (0)