We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 830ce74 commit fd49ff9Copy full SHA for fd49ff9
1 file changed
py/nlrx86.c
@@ -24,6 +24,7 @@
24
* THE SOFTWARE.
25
*/
26
27
+#include "py/mpconfig.h"
28
#include "py/mpstate.h"
29
#include "py/nlr.h"
30
@@ -46,7 +47,14 @@ unsigned int nlr_push(nlr_buf_t *nlr) {
46
47
(void)nlr;
48
49
__asm volatile (
50
+ // Check for Zephyr, which uses a different calling convention
51
+ // by default.
52
+ // TODO: Better check for Zephyr.
53
+ // TODE: Better support for various x86 calling conventions
54
+ // (unfortunately, __attribute__((naked)) is not supported on x86).
55
+ #ifndef CONFIG_SOC_IA32
56
"pop %ebp \n" // undo function's prelude
57
+ #endif
58
"mov 4(%esp), %edx \n" // load nlr_buf
59
"mov (%esp), %eax \n" // load return %eip
60
"mov %eax, 8(%edx) \n" // store %eip into nlr_buf
0 commit comments