Ensure we align the stack to 8 bytes in system calls.

This is not strictly required with the current ABI but will be when we
switch to the ARM EABI. The aapcs requires the stack to be 4 byte aligned
at all times and 8 byte aligned when calling a public subroutine where the
current ABI only requires sp to be a multiple of 4.
This commit is contained in:
Andrew Turner 2012-08-04 05:31:26 +00:00
parent 782b05f96b
commit bfba812656

View File

@ -80,7 +80,10 @@ ASENTRY_NP(swi_entry)
PUSHFRAME
mov r0, sp /* Pass the frame to any function */
mov r6, sp /* Backup the stack pointer */
bic sp, sp, #7 /* Align the stack pointer */
bl _C_LABEL(swi_handler) /* It's a SWI ! */
mov sp, r6 /* Restore the stack */
DO_AST
PULLFRAME