Back to index

glibc  2.9
ucontext.h
Go to the documentation of this file.
00001 /* Copyright (C) 1998, 1999, 2001, 2006 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 #include <sys/procfs.h>
00027 
00028 /* We need the signal context definitions even if they are not used
00029    included in <signal.h>.  */
00030 #include <bits/sigcontext.h>
00031 
00032 typedef int greg_t;
00033 
00034 /* Number of general registers.  */
00035 #define NGREG 18
00036 
00037 /* Container for all general registers.  */
00038 typedef elf_gregset_t gregset_t;
00039 
00040 /* Number of each register is the `gregset_t' array.  */
00041 enum
00042 {
00043   R0 = 0,
00044 #define R0    R0
00045   R1 = 1,
00046 #define R1    R1
00047   R2 = 2,
00048 #define R2    R2
00049   R3 = 3,
00050 #define R3    R3
00051   R4 = 4,
00052 #define R4    R4
00053   R5 = 5,
00054 #define R5    R5
00055   R6 = 6,
00056 #define R6    R6
00057   R7 = 7,
00058 #define R7    R7
00059   R8 = 8,
00060 #define R8    R8
00061   R9 = 9,
00062 #define R9    R9
00063   R10 = 10,
00064 #define R10   R10
00065   R11 = 11,
00066 #define R11   R11
00067   R12 = 12,
00068 #define R12   R12
00069   R13 = 13,
00070 #define R13   R13
00071   R14 = 14,
00072 #define R14   R14
00073   R15 = 15
00074 #define R15   R15
00075 };
00076 
00077 /* Structure to describe FPU registers.  */
00078 typedef elf_fpregset_t      fpregset_t;
00079 
00080 /* Context to describe whole processor state.  This only describes
00081    the core registers; coprocessor registers get saved elsewhere
00082    (e.g. in uc_regspace, or somewhere unspecified on the stack
00083    during non-RT signal handlers).  */
00084 typedef struct sigcontext mcontext_t;
00085 
00086 /* Userlevel context.  */
00087 typedef struct ucontext
00088   {
00089     unsigned long uc_flags;
00090     struct ucontext *uc_link;
00091     stack_t uc_stack;
00092     mcontext_t uc_mcontext;
00093     __sigset_t uc_sigmask;
00094     unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
00095   } ucontext_t;
00096 
00097 #endif /* sys/ucontext.h */