esp32: Enable native emitter.

pull/5082/head
Damien George 2019-09-10 13:47:44 +10:00
rodzic 9adedce42e
commit 917f027c0b
2 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -172,3 +172,13 @@ void nlr_jump_fail(void *val) {
void mbedtls_debug_set_threshold(int threshold) {
(void)threshold;
}
void *esp_native_code_commit(void *buf, size_t len) {
len = (len + 3) & ~3;
uint32_t *p = heap_caps_malloc(len, MALLOC_CAP_EXEC);
if (p == NULL) {
m_malloc_fail(len);
}
memcpy(p, buf, len);
return p;
}

Wyświetl plik

@ -20,6 +20,9 @@
// emitters
#define MICROPY_PERSISTENT_CODE_LOAD (1)
#define MICROPY_EMIT_XTENSAWIN (1)
void *esp_native_code_commit(void*, size_t);
#define MP_PLAT_COMMIT_EXEC(buf, len) esp_native_code_commit(buf, len)
// compiler configuration
#define MICROPY_COMP_MODULE_CONST (1)