File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 632
632
633
633
// D-cache clean/invalidate helpers
634
634
#if __DCACHE_PRESENT == 1
635
- #define MP_HAL_CLEANINVALIDATE_DCACHE ( addr , size ) \
636
- (SCB_CleanInvalidateDCache_by_Addr((uint32_t *)((uint32_t)addr & ~0x1f), \
637
- ((uint32_t)((uint8_t *)addr + size + 0x1f) & ~0x1f) - ((uint32_t)addr & ~0x1f)))
638
- #define MP_HAL_CLEAN_DCACHE (addr , size ) \
639
- (SCB_CleanDCache_by_Addr((uint32_t *)((uint32_t)addr & ~0x1f), \
640
- ((uint32_t)((uint8_t *) addr + size + 0x1f) & ~0x1f) - ((uint32_t)addr & ~0x1f) ))
635
+ // Note: The SCB_Clean<...> functions automatically align their arguments to cover full cache lines.
636
+ // CLEANINVALIDATE will write back (flush) any dirty lines in this region to RAM, then
637
+ // invalidate (evict) the whole region from the cache.
638
+ #define MP_HAL_CLEANINVALIDATE_DCACHE (addr , size ) SCB_CleanInvalidateDCache_by_Addr((volatile void *)(addr), (size))
639
+ // CLEAN will write back (flush) any dirty lines in this region to RAM.
640
+ #define MP_HAL_CLEAN_DCACHE ( addr , size ) SCB_CleanDCache_by_Addr((volatile void *)(addr), (size ))
641
641
#else
642
642
#define MP_HAL_CLEANINVALIDATE_DCACHE (addr , size )
643
643
#define MP_HAL_CLEAN_DCACHE (addr , size )
You can’t perform that action at this time.
0 commit comments