diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-08-23 09:28:42 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-08-23 13:03:25 -0700 |
commit | 71351b98b9be6a867aa00276d67716c0728cfff7 (patch) | |
tree | 9ab25a995c333d21274403ca7302449d51544b26 /arch | |
parent | b015124e562a040f7faf361c72e8f5f457ac6cf5 (diff) | |
download | linux-71351b98b9be6a867aa00276d67716c0728cfff7.tar.gz linux-71351b98b9be6a867aa00276d67716c0728cfff7.tar.bz2 linux-71351b98b9be6a867aa00276d67716c0728cfff7.zip |
[x86 setup] Make sure AH=00h when setting a video mode
Passing a u8 into a register doesn't mean gcc will zero-extend it.
Also, don't depend on thhe register not to change.
Per bug report from Saul Tamari.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/boot/video-vga.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/i386/boot/video-vga.c b/arch/i386/boot/video-vga.c index d660e608cd58..aef02f9ec0c1 100644 --- a/arch/i386/boot/video-vga.c +++ b/arch/i386/boot/video-vga.c @@ -73,9 +73,10 @@ static u8 vga_set_basic_mode(void) mode = 3; /* Set the mode */ + ax = mode; asm volatile(INT10 - : : "a" (mode) - : "ebx", "ecx", "edx", "esi", "edi"); + : "+a" (ax) + : : "ebx", "ecx", "edx", "esi", "edi"); do_restore = 1; return mode; } |