aboutsummaryrefslogtreecommitdiff
path: root/py/nlrx86.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-02-27 15:36:53 +1100
committerDamien George <damien.p.george@gmail.com>2020-02-28 10:33:03 +1100
commit69661f3343bedf86e514337cff63d96cc42f8859 (patch)
treeaf5dfb380ffdb75dda84828f63cf9d840d992f0f /py/nlrx86.c
parent3f39d18c2b884d32f0443e2e8114ff9d7a14d718 (diff)
all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
Diffstat (limited to 'py/nlrx86.c')
-rw-r--r--py/nlrx86.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/py/nlrx86.c b/py/nlrx86.c
index 461b459e2..f658d4191 100644
--- a/py/nlrx86.c
+++ b/py/nlrx86.c
@@ -34,7 +34,7 @@
// ebx, esi, edi, ebp, esp, eip
#if MICROPY_NLR_OS_WINDOWS
-unsigned int nlr_push_tail(nlr_buf_t *nlr) asm("nlr_push_tail");
+unsigned int nlr_push_tail(nlr_buf_t *nlr) asm ("nlr_push_tail");
#else
__attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr);
#endif
@@ -59,19 +59,19 @@ unsigned int nlr_push(nlr_buf_t *nlr) {
(void)nlr;
__asm volatile (
- #if UNDO_PRELUDE
- "pop %ebp \n" // undo function's prelude
- #endif
- "mov 4(%esp), %edx \n" // load nlr_buf
- "mov (%esp), %eax \n" // load return %eip
- "mov %eax, 8(%edx) \n" // store %eip into nlr_buf
- "mov %ebp, 12(%edx) \n" // store %ebp into nlr_buf
- "mov %esp, 16(%edx) \n" // store %esp into nlr_buf
- "mov %ebx, 20(%edx) \n" // store %ebx into nlr_buf
- "mov %edi, 24(%edx) \n" // store %edi into nlr_buf
- "mov %esi, 28(%edx) \n" // store %esi into nlr_buf
- "jmp nlr_push_tail \n" // do the rest in C
- );
+ #if UNDO_PRELUDE
+ "pop %ebp \n" // undo function's prelude
+ #endif
+ "mov 4(%esp), %edx \n" // load nlr_buf
+ "mov (%esp), %eax \n" // load return %eip
+ "mov %eax, 8(%edx) \n" // store %eip into nlr_buf
+ "mov %ebp, 12(%edx) \n" // store %ebp into nlr_buf
+ "mov %esp, 16(%edx) \n" // store %esp into nlr_buf
+ "mov %ebx, 20(%edx) \n" // store %ebx into nlr_buf
+ "mov %edi, 24(%edx) \n" // store %edi into nlr_buf
+ "mov %esi, 28(%edx) \n" // store %esi into nlr_buf
+ "jmp nlr_push_tail \n" // do the rest in C
+ );
#if !USE_NAKED
return 0; // needed to silence compiler warning
@@ -82,21 +82,21 @@ NORETURN void nlr_jump(void *val) {
MP_NLR_JUMP_HEAD(val, top)
__asm volatile (
- "mov %0, %%edx \n" // %edx points to nlr_buf
- "mov 28(%%edx), %%esi \n" // load saved %esi
- "mov 24(%%edx), %%edi \n" // load saved %edi
- "mov 20(%%edx), %%ebx \n" // load saved %ebx
- "mov 16(%%edx), %%esp \n" // load saved %esp
- "mov 12(%%edx), %%ebp \n" // load saved %ebp
- "mov 8(%%edx), %%eax \n" // load saved %eip
- "mov %%eax, (%%esp) \n" // store saved %eip to stack
- "xor %%eax, %%eax \n" // clear return register
- "inc %%al \n" // increase to make 1, non-local return
- "ret \n" // return
- : // output operands
- : "r"(top) // input operands
- : // clobbered registers
- );
+ "mov %0, %%edx \n" // %edx points to nlr_buf
+ "mov 28(%%edx), %%esi \n" // load saved %esi
+ "mov 24(%%edx), %%edi \n" // load saved %edi
+ "mov 20(%%edx), %%ebx \n" // load saved %ebx
+ "mov 16(%%edx), %%esp \n" // load saved %esp
+ "mov 12(%%edx), %%ebp \n" // load saved %ebp
+ "mov 8(%%edx), %%eax \n" // load saved %eip
+ "mov %%eax, (%%esp) \n" // store saved %eip to stack
+ "xor %%eax, %%eax \n" // clear return register
+ "inc %%al \n" // increase to make 1, non-local return
+ "ret \n" // return
+ : // output operands
+ : "r" (top) // input operands
+ : // clobbered registers
+ );
MP_UNREACHABLE
}