1 /* Data structures for user-level context switching. MicroBlaze version. 2 Copyright (C) 1997-2021 Free Software Foundation, Inc. 3 This file is part of the GNU C Library. 4 5 The GNU C Library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 10 The GNU C Library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with the GNU C Library; if not, see 17 <https://www.gnu.org/licenses/>. */ 18 19 #ifndef _SYS_UCONTEXT_H 20 #define _SYS_UCONTEXT_H 1 21 22 #include <features.h> 23 24 #include <bits/types/sigset_t.h> 25 #include <bits/types/stack_t.h> 26 27 28 #ifdef __USE_MISC 29 # define __ctx(fld) fld 30 #else 31 # define __ctx(fld) __ ## fld 32 #endif 33 34 typedef struct 35 { 36 struct 37 { 38 unsigned long int __ctx(r0); 39 unsigned long int __ctx(r1); 40 unsigned long int __ctx(r2); 41 unsigned long int __ctx(r3); 42 unsigned long int __ctx(r4); 43 unsigned long int __ctx(r5); 44 unsigned long int __ctx(r6); 45 unsigned long int __ctx(r7); 46 unsigned long int __ctx(r8); 47 unsigned long int __ctx(r9); 48 unsigned long int __ctx(r10); 49 unsigned long int __ctx(r11); 50 unsigned long int __ctx(r12); 51 unsigned long int __ctx(r13); 52 unsigned long int __ctx(r14); 53 unsigned long int __ctx(r15); 54 unsigned long int __ctx(r16); 55 unsigned long int __ctx(r17); 56 unsigned long int __ctx(r18); 57 unsigned long int __ctx(r19); 58 unsigned long int __ctx(r20); 59 unsigned long int __ctx(r21); 60 unsigned long int __ctx(r22); 61 unsigned long int __ctx(r23); 62 unsigned long int __ctx(r24); 63 unsigned long int __ctx(r25); 64 unsigned long int __ctx(r26); 65 unsigned long int __ctx(r27); 66 unsigned long int __ctx(r28); 67 unsigned long int __ctx(r29); 68 unsigned long int __ctx(r30); 69 unsigned long int __ctx(r31); 70 unsigned long int __ctx(pc); 71 unsigned long int __ctx(msr); 72 unsigned long int __ctx(ear); 73 unsigned long int __ctx(esr); 74 unsigned long int __ctx(fsr); 75 int __ctx(pt_mode); 76 } __ctx(regs); 77 unsigned long int __ctx(oldmask); 78 } mcontext_t; 79 80 /* Userlevel context. */ 81 typedef struct ucontext_t 82 { 83 unsigned long int __ctx(uc_flags); 84 struct ucontext_t *uc_link; 85 stack_t uc_stack; 86 mcontext_t uc_mcontext; 87 sigset_t uc_sigmask; 88 } ucontext_t; 89 90 #undef __ctx 91 92 #endif /* sys/ucontext.h */ 93