/* Save current context and install the given one.
Copyright (C) 2002-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#include <sysdep.h>
#include <rtld-global-offsets.h>
#include <shlib-compat.h>
#define __ASSEMBLY__
#include <asm/ptrace.h>
#include "ucontext_i.h"
#include <asm/errno.h>
.section ".toc","aw"
.LC__dl_hwcap:
#ifdef SHARED
.tc _rtld_global_ro[TC],_rtld_global_ro
#else
.tc _dl_hwcap[TC],_dl_hwcap
#endif
#if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)
.section ".text"
ENTRY(__novec_swapcontext)
CALL_MCOUNT 2
std r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r3)
std r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3)
mflr r0
std r31,-16(1)
cfi_offset(r31,-16)
#ifdef __ROP_PROTECT__
hashst r0,FRAME_ROP_SAVE(r1)
#endif
std r2,(SIGCONTEXT_GP_REGS+(PT_R2*8))(r3)
std r0,FRAME_LR_SAVE(r1)
cfi_offset (lr, FRAME_LR_SAVE)
std r0,(SIGCONTEXT_GP_REGS+(PT_LNK*8))(r3)
std r0,(SIGCONTEXT_GP_REGS+(PT_NIP*8))(r3)
stdu r1,-128(r1)
cfi_adjust_cfa_offset (128)
std r4,(SIGCONTEXT_GP_REGS+(PT_R4*8))(r3)
std r5,(SIGCONTEXT_GP_REGS+(PT_R5*8))(r3)
std r6,(SIGCONTEXT_GP_REGS+(PT_R6*8))(r3)
std r7,(SIGCONTEXT_GP_REGS+(PT_R7*8))(r3)
std r8,(SIGCONTEXT_GP_REGS+(PT_R8*8))(r3)
std r9,(SIGCONTEXT_GP_REGS+(PT_R9*8))(r3)
std r10,(SIGCONTEXT_GP_REGS+(PT_R10*8))(r3)
std r11,(SIGCONTEXT_GP_REGS+(PT_R11*8))(r3)
std r12,(SIGCONTEXT_GP_REGS+(PT_R12*8))(r3)
std r13,(SIGCONTEXT_GP_REGS+(PT_R13*8))(r3)
std r14,(SIGCONTEXT_GP_REGS+(PT_R14*8))(r3)
std r15,(SIGCONTEXT_GP_REGS+(PT_R15*8))(r3)
std r16,(SIGCONTEXT_GP_REGS+(PT_R16*8))(r3)
std r17,(SIGCONTEXT_GP_REGS+(PT_R17*8))(r3)
std