Skip to content
Snippets Groups Projects
Commit f9ecaa13 authored by Damien George's avatar Damien George
Browse files

py/asmthumb: Use existing macro to properly clear the D-cache.

This macro is provided by stmhal/mphalport.h and makes sure the addr and
size arguments are correctly aligned.
parent 64a3c52f
Branches
Tags
No related merge requests found
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
// wrapper around everything in this file // wrapper around everything in this file
#if MICROPY_EMIT_THUMB || MICROPY_EMIT_INLINE_THUMB #if MICROPY_EMIT_THUMB || MICROPY_EMIT_INLINE_THUMB
#include "py/mphal.h"
#include "py/asmthumb.h" #include "py/asmthumb.h"
#define UNSIGNED_FIT8(x) (((x) & 0xffffff00) == 0) #define UNSIGNED_FIT8(x) (((x) & 0xffffff00) == 0)
...@@ -53,7 +54,7 @@ void asm_thumb_end_pass(asm_thumb_t *as) { ...@@ -53,7 +54,7 @@ void asm_thumb_end_pass(asm_thumb_t *as) {
#if defined(MCU_SERIES_F7) #if defined(MCU_SERIES_F7)
if (as->base.pass == MP_ASM_PASS_EMIT) { if (as->base.pass == MP_ASM_PASS_EMIT) {
// flush D-cache, so the code emitted is stored in memory // flush D-cache, so the code emitted is stored in memory
SCB_CleanDCache_by_Addr((uint32_t*)as->base.code_base, as->base.code_size); MP_HAL_CLEAN_DCACHE(as->base.code_base, as->base.code_size);
// invalidate I-cache // invalidate I-cache
SCB_InvalidateICache(); SCB_InvalidateICache();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment