]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/arm/include/asm/ucontext.h
Merge tag 'for-linus-20170825' of git://git.infradead.org/linux-mtd
[mirror_ubuntu-artful-kernel.git] / arch / arm / include / asm / ucontext.h
CommitLineData
1da177e4
LT
1#ifndef _ASMARM_UCONTEXT_H
2#define _ASMARM_UCONTEXT_H
3
85fe0681
DJ
4#include <asm/fpstate.h>
5
6/*
7 * struct sigcontext only has room for the basic registers, but struct
8 * ucontext now has room for all registers which need to be saved and
9 * restored. Coprocessor registers are stored in uc_regspace. Each
10 * coprocessor's saved state should start with a documented 32-bit magic
11 * number, followed by a 32-bit word giving the coproccesor's saved size.
12 * uc_regspace may be expanded if necessary, although this takes some
13 * coordination with glibc.
14 */
15
1da177e4
LT
16struct ucontext {
17 unsigned long uc_flags;
18 struct ucontext *uc_link;
19 stack_t uc_stack;
20 struct sigcontext uc_mcontext;
85fe0681
DJ
21 sigset_t uc_sigmask;
22 /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */
23 int __unused[32 - (sizeof (sigset_t) / sizeof (int))];
24 /* Last for extensibility. Eight byte aligned because some
25 coprocessors require eight byte alignment. */
26 unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
1da177e4
LT
27};
28
85fe0681
DJ
29#ifdef __KERNEL__
30
31/*
32 * Coprocessor save state. The magic values and specific
33 * coprocessor's layouts are part of the userspace ABI. Each one of
34 * these should be a multiple of eight bytes and aligned to eight
35 * bytes, to prevent unpredictable padding in the signal frame.
36 */
37
ce184a0d
DM
38/*
39 * Dummy padding block: if this magic is encountered, the block should
40 * be skipped using the corresponding size field.
41 */
42#define DUMMY_MAGIC 0xb0d9ed01
43
3bec6ded
LB
44#ifdef CONFIG_CRUNCH
45#define CRUNCH_MAGIC 0x5065cf03
46#define CRUNCH_STORAGE_SIZE (CRUNCH_SIZE + 8)
47
48struct crunch_sigframe {
49 unsigned long magic;
50 unsigned long size;
51 struct crunch_state storage;
52} __attribute__((__aligned__(8)));
53#endif
54
85fe0681 55#ifdef CONFIG_IWMMXT
25985edc 56/* iwmmxt_area is 0x98 bytes long, preceded by 8 bytes of signature */
85fe0681
DJ
57#define IWMMXT_MAGIC 0x12ef842a
58#define IWMMXT_STORAGE_SIZE (IWMMXT_SIZE + 8)
59
60struct iwmmxt_sigframe {
61 unsigned long magic;
62 unsigned long size;
63 struct iwmmxt_struct storage;
64} __attribute__((__aligned__(8)));
65#endif /* CONFIG_IWMMXT */
66
67#ifdef CONFIG_VFP
85fe0681 68#define VFP_MAGIC 0x56465001
85fe0681
DJ
69
70struct vfp_sigframe
71{
72 unsigned long magic;
73 unsigned long size;
82c6f5a5
ID
74 struct user_vfp ufp;
75 struct user_vfp_exc ufp_exc;
76} __attribute__((__aligned__(8)));
77
78/*
79 * 8 byte for magic and size, 264 byte for ufp, 12 bytes for ufp_exc,
80 * 4 bytes padding.
81 */
82#define VFP_STORAGE_SIZE sizeof(struct vfp_sigframe)
83
85fe0681
DJ
84#endif /* CONFIG_VFP */
85
86/*
87 * Auxiliary signal frame. This saves stuff like FP state.
88 * The layout of this structure is not part of the user ABI,
89 * because the config options aren't. uc_regspace is really
90 * one of these.
91 */
92struct aux_sigframe {
3bec6ded
LB
93#ifdef CONFIG_CRUNCH
94 struct crunch_sigframe crunch;
95#endif
85fe0681
DJ
96#ifdef CONFIG_IWMMXT
97 struct iwmmxt_sigframe iwmmxt;
98#endif
82c6f5a5 99#ifdef CONFIG_VFP
85fe0681
DJ
100 struct vfp_sigframe vfp;
101#endif
102 /* Something that isn't a valid magic number for any coprocessor. */
103 unsigned long end_magic;
104} __attribute__((__aligned__(8)));
105
106#endif
107
1da177e4 108#endif /* !_ASMARM_UCONTEXT_H */