bcache.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (c) 1997, 1999 by Ralf Baechle
  7. * Copyright (c) 1999 Silicon Graphics, Inc.
  8. */
  9. #ifndef _ASM_BCACHE_H
  10. #define _ASM_BCACHE_H
  11. /* Some R4000 / R4400 / R4600 / R5000 machines may have a non-dma-coherent,
  12. chipset implemented caches. On machines with other CPUs the CPU does the
  13. cache thing itself. */
  14. struct bcache_ops {
  15. void (*bc_enable)(void);
  16. void (*bc_disable)(void);
  17. void (*bc_wback_inv)(unsigned long page, unsigned long size);
  18. void (*bc_inv)(unsigned long page, unsigned long size);
  19. };
  20. extern void indy_sc_init(void);
  21. extern void sni_pcimt_sc_init(void);
  22. #ifdef CONFIG_BOARD_SCACHE
  23. extern struct bcache_ops *bcops;
  24. static inline void bc_enable(void)
  25. {
  26. bcops->bc_enable();
  27. }
  28. static inline void bc_disable(void)
  29. {
  30. bcops->bc_disable();
  31. }
  32. static inline void bc_wback_inv(unsigned long page, unsigned long size)
  33. {
  34. bcops->bc_wback_inv(page, size);
  35. }
  36. static inline void bc_inv(unsigned long page, unsigned long size)
  37. {
  38. bcops->bc_inv(page, size);
  39. }
  40. #else /* !defined(CONFIG_BOARD_SCACHE) */
  41. /* Not R4000 / R4400 / R4600 / R5000. */
  42. #define bc_enable() do { } while (0)
  43. #define bc_disable() do { } while (0)
  44. #define bc_wback_inv(page, size) do { } while (0)
  45. #define bc_inv(page, size) do { } while (0)
  46. #endif /* !defined(CONFIG_BOARD_SCACHE) */
  47. #endif /* _ASM_BCACHE_H */