Linux 2.6.28-rc5
[cris-mirror.git] / arch / powerpc / include / asm / asm-compat.h
blob8f0fe797194992829dd5926ef2d80605415e5059
1 #ifndef _ASM_POWERPC_ASM_COMPAT_H
2 #define _ASM_POWERPC_ASM_COMPAT_H
4 #include <asm/types.h>
6 #ifdef __ASSEMBLY__
7 # define stringify_in_c(...) __VA_ARGS__
8 # define ASM_CONST(x) x
9 #else
10 /* This version of stringify will deal with commas... */
11 # define __stringify_in_c(...) #__VA_ARGS__
12 # define stringify_in_c(...) __stringify_in_c(__VA_ARGS__) " "
13 # define __ASM_CONST(x) x##UL
14 # define ASM_CONST(x) __ASM_CONST(x)
15 #endif
18 #ifdef __powerpc64__
20 /* operations for longs and pointers */
21 #define PPC_LL stringify_in_c(ld)
22 #define PPC_STL stringify_in_c(std)
23 #define PPC_LCMPI stringify_in_c(cmpdi)
24 #define PPC_LONG stringify_in_c(.llong)
25 #define PPC_LONG_ALIGN stringify_in_c(.balign 8)
26 #define PPC_TLNEI stringify_in_c(tdnei)
27 #define PPC_LLARX stringify_in_c(ldarx)
28 #define PPC_STLCX stringify_in_c(stdcx.)
29 #define PPC_CNTLZL stringify_in_c(cntlzd)
31 /* Move to CR, single-entry optimized version. Only available
32 * on POWER4 and later.
34 #ifdef CONFIG_POWER4_ONLY
35 #define PPC_MTOCRF stringify_in_c(mtocrf)
36 #else
37 #define PPC_MTOCRF stringify_in_c(mtcrf)
38 #endif
40 #else /* 32-bit */
42 /* operations for longs and pointers */
43 #define PPC_LL stringify_in_c(lwz)
44 #define PPC_STL stringify_in_c(stw)
45 #define PPC_LCMPI stringify_in_c(cmpwi)
46 #define PPC_LONG stringify_in_c(.long)
47 #define PPC_LONG_ALIGN stringify_in_c(.balign 4)
48 #define PPC_TLNEI stringify_in_c(twnei)
49 #define PPC_LLARX stringify_in_c(lwarx)
50 #define PPC_STLCX stringify_in_c(stwcx.)
51 #define PPC_CNTLZL stringify_in_c(cntlzw)
52 #define PPC_MTOCRF stringify_in_c(mtcrf)
54 #endif
56 #ifdef __KERNEL__
57 #ifdef CONFIG_IBM405_ERR77
58 /* Erratum #77 on the 405 means we need a sync or dcbt before every
59 * stwcx. The old ATOMIC_SYNC_FIX covered some but not all of this.
61 #define PPC405_ERR77(ra,rb) stringify_in_c(dcbt ra, rb;)
62 #define PPC405_ERR77_SYNC stringify_in_c(sync;)
63 #else
64 #define PPC405_ERR77(ra,rb)
65 #define PPC405_ERR77_SYNC
66 #endif
67 #endif
69 #endif /* _ASM_POWERPC_ASM_COMPAT_H */