summaryrefslogtreecommitdiffstats
path: root/arch/um/include/longjmp.h
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2006-10-11 10:21:34 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 20:14:20 +0200
commitb5cdb5797d364a112879e49cc708083853ffc592 (patch)
treefa87aa6b3a0511ffe7f7c76f52e3e0d037833bb0 /arch/um/include/longjmp.h
parent[PATCH] uml: make TT mode compile after setjmp-related changes (diff)
downloadlinux-b5cdb5797d364a112879e49cc708083853ffc592.tar.xz
linux-b5cdb5797d364a112879e49cc708083853ffc592.zip
[PATCH] uml: make UML_SETJMP always safe
If enable is moved by GCC in a register its value may not be preserved after coming back there with longjmp(). So, mark it as volatile to prevent this; this is suggested (it seems) in info gcc, when it talks about -Wuninitialized. I re-read this and it seems to say something different, but I still believe this may be needed. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to '')
-rw-r--r--arch/um/include/longjmp.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/um/include/longjmp.h b/arch/um/include/longjmp.h
index e93c6d3e893b..e860bc5848e0 100644
--- a/arch/um/include/longjmp.h
+++ b/arch/um/include/longjmp.h
@@ -12,7 +12,8 @@ extern void longjmp(jmp_buf, int);
} while(0)
#define UML_SETJMP(buf) ({ \
- int n, enable; \
+ int n; \
+ volatile int enable; \
enable = get_signals(); \
n = setjmp(*buf); \
if(n != 0) \