chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / ports / sysdeps / unix / sysv / aix / sys / ucontext.h
1 /* Copyright (C) 1997, 1998, 1999, 2000 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 <bits/types.h>
24 #include <bits/sigset.h>
25
26
27 /* Alternate, preferred interface.  */
28 typedef struct sigaltstack
29   {
30     void *ss_sp;
31     size_t ss_size;
32     int ss_flags;
33     int __pad[4];
34   } stack_t;
35
36
37 /* Forward declaration of AIX type.  */
38 typedef struct label_t label_t;
39
40
41
42 typedef unsigned int kvmhandle_t;
43 typedef struct
44   {
45     unsigned long int __alloc;
46     kvmhandle_t __srval[16];
47   } adspace_t;
48
49
50
51 #define _NGPRS 32
52 #define _NFPRS 32
53
54 struct __mstsafe
55 {
56   struct __mstsave *__prev;             /* Previous save area. */
57   label_t *__kjmpbuf;                   /* Pointer to saved context.  */
58   char *__stackfix;                     /* Stack fix pointer.  */
59   char __intpri;                        /* Interrupt priority.  */
60   char __backt;                         /* Back-track flag.  */
61   char __rsvd[2];                       /* Reserved.  */
62   __pid_t __curid;                      /* Copy of curid.  */
63
64   int __excp_type;                      /* Exception type for debugger.  */
65   unsigned long int __iar;              /* Instruction address register.  */
66   unsigned long int __msr;              /* Machine state register.  */
67   unsigned long int __cr;               /* Condition register.  */
68   unsigned long int __lr;               /* Link register.  */
69   unsigned long int __ctr;              /* Count register.  */
70   unsigned long int __xer;              /* Fixed point exception.  */
71   unsigned long int __mq;               /* Multiply/quotient register.  */
72   unsigned long int __tid;              /* TID register.  */
73   unsigned long int __fpscr;            /* Floating point status reg.  */
74   char __fpeu;                          /* Floating point ever used.  */
75   char __fpinfo;                        /* Floating point status flags.  */
76   char __pad[2];                        /* Pad to dword boundary.  */
77                                         /* 1 implies state is in mstext */
78   unsigned long int __except[5];        /* exception structure.  */
79   char __pad1[4];                       /* Old bus field.  */
80   unsigned long int __o_iar;            /* Old iar (for longjmp excpt).  */
81   unsigned long int __o_toc;            /* Old toc (for longjmp excpt).  */
82   unsigned long int __o_arg1;           /* Old arg1 (for longjmp excpt).  */
83   unsigned long int __excbranch;        /* If not NULL, address to branch
84                                            to on exception.  Used by
85                                            assembler routines for low
86                                            cost exception handling.  */
87   unsigned long int __fpscrx;           /* Software extension to fpscr.  */
88   unsigned long int __o_vaddr;          /* Saved vaddr for vmexception.  */
89   unsigned long int __cachealign[7];    /* Reserved.  */
90   adspace_t __as;                       /* Segment registers.  */
91   unsigned long int __gpr[_NGPRS];      /* General purpose registers.  */
92   double __fpr[_NFPRS];                 /* Floating point registers.  */
93     };
94
95 typedef struct mcontext_t
96   {
97     struct __mstsafe __jmp_context;
98   } mcontext_t;
99
100
101 typedef struct ucontext_t
102   {
103     int __sc_onstack;           /* Sigstack state to restore.  */
104     __sigset_t uc_sigmask;      /* The set of signals that are blocked when
105                                    this context is active.  */
106     int __sc_uerror;            /* u_error to restore.  */
107     mcontext_t uc_mcontext;     /* Machine-specific image of saved context.  */
108     struct ucontext_t *uc_link; /* context resumed after this one returns */
109     stack_t uc_stack;           /* stack used by context */
110     int __pad[4];
111   } ucontext_t;
112
113 #endif /* sys/ucontext.h */