cache.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright 2004-2009 Analog Devices Inc.
  3. *
  4. * Licensed under the GPL-2 or later.
  5. */
  6. #ifndef __ARCH_BLACKFIN_CACHE_H
  7. #define __ARCH_BLACKFIN_CACHE_H
  8. #include <linux/linkage.h> /* for asmlinkage */
  9. /*
  10. * Bytes per L1 cache line
  11. * Blackfin loads 32 bytes for cache
  12. */
  13. #define L1_CACHE_SHIFT 5
  14. #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
  15. #define SMP_CACHE_BYTES L1_CACHE_BYTES
  16. #define ARCH_DMA_MINALIGN L1_CACHE_BYTES
  17. #ifdef CONFIG_SMP
  18. #define __cacheline_aligned
  19. #else
  20. #define ____cacheline_aligned
  21. /*
  22. * Put cacheline_aliged data to L1 data memory
  23. */
  24. #ifdef CONFIG_CACHELINE_ALIGNED_L1
  25. #define __cacheline_aligned \
  26. __attribute__((__aligned__(L1_CACHE_BYTES), \
  27. __section__(".data_l1.cacheline_aligned")))
  28. #endif
  29. #endif
  30. /*
  31. * largest L1 which this arch supports
  32. */
  33. #define L1_CACHE_SHIFT_MAX 5
  34. #if defined(CONFIG_SMP) && \
  35. !defined(CONFIG_BFIN_CACHE_COHERENT)
  36. # if defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) || defined(CONFIG_BFIN_L2_ICACHEABLE)
  37. # define __ARCH_SYNC_CORE_ICACHE
  38. # endif
  39. # if defined(CONFIG_BFIN_EXTMEM_DCACHEABLE) || defined(CONFIG_BFIN_L2_DCACHEABLE)
  40. # define __ARCH_SYNC_CORE_DCACHE
  41. # endif
  42. #ifndef __ASSEMBLY__
  43. asmlinkage void __raw_smp_mark_barrier_asm(void);
  44. asmlinkage void __raw_smp_check_barrier_asm(void);
  45. static inline void smp_mark_barrier(void)
  46. {
  47. __raw_smp_mark_barrier_asm();
  48. }
  49. static inline void smp_check_barrier(void)
  50. {
  51. __raw_smp_check_barrier_asm();
  52. }
  53. void resync_core_dcache(void);
  54. void resync_core_icache(void);
  55. #endif
  56. #endif
  57. #endif