2 * libc/sysdeps/linux/microblaze/setjmp.S -- `setjmp' for microblaze
4 * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
5 * Copyright (C) 2001,2002 NEC Corporation
6 * Copyright (C) 2001,2002 Miles Bader <miles@gnu.org>
8 * This file is subject to the terms and conditions of the GNU Lesser
9 * General Public License. See the file COPYING.LIB in the main
10 * directory of this archive for more details.
12 * Written by Miles Bader <miles@gnu.org>
14 * PIC code based on glibc 2.3.6 */
17 The GNU C Library is free software; you can redistribute it and/or
18 modify it under the terms of the GNU Lesser General Public
19 License as published by the Free Software Foundation; either
20 version 2.1 of the License, or (at your option) any later version.
22 The GNU C Library is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 Lesser General Public License for more details.
27 You should have received a copy of the GNU Lesser General Public
28 License along with the GNU C Library; if not, see
29 <http://www.gnu.org/licenses/>. */
31 #include <libc-symbols.h>
34 .globl C_SYMBOL_NAME(setjmp)
36 C_SYMBOL_NAME(setjmp):
40 braid C_SYMBOL_NAME(__sigsetjmp)
42 addi r6, r0, 1 /* Save the signal mask. */
44 .globl C_SYMBOL_NAME(_setjmp)
45 C_SYMBOL_NAME(_setjmp):
46 and r6, r0, r0 /* Don't save the signal mask. */
48 .globl C_SYMBOL_NAME(__sigsetjmp)
49 C_SYMBOL_NAME(__sigsetjmp):
51 /* Save registers relative to r5 (arg0)*/
52 swi r1, r5, 0 /* stack pointer */
53 swi r15, r5, 4 /* link register */
54 swi r2, r5, 8 /* SDA and SDA2 ptrs */
56 swi r18, r5, 16 /* assembler temp */
57 swi r19, r5, 20 /* now call-preserved regs */
71 /* Make a tail call to __sigjmp_save; it takes the same args. */
74 addik r12,r12,_GLOBAL_OFFSET_TABLE_+8
75 lwi r12,r12,__sigjmp_save@GOT
79 braid C_SYMBOL_NAME(__sigjmp_save)