ping locking
[cor_2_6_31.git] / arch / blackfin / include / asm / blackfin.h
blob4d4439583396c5c263f88f577a0b6e14b22779c6
1 /*
2 * Common header file for blackfin family of processors.
4 */
6 #ifndef _BLACKFIN_H_
7 #define _BLACKFIN_H_
9 #include <mach/anomaly.h>
11 #ifndef __ASSEMBLY__
13 /* SSYNC implementation for C file */
14 static inline void SSYNC(void)
16 int _tmp;
17 if (ANOMALY_05000312)
18 __asm__ __volatile__(
19 "cli %0;"
20 "nop;"
21 "nop;"
22 "ssync;"
23 "sti %0;"
24 : "=d" (_tmp)
26 else if (ANOMALY_05000244)
27 __asm__ __volatile__(
28 "nop;"
29 "nop;"
30 "nop;"
31 "ssync;"
33 else
34 __asm__ __volatile__("ssync;");
37 /* CSYNC implementation for C file */
38 static inline void CSYNC(void)
40 int _tmp;
41 if (ANOMALY_05000312)
42 __asm__ __volatile__(
43 "cli %0;"
44 "nop;"
45 "nop;"
46 "csync;"
47 "sti %0;"
48 : "=d" (_tmp)
50 else if (ANOMALY_05000244)
51 __asm__ __volatile__(
52 "nop;"
53 "nop;"
54 "nop;"
55 "csync;"
57 else
58 __asm__ __volatile__("csync;");
61 #else /* __ASSEMBLY__ */
63 #define LO(con32) ((con32) & 0xFFFF)
64 #define lo(con32) ((con32) & 0xFFFF)
65 #define HI(con32) (((con32) >> 16) & 0xFFFF)
66 #define hi(con32) (((con32) >> 16) & 0xFFFF)
68 /* SSYNC & CSYNC implementations for assembly files */
70 #define ssync(x) SSYNC(x)
71 #define csync(x) CSYNC(x)
73 #if ANOMALY_05000312
74 #define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;
75 #define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;
77 #elif ANOMALY_05000244
78 #define SSYNC(scratch) nop; nop; nop; SSYNC;
79 #define CSYNC(scratch) nop; nop; nop; CSYNC;
81 #else
82 #define SSYNC(scratch) SSYNC;
83 #define CSYNC(scratch) CSYNC;
85 #endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */
87 #endif /* __ASSEMBLY__ */
89 #include <asm/mem_map.h>
90 #include <mach/blackfin.h>
91 #include <asm/bfin-global.h>
93 #endif /* _BLACKFIN_H_ */