Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Common header file for blackfin family of processors. |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | #ifndef _BLACKFIN_H_ |
| 7 | #define _BLACKFIN_H_ |
| 8 | |
| 9 | #include <asm/macros.h> |
| 10 | #include <asm/mach/blackfin.h> |
| 11 | #include <asm/bfin-global.h> |
| 12 | |
| 13 | #ifndef __ASSEMBLY__ |
| 14 | |
| 15 | /* SSYNC implementation for C file */ |
| 16 | #if defined(ANOMALY_05000312) && defined(ANOMALY_05000244) |
| 17 | static inline void SSYNC (void) |
| 18 | { |
| 19 | int _tmp; |
| 20 | __asm__ __volatile__ ("cli %0;\n\t" |
| 21 | "nop;nop;\n\t" |
| 22 | "ssync;\n\t" |
| 23 | "sti %0;\n\t" |
| 24 | :"=d"(_tmp):); |
| 25 | } |
| 26 | #elif defined(ANOMALY_05000312) && !defined(ANOMALY_05000244) |
| 27 | static inline void SSYNC (void) |
| 28 | { |
| 29 | int _tmp; |
| 30 | __asm__ __volatile__ ("cli %0;\n\t" |
| 31 | "ssync;\n\t" |
| 32 | "sti %0;\n\t" |
| 33 | :"=d"(_tmp):); |
| 34 | } |
| 35 | #elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244) |
| 36 | static inline void SSYNC (void) |
| 37 | { |
| 38 | __builtin_bfin_ssync(); |
| 39 | } |
| 40 | #elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244) |
| 41 | static inline void SSYNC (void) |
| 42 | { |
| 43 | __asm__ __volatile__ ("ssync;\n\t"); |
| 44 | } |
| 45 | #endif |
| 46 | |
| 47 | /* CSYNC implementation for C file */ |
| 48 | #if defined(ANOMALY_05000312) && defined(ANOMALY_05000244) |
| 49 | static inline void CSYNC (void) |
| 50 | { |
| 51 | int _tmp; |
| 52 | __asm__ __volatile__ ("cli %0;\n\t" |
| 53 | "nop;nop;\n\t" |
| 54 | "csync;\n\t" |
| 55 | "sti %0;\n\t" |
| 56 | :"=d"(_tmp):); |
| 57 | } |
| 58 | #elif defined(ANOMALY_05000312) && !defined(ANOMALY_05000244) |
| 59 | static inline void CSYNC (void) |
| 60 | { |
| 61 | int _tmp; |
| 62 | __asm__ __volatile__ ("cli %0;\n\t" |
| 63 | "csync;\n\t" |
| 64 | "sti %0;\n\t" |
| 65 | :"=d"(_tmp):); |
| 66 | } |
| 67 | #elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244) |
| 68 | static inline void CSYNC (void) |
| 69 | { |
| 70 | __builtin_bfin_csync(); |
| 71 | } |
| 72 | #elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244) |
| 73 | static inline void CSYNC (void) |
| 74 | { |
| 75 | __asm__ __volatile__ ("csync;\n\t"); |
| 76 | } |
| 77 | #endif |
| 78 | |
| 79 | #endif /* __ASSEMBLY__ */ |
| 80 | |
| 81 | #endif /* _BLACKFIN_H_ */ |