Mercurial > pub > dyncall > dyncall
diff dyncall/dyncall_call_arm32_thumb_gas.s @ 175:00dd15cc5c87
- fixed ARM32-THUMB stack alignment issues (found on Cortex-m0, thanks Darren Whobrey!)
author | cslag |
---|---|
date | Thu, 09 Feb 2017 15:44:14 +0100 |
parents | 523c45dfa8fb |
children | 351bb41d3bb1 |
line wrap: on
line diff
--- a/dyncall/dyncall_call_arm32_thumb_gas.s Wed Feb 08 12:56:59 2017 +0100 +++ b/dyncall/dyncall_call_arm32_thumb_gas.s Thu Feb 09 15:44:14 2017 +0100 @@ -36,17 +36,13 @@ dcCall_arm32_thumb: /* Prolog. This function never needs to spill inside its prolog, so just store the permanent registers. */ - push {%r4-%r7, %r14} /* Frame ptr, permanent registers, link register -> save area on stack. */ + /* Code below is not using high registers, so not storing them in prolog, which is more involved with thumb, anyways. */ + push {%r4-%r7, %r14} /* Frame ptr, permanent registers, link register -> save area on stack. */ mov %r7, %r13 /* Set frame ptr. */ + sub %r13, #4 /* Realign stack to 8 bytes (b/c we stored 5 regs = 20b). */ /* Call. */ mov %r4, %r0 /* Move 'fptr' to r4 (1st argument is passed in r0). */ - - /* Disable 'thumb' address forcing... */ - - /* mov %r0, #1 */ /* Assure that LSB is set to 1 (THUMB call). - Not Required and not useful for interworking calls */ - /* orr %r4, %r0 */ - mov %r5, %r1 /* Move 'args' to r5 (2nd argument is passed in r1). */ mov %r6, %r2 /* Move 'size' to r6 (3rd argument is passed in r2). */