// 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 64-bit signal mask
// 2 ra
// 3 sp
// 4 gp
// 5 s0
// ......
// 16 s11
// 17 fs0
// ......
// 28 fs11
// 29 checksum
// _JBLEN: defined in bionic/libc/include/setjmp.h
ENTRY_WEAK_FOR_NATIVE_BRIDGE(setjmp)
li a1, 1
tail sigsetjmp
END(setjmp)
ENTRY_WEAK_FOR_NATIVE_BRIDGE(_setjmp)
li a1, 0
tail sigsetjmp
END(_setjmp)
// int sigsetjmp(sigjmp_buf env, int save_signal_mask);
ENTRY_WEAK_FOR_NATIVE_BRIDGE(sigsetjmp)
addi sp, sp, -24
sd a0, 0(sp)
sd a1, 8(sp)
sd ra, 16(sp)
// Get the cookie and store it along with the signal flag.
mv a0, a1
call __bionic_setjmp_cookie_get
mv a1, a0 ld a0, 0(sp)
sd a1, _JB_SIGFLAG(a0)
// Do we need to save the signal mask?
andi a1, a1, 1
beqz a1, L(save_registers)
// Save current signal mask.
// The 'how'/a0 argument is ignored if set is NULL.
li a1, 0 // NULL
addi a2, a0, _JB_SIGMASK // old_mask.
call sigprocmask
// Get the cookie. ld a1, _JB_SIGFLAG(a0)
andi a1, a1, -2
// Mask off the high bits of the shadow call stack pointer.
// We only store the low bits of gp to avoid leaking the
// shadow call stack address into memory.
// See the SCS commentary in pthread_internal.h for more detail.
li a4, SCS_MASK
and a4, a4, gp
¤ 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.0.16Bemerkung:
(vorverarbeitet am 2026-06-28)
¤
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.