]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/m68k/bsd-_setjmp.S
update from main archvie 961022
[thirdparty/glibc.git] / sysdeps / m68k / bsd-_setjmp.S
CommitLineData
28f540f4
RM
1/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. m68k version.
2Copyright (C) 1994 Free Software Foundation, Inc.
3This file is part of the GNU C Library.
4
5The GNU C Library is free software; you can redistribute it and/or
6modify it under the terms of the GNU Library General Public License as
7published by the Free Software Foundation; either version 2 of the
8License, or (at your option) any later version.
9
10The GNU C Library is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13Library General Public License for more details.
14
15You should have received a copy of the GNU Library General Public
16License along with the GNU C Library; see the file COPYING.LIB. If
17not, write to the Free Software Foundation, Inc., 675 Mass Ave,
18Cambridge, MA 02139, USA. */
19
20/* This just does a tail-call to `__sigsetjmp (ARG, 0)'.
21 We cannot do it in C because it must be a tail-call, so frame-unwinding
22 in setjmp doesn't clobber the state restored by longjmp. */
23
24#include <sysdep.h>
25
bfc04a9f 26#ifdef MOTOROLA_SYNTAX
28f540f4
RM
27#define d0 %d0
28#define d1 %d1
7176f4e4
RM
29#define PUSH(reg) move.l reg, -(%sp)
30#define POP(reg) move.l (%sp)+, reg
31#define PUSH0 clr.l -(%sp)
28f540f4
RM
32#else
33#define PUSH(reg) movel reg, sp@-
34#define POP(reg) movel sp@+, reg
7176f4e4 35#define PUSH0 clrl sp@-
28f540f4
RM
36#endif
37
38ENTRY (_setjmp)
39 POP (d0) /* Pop return PC. */
40 POP (d1) /* Pop jmp_buf argument. */
7176f4e4 41 PUSH0 /* Push second argument of zero. */
28f540f4
RM
42 PUSH (d1) /* Push back first argument. */
43 PUSH (d0) /* Push back return PC. */
7176f4e4
RM
44#ifdef PIC
45 bra.l C_SYMBOL_NAME (__sigsetjmp@PLTPC)
46#else
28f540f4 47 jmp C_SYMBOL_NAME (__sigsetjmp)
7176f4e4 48#endif
6ed0492f 49END (_setjmp)