cache.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-01-29 lizhirui first version
  9. */
  10. #include <rthw.h>
  11. #include <rtdef.h>
  12. #include <board.h>
  13. #include <riscv.h>
  14. rt_inline rt_uint32_t rt_cpu_icache_line_size()
  15. {
  16. return 0;
  17. }
  18. rt_inline rt_uint32_t rt_cpu_dcache_line_size()
  19. {
  20. return 0;
  21. }
  22. void rt_hw_cpu_icache_invalidate(void *addr,int size)
  23. {
  24. }
  25. void rt_hw_cpu_dcache_invalidate(void *addr,int size)
  26. {
  27. }
  28. void rt_hw_cpu_dcache_clean(void *addr,int size)
  29. {
  30. }
  31. void rt_hw_cpu_icache_ops(int ops,void *addr,int size)
  32. {
  33. if(ops == RT_HW_CACHE_INVALIDATE)
  34. {
  35. rt_hw_cpu_icache_invalidate(addr,size);
  36. }
  37. }
  38. void rt_hw_cpu_dcache_ops(int ops,void *addr,int size)
  39. {
  40. if(ops == RT_HW_CACHE_FLUSH)
  41. {
  42. rt_hw_cpu_dcache_clean(addr,size);
  43. }
  44. else
  45. {
  46. rt_hw_cpu_dcache_invalidate(addr,size);
  47. }
  48. }
  49. void rt_hw_cpu_dcache_flush_all()
  50. {
  51. }
  52. void rt_hw_cpu_icache_invalidate_all()
  53. {
  54. }
  55. rt_base_t rt_hw_cpu_icache_status()
  56. {
  57. return 0;
  58. }
  59. rt_base_t rt_hw_cpu_dcache_status()
  60. {
  61. return 0;
  62. }
  63. int sys_cacheflush(void *addr, int size, int cache)
  64. {
  65. return 0;
  66. }