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. #define LO(con32) ((con32) & 0xFFFF)
  8. #define lo(con32) ((con32) & 0xFFFF)
  9. #define HI(con32) (((con32) >> 16) & 0xFFFF)
  10. #define hi(con32) (((con32) >> 16) & 0xFFFF)
  11. #include <mach/anomaly.h>
  12. #ifndef __ASSEMBLY__
  13. /* SSYNC implementation for C file */
  14. static inline void SSYNC(void)
  15. {
  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)
  25. );
  26. else if (ANOMALY_05000244)
  27. __asm__ __volatile__(
  28. "nop;"
  29. "nop;"
  30. "nop;"
  31. "ssync;"
  32. );
  33. else
  34. __asm__ __volatile__("ssync;");
  35. }
  36. /* CSYNC implementation for C file */
  37. static inline void CSYNC(void)
  38. {
  39. int _tmp;
  40. if (ANOMALY_05000312)
  41. __asm__ __volatile__(
  42. "cli %0;"
  43. "nop;"
  44. "nop;"
  45. "csync;"
  46. "sti %0;"
  47. : "=d" (_tmp)
  48. );
  49. else if (ANOMALY_05000244)
  50. __asm__ __volatile__(
  51. "nop;"
  52. "nop;"
  53. "nop;"
  54. "csync;"
  55. );
  56. else
  57. __asm__ __volatile__("csync;");
  58. }
  59. #else /* __ASSEMBLY__ */
  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_ */