14template <
typename FunctionType>
20template <
typename FunctionType>
22 std::is_invocable_v<FunctionType, volatile void*, int32_t>;
29template <
typename FunctionType>
33 function(addr, dsize);
36template <
typename FunctionType>
37 requires(!DCacheFunctionAcceptsVoidPtr<FunctionType> &&
38 DCacheFunctionAcceptsVolatileVoidPtr<FunctionType>)
41 function(
reinterpret_cast<volatile void*
>(addr), dsize);
44template <
typename FunctionType>
45 requires(!DCacheFunctionAcceptsVoidPtr<FunctionType> &&
46 !DCacheFunctionAcceptsVolatileVoidPtr<FunctionType>)
49 function(
reinterpret_cast<uint32_t*
>(addr), dsize);
58#if defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)
59 auto* raw =
const_cast<void*
>(addr);
60 const auto dsize =
static_cast<int32_t
>(size);
74#if defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)
75 auto* raw =
const_cast<void*
>(addr);
76 const auto dsize =
static_cast<int32_t
>(size);
D-Cache API 可直接接受 void* / D-Cache API accepts void*
D-Cache API 可直接接受 volatile void* / D-Cache API accepts volatile void*
LibXR 命名空间 / LibXR namespace.
void STM32_InvalidateDCacheByAddr(const void *addr, size_t size)
失效指定内存范围覆盖的 D-Cache cache line Invalidates D-Cache lines covering the specified memory range
void STM32_CallDCacheByAddr(FunctionType function, void *addr, int32_t dsize)
按当前工具链接受的指针类型调用 CMSIS D-Cache 接口 Calls the CMSIS D-Cache helper with the pointer type accepted by the...
void STM32_CleanDCacheByAddr(const void *addr, size_t size)
清理指定内存范围覆盖的 D-Cache cache line Cleans D-Cache lines covering the specified memory range