]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/sparc/bits/setjmp.h
Update.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / sparc / bits / setjmp.h
CommitLineData
a1303dc8 1/* Copyright (C) 1997,1999,2000 Free Software Foundation, Inc.
c84142e8 2 This file is part of the GNU C Library.
28f540f4 3
c84142e8
UD
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
28f540f4 8
c84142e8
UD
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
28f540f4 13
c84142e8
UD
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
28f540f4 18
f4017d20
UD
19
20#ifndef _SETJMP_H
21# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
22#endif
28f540f4 23
1c25bcac
UD
24#include <bits/wordsize.h>
25
26#if __WORDSIZE == 64
27
a1303dc8
UD
28#ifndef _ASM
29typedef struct __sparc64_jmp_buf
30 {
31 struct __sparc64_jmp_buf *uc_link;
32 unsigned long uc_flags;
33 unsigned long uc_sigmask;
34 struct __sparc64_jmp_buf_mcontext
35 {
36 unsigned long mc_gregs[19];
37 unsigned long mc_fp;
38 unsigned long mc_i7;
39 struct __sparc64_jmp_buf_fpu
40 {
41 union
42 {
43 unsigned int sregs[32];
44 unsigned long dregs[32];
45 long double qregs[16];
46 } mcfpu_fpregs;
47 unsigned long mcfpu_fprs;
48 unsigned long mcfpu_gsr;
49 void *mcfpu_fq;
50 unsigned char mcfpu_qcnt;
51 unsigned char mcfpu_qentsz;
52 unsigned char mcfpu_enab;
53 } mc_fpregs;
54 } uc_mcontext;
55 } __jmp_buf[1];
56#endif
9c4c0024
UD
57
58/* Test if longjmp to JMPBUF would unwind the frame
59 containing a local variable at ADDRESS. */
60#define _JMPBUF_UNWINDS(jmpbuf, address) \
61 ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp)
1c25bcac
UD
62
63#else
64
65#if defined __USE_MISC || defined _ASM
66# define JB_SP 0
67# define JB_FP 1
68# define JB_PC 2
69#endif
70
71#ifndef _ASM
72typedef int __jmp_buf[3];
73#endif
74
75/* Test if longjmp to JMPBUF would unwind the frame
76 containing a local variable at ADDRESS. */
77#define _JMPBUF_UNWINDS(jmpbuf, address) \
78 ((int) (address) < (jmpbuf)[JB_SP])
79
80#endif