Back to index

glibc  2.9
ucontext.h
Go to the documentation of this file.
00001 /* Copyright 1997, 1999, 2000, 2002 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 Library General Public License as
00006    published by the Free Software Foundation; either version 2 of the
00007    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    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public
00015    License along with the GNU C Library; see the file COPYING.LIB.  If not,
00016    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.  */
00018 
00019 /* AM33/2.0 context switching support.  */
00020 
00021 #ifndef _SYS_UCONTEXT_H
00022 #define _SYS_UCONTEXT_H     1
00023 
00024 #include <features.h>
00025 #include <signal.h>
00026 
00027 /* Type for general register.  */
00028 typedef int greg_t;
00029 
00030 /* Number of general registers.  */
00031 #define NGREG 28
00032 
00033 /* Container for all general registers.  */
00034 typedef greg_t gregset_t[NGREG];
00035 
00036 /* Number of each register is the `gregset_t' array.  */
00037 enum
00038 {
00039   REG_D0 = 0,
00040 #define REG_D0       REG_D0
00041   REG_D1,
00042 #define REG_D1       REG_D1
00043   REG_D2,
00044 #define REG_D2       REG_D2
00045   REG_D3,
00046 #define REG_D3       REG_D3
00047   REG_A0,
00048 #define REG_A0       REG_A0
00049   REG_A1,
00050 #define REG_A1       REG_A1
00051   REG_A2,
00052 #define REG_A2       REG_A2
00053   REG_A3,
00054 #define REG_A3       REG_A3
00055   REG_E0,
00056 #define REG_E0       REG_E0
00057   REG_E1,
00058 #define REG_E1       REG_E1
00059   REG_E2,
00060 #define REG_E2       REG_E2
00061   REG_E3,
00062 #define REG_E3       REG_E3
00063   REG_E4,
00064 #define REG_E4       REG_E4
00065   REG_E5,
00066 #define REG_E5       REG_E5
00067   REG_E6,
00068 #define REG_E6       REG_E6
00069   REG_E7,
00070 #define REG_E7       REG_E7
00071   REG_LAR,
00072 #define REG_LAR      REG_LAR
00073   REG_LIR,
00074 #define REG_LIR      REG_LIR
00075   REG_MDR,
00076 #define REG_MDR      REG_MDR
00077   REG_MCVF,
00078 #define REG_MCVF     REG_MCVF
00079   REG_MCRL,
00080 #define REG_MCRL     REG_MCRL
00081   REG_MCRH,
00082 #define REG_MCRH     REG_MCRH
00083   REG_MDRQ,
00084 #define REG_MDRQ     REG_MDRQ
00085   REG_SP,
00086 #define REG_SP       REG_SP
00087   REG_EPSW,
00088 #define REG_EPSW     REG_EPSW
00089   REG_PC,
00090 #define REG_PC       REG_PC
00091 };
00092 
00093 typedef int freg_t;
00094 
00095 /* Structure to describe FPU registers.  */
00096 typedef struct {
00097   union {
00098     double fp_dregs[16];
00099     float fp_fregs[32];
00100     freg_t fp_regs[32];
00101   } regs;
00102   freg_t fpcr;
00103 } fpregset_t;
00104 
00105 /* Context to describe whole processor state.  */
00106 typedef struct
00107   {
00108     gregset_t gregs;
00109     fpregset_t fpregs;
00110   } mcontext_t;
00111 
00112 /* Userlevel context.  */
00113 typedef struct ucontext
00114   {
00115     unsigned long int uc_flags;
00116     struct ucontext *uc_link;
00117     __sigset_t uc_sigmask;
00118     stack_t uc_stack;
00119     mcontext_t uc_mcontext;
00120     long int uc_filler[5];
00121   } ucontext_t;
00122 
00123 #endif /* sys/ucontext.h */