mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
systrap/arm64: use the fpsimd_context structure to parse fpu states
PiperOrigin-RevId: 514487900
This commit is contained in:
@@ -106,13 +106,13 @@ void __export_sighandler(int signo, siginfo_t *siginfo, void *_ucontext) {
|
||||
// point context.
|
||||
//
|
||||
// See: arch/arm64/include/uapi/asm/sigcontext.h
|
||||
const uint64_t kSigframeMagicHeaderLen = sizeof(struct _aarch64_ctx);
|
||||
struct fpsimd_context *fpctx = &ucontext->uc_mcontext.__reserved;
|
||||
// Verify the header.
|
||||
if (((uint32_t *)&ucontext->uc_mcontext.__reserved)[0] != FPSIMD_MAGIC) {
|
||||
if (fpctx->head.magic != FPSIMD_MAGIC ||
|
||||
__export_arch_state.fp_len != sizeof(*fpctx) - sizeof(fpctx->head)) {
|
||||
panic(0xbadf);
|
||||
}
|
||||
uint8_t *fpStatePointer =
|
||||
(uint8_t *)&ucontext->uc_mcontext.__reserved + kSigframeMagicHeaderLen;
|
||||
uint8_t *fpStatePointer = (uint8_t *)&fpctx->fpsr;
|
||||
if (__export_context_decoupling_exp) {
|
||||
memcpy(ctx->fpstate, fpStatePointer, __export_arch_state.fp_len);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user