[PATCH] uml: add -ffreestanding to CFLAGS
[linux/fpc-iii.git] / include / asm-powerpc / asm-compat.h
blob8e64be0cc47d3d0f7579445af6726a661f50a17b
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
17 #ifdef __powerpc64__
19 /* operations for longs and pointers */
20 #define PPC_LL stringify_in_c(ld)
21 #define PPC_STL stringify_in_c(std)
22 #define PPC_LCMPI stringify_in_c(cmpdi)
23 #define PPC_LONG stringify_in_c(.llong)
24 #define PPC_TLNEI stringify_in_c(tdnei)
25 #define PPC_LLARX stringify_in_c(ldarx)
26 #define PPC_STLCX stringify_in_c(stdcx.)
27 #define PPC_CNTLZL stringify_in_c(cntlzd)
29 #else /* 32-bit */
31 /* operations for longs and pointers */
32 #define PPC_LL stringify_in_c(lwz)
33 #define PPC_STL stringify_in_c(stw)
34 #define PPC_LCMPI stringify_in_c(cmpwi)
35 #define PPC_LONG stringify_in_c(.long)
36 #define PPC_TLNEI stringify_in_c(twnei)
37 #define PPC_LLARX stringify_in_c(lwarx)
38 #define PPC_STLCX stringify_in_c(stwcx.)
39 #define PPC_CNTLZL stringify_in_c(cntlzw)
41 #endif
43 #ifdef __KERNEL__
44 #ifdef CONFIG_IBM405_ERR77
45 /* Erratum #77 on the 405 means we need a sync or dcbt before every
46 * stwcx. The old ATOMIC_SYNC_FIX covered some but not all of this.
48 #define PPC405_ERR77(ra,rb) stringify_in_c(dcbt ra, rb;)
49 #define PPC405_ERR77_SYNC stringify_in_c(sync;)
50 #else
51 #define PPC405_ERR77(ra,rb)
52 #define PPC405_ERR77_SYNC
53 #endif
54 #endif
56 #endif /* _ASM_POWERPC_ASM_COMPAT_H */