cache.c 989 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #include <cache.h>
  15. rt_inline rt_uint32_t rt_cpu_icache_line_size()
  16. {
  17. return 0;
  18. }
  19. rt_inline rt_uint32_t rt_cpu_dcache_line_size()
  20. {
  21. return 0;
  22. }
  23. void rt_hw_cpu_icache_ops(int ops, void *addr, int size)
  24. {
  25. if (ops == RT_HW_CACHE_INVALIDATE)
  26. {
  27. rt_hw_cpu_icache_invalidate(addr, size);
  28. }
  29. }
  30. void rt_hw_cpu_dcache_ops(int ops, void *addr, int size)
  31. {
  32. if (ops == RT_HW_CACHE_FLUSH)
  33. {
  34. rt_hw_cpu_dcache_clean(addr, size);
  35. }
  36. else
  37. {
  38. rt_hw_cpu_dcache_invalidate(addr, size);
  39. }
  40. }
  41. rt_base_t rt_hw_cpu_icache_status_local()
  42. {
  43. return 0;
  44. }
  45. rt_base_t rt_hw_cpu_dcache_status()
  46. {
  47. return 0;
  48. }
  49. void rt_hw_sync_cache_local(void *addr, int size)
  50. {
  51. }