diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-22 01:14:28 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-22 01:40:45 +0300 |
commit | a96cc824bdacb34ced0edef523181c215fba313b (patch) | |
tree | 8fc6088d486ce71fae5f9bd1bb05af77d5558edd /py | |
parent | 59c675a64c1d9757d50ad4627da67a6f996a99fb (diff) | |
download | micropython-a96cc824bdacb34ced0edef523181c215fba313b.tar.gz micropython-a96cc824bdacb34ced0edef523181c215fba313b.zip |
py: Support arm and thumb ARM ISAs, in addition to thumb2.
These changes were tested with QEMU, and by few people of real hardware.
Diffstat (limited to 'py')
-rw-r--r-- | py/nlr.h | 2 | ||||
-rw-r--r-- | py/nlrthumb.S | 12 |
2 files changed, 10 insertions, 4 deletions
@@ -45,7 +45,7 @@ struct _nlr_buf_t { #else void *regs[8]; #endif -#elif defined(__thumb2__) +#elif defined(__thumb2__) || defined(__thumb__) || defined(__arm__) void *regs[10]; #else #define MICROPY_NLR_SETJMP (1) diff --git a/py/nlrthumb.S b/py/nlrthumb.S index b306c01753..dabf57cf85 100644 --- a/py/nlrthumb.S +++ b/py/nlrthumb.S @@ -24,19 +24,21 @@ * THE SOFTWARE. */ -#if defined(__thumb2__) && !MICROPY_NLR_SETJMP -/* thumb callee save: bx, bp, sp, r12, r14, r14, r15 */ +#if !MICROPY_NLR_SETJMP && (defined(__thumb2__) || defined(__thumb__) || defined(__arm__)) +/* arm callee save: bx, bp, sp, r12, r14, r14, r15 */ .syntax unified /*.cpu cortex-m4*/ - .thumb + /*.thumb*/ .text .align 2 /* uint nlr_push(r0=nlr_buf_t *nlr) */ .global nlr_push +#if defined(__thumb2__) .thumb .thumb_func +#endif .type nlr_push, %function nlr_push: str lr, [r0, #8] @ store lr into nlr_buf @@ -64,8 +66,10 @@ nlr_push: @ void nlr_pop() .global nlr_pop +#if defined(__thumb2__) .thumb .thumb_func +#endif .type nlr_pop, %function nlr_pop: ldr r3, .L5 @ load addr of nlr_top @@ -80,8 +84,10 @@ nlr_pop: /* void nlr_jump(r0=uint val) */ .global nlr_jump +#if defined(__thumb2__) .thumb .thumb_func +#endif .type nlr_jump, %function nlr_jump: ldr r3, .L2 @ load addr of nlr_top |