summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-12-09 16:27:17 +1100
committerDamien George <damien.p.george@gmail.com>2016-12-09 16:51:49 +1100
commit81316fa41195e648c32ac0bc6859d4527b5ee9f1 (patch)
tree1b726cce62c5fbab235624e5df1094dde98605d2
parentc8746e1e7243f27f2824a67c2ac9921839784857 (diff)
downloadmicropython-81316fa41195e648c32ac0bc6859d4527b5ee9f1.tar.gz
micropython-81316fa41195e648c32ac0bc6859d4527b5ee9f1.zip
py/asmbase: Add MP_PLAT_COMMIT_EXEC option for handling exec code.
If a port defines MP_PLAT_COMMIT_EXEC then this function is used to turn RAM data into executable code. For example a port may want to write the data to flash for execution. The function must return a pointer to the executable data.
-rw-r--r--py/asmbase.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/asmbase.h b/py/asmbase.h
index bfc8ac7ff2..06fdd4b909 100644
--- a/py/asmbase.h
+++ b/py/asmbase.h
@@ -62,7 +62,11 @@ static inline size_t mp_asm_base_get_code_size(mp_asm_base_t *as) {
}
static inline void *mp_asm_base_get_code(mp_asm_base_t *as) {
+ #if defined(MP_PLAT_COMMIT_EXEC)
+ return MP_PLAT_COMMIT_EXEC(as->code_base, as->code_size);
+ #else
return as->code_base;
+ #endif
}
#endif // MICROPY_INCLUDED_PY_ASMBASE_H