123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758 |
- // This file is generated from a similarly-named Perl script in the BoringSSL
- // source tree. Do not edit by hand.
- #if !defined(__has_feature)
- #define __has_feature(x) 0
- #endif
- #if __has_feature(memory_sanitizer) && !defined(OPENSSL_NO_ASM)
- #define OPENSSL_NO_ASM
- #endif
- #if !defined(OPENSSL_NO_ASM)
- #if defined(BORINGSSL_PREFIX)
- #include <boringssl_prefix_symbols_asm.h>
- #endif
- #include <openssl/arm_arch.h>
- .text
- // abi_test_trampoline loads callee-saved registers from |state|, calls |func|
- // with |argv|, then saves the callee-saved registers into |state|. It returns
- // the result of |func|. The |unwind| argument is unused.
- // uint64_t abi_test_trampoline(void (*func)(...), CallerState *state,
- // const uint64_t *argv, size_t argc,
- // uint64_t unwind);
- .globl _abi_test_trampoline
- .private_extern _abi_test_trampoline
- .align 4
- _abi_test_trampoline:
- Labi_test_trampoline_begin:
- AARCH64_SIGN_LINK_REGISTER
- // Stack layout (low to high addresses)
- // x29,x30 (16 bytes)
- // d8-d15 (64 bytes)
- // x19-x28 (80 bytes)
- // x1 (8 bytes)
- // padding (8 bytes)
- stp x29, x30, [sp, #-176]!
- mov x29, sp
- // Saved callee-saved registers and |state|.
- stp d8, d9, [sp, #16]
- stp d10, d11, [sp, #32]
- stp d12, d13, [sp, #48]
- stp d14, d15, [sp, #64]
- stp x19, x20, [sp, #80]
- stp x21, x22, [sp, #96]
- stp x23, x24, [sp, #112]
- stp x25, x26, [sp, #128]
- stp x27, x28, [sp, #144]
- str x1, [sp, #160]
- // Load registers from |state|, with the exception of x29. x29 is the
- // frame pointer and also callee-saved, but AAPCS64 allows platforms to
- // mandate that x29 always point to a frame. iOS64 does so, which means
- // we cannot fill x29 with entropy without violating ABI rules
- // ourselves. x29 is tested separately below.
- ldp d8, d9, [x1], #16
- ldp d10, d11, [x1], #16
- ldp d12, d13, [x1], #16
- ldp d14, d15, [x1], #16
- ldp x19, x20, [x1], #16
- ldp x21, x22, [x1], #16
- ldp x23, x24, [x1], #16
- ldp x25, x26, [x1], #16
- ldp x27, x28, [x1], #16
- // Move parameters into temporary registers.
- mov x9, x0
- mov x10, x2
- mov x11, x3
- // Load parameters into registers.
- cbz x11, Largs_done
- ldr x0, [x10], #8
- subs x11, x11, #1
- b.eq Largs_done
- ldr x1, [x10], #8
- subs x11, x11, #1
- b.eq Largs_done
- ldr x2, [x10], #8
- subs x11, x11, #1
- b.eq Largs_done
- ldr x3, [x10], #8
- subs x11, x11, #1
- b.eq Largs_done
- ldr x4, [x10], #8
- subs x11, x11, #1
- b.eq Largs_done
- ldr x5, [x10], #8
- subs x11, x11, #1
- b.eq Largs_done
- ldr x6, [x10], #8
- subs x11, x11, #1
- b.eq Largs_done
- ldr x7, [x10], #8
- Largs_done:
- blr x9
- // Reload |state| and store registers.
- ldr x1, [sp, #160]
- stp d8, d9, [x1], #16
- stp d10, d11, [x1], #16
- stp d12, d13, [x1], #16
- stp d14, d15, [x1], #16
- stp x19, x20, [x1], #16
- stp x21, x22, [x1], #16
- stp x23, x24, [x1], #16
- stp x25, x26, [x1], #16
- stp x27, x28, [x1], #16
- // |func| is required to preserve x29, the frame pointer. We cannot load
- // random values into x29 (see comment above), so compare it against the
- // expected value and zero the field of |state| if corrupted.
- mov x9, sp
- cmp x29, x9
- b.eq Lx29_ok
- str xzr, [x1]
- Lx29_ok:
- // Restore callee-saved registers.
- ldp d8, d9, [sp, #16]
- ldp d10, d11, [sp, #32]
- ldp d12, d13, [sp, #48]
- ldp d14, d15, [sp, #64]
- ldp x19, x20, [sp, #80]
- ldp x21, x22, [sp, #96]
- ldp x23, x24, [sp, #112]
- ldp x25, x26, [sp, #128]
- ldp x27, x28, [sp, #144]
- ldp x29, x30, [sp], #176
- AARCH64_VALIDATE_LINK_REGISTER
- ret
- .globl _abi_test_clobber_x0
- .private_extern _abi_test_clobber_x0
- .align 4
- _abi_test_clobber_x0:
- AARCH64_VALID_CALL_TARGET
- mov x0, xzr
- ret
- .globl _abi_test_clobber_x1
- .private_extern _abi_test_clobber_x1
- .align 4
- _abi_test_clobber_x1:
- AARCH64_VALID_CALL_TARGET
- mov x1, xzr
- ret
- .globl _abi_test_clobber_x2
- .private_extern _abi_test_clobber_x2
- .align 4
- _abi_test_clobber_x2:
- AARCH64_VALID_CALL_TARGET
- mov x2, xzr
- ret
- .globl _abi_test_clobber_x3
- .private_extern _abi_test_clobber_x3
- .align 4
- _abi_test_clobber_x3:
- AARCH64_VALID_CALL_TARGET
- mov x3, xzr
- ret
- .globl _abi_test_clobber_x4
- .private_extern _abi_test_clobber_x4
- .align 4
- _abi_test_clobber_x4:
- AARCH64_VALID_CALL_TARGET
- mov x4, xzr
- ret
- .globl _abi_test_clobber_x5
- .private_extern _abi_test_clobber_x5
- .align 4
- _abi_test_clobber_x5:
- AARCH64_VALID_CALL_TARGET
- mov x5, xzr
- ret
- .globl _abi_test_clobber_x6
- .private_extern _abi_test_clobber_x6
- .align 4
- _abi_test_clobber_x6:
- AARCH64_VALID_CALL_TARGET
- mov x6, xzr
- ret
- .globl _abi_test_clobber_x7
- .private_extern _abi_test_clobber_x7
- .align 4
- _abi_test_clobber_x7:
- AARCH64_VALID_CALL_TARGET
- mov x7, xzr
- ret
- .globl _abi_test_clobber_x8
- .private_extern _abi_test_clobber_x8
- .align 4
- _abi_test_clobber_x8:
- AARCH64_VALID_CALL_TARGET
- mov x8, xzr
- ret
- .globl _abi_test_clobber_x9
- .private_extern _abi_test_clobber_x9
- .align 4
- _abi_test_clobber_x9:
- AARCH64_VALID_CALL_TARGET
- mov x9, xzr
- ret
- .globl _abi_test_clobber_x10
- .private_extern _abi_test_clobber_x10
- .align 4
- _abi_test_clobber_x10:
- AARCH64_VALID_CALL_TARGET
- mov x10, xzr
- ret
- .globl _abi_test_clobber_x11
- .private_extern _abi_test_clobber_x11
- .align 4
- _abi_test_clobber_x11:
- AARCH64_VALID_CALL_TARGET
- mov x11, xzr
- ret
- .globl _abi_test_clobber_x12
- .private_extern _abi_test_clobber_x12
- .align 4
- _abi_test_clobber_x12:
- AARCH64_VALID_CALL_TARGET
- mov x12, xzr
- ret
- .globl _abi_test_clobber_x13
- .private_extern _abi_test_clobber_x13
- .align 4
- _abi_test_clobber_x13:
- AARCH64_VALID_CALL_TARGET
- mov x13, xzr
- ret
- .globl _abi_test_clobber_x14
- .private_extern _abi_test_clobber_x14
- .align 4
- _abi_test_clobber_x14:
- AARCH64_VALID_CALL_TARGET
- mov x14, xzr
- ret
- .globl _abi_test_clobber_x15
- .private_extern _abi_test_clobber_x15
- .align 4
- _abi_test_clobber_x15:
- AARCH64_VALID_CALL_TARGET
- mov x15, xzr
- ret
- .globl _abi_test_clobber_x16
- .private_extern _abi_test_clobber_x16
- .align 4
- _abi_test_clobber_x16:
- AARCH64_VALID_CALL_TARGET
- mov x16, xzr
- ret
- .globl _abi_test_clobber_x17
- .private_extern _abi_test_clobber_x17
- .align 4
- _abi_test_clobber_x17:
- AARCH64_VALID_CALL_TARGET
- mov x17, xzr
- ret
- .globl _abi_test_clobber_x19
- .private_extern _abi_test_clobber_x19
- .align 4
- _abi_test_clobber_x19:
- AARCH64_VALID_CALL_TARGET
- mov x19, xzr
- ret
- .globl _abi_test_clobber_x20
- .private_extern _abi_test_clobber_x20
- .align 4
- _abi_test_clobber_x20:
- AARCH64_VALID_CALL_TARGET
- mov x20, xzr
- ret
- .globl _abi_test_clobber_x21
- .private_extern _abi_test_clobber_x21
- .align 4
- _abi_test_clobber_x21:
- AARCH64_VALID_CALL_TARGET
- mov x21, xzr
- ret
- .globl _abi_test_clobber_x22
- .private_extern _abi_test_clobber_x22
- .align 4
- _abi_test_clobber_x22:
- AARCH64_VALID_CALL_TARGET
- mov x22, xzr
- ret
- .globl _abi_test_clobber_x23
- .private_extern _abi_test_clobber_x23
- .align 4
- _abi_test_clobber_x23:
- AARCH64_VALID_CALL_TARGET
- mov x23, xzr
- ret
- .globl _abi_test_clobber_x24
- .private_extern _abi_test_clobber_x24
- .align 4
- _abi_test_clobber_x24:
- AARCH64_VALID_CALL_TARGET
- mov x24, xzr
- ret
- .globl _abi_test_clobber_x25
- .private_extern _abi_test_clobber_x25
- .align 4
- _abi_test_clobber_x25:
- AARCH64_VALID_CALL_TARGET
- mov x25, xzr
- ret
- .globl _abi_test_clobber_x26
- .private_extern _abi_test_clobber_x26
- .align 4
- _abi_test_clobber_x26:
- AARCH64_VALID_CALL_TARGET
- mov x26, xzr
- ret
- .globl _abi_test_clobber_x27
- .private_extern _abi_test_clobber_x27
- .align 4
- _abi_test_clobber_x27:
- AARCH64_VALID_CALL_TARGET
- mov x27, xzr
- ret
- .globl _abi_test_clobber_x28
- .private_extern _abi_test_clobber_x28
- .align 4
- _abi_test_clobber_x28:
- AARCH64_VALID_CALL_TARGET
- mov x28, xzr
- ret
- .globl _abi_test_clobber_x29
- .private_extern _abi_test_clobber_x29
- .align 4
- _abi_test_clobber_x29:
- AARCH64_VALID_CALL_TARGET
- mov x29, xzr
- ret
- .globl _abi_test_clobber_d0
- .private_extern _abi_test_clobber_d0
- .align 4
- _abi_test_clobber_d0:
- AARCH64_VALID_CALL_TARGET
- fmov d0, xzr
- ret
- .globl _abi_test_clobber_d1
- .private_extern _abi_test_clobber_d1
- .align 4
- _abi_test_clobber_d1:
- AARCH64_VALID_CALL_TARGET
- fmov d1, xzr
- ret
- .globl _abi_test_clobber_d2
- .private_extern _abi_test_clobber_d2
- .align 4
- _abi_test_clobber_d2:
- AARCH64_VALID_CALL_TARGET
- fmov d2, xzr
- ret
- .globl _abi_test_clobber_d3
- .private_extern _abi_test_clobber_d3
- .align 4
- _abi_test_clobber_d3:
- AARCH64_VALID_CALL_TARGET
- fmov d3, xzr
- ret
- .globl _abi_test_clobber_d4
- .private_extern _abi_test_clobber_d4
- .align 4
- _abi_test_clobber_d4:
- AARCH64_VALID_CALL_TARGET
- fmov d4, xzr
- ret
- .globl _abi_test_clobber_d5
- .private_extern _abi_test_clobber_d5
- .align 4
- _abi_test_clobber_d5:
- AARCH64_VALID_CALL_TARGET
- fmov d5, xzr
- ret
- .globl _abi_test_clobber_d6
- .private_extern _abi_test_clobber_d6
- .align 4
- _abi_test_clobber_d6:
- AARCH64_VALID_CALL_TARGET
- fmov d6, xzr
- ret
- .globl _abi_test_clobber_d7
- .private_extern _abi_test_clobber_d7
- .align 4
- _abi_test_clobber_d7:
- AARCH64_VALID_CALL_TARGET
- fmov d7, xzr
- ret
- .globl _abi_test_clobber_d8
- .private_extern _abi_test_clobber_d8
- .align 4
- _abi_test_clobber_d8:
- AARCH64_VALID_CALL_TARGET
- fmov d8, xzr
- ret
- .globl _abi_test_clobber_d9
- .private_extern _abi_test_clobber_d9
- .align 4
- _abi_test_clobber_d9:
- AARCH64_VALID_CALL_TARGET
- fmov d9, xzr
- ret
- .globl _abi_test_clobber_d10
- .private_extern _abi_test_clobber_d10
- .align 4
- _abi_test_clobber_d10:
- AARCH64_VALID_CALL_TARGET
- fmov d10, xzr
- ret
- .globl _abi_test_clobber_d11
- .private_extern _abi_test_clobber_d11
- .align 4
- _abi_test_clobber_d11:
- AARCH64_VALID_CALL_TARGET
- fmov d11, xzr
- ret
- .globl _abi_test_clobber_d12
- .private_extern _abi_test_clobber_d12
- .align 4
- _abi_test_clobber_d12:
- AARCH64_VALID_CALL_TARGET
- fmov d12, xzr
- ret
- .globl _abi_test_clobber_d13
- .private_extern _abi_test_clobber_d13
- .align 4
- _abi_test_clobber_d13:
- AARCH64_VALID_CALL_TARGET
- fmov d13, xzr
- ret
- .globl _abi_test_clobber_d14
- .private_extern _abi_test_clobber_d14
- .align 4
- _abi_test_clobber_d14:
- AARCH64_VALID_CALL_TARGET
- fmov d14, xzr
- ret
- .globl _abi_test_clobber_d15
- .private_extern _abi_test_clobber_d15
- .align 4
- _abi_test_clobber_d15:
- AARCH64_VALID_CALL_TARGET
- fmov d15, xzr
- ret
- .globl _abi_test_clobber_d16
- .private_extern _abi_test_clobber_d16
- .align 4
- _abi_test_clobber_d16:
- AARCH64_VALID_CALL_TARGET
- fmov d16, xzr
- ret
- .globl _abi_test_clobber_d17
- .private_extern _abi_test_clobber_d17
- .align 4
- _abi_test_clobber_d17:
- AARCH64_VALID_CALL_TARGET
- fmov d17, xzr
- ret
- .globl _abi_test_clobber_d18
- .private_extern _abi_test_clobber_d18
- .align 4
- _abi_test_clobber_d18:
- AARCH64_VALID_CALL_TARGET
- fmov d18, xzr
- ret
- .globl _abi_test_clobber_d19
- .private_extern _abi_test_clobber_d19
- .align 4
- _abi_test_clobber_d19:
- AARCH64_VALID_CALL_TARGET
- fmov d19, xzr
- ret
- .globl _abi_test_clobber_d20
- .private_extern _abi_test_clobber_d20
- .align 4
- _abi_test_clobber_d20:
- AARCH64_VALID_CALL_TARGET
- fmov d20, xzr
- ret
- .globl _abi_test_clobber_d21
- .private_extern _abi_test_clobber_d21
- .align 4
- _abi_test_clobber_d21:
- AARCH64_VALID_CALL_TARGET
- fmov d21, xzr
- ret
- .globl _abi_test_clobber_d22
- .private_extern _abi_test_clobber_d22
- .align 4
- _abi_test_clobber_d22:
- AARCH64_VALID_CALL_TARGET
- fmov d22, xzr
- ret
- .globl _abi_test_clobber_d23
- .private_extern _abi_test_clobber_d23
- .align 4
- _abi_test_clobber_d23:
- AARCH64_VALID_CALL_TARGET
- fmov d23, xzr
- ret
- .globl _abi_test_clobber_d24
- .private_extern _abi_test_clobber_d24
- .align 4
- _abi_test_clobber_d24:
- AARCH64_VALID_CALL_TARGET
- fmov d24, xzr
- ret
- .globl _abi_test_clobber_d25
- .private_extern _abi_test_clobber_d25
- .align 4
- _abi_test_clobber_d25:
- AARCH64_VALID_CALL_TARGET
- fmov d25, xzr
- ret
- .globl _abi_test_clobber_d26
- .private_extern _abi_test_clobber_d26
- .align 4
- _abi_test_clobber_d26:
- AARCH64_VALID_CALL_TARGET
- fmov d26, xzr
- ret
- .globl _abi_test_clobber_d27
- .private_extern _abi_test_clobber_d27
- .align 4
- _abi_test_clobber_d27:
- AARCH64_VALID_CALL_TARGET
- fmov d27, xzr
- ret
- .globl _abi_test_clobber_d28
- .private_extern _abi_test_clobber_d28
- .align 4
- _abi_test_clobber_d28:
- AARCH64_VALID_CALL_TARGET
- fmov d28, xzr
- ret
- .globl _abi_test_clobber_d29
- .private_extern _abi_test_clobber_d29
- .align 4
- _abi_test_clobber_d29:
- AARCH64_VALID_CALL_TARGET
- fmov d29, xzr
- ret
- .globl _abi_test_clobber_d30
- .private_extern _abi_test_clobber_d30
- .align 4
- _abi_test_clobber_d30:
- AARCH64_VALID_CALL_TARGET
- fmov d30, xzr
- ret
- .globl _abi_test_clobber_d31
- .private_extern _abi_test_clobber_d31
- .align 4
- _abi_test_clobber_d31:
- AARCH64_VALID_CALL_TARGET
- fmov d31, xzr
- ret
- .globl _abi_test_clobber_v8_upper
- .private_extern _abi_test_clobber_v8_upper
- .align 4
- _abi_test_clobber_v8_upper:
- AARCH64_VALID_CALL_TARGET
- fmov v8.d[1], xzr
- ret
- .globl _abi_test_clobber_v9_upper
- .private_extern _abi_test_clobber_v9_upper
- .align 4
- _abi_test_clobber_v9_upper:
- AARCH64_VALID_CALL_TARGET
- fmov v9.d[1], xzr
- ret
- .globl _abi_test_clobber_v10_upper
- .private_extern _abi_test_clobber_v10_upper
- .align 4
- _abi_test_clobber_v10_upper:
- AARCH64_VALID_CALL_TARGET
- fmov v10.d[1], xzr
- ret
- .globl _abi_test_clobber_v11_upper
- .private_extern _abi_test_clobber_v11_upper
- .align 4
- _abi_test_clobber_v11_upper:
- AARCH64_VALID_CALL_TARGET
- fmov v11.d[1], xzr
- ret
- .globl _abi_test_clobber_v12_upper
- .private_extern _abi_test_clobber_v12_upper
- .align 4
- _abi_test_clobber_v12_upper:
- AARCH64_VALID_CALL_TARGET
- fmov v12.d[1], xzr
- ret
- .globl _abi_test_clobber_v13_upper
- .private_extern _abi_test_clobber_v13_upper
- .align 4
- _abi_test_clobber_v13_upper:
- AARCH64_VALID_CALL_TARGET
- fmov v13.d[1], xzr
- ret
- .globl _abi_test_clobber_v14_upper
- .private_extern _abi_test_clobber_v14_upper
- .align 4
- _abi_test_clobber_v14_upper:
- AARCH64_VALID_CALL_TARGET
- fmov v14.d[1], xzr
- ret
- .globl _abi_test_clobber_v15_upper
- .private_extern _abi_test_clobber_v15_upper
- .align 4
- _abi_test_clobber_v15_upper:
- AARCH64_VALID_CALL_TARGET
- fmov v15.d[1], xzr
- ret
- #endif // !OPENSSL_NO_ASM
|