aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-04-19 01:21:44 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-19 12:13:51 -0400
commitfb30d64568fd8f6a21afef987f11852a109723da (patch)
treef5cb57a46f237bb3500743d3421d2ec95849e38a /arch
parent966a082f80a073af1564c5ed6313ef2f0587dde3 (diff)
[PATCH] uml: add missing __volatile__
We were missing __volatile__ on some bits of asm in the segfault handlers. On x86_64, this was messing up the move from %rdx to uc because that was moved to after the GET_FAULTINFO_FROM_SC, which changed %rdx. Also changed the other bit of asm and the one in the i386 handler to prevent any similar occurrences. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/um/sys-i386/stub_segv.c4
-rw-r--r--arch/um/sys-x86_64/stub_segv.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/arch/um/sys-i386/stub_segv.c b/arch/um/sys-i386/stub_segv.c
index a37f672ec964..2355dc19c46c 100644
--- a/arch/um/sys-i386/stub_segv.c
+++ b/arch/um/sys-i386/stub_segv.c
@@ -27,6 +27,6 @@ stub_segv_handler(int sig)
27 * the stack in its original form when we do the sigreturn here, by 27 * the stack in its original form when we do the sigreturn here, by
28 * hand. 28 * hand.
29 */ 29 */
30 __asm__("mov %0,%%esp ; movl %1, %%eax ; " 30 __asm__ __volatile__("mov %0,%%esp ; movl %1, %%eax ; "
31 "int $0x80" : : "a" (sc), "g" (__NR_sigreturn)); 31 "int $0x80" : : "a" (sc), "g" (__NR_sigreturn));
32} 32}
diff --git a/arch/um/sys-x86_64/stub_segv.c b/arch/um/sys-x86_64/stub_segv.c
index a27099533198..1c967026c957 100644
--- a/arch/um/sys-x86_64/stub_segv.c
+++ b/arch/um/sys-x86_64/stub_segv.c
@@ -33,7 +33,7 @@ stub_segv_handler(int sig)
33 struct ucontext *uc; 33 struct ucontext *uc;
34 int pid; 34 int pid;
35 35
36 __asm__("movq %%rdx, %0" : "=g" (uc) :); 36 __asm__ __volatile__("movq %%rdx, %0" : "=g" (uc) :);
37 GET_FAULTINFO_FROM_SC(*((struct faultinfo *) UML_CONFIG_STUB_DATA), 37 GET_FAULTINFO_FROM_SC(*((struct faultinfo *) UML_CONFIG_STUB_DATA),
38 &uc->uc_mcontext); 38 &uc->uc_mcontext);
39 39
@@ -44,8 +44,8 @@ stub_segv_handler(int sig)
44 * the signal frame. So, we use the ucontext pointer, which we know 44 * the signal frame. So, we use the ucontext pointer, which we know
45 * already, to get the signal frame pointer, and add 8 to that. 45 * already, to get the signal frame pointer, and add 8 to that.
46 */ 46 */
47 __asm__("movq %0, %%rsp; movq %1, %%rax ; syscall": : 47 __asm__ __volatile__("movq %0, %%rsp; movq %1, %%rax ; syscall": :
48 "g" ((unsigned long) container_of(uc, struct rt_sigframe, 48 "g" ((unsigned long)
49 uc) + 8), 49 container_of(uc, struct rt_sigframe, uc) + 8),
50 "g" (__NR_rt_sigreturn)); 50 "g" (__NR_rt_sigreturn));
51} 51}