blackfin.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Common header file for blackfin family of processors.
  3. *
  4. */
  5. #ifndef _BLACKFIN_H_
  6. #define _BLACKFIN_H_
  7. #include <mach/anomaly.h>
  8. #ifndef __ASSEMBLY__
  9. /* SSYNC implementation for C file */
  10. static inline void SSYNC(void)
  11. {
  12. int _tmp;
  13. if (ANOMALY_05000312)
  14. __asm__ __volatile__(
  15. "cli %0;"
  16. "nop;"
  17. "nop;"
  18. "ssync;"
  19. "sti %0;"
  20. : "=d" (_tmp)
  21. );
  22. else if (ANOMALY_05000244)
  23. __asm__ __volatile__(
  24. "nop;"
  25. "nop;"
  26. "nop;"
  27. "ssync;"
  28. );
  29. else
  30. __asm__ __volatile__("ssync;");
  31. }
  32. /* CSYNC implementation for C file */
  33. static inline void CSYNC(void)
  34. {
  35. int _tmp;
  36. if (ANOMALY_05000312)
  37. __asm__ __volatile__(
  38. "cli %0;"
  39. "nop;"
  40. "nop;"
  41. "csync;"
  42. "sti %0;"
  43. : "=d" (_tmp)
  44. );
  45. else if (ANOMALY_05000244)
  46. __asm__ __volatile__(
  47. "nop;"
  48. "nop;"
  49. "nop;"
  50. "csync;"
  51. );
  52. else
  53. __asm__ __volatile__("csync;");
  54. }
  55. #else /* __ASSEMBLY__ */
  56. #define LO(con32) ((con32) & 0xFFFF)
  57. #define lo(con32) ((con32) & 0xFFFF)
  58. #define HI(con32) (((con32) >> 16) & 0xFFFF)
  59. #define hi(con32) (((con32) >> 16) & 0xFFFF)
  60. /* SSYNC & CSYNC implementations for assembly files */
  61. #define ssync(x) SSYNC(x)
  62. #define csync(x) CSYNC(x)
  63. #if ANOMALY_05000312
  64. #define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;
  65. #define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;
  66. #elif ANOMALY_05000244
  67. #define SSYNC(scratch) nop; nop; nop; SSYNC;
  68. #define CSYNC(scratch) nop; nop; nop; CSYNC;
  69. #else
  70. #define SSYNC(scratch) SSYNC;
  71. #define CSYNC(scratch) CSYNC;
  72. #endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */
  73. #endif /* __ASSEMBLY__ */
  74. #include <mach/blackfin.h>
  75. #include <asm/bfin-global.h>
  76. #endif /* _BLACKFIN_H_ */