hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame sysdeps/aarch64/setjmp.S

Packit 6c4009
/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
Packit 6c4009
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public License as
Packit 6c4009
   published by the Free Software Foundation; either version 2.1 of the
Packit 6c4009
   License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library.  If not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#include <sysdep.h>
Packit 6c4009
#include <jmpbuf-offsets.h>
Packit 6c4009
#include <stap-probe.h>
Packit 6c4009
Packit 6c4009
        /* Keep traditional entry points in with sigsetjmp(). */
Packit 6c4009
ENTRY (setjmp)
Packit 6c4009
	mov	x1, #1
Packit 6c4009
	b	1f
Packit 6c4009
END (setjmp)
Packit 6c4009
Packit 6c4009
ENTRY (_setjmp)
Packit 6c4009
	mov	x1, #0
Packit 6c4009
	b	1f
Packit 6c4009
END (_setjmp)
Packit 6c4009
libc_hidden_def (_setjmp)
Packit 6c4009
Packit 6c4009
ENTRY (__sigsetjmp)
Packit 6c4009
	DELOUSE (0)
Packit 6c4009
Packit 6c4009
1:
Packit 6c4009
	stp	x19, x20, [x0, #JB_X19<<3]
Packit 6c4009
	stp	x21, x22, [x0, #JB_X21<<3]
Packit 6c4009
	stp	x23, x24, [x0, #JB_X23<<3]
Packit 6c4009
	stp	x25, x26, [x0, #JB_X25<<3]
Packit 6c4009
	stp	x27, x28, [x0, #JB_X27<<3]
Packit 6c4009
Packit 6c4009
#ifdef PTR_MANGLE
Packit 6c4009
	PTR_MANGLE (4, 30, 3, 2)
Packit 6c4009
	stp	x29,  x4, [x0, #JB_X29<<3]
Packit 6c4009
#else
Packit 6c4009
	stp	x29, x30, [x0, #JB_X29<<3]
Packit 6c4009
#endif
Packit 6c4009
	/* setjmp probe takes 3 arguments, address of jump buffer
Packit 6c4009
	   first argument (8@x0), return value second argument (-4@x1),
Packit 6c4009
	   and target address (8@x30), respectively.  */
Packit 6c4009
	LIBC_PROBE (setjmp, 3, 8@x0, -4@x1, 8@x30)
Packit 6c4009
	stp	 d8,  d9, [x0, #JB_D8<<3]
Packit 6c4009
	stp	d10, d11, [x0, #JB_D10<<3]
Packit 6c4009
	stp	d12, d13, [x0, #JB_D12<<3]
Packit 6c4009
	stp	d14, d15, [x0, #JB_D14<<3]
Packit 6c4009
#ifdef PTR_MANGLE
Packit 6c4009
	mov	x4, sp
Packit 6c4009
	PTR_MANGLE (5, 4, 3, 2)
Packit 6c4009
	str	x5, [x0, #JB_SP<<3]
Packit 6c4009
#else
Packit 6c4009
	mov	x2,  sp
Packit 6c4009
	str	x2,  [x0, #JB_SP<<3]
Packit 6c4009
#endif
Packit 6c4009
#if IS_IN (rtld)
Packit 6c4009
	/* In ld.so we never save the signal mask */
Packit 6c4009
	mov	w0, #0
Packit 6c4009
	RET
Packit 6c4009
#else
Packit 6c4009
	b	C_SYMBOL_NAME(__sigjmp_save)
Packit 6c4009
#endif
Packit 6c4009
END (__sigsetjmp)
Packit 6c4009
hidden_def (__sigsetjmp)