cache.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * include/asm-blackfin/cache.h
  3. */
  4. #ifndef __ARCH_BLACKFIN_CACHE_H
  5. #define __ARCH_BLACKFIN_CACHE_H
  6. /*
  7. * Bytes per L1 cache line
  8. * Blackfin loads 32 bytes for cache
  9. */
  10. #define L1_CACHE_SHIFT 5
  11. #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
  12. #define SMP_CACHE_BYTES L1_CACHE_BYTES
  13. #ifdef CONFIG_SMP
  14. #define __cacheline_aligned
  15. #else
  16. #define ____cacheline_aligned
  17. /*
  18. * Put cacheline_aliged data to L1 data memory
  19. */
  20. #ifdef CONFIG_CACHELINE_ALIGNED_L1
  21. #define __cacheline_aligned \
  22. __attribute__((__aligned__(L1_CACHE_BYTES), \
  23. __section__(".data_l1.cacheline_aligned")))
  24. #endif
  25. #endif
  26. /*
  27. * largest L1 which this arch supports
  28. */
  29. #define L1_CACHE_SHIFT_MAX 5
  30. #if defined(CONFIG_SMP) && \
  31. !defined(CONFIG_BFIN_CACHE_COHERENT) && \
  32. defined(CONFIG_BFIN_DCACHE)
  33. #define __ARCH_SYNC_CORE_DCACHE
  34. #ifndef __ASSEMBLY__
  35. asmlinkage void __raw_smp_mark_barrier_asm(void);
  36. asmlinkage void __raw_smp_check_barrier_asm(void);
  37. static inline void smp_mark_barrier(void)
  38. {
  39. __raw_smp_mark_barrier_asm();
  40. }
  41. static inline void smp_check_barrier(void)
  42. {
  43. __raw_smp_check_barrier_asm();
  44. }
  45. void resync_core_dcache(void);
  46. #endif
  47. #endif
  48. #endif