Back to index

glibc  2.9
sigcontext.h
Go to the documentation of this file.
00001 /* Machine-dependent signal context structure for GNU Hurd.  MIPS version.
00002    Copyright (C) 1994,97,2001 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
00021 # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
00022 #endif
00023 
00024 #ifndef sc_mips_thread_state
00025 
00026 /* Signal handlers are actually called:
00027    void handler (int sig, int code, struct sigcontext *scp);  */
00028 
00029 /* State of this thread when the signal was taken.  */
00030 struct sigcontext
00031   {
00032     /* These first members are machine-independent.  */
00033 
00034     int sc_onstack;         /* Nonzero if running on sigstack.  */
00035     __sigset_t sc_mask;            /* Blocked signals to restore.  */
00036 
00037     /* MiG reply port this thread is using.  */
00038     unsigned int sc_reply_port;
00039 
00040     /* Port this thread is doing an interruptible RPC on.  */
00041     unsigned int sc_intr_port;
00042 
00043     /* Error code associated with this signal (interpreted as `error_t').  */
00044     int sc_error;
00045 
00046     /* All following members are machine-dependent.  The rest of this
00047        structure is written to be laid out identically to:
00048        {
00049          struct mips_thread_state ts;
00050          struct mips_exc_state es;
00051          struct mips_float_state fs;
00052        }
00053        trampoline.c knows this, so it must be changed if this changes.  */
00054 #define       sc_mips_thread_state sc_gpr /* Beginning of correspondence.  */
00055     int sc_gpr[31];         /* "General" registers; [0] is r1.  */
00056     int sc_mdlo, sc_mdhi;   /* Low and high multiplication results.  */
00057     int sc_pc;                     /* Instruction pointer.  */
00058 
00059     /* struct mips_exc_state */
00060 #define sc_mips_exc_state sc_cause
00061     unsigned int sc_cause;  /* Machine-level trap code.  */
00062 #define SC_CAUSE_SST 0x00000044
00063     unsigned int sc_badvaddr;
00064     unsigned int sc_coproc_used; /* Which coprocessors the thread has used.  */
00065 #define SC_COPROC_USE_COP0  1 /* (by definition) */
00066 #define SC_COPROC_USE_COP1  2 /* FPA */
00067 #define       SC_COPROC_USE_FPU    SC_COPROC_USE_COP1
00068 #define SC_COPROC_USE_COP2  4
00069 #define SC_COPROC_USE_COP3  8
00070 
00071     /* struct mips_float_state
00072        This is only filled in if the SC_COPROC_USE_FPU bit
00073        is set in sc_coproc_used.  */
00074 #define sc_mips_float_state sc_fpr
00075     int sc_fpr[32];         /* FP registers.  */
00076     int sc_fpcsr;           /* FPU status register.  */
00077     int sc_fpeir;           /* FP exception instruction register.  */
00078   };
00079 
00080 #endif /* sc_mips_thread_state */