aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-blackfin/blackfin.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-blackfin/blackfin.h')
-rw-r--r--include/asm-blackfin/blackfin.h112
1 files changed, 45 insertions, 67 deletions
diff --git a/include/asm-blackfin/blackfin.h b/include/asm-blackfin/blackfin.h
index 25b934b7f829..984b74f0a2ec 100644
--- a/include/asm-blackfin/blackfin.h
+++ b/include/asm-blackfin/blackfin.h
@@ -11,78 +11,57 @@
11#define HI(con32) (((con32) >> 16) & 0xFFFF) 11#define HI(con32) (((con32) >> 16) & 0xFFFF)
12#define hi(con32) (((con32) >> 16) & 0xFFFF) 12#define hi(con32) (((con32) >> 16) & 0xFFFF)
13 13
14#include <asm/mach/blackfin.h> 14#include <asm/mach/anomaly.h>
15#include <asm/bfin-global.h>
16 15
17#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
18 17
19/* SSYNC implementation for C file */ 18/* SSYNC implementation for C file */
20#if defined(ANOMALY_05000312) && defined(ANOMALY_05000244) 19static inline void SSYNC(void)
21static inline void SSYNC (void)
22{
23 int _tmp;
24 __asm__ __volatile__ ("cli %0;\n\t"
25 "nop;nop;\n\t"
26 "ssync;\n\t"
27 "sti %0;\n\t"
28 :"=d"(_tmp):);
29}
30#elif defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
31static inline void SSYNC (void)
32{ 20{
33 int _tmp; 21 int _tmp;
34 __asm__ __volatile__ ("cli %0;\n\t" 22 if (ANOMALY_05000312)
35 "ssync;\n\t" 23 __asm__ __volatile__(
36 "sti %0;\n\t" 24 "cli %0;"
37 :"=d"(_tmp):); 25 "nop;"
26 "nop;"
27 "ssync;"
28 "sti %0;"
29 : "=d" (_tmp)
30 );
31 else if (ANOMALY_05000244)
32 __asm__ __volatile__(
33 "nop;"
34 "nop;"
35 "nop;"
36 "ssync;"
37 );
38 else
39 __asm__ __volatile__("ssync;");
38} 40}
39#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
40static inline void SSYNC (void)
41{
42 __asm__ __volatile__ ("nop; nop; nop;\n\t"
43 "ssync;\n\t"
44 ::);
45}
46#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
47static inline void SSYNC (void)
48{
49 __asm__ __volatile__ ("ssync;\n\t");
50}
51#endif
52 41
53/* CSYNC implementation for C file */ 42/* CSYNC implementation for C file */
54#if defined(ANOMALY_05000312) && defined(ANOMALY_05000244) 43static inline void CSYNC(void)
55static inline void CSYNC (void)
56{
57 int _tmp;
58 __asm__ __volatile__ ("cli %0;\n\t"
59 "nop;nop;\n\t"
60 "csync;\n\t"
61 "sti %0;\n\t"
62 :"=d"(_tmp):);
63}
64#elif defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
65static inline void CSYNC (void)
66{ 44{
67 int _tmp; 45 int _tmp;
68 __asm__ __volatile__ ("cli %0;\n\t" 46 if (ANOMALY_05000312)
69 "csync;\n\t" 47 __asm__ __volatile__(
70 "sti %0;\n\t" 48 "cli %0;"
71 :"=d"(_tmp):); 49 "nop;"
72} 50 "nop;"
73#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244) 51 "csync;"
74static inline void CSYNC (void) 52 "sti %0;"
75{ 53 : "=d" (_tmp)
76 __asm__ __volatile__ ("nop; nop; nop;\n\t" 54 );
77 "ssync;\n\t" 55 else if (ANOMALY_05000244)
78 ::); 56 __asm__ __volatile__(
57 "nop;"
58 "nop;"
59 "nop;"
60 "csync;"
61 );
62 else
63 __asm__ __volatile__("csync;");
79} 64}
80#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
81static inline void CSYNC (void)
82{
83 __asm__ __volatile__ ("csync;\n\t");
84}
85#endif
86 65
87#else /* __ASSEMBLY__ */ 66#else /* __ASSEMBLY__ */
88 67
@@ -91,19 +70,15 @@ static inline void CSYNC (void)
91#define ssync(x) SSYNC(x) 70#define ssync(x) SSYNC(x)
92#define csync(x) CSYNC(x) 71#define csync(x) CSYNC(x)
93 72
94#if defined(ANOMALY_05000312) && defined(ANOMALY_05000244) 73#if ANOMALY_05000312
95#define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch; 74#define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;
96#define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch; 75#define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;
97 76
98#elif defined(ANOMALY_05000312) && !defined(ANOMALY_05000244) 77#elif ANOMALY_05000244
99#define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;
100#define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;
101
102#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
103#define SSYNC(scratch) nop; nop; nop; SSYNC; 78#define SSYNC(scratch) nop; nop; nop; SSYNC;
104#define CSYNC(scratch) nop; nop; nop; CSYNC; 79#define CSYNC(scratch) nop; nop; nop; CSYNC;
105 80
106#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244) 81#else
107#define SSYNC(scratch) SSYNC; 82#define SSYNC(scratch) SSYNC;
108#define CSYNC(scratch) CSYNC; 83#define CSYNC(scratch) CSYNC;
109 84
@@ -111,4 +86,7 @@ static inline void CSYNC (void)
111 86
112#endif /* __ASSEMBLY__ */ 87#endif /* __ASSEMBLY__ */
113 88
89#include <asm/mach/blackfin.h>
90#include <asm/bfin-global.h>
91
114#endif /* _BLACKFIN_H_ */ 92#endif /* _BLACKFIN_H_ */