Back to index

glibc  2.9
sigcontext.h
Go to the documentation of this file.
00001 /* Copyright (C) 1996, 1997, 1998, 2000, 2001, 2003, 2004, 2007
00002    Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004    Contributed by Jes Sorensen <jes@linuxcare.com>, July 2000
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
00022 # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
00023 #endif
00024 
00025 #ifndef _BITS_SIGCONTEXT_H
00026 #define _BITS_SIGCONTEXT_H 1
00027 
00028 #define __need_size_t
00029 #include <stddef.h>
00030 #include <bits/sigstack.h>
00031 
00032 struct ia64_fpreg
00033   {
00034     union
00035       {
00036        unsigned long bits[2];
00037       } u;
00038   } __attribute__ ((aligned (16)));
00039 
00040 struct sigcontext
00041 {
00042   unsigned long int sc_flags;      /* see manifest constants below */
00043   unsigned long int sc_nat; /* bit i == 1 iff scratch reg gr[i] is a NaT */
00044   stack_t sc_stack;         /* previously active stack */
00045 
00046   unsigned long int sc_ip;  /* instruction pointer */
00047   unsigned long int sc_cfm; /* current frame marker */
00048   unsigned long int sc_um;  /* user mask bits */
00049   unsigned long int sc_ar_rsc;     /* register stack configuration register */
00050   unsigned long int sc_ar_bsp;     /* backing store pointer */
00051   unsigned long int sc_ar_rnat;    /* RSE NaT collection register */
00052   unsigned long int sc_ar_ccv;     /* compare & exchange compare value register */
00053   unsigned long int sc_ar_unat;    /* ar.unat of interrupted context */
00054   unsigned long int sc_ar_fpsr;    /* floating-point status register */
00055   unsigned long int sc_ar_pfs;     /* previous function state */
00056   unsigned long int sc_ar_lc;      /* loop count register */
00057   unsigned long int sc_pr;  /* predicate registers */
00058   unsigned long int sc_br[8];      /* branch registers */
00059   unsigned long int sc_gr[32];     /* general registers (static partition) */
00060   struct ia64_fpreg sc_fr[128];    /* floating-point registers */
00061   unsigned long int sc_rbs_base;/* NULL or new base of sighandler's rbs */
00062   unsigned long int sc_loadrs;     /* see description above */
00063   unsigned long int sc_ar25;       /* cmp8xchg16 uses this */
00064   unsigned long int sc_ar26;       /* rsvd for scratch use */
00065   unsigned long int sc_rsvd[12];/* reserved for future use */
00066 
00067   /* sc_mask is actually an sigset_t but we don't want to
00068    * include the kernel headers here. */
00069   unsigned long int sc_mask;       /* signal mask to restore after handler returns */
00070 };
00071 
00072 /* sc_flag bit definitions. */
00073 #define IA64_SC_FLAG_ONSTACK_BIT   0      /* is handler running on signal stack? */
00074 #define IA64_SC_FLAG_IN_SYSCALL_BIT       1      /* did signal interrupt a syscall? */
00075 #define IA64_SC_FLAG_FPH_VALID_BIT 2      /* is state in f[32]-f[127] valid? */
00076 
00077 #define IA64_SC_FLAG_ONSTACK              (1 << IA64_SC_FLAG_ONSTACK_BIT)
00078 #define IA64_SC_FLAG_IN_SYSCALL           (1 << IA64_SC_FLAG_IN_SYSCALL_BIT)
00079 #define IA64_SC_FLAG_FPH_VALID            (1 << IA64_SC_FLAG_FPH_VALID_BIT)
00080 
00081 #endif /* _BITS_SIGCONTEXT_H */