Add a reference for Linux ARM ABI.
The Android NDK docs link to a ARM GNU/Linux Application Binary Interface Supplement document. Also fix a type in trampoline-armv4.pl. The generic ARM document is usually shortened AAPCS, not APCS. I couldn't find a corresponding link for aarch64. Change-Id: I6e5543f5c9e26955cd3945e9e7a5dcff27c2bd78 Reviewed-on: https://boringssl-review.googlesource.com/c/35064 Commit-Queue: David Benjamin <davidben@google.com> Commit-Queue: Adam Langley <agl@google.com> Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
parent
a57435e138
commit
1e0262ad87
@ -109,14 +109,12 @@ struct alignas(16) Reg128 {
|
||||
// References:
|
||||
// AAPCS: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042f/IHI0042F_aapcs.pdf
|
||||
// iOS32: https://developer.apple.com/library/archive/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARMv6FunctionCallingConventions.html
|
||||
// Linux: http://sourcery.mentor.com/sgpp/lite/arm/portal/kbattach142/arm_gnu_linux_%20abi.pdf
|
||||
//
|
||||
// ARM specifies a common calling convention, except r9 is left to the
|
||||
// platform. Linux and iOS differ in handling of r9. iOS's behavior is defined
|
||||
// below. We found no clear reference for Linux but observed behavior from
|
||||
// LLVM. iOS 3+ treats r9 as caller-saved, while Linux treats it as
|
||||
// callee-saved. Most of our assembly treats it as callee-saved to be uniform,
|
||||
// but we match the platform to avoid false positives when testing
|
||||
// compiler-generated output.
|
||||
// ARM specifies a common calling convention, except r9 is left to the platform.
|
||||
// Linux treats r9 as callee-saved, while iOS 3+ treats it as caller-saved. Most
|
||||
// of our assembly treats it as callee-saved to be uniform, but we match the
|
||||
// platform to avoid false positives when testing compiler-generated output.
|
||||
#define LOOP_CALLER_STATE_REGISTERS_PRE_R9() \
|
||||
CALLER_STATE_REGISTER(uint64_t, d8) \
|
||||
CALLER_STATE_REGISTER(uint64_t, d9) \
|
||||
|
@ -27,6 +27,7 @@
|
||||
# AAPCS: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042f/IHI0042F_aapcs.pdf
|
||||
# iOS ARMv6: https://developer.apple.com/library/archive/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARMv6FunctionCallingConventions.html
|
||||
# iOS ARMv7: https://developer.apple.com/library/archive/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARMv7FunctionCallingConventions.html
|
||||
# Linux: http://sourcery.mentor.com/sgpp/lite/arm/portal/kbattach142/arm_gnu_linux_%20abi.pdf
|
||||
|
||||
use strict;
|
||||
|
||||
@ -70,10 +71,10 @@ abi_test_trampoline:
|
||||
stmdb sp!, {r0-r11,lr}
|
||||
|
||||
@ Reserve stack space for six (10-4) stack parameters, plus an extra 4
|
||||
@ bytes to keep it 8-byte-aligned (see APCS, section 5.3).
|
||||
@ bytes to keep it 8-byte-aligned (see AAPCS, section 5.3).
|
||||
sub sp, sp, #28
|
||||
|
||||
@ Every register in APCS is either non-volatile or a parameter (except
|
||||
@ Every register in AAPCS is either non-volatile or a parameter (except
|
||||
@ r9 on iOS), so this code, by the actual call, loses all its scratch
|
||||
@ registers. First fill in stack parameters while there are registers
|
||||
@ to spare.
|
||||
|
Loading…
Reference in New Issue
Block a user