cacheops.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Cache operations for the cache instruction.
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * (C) Copyright 1996, 97, 99, 2002, 03 Ralf Baechle
  9. * (C) Copyright 1999 Silicon Graphics, Inc.
  10. */
  11. #ifndef __ASM_CACHEOPS_H
  12. #define __ASM_CACHEOPS_H
  13. /*
  14. * Most cache ops are split into a 2 bit field identifying the cache, and a 3
  15. * bit field identifying the cache operation.
  16. */
  17. #define CacheOp_Cache 0x03
  18. #define CacheOp_Op 0x1c
  19. #define Cache_I 0x00
  20. #define Cache_D 0x01
  21. #define Cache_T 0x02
  22. #define Cache_V 0x02 /* Loongson-3 */
  23. #define Cache_S 0x03
  24. #define Index_Writeback_Inv 0x00
  25. #define Index_Load_Tag 0x04
  26. #define Index_Store_Tag 0x08
  27. #define Hit_Invalidate 0x10
  28. #define Hit_Writeback_Inv 0x14 /* not with Cache_I though */
  29. #define Hit_Writeback 0x18
  30. /*
  31. * Cache Operations available on all MIPS processors with R4000-style caches
  32. */
  33. #define Index_Invalidate_I (Cache_I | Index_Writeback_Inv)
  34. #define Index_Writeback_Inv_D (Cache_D | Index_Writeback_Inv)
  35. #define Index_Load_Tag_I (Cache_I | Index_Load_Tag)
  36. #define Index_Load_Tag_D (Cache_D | Index_Load_Tag)
  37. #define Index_Store_Tag_I (Cache_I | Index_Store_Tag)
  38. #define Index_Store_Tag_D (Cache_D | Index_Store_Tag)
  39. #define Hit_Invalidate_I (Cache_I | Hit_Invalidate)
  40. #define Hit_Invalidate_D (Cache_D | Hit_Invalidate)
  41. #define Hit_Writeback_Inv_D (Cache_D | Hit_Writeback_Inv)
  42. /*
  43. * R4000-specific cacheops
  44. */
  45. #define Create_Dirty_Excl_D (Cache_D | 0x0c)
  46. #define Fill (Cache_I | 0x14)
  47. #define Hit_Writeback_I (Cache_I | Hit_Writeback)
  48. #define Hit_Writeback_D (Cache_D | Hit_Writeback)
  49. /*
  50. * R4000SC and R4400SC-specific cacheops
  51. */
  52. #define Cache_SI 0x02
  53. #define Cache_SD 0x03
  54. #define Index_Invalidate_SI (Cache_SI | Index_Writeback_Inv)
  55. #define Index_Writeback_Inv_SD (Cache_SD | Index_Writeback_Inv)
  56. #define Index_Load_Tag_SI (Cache_SI | Index_Load_Tag)
  57. #define Index_Load_Tag_SD (Cache_SD | Index_Load_Tag)
  58. #define Index_Store_Tag_SI (Cache_SI | Index_Store_Tag)
  59. #define Index_Store_Tag_SD (Cache_SD | Index_Store_Tag)
  60. #define Create_Dirty_Excl_SD (Cache_SD | 0x0c)
  61. #define Hit_Invalidate_SI (Cache_SI | Hit_Invalidate)
  62. #define Hit_Invalidate_SD (Cache_SD | Hit_Invalidate)
  63. #define Hit_Writeback_Inv_SD (Cache_SD | Hit_Writeback_Inv)
  64. #define Hit_Writeback_SD (Cache_SD | Hit_Writeback)
  65. #define Hit_Set_Virtual_SI (Cache_SI | 0x1c)
  66. #define Hit_Set_Virtual_SD (Cache_SD | 0x1c)
  67. /*
  68. * R5000-specific cacheops
  69. */
  70. #define R5K_Page_Invalidate_S (Cache_S | 0x14)
  71. /*
  72. * RM7000-specific cacheops
  73. */
  74. #define Page_Invalidate_T (Cache_T | 0x14)
  75. #define Index_Store_Tag_T (Cache_T | Index_Store_Tag)
  76. #define Index_Load_Tag_T (Cache_T | Index_Load_Tag)
  77. /*
  78. * R10000-specific cacheops
  79. *
  80. * Cacheops 0x02, 0x06, 0x0a, 0x0c-0x0e, 0x16, 0x1a and 0x1e are unused.
  81. * Most of the _S cacheops are identical to the R4000SC _SD cacheops.
  82. */
  83. #define Index_Writeback_Inv_S (Cache_S | Index_Writeback_Inv)
  84. #define Index_Load_Tag_S (Cache_S | Index_Load_Tag)
  85. #define Index_Store_Tag_S (Cache_S | Index_Store_Tag)
  86. #define Hit_Invalidate_S (Cache_S | Hit_Invalidate)
  87. #define Cache_Barrier 0x14
  88. #define Hit_Writeback_Inv_S (Cache_S | Hit_Writeback_Inv)
  89. #define Index_Load_Data_I (Cache_I | 0x18)
  90. #define Index_Load_Data_D (Cache_D | 0x18)
  91. #define Index_Load_Data_S (Cache_S | 0x18)
  92. #define Index_Store_Data_I (Cache_I | 0x1c)
  93. #define Index_Store_Data_D (Cache_D | 0x1c)
  94. #define Index_Store_Data_S (Cache_S | 0x1c)
  95. /*
  96. * Loongson2-specific cacheops
  97. */
  98. #define Hit_Invalidate_I_Loongson2 (Cache_I | 0x00)
  99. /*
  100. * Loongson3-specific cacheops
  101. */
  102. #define Index_Writeback_Inv_V (Cache_V | Index_Writeback_Inv)
  103. #endif /* __ASM_CACHEOPS_H */