diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-02-13 10:20:35 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-02-13 10:20:35 -0500 |
commit | 1cdde19109901e8f1194e227d0bcd48caf713323 (patch) | |
tree | 2d0674a4b7c70d81ae4905a5181cb8ed4777cf85 | |
parent | 96b5a46e2a72dc1829370c87053e0cd558d58bc0 (diff) |
x86: fix sigcontext.h user export
Jakub Jelinek reported that some user-space code that relies on
kernel headers has built dependency on the sigcontext->eip/rip
register names - which have been unified in commit:
commit 742fa54a62be6a263df14a553bf832724471dfbe
Author: H. Peter Anvin <hpa@zytor.com>
Date: Wed Jan 30 13:30:56 2008 +0100
x86: use generic register names in struct sigcontext
so give the old layout to user-space. This is not particularly
pretty, but it's an ABI so there's no danger of the two definitions
getting out of sync.
Reported-by: Jakub Jelinek <jakub@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/asm-x86/sigcontext.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/include/asm-x86/sigcontext.h b/include/asm-x86/sigcontext.h index 681deade5f00..d743947f4c77 100644 --- a/include/asm-x86/sigcontext.h +++ b/include/asm-x86/sigcontext.h | |||
@@ -58,6 +58,7 @@ struct _fpstate { | |||
58 | 58 | ||
59 | #define X86_FXSR_MAGIC 0x0000 | 59 | #define X86_FXSR_MAGIC 0x0000 |
60 | 60 | ||
61 | #ifdef __KERNEL__ | ||
61 | struct sigcontext { | 62 | struct sigcontext { |
62 | unsigned short gs, __gsh; | 63 | unsigned short gs, __gsh; |
63 | unsigned short fs, __fsh; | 64 | unsigned short fs, __fsh; |
@@ -82,6 +83,35 @@ struct sigcontext { | |||
82 | unsigned long oldmask; | 83 | unsigned long oldmask; |
83 | unsigned long cr2; | 84 | unsigned long cr2; |
84 | }; | 85 | }; |
86 | #else /* __KERNEL__ */ | ||
87 | /* | ||
88 | * User-space might still rely on the old definition: | ||
89 | */ | ||
90 | struct sigcontext { | ||
91 | unsigned short gs, __gsh; | ||
92 | unsigned short fs, __fsh; | ||
93 | unsigned short es, __esh; | ||
94 | unsigned short ds, __dsh; | ||
95 | unsigned long edi; | ||
96 | unsigned long esi; | ||
97 | unsigned long ebp; | ||
98 | unsigned long esp; | ||
99 | unsigned long ebx; | ||
100 | unsigned long edx; | ||
101 | unsigned long ecx; | ||
102 | unsigned long eax; | ||
103 | unsigned long trapno; | ||
104 | unsigned long err; | ||
105 | unsigned long eip; | ||
106 | unsigned short cs, __csh; | ||
107 | unsigned long eflags; | ||
108 | unsigned long esp_at_signal; | ||
109 | unsigned short ss, __ssh; | ||
110 | struct _fpstate __user * fpstate; | ||
111 | unsigned long oldmask; | ||
112 | unsigned long cr2; | ||
113 | }; | ||
114 | #endif /* !__KERNEL__ */ | ||
85 | 115 | ||
86 | #else /* __i386__ */ | 116 | #else /* __i386__ */ |
87 | 117 | ||
@@ -102,6 +132,7 @@ struct _fpstate { | |||
102 | __u32 reserved2[24]; | 132 | __u32 reserved2[24]; |
103 | }; | 133 | }; |
104 | 134 | ||
135 | #ifdef __KERNEL__ | ||
105 | struct sigcontext { | 136 | struct sigcontext { |
106 | unsigned long r8; | 137 | unsigned long r8; |
107 | unsigned long r9; | 138 | unsigned long r9; |
@@ -132,6 +163,41 @@ struct sigcontext { | |||
132 | struct _fpstate __user *fpstate; /* zero when no FPU context */ | 163 | struct _fpstate __user *fpstate; /* zero when no FPU context */ |
133 | unsigned long reserved1[8]; | 164 | unsigned long reserved1[8]; |
134 | }; | 165 | }; |
166 | #else /* __KERNEL__ */ | ||
167 | /* | ||
168 | * User-space might still rely on the old definition: | ||
169 | */ | ||
170 | struct sigcontext { | ||
171 | unsigned long r8; | ||
172 | unsigned long r9; | ||
173 | unsigned long r10; | ||
174 | unsigned long r11; | ||
175 | unsigned long r12; | ||
176 | unsigned long r13; | ||
177 | unsigned long r14; | ||
178 | unsigned long r15; | ||
179 | unsigned long rdi; | ||
180 | unsigned long rsi; | ||
181 | unsigned long rbp; | ||
182 | unsigned long rbx; | ||
183 | unsigned long rdx; | ||
184 | unsigned long rax; | ||
185 | unsigned long rcx; | ||
186 | unsigned long rsp; | ||
187 | unsigned long rip; | ||
188 | unsigned long eflags; /* RFLAGS */ | ||
189 | unsigned short cs; | ||
190 | unsigned short gs; | ||
191 | unsigned short fs; | ||
192 | unsigned short __pad0; | ||
193 | unsigned long err; | ||
194 | unsigned long trapno; | ||
195 | unsigned long oldmask; | ||
196 | unsigned long cr2; | ||
197 | struct _fpstate __user *fpstate; /* zero when no FPU context */ | ||
198 | unsigned long reserved1[8]; | ||
199 | }; | ||
200 | #endif /* !__KERNEL__ */ | ||
135 | 201 | ||
136 | #endif /* !__i386__ */ | 202 | #endif /* !__i386__ */ |
137 | 203 | ||