]> sourceware.org Git - glibc.git/blame - sysdeps/s390/jmpbuf-unwind.h
* sysdeps/alpha/jmpbuf-unwind.h: New file, moved from nptl/.
[glibc.git] / sysdeps / s390 / jmpbuf-unwind.h
CommitLineData
de59a291 1/* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
58e8ec84
UD
2 This file is part of the GNU C Library.
3 Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
19
20#include <setjmp.h>
675620f7 21#include <stdint.h>
58e8ec84 22#include <unwind.h>
6bdd38ba 23#include <bits/wordsize.h>
db169ed5 24#include <sysdep.h>
58e8ec84 25
6bdd38ba
UD
26/* On s390{,x}, CFA is always 96 (resp. 160) bytes above actual
27 %r15. */
675620f7 28#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
6bdd38ba
UD
29 _JMPBUF_UNWINDS_ADJ (_jmpbuf, \
30 (void *) (_Unwind_GetCFA (_context) \
31 - 32 - 2 * __WORDSIZE), _adj)
675620f7 32
db169ed5
RM
33static inline uintptr_t __attribute__ ((unused))
34_jmpbuf_sp (__jmp_buf regs)
35{
36 uintptr_t sp = regs[0].__gregs[__JB_GPR15];
37#ifdef PTR_DEMANGLE
38 PTR_DEMANGLE (sp);
39#endif
40 return sp;
41}
42
43#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
44 ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
f76c8499 45
6bdd38ba 46/* We use the normal longjmp for unwinding. */
f76c8499 47#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
This page took 0.337233 seconds and 5 git commands to generate.