1 /* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. 2 This file is part of the GNU C Library. 3 4 The GNU C Library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 2.1 of the License, or (at your option) any later version. 8 9 The GNU C Library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public 15 License along with the GNU C Library; if not, see 16 <http://www.gnu.org/licenses/>. */ 17 18 /* H8/300 compliant context switching support. */ 19 20 #ifndef _SYS_UCONTEXT_H 21 #define _SYS_UCONTEXT_H 1 22 23 #include <features.h> 24 #include <signal.h> 25 26 typedef int greg_t; 27 28 /* Number of general registers. */ 29 #define NFPREG 8 30 31 /* Container for all general registers. */ 32 typedef greg_t gregset_t[NFPREG]; 33 34 #ifdef __USE_GNU 35 /* Number of each register is the `gregset_t' array. */ 36 enum 37 { 38 ER0 = 0, 39 #define ER0 ER0 40 ER1 = 1, 41 #define ER1 ER1 42 ER2 = 2, 43 #define ER2 ER2 44 ER3 = 3, 45 #define ER3 ER3 46 ER4 = 4, 47 #define ER4 ER4 48 ER5 = 5, 49 #define ER5 ER5 50 ER6 = 6, 51 #define ER6 ER6 52 ER7 = 7, 53 #define ER7 ER7 54 }; 55 #endif 56 57 /* Context to describe whole processor state. */ 58 typedef struct 59 { 60 gregset_t gregs; 61 } mcontext_t; 62 63 /* Userlevel context. */ 64 typedef struct ucontext 65 { 66 unsigned long int uc_flags; 67 struct ucontext *uc_link; 68 stack_t uc_stack; 69 mcontext_t uc_mcontext; 70 __sigset_t uc_sigmask; 71 } ucontext_t; 72 73 #endif 74 75