blackfin.h 1.7 KB

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