]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-powerpc/asm-compat.h
Merge branch 'for-linus' of git://www.jni.nu/cris
[linux-2.6-omap-h63xx.git] / include / asm-powerpc / asm-compat.h
1 #ifndef _ASM_POWERPC_ASM_COMPAT_H
2 #define _ASM_POWERPC_ASM_COMPAT_H
3
4 #include <asm/types.h>
5
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
16
17
18 #ifdef __powerpc64__
19
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_TLNEI       stringify_in_c(tdnei)
26 #define PPC_LLARX       stringify_in_c(ldarx)
27 #define PPC_STLCX       stringify_in_c(stdcx.)
28 #define PPC_CNTLZL      stringify_in_c(cntlzd)
29
30 /* Move to CR, single-entry optimized version. Only available
31  * on POWER4 and later.
32  */
33 #ifdef CONFIG_POWER4_ONLY
34 #define PPC_MTOCRF      stringify_in_c(mtocrf)
35 #else
36 #define PPC_MTOCRF      stringify_in_c(mtcrf)
37 #endif
38
39 #else /* 32-bit */
40
41 /* operations for longs and pointers */
42 #define PPC_LL          stringify_in_c(lwz)
43 #define PPC_STL         stringify_in_c(stw)
44 #define PPC_LCMPI       stringify_in_c(cmpwi)
45 #define PPC_LONG        stringify_in_c(.long)
46 #define PPC_TLNEI       stringify_in_c(twnei)
47 #define PPC_LLARX       stringify_in_c(lwarx)
48 #define PPC_STLCX       stringify_in_c(stwcx.)
49 #define PPC_CNTLZL      stringify_in_c(cntlzw)
50 #define PPC_MTOCRF      stringify_in_c(mtcrf)
51
52 #endif
53
54 #ifdef __KERNEL__
55 #ifdef CONFIG_IBM405_ERR77
56 /* Erratum #77 on the 405 means we need a sync or dcbt before every
57  * stwcx.  The old ATOMIC_SYNC_FIX covered some but not all of this.
58  */
59 #define PPC405_ERR77(ra,rb)     stringify_in_c(dcbt     ra, rb;)
60 #define PPC405_ERR77_SYNC       stringify_in_c(sync;)
61 #else
62 #define PPC405_ERR77(ra,rb)
63 #define PPC405_ERR77_SYNC
64 #endif
65 #endif
66
67 #endif /* _ASM_POWERPC_ASM_COMPAT_H */