From: Mikhail Kurinnoi Date: Wed, 22 Jul 2020 14:35:40 +0000 (+0300) Subject: Fix SIGBUS in EnterNaked3() X-Git-Tag: submit/tizen/20200821.032349^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9c5c61e627e9e9be54119fe0dda0860fccf9f49c;p=sdk%2Ftools%2Fcoreprofiler.git Fix SIGBUS in EnterNaked3() SP must be 16-byte aligned all the time. --- diff --git a/src/arch/arm64/asmhelpers.S b/src/arch/arm64/asmhelpers.S index d91a85f..605557a 100644 --- a/src/arch/arm64/asmhelpers.S +++ b/src/arch/arm64/asmhelpers.S @@ -11,35 +11,15 @@ // Values of other volatile registers are not preserved. .macro PUSH_REGS - stp fp, lr, [sp, #-16]! - - stp x0, x1, [sp, #-16]! - stp x2, x3, [sp, #-16]! - stp x4, x5, [sp, #-16]! - stp x6, x7, [sp, #-16]! - str x8, [sp, #-8]! - sub sp, sp, #8 - - stp q0, q1, [sp, #-32]! - stp q2, q3, [sp, #-32]! - stp q4, q5, [sp, #-32]! - stp q6, q7, [sp, #-32]! + PROLOG_SAVE_REG_PAIR_INDEXED fp, lr, -224 // Allocate space and save Fp, Pc. + SAVE_ARGUMENT_REGISTERS sp, 16 // Save x8 and argument registers (x0-x7). + SAVE_FLOAT_ARGUMENT_REGISTERS sp, 96 // Save floating-point/SIMD registers (q0-q7). .endm .macro POP_REGS - ldp q6, q7, [sp], #32 - ldp q4, q5, [sp], #32 - ldp q2, q3, [sp], #32 - ldp q0, q1, [sp], #32 - - add sp, sp, #8 - ldr x8, [sp], #8 - ldp x6, x7, [sp], #16 - ldp x4, x5, [sp], #16 - ldp x2, x3, [sp], #16 - ldp x0, x1, [sp], #16 - - ldp fp, lr, [sp], #16 + RESTORE_ARGUMENT_REGISTERS sp, 16 // Restore x8 and argument registers (x0-x7). + RESTORE_FLOAT_ARGUMENT_REGISTERS sp, 96 // Restore floating-point/SIMD registers. + EPILOG_RESTORE_REG_PAIR_INDEXED fp, lr, 224 .endm //