Back to index

glibc  2.9
ucontext.h
Go to the documentation of this file.
00001 /* Copyright (C) 1998, 1999 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 /* System V/ARM ABI compliant 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 typedef int greg_t;
00028 
00029 /* Number of general registers.  */
00030 #define NGREG 16
00031 
00032 /* Container for all general registers.  */
00033 typedef greg_t gregset_t[NGREG];
00034 
00035 /* Number of each register is the `gregset_t' array.  */
00036 enum
00037 {
00038   R0 = 0,
00039 #define R0    R0
00040   R1 = 1,
00041 #define R1    R1
00042   R2 = 2,
00043 #define R2    R2
00044   R3 = 3,
00045 #define R3    R3
00046   R4 = 4,
00047 #define R4    R4
00048   R5 = 5,
00049 #define R5    R5
00050   R6 = 6,
00051 #define R6    R6
00052   R7 = 7,
00053 #define R7    R7
00054   R8 = 8,
00055 #define R8    R8
00056   R9 = 9,
00057 #define R9    R9
00058   R10 = 10,
00059 #define R10   R10
00060   R11 = 11,
00061 #define R11   R11
00062   R12 = 12,
00063 #define R12   R12
00064   R13 = 13,
00065 #define R13   R13
00066   R14 = 14,
00067 #define R14   R14
00068   R15 = 15,
00069 #define R15   R15
00070 };
00071 
00072 /* Structure to describe FPU registers.  */
00073 typedef struct fpregset
00074   {
00075   } fpregset_t;
00076 
00077 /* Context to describe whole processor state.  */
00078 typedef struct
00079   {
00080     gregset_t gregs;
00081     fpregset_t fpregs;
00082   } mcontext_t;
00083 
00084 /* Userlevel context.  */
00085 typedef struct ucontext
00086   {
00087     unsigned long int uc_flags;
00088     struct ucontext *uc_link;
00089     __sigset_t uc_sigmask;
00090     stack_t uc_stack;
00091     mcontext_t uc_mcontext;
00092     long int uc_filler[5];
00093   } ucontext_t;
00094 
00095 #endif /* sys/ucontext.h */