Skip to content
This repository was archived by the owner on Aug 2, 2020. It is now read-only.

Commit 99866a0

Browse files
committed
py/nlrx86: Better check for Zephyr (requires 1.7).
1 parent fa17eab commit 99866a0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

py/nlrx86.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ unsigned int nlr_push(nlr_buf_t *nlr) {
4949
__asm volatile (
5050
// Check for Zephyr, which uses a different calling convention
5151
// by default.
52-
// TODO: Better check for Zephyr.
5352
// TODE: Better support for various x86 calling conventions
5453
// (unfortunately, __attribute__((naked)) is not supported on x86).
55-
#ifndef CONFIG_SOC_IA32
54+
#ifndef __ZEPHYR__
5655
"pop %ebp \n" // undo function's prelude
5756
#endif
5857
"mov 4(%esp), %edx \n" // load nlr_buf

zephyr/mpconfigport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
// Include Zephyr's autoconf.h, which should be made first by Zephyr makefiles
2929
#include "autoconf.h"
30+
// Included here to get basic Zephyr environment (macros, etc.)
31+
#include <zephyr.h>
3032

3133
// Usually passed from Makefile
3234
#ifndef MICROPY_HEAP_SIZE

0 commit comments

Comments
 (0)