// According to AARCH64 PCS document we need to save the following
// registers:
//
// Core x19 - x30, sp (see section5.1.1)
// VFP d8 - d15 (see section5.1.2)
//
// NOTE: All the registers saved here will have 64 bit vales.
// AAPCS mandates that the higher part of q registers do not need to
// be saved by the callee.
//
// The internal structure of a jmp_buf is totally private.
// Current layout (changes from release to release):
//
// word name description
// 0 sigflag/cookie setjmp cookie in top 63 bits, signal mask flag in low bit
// 1 sigmask signal mask (not used with _setjmp / _longjmp)
// 2 core_base base of core registers (x18-x30, sp)
// 16 float_base base of float registers (d8-d15)
// 24 checksum
// 25 reserved reserved entries (room to grow)
// 32
// Commit SME's ZA lazy save. Note that the call preserves x1.
bl __arm_za_disable
// Get the cookie and store it along with the signal flag.
mov x0, x1
bl __bionic_setjmp_cookie_get
mov x1, x0
ldr x0, [sp, #0]
str x1, [x0, #(_JB_SIGFLAG * 8)]
// Do we need to save the signal mask?
tbz w1, #0, L(save_registers)
// Save the cookie for later.
stp x1, xzr, [sp, #-16]!
.cfi_adjust_cfa_offset 16
// Save current signal mask.
// The 'how' argument is ignored if new_mask is NULL.
mov x1, #0 // NULL.
add x2, x0, #(_JB_SIGMASK * 8) // old_mask.
bl sigprocmask
ldp x1, xzr, [sp], #16
.cfi_adjust_cfa_offset -16
L(save_registers):
// Restore original x0 and lr.
ldp x0, x30, [sp], #16
.cfi_adjust_cfa_offset -16
.cfi_restore x0
.cfi_restore x30
// Mask off the signal flag bit.
bic x1, x1, #1
// Mask off the high bits of the shadow call stack pointer.
// We only store the low bits of x18 to avoid leaking the
// shadow call stack address into memory.
// See the SCS commentary in pthread_internal.h for more detail.
and x3, x18, #SCS_MASK
mov w0, #0
autiasp
.cfi_negate_ra_state
ret
END(sigsetjmp)
// void siglongjmp(sigjmp_buf env, int value);
ENTRY_WEAK_FOR_NATIVE_BRIDGE(siglongjmp)
// Stash lr to enable unwinds from within siglongjmp() at least until we
// overwrite lr with the value from the jmp_buf later.
str lr, [sp, #-16]!
.cfi_adjust_cfa_offset 16
.cfi_rel_offset lr, 0
// First of all, disable SME's ZA, so that it does not interfere
// with anything else. Note that __arm_za_disable is guaranteed to
// preserve x0 and x1.
bl __arm_za_disable
mov x19, x0 // Save 'env'.
mov x20, x1 // Save 'value'.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.