1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASMARM_UCONTEXT_H
3 #define _ASMARM_UCONTEXT_H
5 #include <asm/fpstate.h>
9 * struct sigcontext only has room for the basic registers, but struct
10 * ucontext now has room for all registers which need to be saved and
11 * restored. Coprocessor registers are stored in uc_regspace. Each
12 * coprocessor's saved state should start with a documented 32-bit magic
13 * number, followed by a 32-bit word giving the coproccesor's saved size.
14 * uc_regspace may be expanded if necessary, although this takes some
15 * coordination with glibc.
19 unsigned long uc_flags;
20 struct ucontext *uc_link;
22 struct sigcontext uc_mcontext;
24 /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */
25 int __unused[32 - (sizeof (sigset_t) / sizeof (int))];
26 /* Last for extensibility. Eight byte aligned because some
27 coprocessors require eight byte alignment. */
28 unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
34 * Coprocessor save state. The magic values and specific
35 * coprocessor's layouts are part of the userspace ABI. Each one of
36 * these should be a multiple of eight bytes and aligned to eight
37 * bytes, to prevent unpredictable padding in the signal frame.
41 * Dummy padding block: if this magic is encountered, the block should
42 * be skipped using the corresponding size field.
44 #define DUMMY_MAGIC 0xb0d9ed01
47 /* iwmmxt_area is 0x98 bytes long, preceded by 8 bytes of signature */
48 #define IWMMXT_MAGIC 0x12ef842a
49 #define IWMMXT_STORAGE_SIZE (IWMMXT_SIZE + 8)
51 struct iwmmxt_sigframe {
54 struct iwmmxt_struct storage;
55 } __attribute__((__aligned__(8)));
56 #endif /* CONFIG_IWMMXT */
59 #define VFP_MAGIC 0x56465001
66 struct user_vfp_exc ufp_exc;
67 } __attribute__((__aligned__(8)));
70 * 8 byte for magic and size, 264 byte for ufp, 12 bytes for ufp_exc,
73 #define VFP_STORAGE_SIZE sizeof(struct vfp_sigframe)
75 #endif /* CONFIG_VFP */
78 * Auxiliary signal frame. This saves stuff like FP state.
79 * The layout of this structure is not part of the user ABI,
80 * because the config options aren't. uc_regspace is really
85 struct iwmmxt_sigframe iwmmxt;
88 struct vfp_sigframe vfp;
90 /* Something that isn't a valid magic number for any coprocessor. */
91 unsigned long end_magic;
92 } __attribute__((__aligned__(8)));
96 #endif /* !_ASMARM_UCONTEXT_H */