diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-03-26 00:32:51 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-03-26 00:33:23 +0300 |
commit | 99866a00a0172f3aba1e49c9c15f0afcf166a3e8 (patch) | |
tree | 67386276af08083750eb5d0e5c6e7fb7a9eb18bc | |
parent | fa17eabce934212861b406f42c1bb34564848d84 (diff) | |
download | micropython-99866a00a0172f3aba1e49c9c15f0afcf166a3e8.tar.gz micropython-99866a00a0172f3aba1e49c9c15f0afcf166a3e8.zip |
py/nlrx86: Better check for Zephyr (requires 1.7).
-rw-r--r-- | py/nlrx86.c | 3 | ||||
-rw-r--r-- | zephyr/mpconfigport.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/py/nlrx86.c b/py/nlrx86.c index 07ba72628c..58aaa1a571 100644 --- a/py/nlrx86.c +++ b/py/nlrx86.c @@ -49,10 +49,9 @@ unsigned int nlr_push(nlr_buf_t *nlr) { __asm volatile ( // Check for Zephyr, which uses a different calling convention // by default. - // TODO: Better check for Zephyr. // TODE: Better support for various x86 calling conventions // (unfortunately, __attribute__((naked)) is not supported on x86). - #ifndef CONFIG_SOC_IA32 + #ifndef __ZEPHYR__ "pop %ebp \n" // undo function's prelude #endif "mov 4(%esp), %edx \n" // load nlr_buf diff --git a/zephyr/mpconfigport.h b/zephyr/mpconfigport.h index e1e85df9cd..ff8a593a49 100644 --- a/zephyr/mpconfigport.h +++ b/zephyr/mpconfigport.h @@ -27,6 +27,8 @@ // Include Zephyr's autoconf.h, which should be made first by Zephyr makefiles #include "autoconf.h" +// Included here to get basic Zephyr environment (macros, etc.) +#include <zephyr.h> // Usually passed from Makefile #ifndef MICROPY_HEAP_SIZE |