summaryrefslogtreecommitdiff
path: root/py/nlr.h
diff options
context:
space:
mode:
authorJan Willeke <willeke@smartmote.de>2022-01-07 21:57:20 +0100
committerDamien George <damien@micropython.org>2022-11-15 17:09:49 +1100
commit40a3aa709c874f1eb3cabd6d8a393ea8042d976c (patch)
treee77b62019c77b3a78daea34c7a600cb5d9b5bbe0 /py/nlr.h
parent043dc4dd0cc4679fca96a2d36f1bf7cf1656606f (diff)
py/nlrmips: Add native NLR support for MIPS architecture.
This can be tested using ports/minimal and qemu: make CC=mips-linux-gnu-gcc-8 Then run with qemu-mips: stty raw opost -echo; QEMU_LD_PREFIX=/usr/mips-linux-gnu/ qemu-mips build/firmware.elf; sleep 1; reset Signed-off-by: Jan Willeke <willeke@smartmote.de>
Diffstat (limited to 'py/nlr.h')
-rw-r--r--py/nlr.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/nlr.h b/py/nlr.h
index dade10771..338a67570 100644
--- a/py/nlr.h
+++ b/py/nlr.h
@@ -40,6 +40,7 @@
#define MICROPY_NLR_NUM_REGS_ARM_THUMB (10)
#define MICROPY_NLR_NUM_REGS_ARM_THUMB_FP (10 + 6)
#define MICROPY_NLR_NUM_REGS_AARCH64 (13)
+#define MICROPY_NLR_NUM_REGS_MIPS (13)
#define MICROPY_NLR_NUM_REGS_XTENSA (10)
#define MICROPY_NLR_NUM_REGS_XTENSAWIN (17)
@@ -83,6 +84,9 @@
#define MICROPY_NLR_POWERPC (1)
// this could be less but using 128 for safety
#define MICROPY_NLR_NUM_REGS (128)
+#elif defined(__mips__)
+ #define MICROPY_NLR_MIPS (1)
+ #define MICROPY_NLR_NUM_REGS (MICROPY_NLR_NUM_REGS_MIPS)
#else
#define MICROPY_NLR_SETJMP (1)
//#warning "No native NLR support for this arch, using setjmp implementation"