Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _ASMARM_UCONTEXT_H |
| 2 | #define _ASMARM_UCONTEXT_H |
| 3 | |
Daniel Jacobowitz | 85fe068 | 2006-06-24 23:46:21 +0100 | [diff] [blame] | 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 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | struct ucontext { |
| 17 | unsigned long uc_flags; |
| 18 | struct ucontext *uc_link; |
| 19 | stack_t uc_stack; |
| 20 | struct sigcontext uc_mcontext; |
Daniel Jacobowitz | 85fe068 | 2006-06-24 23:46:21 +0100 | [diff] [blame] | 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))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | }; |
| 28 | |
Daniel Jacobowitz | 85fe068 | 2006-06-24 23:46:21 +0100 | [diff] [blame] | 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 | |
Lennert Buytenhek | 3bec6ded | 2006-06-27 22:56:18 +0100 | [diff] [blame] | 38 | #ifdef CONFIG_CRUNCH |
| 39 | #define CRUNCH_MAGIC 0x5065cf03 |
| 40 | #define CRUNCH_STORAGE_SIZE (CRUNCH_SIZE + 8) |
| 41 | |
| 42 | struct crunch_sigframe { |
| 43 | unsigned long magic; |
| 44 | unsigned long size; |
| 45 | struct crunch_state storage; |
| 46 | } __attribute__((__aligned__(8))); |
| 47 | #endif |
| 48 | |
Daniel Jacobowitz | 85fe068 | 2006-06-24 23:46:21 +0100 | [diff] [blame] | 49 | #ifdef CONFIG_IWMMXT |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 50 | /* iwmmxt_area is 0x98 bytes long, preceded by 8 bytes of signature */ |
Daniel Jacobowitz | 85fe068 | 2006-06-24 23:46:21 +0100 | [diff] [blame] | 51 | #define IWMMXT_MAGIC 0x12ef842a |
| 52 | #define IWMMXT_STORAGE_SIZE (IWMMXT_SIZE + 8) |
| 53 | |
| 54 | struct iwmmxt_sigframe { |
| 55 | unsigned long magic; |
| 56 | unsigned long size; |
| 57 | struct iwmmxt_struct storage; |
| 58 | } __attribute__((__aligned__(8))); |
| 59 | #endif /* CONFIG_IWMMXT */ |
| 60 | |
| 61 | #ifdef CONFIG_VFP |
Daniel Jacobowitz | 85fe068 | 2006-06-24 23:46:21 +0100 | [diff] [blame] | 62 | #define VFP_MAGIC 0x56465001 |
Daniel Jacobowitz | 85fe068 | 2006-06-24 23:46:21 +0100 | [diff] [blame] | 63 | |
| 64 | struct vfp_sigframe |
| 65 | { |
| 66 | unsigned long magic; |
| 67 | unsigned long size; |
Imre Deak | 82c6f5a | 2010-04-11 15:58:27 +0100 | [diff] [blame] | 68 | struct user_vfp ufp; |
| 69 | struct user_vfp_exc ufp_exc; |
| 70 | } __attribute__((__aligned__(8))); |
| 71 | |
| 72 | /* |
| 73 | * 8 byte for magic and size, 264 byte for ufp, 12 bytes for ufp_exc, |
| 74 | * 4 bytes padding. |
| 75 | */ |
| 76 | #define VFP_STORAGE_SIZE sizeof(struct vfp_sigframe) |
| 77 | |
Daniel Jacobowitz | 85fe068 | 2006-06-24 23:46:21 +0100 | [diff] [blame] | 78 | #endif /* CONFIG_VFP */ |
| 79 | |
| 80 | /* |
| 81 | * Auxiliary signal frame. This saves stuff like FP state. |
| 82 | * The layout of this structure is not part of the user ABI, |
| 83 | * because the config options aren't. uc_regspace is really |
| 84 | * one of these. |
| 85 | */ |
| 86 | struct aux_sigframe { |
Lennert Buytenhek | 3bec6ded | 2006-06-27 22:56:18 +0100 | [diff] [blame] | 87 | #ifdef CONFIG_CRUNCH |
| 88 | struct crunch_sigframe crunch; |
| 89 | #endif |
Daniel Jacobowitz | 85fe068 | 2006-06-24 23:46:21 +0100 | [diff] [blame] | 90 | #ifdef CONFIG_IWMMXT |
| 91 | struct iwmmxt_sigframe iwmmxt; |
| 92 | #endif |
Imre Deak | 82c6f5a | 2010-04-11 15:58:27 +0100 | [diff] [blame] | 93 | #ifdef CONFIG_VFP |
Daniel Jacobowitz | 85fe068 | 2006-06-24 23:46:21 +0100 | [diff] [blame] | 94 | struct vfp_sigframe vfp; |
| 95 | #endif |
| 96 | /* Something that isn't a valid magic number for any coprocessor. */ |
| 97 | unsigned long end_magic; |
| 98 | } __attribute__((__aligned__(8))); |
| 99 | |
| 100 | #endif |
| 101 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | #endif /* !_ASMARM_UCONTEXT_H */ |