1997-07-07 05:52:39 +08:00
|
|
|
/* Copyright (C) 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
|
|
|
|
This file is part of the GNU C Library.
|
1991-06-13 07:41:10 +09:00
|
|
|
Derived from @(#)_setjmp.s 5.7 (Berkeley) 6/27/88,
|
|
|
|
Copyright (c) 1980 Regents of the University of California.
|
|
|
|
|
1997-07-07 05:52:39 +08:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public License as
|
|
|
|
published by the Free Software Foundation; either version 2 of the
|
|
|
|
License, or (at your option) any later version.
|
1991-06-13 07:41:10 +09:00
|
|
|
|
1997-07-07 05:52:39 +08:00
|
|
|
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
|
|
|
|
Library General Public License for more details.
|
1991-06-13 07:41:10 +09:00
|
|
|
|
1997-07-07 05:52:39 +08:00
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
|
|
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1991-06-13 07:41:10 +09:00
|
|
|
|
|
|
|
#include <setjmp.h>
|
|
|
|
|
|
|
|
|
|
|
|
/* Save the current program position in ENV and return 0. */
|
|
|
|
int
|
1994-12-05 01:53:34 +08:00
|
|
|
__sigsetjmp (jmp_buf env, int savemask)
|
1991-06-13 07:41:10 +09:00
|
|
|
{
|
|
|
|
/* Save our caller's FP and PC. */
|
1994-12-05 02:51:22 +08:00
|
|
|
asm ("movl 12(fp), %0" : "=g" (env[0].__jmpbuf[0].__fp));
|
|
|
|
asm ("movl 16(fp), %0" : "=g" (env[0].__jmpbuf[0].__pc));
|
1994-12-05 01:53:34 +08:00
|
|
|
|
|
|
|
/* Save the signal mask if requested. */
|
1994-12-05 02:51:22 +08:00
|
|
|
return __sigjmp_save (env, savemask);
|
1991-06-13 07:41:10 +09:00
|
|
|
}
|