Skip to content
Snippets Groups Projects
Commit fd49ff99 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

py/nlrx86: Add workaround for Zephyr.

Actually, this removes -fno-omit-frame-pointer workaround for Zephyr.
parent 830ce74f
Branches
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "py/mpconfig.h"
#include "py/mpstate.h" #include "py/mpstate.h"
#include "py/nlr.h" #include "py/nlr.h"
...@@ -46,7 +47,14 @@ unsigned int nlr_push(nlr_buf_t *nlr) { ...@@ -46,7 +47,14 @@ unsigned int nlr_push(nlr_buf_t *nlr) {
(void)nlr; (void)nlr;
__asm volatile ( __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
"pop %ebp \n" // undo function's prelude "pop %ebp \n" // undo function's prelude
#endif
"mov 4(%esp), %edx \n" // load nlr_buf "mov 4(%esp), %edx \n" // load nlr_buf
"mov (%esp), %eax \n" // load return %eip "mov (%esp), %eax \n" // load return %eip
"mov %eax, 8(%edx) \n" // store %eip into nlr_buf "mov %eax, 8(%edx) \n" // store %eip into nlr_buf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment