restructure nlr.h for udefined archtectures

This commit is contained in:
Jerry Needell 2019-10-14 07:02:32 -04:00
parent 1a53ced167
commit 051670038e

View File

@ -36,33 +36,38 @@
// If MICROPY_NLR_SETJMP is not enabled then auto-detect the machine arch // If MICROPY_NLR_SETJMP is not enabled then auto-detect the machine arch
#if !defined(MICROPY_NLR_SETJMP) || !MICROPY_NLR_SETJMP #if !defined(MICROPY_NLR_SETJMP) || !MICROPY_NLR_SETJMP
#define MICROPY_NLR_SETJMP (0)
// A lot of nlr-related things need different treatment on Windows // A lot of nlr-related things need different treatment on Windows
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32) || defined(__CYGWIN__)
#define MICROPY_NLR_OS_WINDOWS 1 #define MICROPY_NLR_OS_WINDOWS 1
#else #else
#define MICROPY_NLR_OS_WINDOWS 0 #define MICROPY_NLR_OS_WINDOWS 0
#endif #endif
#if defined(__i386__) #if defined(__i386__)
#define MICROPY_NLR_X86 (1) #define MICROPY_NLR_X86 (1)
#define MICROPY_NLR_NUM_REGS (6) #define MICROPY_NLR_NUM_REGS (6)
#elif defined(__x86_64__) #elif defined(__x86_64__)
#define MICROPY_NLR_X64 (1) #define MICROPY_NLR_X64 (1)
#if MICROPY_NLR_OS_WINDOWS #if MICROPY_NLR_OS_WINDOWS
#define MICROPY_NLR_NUM_REGS (10) #define MICROPY_NLR_NUM_REGS (10)
#else #else
#define MICROPY_NLR_NUM_REGS (8) #define MICROPY_NLR_NUM_REGS (8)
#endif #endif
#elif defined(__thumb2__) || defined(__thumb__) || defined(__arm__) #elif defined(__thumb2__) || defined(__thumb__) || defined(__arm__)
#define MICROPY_NLR_THUMB (1) #define MICROPY_NLR_THUMB (1)
#define MICROPY_NLR_NUM_REGS (10) #define MICROPY_NLR_NUM_REGS (10)
#elif defined(__xtensa__) #elif defined(__xtensa__)
#define MICROPY_NLR_XTENSA (1) #define MICROPY_NLR_XTENSA (1)
#define MICROPY_NLR_NUM_REGS (10) #define MICROPY_NLR_NUM_REGS (10)
#else #else
#define MICROPY_NLR_SETJMP (1) #define MICROPY_NLR_SETJMP (1)
//#warning "No native NLR support for this arch, using setjmp implementation" //#warning "No native NLR support for this arch, using setjmp implementation"
#endif
#endif #endif
// If MICROPY_NLR_SETJMP is not defined above - define/disable it here
#if !defined(MICROPY_NLR_SETJMP)
#define MICROPY_NLR_SETJMP (0)
#endif #endif
#if MICROPY_NLR_SETJMP #if MICROPY_NLR_SETJMP