Back to index

glibc  2.9
ucontext.h
Go to the documentation of this file.
00001 /* Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 /* Where is System V/SH ABI?  */
00020 
00021 #ifndef _SYS_UCONTEXT_H
00022 #define _SYS_UCONTEXT_H     1
00023 
00024 #include <features.h>
00025 #include <signal.h>
00026 
00027 /* We need the signal context definitions even if they are not used
00028    included in <signal.h>.  */
00029 #include <bits/sigcontext.h>
00030 
00031 
00032 typedef int greg_t;
00033 
00034 /* Number of general registers.  */
00035 #define NFPREG       16
00036 
00037 /* Container for all general registers.  */
00038 typedef greg_t gregset_t[NFPREG];
00039 
00040 #ifdef __USE_GNU
00041 /* Number of each register is the `gregset_t' array.  */
00042 enum
00043 {
00044   R0 = 0,
00045 #define R0    R0
00046   R1 = 1,
00047 #define R1    R1
00048   R2 = 2,
00049 #define R2    R2
00050   R3 = 3,
00051 #define R3    R3
00052   R4 = 4,
00053 #define R4    R4
00054   R5 = 5,
00055 #define R5    R5
00056   R6 = 6,
00057 #define R6    R6
00058   R7 = 7,
00059 #define R7    R7
00060   R8 = 8,
00061 #define R8    R8
00062   R9 = 9,
00063 #define R9    R9
00064   R10 = 10,
00065 #define R10   R10
00066   R11 = 11,
00067 #define R11   R11
00068   R12 = 12,
00069 #define R12   R12
00070   R13 = 13,
00071 #define R13   R13
00072   R14 = 14,
00073 #define R14   R14
00074   R15 = 15,
00075 #define R15   R15
00076 };
00077 #endif
00078 
00079 typedef int freg_t;
00080 
00081 /* Number of FPU registers.  */
00082 #define NFPREG       16
00083 
00084 /* Structure to describe FPU registers.  */
00085 typedef freg_t fpregset_t[NFPREG];
00086 
00087 /* Context to describe whole processor state.  */
00088 typedef struct
00089   {
00090     unsigned int oldmask;
00091     gregset_t gregs;
00092     unsigned int pc;
00093     unsigned int pr;
00094     unsigned int sr;
00095     unsigned int gbr;
00096     unsigned int mach;
00097     unsigned int macl;
00098     fpregset_t fpregs;
00099     fpregset_t xfpregs;
00100     unsigned int fpscr;
00101     unsigned int fpul;
00102     unsigned int ownedfp;
00103   } mcontext_t;
00104 
00105 /* Userlevel context.  */
00106 typedef struct ucontext
00107   {
00108     unsigned long int uc_flags;
00109     struct ucontext *uc_link;
00110     stack_t uc_stack;
00111     mcontext_t uc_mcontext;
00112     __sigset_t uc_sigmask;
00113   } ucontext_t;
00114 
00115 #endif /* sys/ucontext.h */