chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / sysdeps / unix / sysv / linux / ia64 / sys / ucontext.h
1 /* Copyright (C) 1998, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8
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    Lesser General Public License for more details.
13
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, write to the Free
16    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17    02111-1307 USA.  */
18
19 #ifndef _SYS_UCONTEXT_H
20 #define _SYS_UCONTEXT_H 1
21
22 #include <features.h>
23 #include <signal.h>
24
25 #include <bits/sigcontext.h>
26
27 /*
28  * These are here mostly for backwards compatibility with older Unices.
29  * IA-64 Linux does not distinguish between "struct sigcontext" and
30  * "ucontext_t" as all the necessary info is inside the former.
31  */
32
33 typedef struct sigcontext mcontext_t;
34
35 #if defined __cplusplus && __GNUC_PREREQ (3, 5)
36 # define _SC_GR0_OFFSET \
37         __builtin_offsetof (struct sigcontext, sc_gr[0])
38 #elif defined __GNUC__
39 # define _SC_GR0_OFFSET \
40         (((char *) &((struct sigcontext *) 0)->sc_gr[0]) - (char *) 0)
41 #else
42 # define _SC_GR0_OFFSET 0xc8    /* pray that this is correct... */
43 #endif
44
45 typedef struct ucontext
46   {
47     union
48       {
49         mcontext_t _mc;
50         struct
51           {
52             unsigned long _pad[_SC_GR0_OFFSET/8];
53             struct ucontext *_link;     /* this should overlay sc_gr[0] */
54           }
55         _uc;
56       }
57     _u;
58   }
59 ucontext_t;
60
61 #define uc_mcontext     _u._mc
62 #define uc_sigmask      _u._mc.sc_mask
63 #define uc_stack        _u._mc.sc_stack
64 #define uc_link         _u._uc._link
65
66 #endif /* sys/ucontext.h */