esp_cache_esp32_private.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdlib.h>
  8. #include <stdint.h>
  9. #include "esp_err.h"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /**
  14. * @brief Private header for cache drivers, where cache functionality requires other components
  15. *
  16. * @note Now only esp32, can be applied to other similar chips
  17. */
  18. typedef struct cache_driver_s cache_driver_t;
  19. /**
  20. * @brief Cache driver
  21. */
  22. struct cache_driver_s {
  23. /**
  24. * @brief Cache flush
  25. *
  26. * @param[in] cpu_no CPU id
  27. */
  28. void (*cache_flush)(int cpu_no);
  29. /**
  30. * @brief Cache writeback to psram
  31. */
  32. void (*cache_writeback_psram)(void);
  33. };
  34. /**
  35. * @brief Register cache writeback
  36. *
  37. * @param[in] func Cache driver
  38. */
  39. void cache_register_writeback(cache_driver_t *func);
  40. /**
  41. * @brief Cache sync
  42. *
  43. * @note This API only do cache sync, but doesn't guarantee concurrent access to cache
  44. * @note Do not use in your application
  45. */
  46. void cache_sync(void);
  47. #ifdef __cplusplus
  48. }
  49. #endif