1 /* Copyright (C) 1998-2023 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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.
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.
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/>. */
19 /* System V/AArch64 ABI compliant context switching support. */
21 #ifndef _SYS_UCONTEXT_H
22 #define _SYS_UCONTEXT_H 1
26 #include <bits/types/sigset_t.h>
27 #include <bits/types/stack_t.h>
30 # define __ctx(fld) fld
32 # define __ctx(fld) __ ## fld
36 # include <sys/procfs.h>
39 typedef elf_greg_t greg_t
;
41 /* Container for all general registers. */
42 typedef elf_gregset_t gregset_t
;
44 /* Structure to describe FPU registers. */
45 typedef elf_fpregset_t fpregset_t
;
48 /* Context to describe whole processor state. This only describes
49 the core registers; coprocessor registers get saved elsewhere
50 (e.g. in uc_regspace, or somewhere unspecified on the stack
51 during non-RT signal handlers). */
54 unsigned long long int __ctx(fault_address
);
55 unsigned long long int __ctx(regs
)[31];
56 unsigned long long int __ctx(sp
);
57 unsigned long long int __ctx(pc
);
58 unsigned long long int __ctx(pstate
);
59 /* This field contains extension records for additional processor
60 state such as the FP/SIMD state. It has to match the definition
61 of the corresponding field in the sigcontext struct, see the
62 arch/arm64/include/uapi/asm/sigcontext.h linux header for details. */
63 unsigned char __reserved
[4096] __attribute__ ((__aligned__ (16)));
66 /* Userlevel context. */
67 typedef struct ucontext_t
69 unsigned long __ctx(uc_flags
);
70 struct ucontext_t
*uc_link
;
73 mcontext_t uc_mcontext
;
78 #endif /* sys/ucontext.h */