123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- /*
- * Copyright (c) 2020 Actions Technology Co., Ltd
- *
- * SPDX-License-Identifier: Apache-2.0
- */
- #ifndef ZEPHYR_FRAMEWORK_INCLUDE_MEMORY_MEM_CACHE_H_
- #define ZEPHYR_FRAMEWORK_INCLUDE_MEMORY_MEM_CACHE_H_
- #include <stdint.h>
- #include <stdbool.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- /**
- * @brief Invalidate memory dcache
- *
- * @note This function is asynchronous. Call mem_dcache_sync() to synchronize.
- *
- * @param addr memory base address
- * @param length memory length
- *
- * @retval N/A
- */
- void mem_dcache_invalidate(const void *addr, uint32_t length);
- /**
- * @brief Invalidate all memory dcache
- *
- * @note This function is asynchronous. Call mem_dcache_sync() to synchronize.
- *
- * @retval N/A
- */
- void mem_dcache_invalidate_all(void);
- /**
- * @brief Clean memory dcache
- *
- * @note This function is asynchronous. Call mem_dcache_sync() to synchronize.
- *
- * @param addr memory base address
- * @param length memory length
- *
- * @retval N/A
- */
- void mem_dcache_clean(const void *addr, uint32_t length);
- /**
- * @brief Clean all memory dcache
- *
- * @note This function is asynchronous. Call mem_dcache_sync() to synchronize.
- *
- * @retval N/A
- */
- void mem_dcache_clean_all(void);
- /**
- * @brief Flush (clean, then invalidate) memory dcache
- *
- * @note This function is asynchronous. Call mem_dcache_sync() to synchronize.
- *
- * @param addr memory base address
- * @param length memory length
- *
- * @retval N/A
- */
- void mem_dcache_flush(const void *addr, uint32_t length);
- /**
- * @brief Flush (clean, then invalidate) all memory dcache
- *
- * @note This function is asynchronous. Call mem_dcache_sync() to synchronize.
- *
- * @retval N/A
- */
- void mem_dcache_flush_all(void);
- /**
- * @brief Synchronize the dcache ops, that is, wait until all the dcache ops finished
- *
- * @retval N/A
- */
- void mem_dcache_sync(void);
- /**
- * @brief Synchronize the dcache ops, that is, wait until all the dcache ops finished
- *
- * @retval N/A
- */
- void * mem_addr_to_uncache(void * addr);
- /**
- * @brief Query whether any part of memory is cacheable
- *
- * @param addr memory base address
- * @param length memory length
- *
- * @retval query result
- */
- bool mem_is_cacheable(const void *addr);
- /**
- * @brief Clean the memory write buffer
- *
- * @retval N/A
- */
- void mem_writebuf_clean(const void *addr, uint32_t length);
- /**
- * @brief Clean all memory write buffer
- *
- * @param addr memory base address
- * @param length memory length
- *
- * @retval N/A
- */
- void mem_writebuf_clean_all(void);
- /**
- * @brief Query whether any part of memory is bufferable
- *
- * @param addr memory base address
- * @param length memory length
- *
- * @retval query result
- */
- bool mem_is_bufferable(const void *addr);
- #ifdef __cplusplus
- }
- #endif
- #endif /* ZEPHYR_FRAMEWORK_INCLUDE_MEMORY_MEM_CACHE_H_ */
|