chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / sysdeps / unix / sysv / linux / ia64 / bits / sigcontext.h
1 /* Copyright (C) 1996, 1997, 1998, 2000, 2001, 2003, 2004, 2007
2    Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4    Contributed by Jes Sorensen <jes@linuxcare.com>, July 2000
5
6    The GNU C Library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    The GNU C Library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with the GNU C Library; if not, write to the Free
18    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19    02111-1307 USA.  */
20
21 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
22 # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
23 #endif
24
25 #ifndef _BITS_SIGCONTEXT_H
26 #define _BITS_SIGCONTEXT_H 1
27
28 #define __need_size_t
29 #include <stddef.h>
30 #include <bits/sigstack.h>
31
32 struct ia64_fpreg
33   {
34     union
35       {
36         unsigned long bits[2];
37       } u;
38   } __attribute__ ((aligned (16)));
39
40 struct sigcontext
41 {
42   unsigned long int sc_flags;   /* see manifest constants below */
43   unsigned long int sc_nat;     /* bit i == 1 iff scratch reg gr[i] is a NaT */
44   stack_t sc_stack;             /* previously active stack */
45
46   unsigned long int sc_ip;      /* instruction pointer */
47   unsigned long int sc_cfm;     /* current frame marker */
48   unsigned long int sc_um;      /* user mask bits */
49   unsigned long int sc_ar_rsc;  /* register stack configuration register */
50   unsigned long int sc_ar_bsp;  /* backing store pointer */
51   unsigned long int sc_ar_rnat; /* RSE NaT collection register */
52   unsigned long int sc_ar_ccv;  /* compare & exchange compare value register */
53   unsigned long int sc_ar_unat; /* ar.unat of interrupted context */
54   unsigned long int sc_ar_fpsr; /* floating-point status register */
55   unsigned long int sc_ar_pfs;  /* previous function state */
56   unsigned long int sc_ar_lc;   /* loop count register */
57   unsigned long int sc_pr;      /* predicate registers */
58   unsigned long int sc_br[8];   /* branch registers */
59   unsigned long int sc_gr[32];  /* general registers (static partition) */
60   struct ia64_fpreg sc_fr[128]; /* floating-point registers */
61   unsigned long int sc_rbs_base;/* NULL or new base of sighandler's rbs */
62   unsigned long int sc_loadrs;  /* see description above */
63   unsigned long int sc_ar25;    /* cmp8xchg16 uses this */
64   unsigned long int sc_ar26;    /* rsvd for scratch use */
65   unsigned long int sc_rsvd[12];/* reserved for future use */
66
67   /* sc_mask is actually an sigset_t but we don't want to
68    * include the kernel headers here. */
69   unsigned long int sc_mask;    /* signal mask to restore after handler returns */
70 };
71
72 /* sc_flag bit definitions. */
73 #define IA64_SC_FLAG_ONSTACK_BIT        0       /* is handler running on signal stack? */
74 #define IA64_SC_FLAG_IN_SYSCALL_BIT     1       /* did signal interrupt a syscall? */
75 #define IA64_SC_FLAG_FPH_VALID_BIT      2       /* is state in f[32]-f[127] valid? */
76
77 #define IA64_SC_FLAG_ONSTACK            (1 << IA64_SC_FLAG_ONSTACK_BIT)
78 #define IA64_SC_FLAG_IN_SYSCALL         (1 << IA64_SC_FLAG_IN_SYSCALL_BIT)
79 #define IA64_SC_FLAG_FPH_VALID          (1 << IA64_SC_FLAG_FPH_VALID_BIT)
80
81 #endif /* _BITS_SIGCONTEXT_H */