aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/boot/video-vga.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-08-22 19:28:01 -0400
committerH. Peter Anvin <hpa@zytor.com>2007-08-23 16:03:25 -0400
commitb015124e562a040f7faf361c72e8f5f457ac6cf5 (patch)
tree452f3fe6b9a7d2ef692e021a18f588490bc78441 /arch/i386/boot/video-vga.c
parentb377fd3982ad957c796758a90e2988401a884241 (diff)
[x86 setup] Volatilize asm() statements
asm() statements need to be volatile when: a. They have side effects (other than value returned). b. When the value returned can vary over time. c. When they have ordering constraints that cannot be expressed to gcc. In particular, the keyboard and timer reads were violating constraint (b), which resulted in the keyboard/timeout poll getting loop-invariant-removed when compiling with gcc 4.2.0. Thanks to an anonymous bug reporter for pointing this out. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/i386/boot/video-vga.c')
-rw-r--r--arch/i386/boot/video-vga.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/i386/boot/video-vga.c b/arch/i386/boot/video-vga.c
index 700d09a9c9b3..d660e608cd58 100644
--- a/arch/i386/boot/video-vga.c
+++ b/arch/i386/boot/video-vga.c
@@ -47,16 +47,16 @@ static u8 vga_set_basic_mode(void)
47 47
48#ifdef CONFIG_VIDEO_400_HACK 48#ifdef CONFIG_VIDEO_400_HACK
49 if (adapter >= ADAPTER_VGA) { 49 if (adapter >= ADAPTER_VGA) {
50 asm(INT10 50 asm volatile(INT10
51 : : "a" (0x1202), "b" (0x0030) 51 : : "a" (0x1202), "b" (0x0030)
52 : "ecx", "edx", "esi", "edi"); 52 : "ecx", "edx", "esi", "edi");
53 } 53 }
54#endif 54#endif
55 55
56 ax = 0x0f00; 56 ax = 0x0f00;
57 asm(INT10 57 asm volatile(INT10
58 : "+a" (ax) 58 : "+a" (ax)
59 : : "ebx", "ecx", "edx", "esi", "edi"); 59 : : "ebx", "ecx", "edx", "esi", "edi");
60 60
61 mode = (u8)ax; 61 mode = (u8)ax;
62 62