diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2009-06-30 22:13:07 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-07-04 15:56:32 -0400 |
commit | febe04de3be4bf66f9339d8847db2806d99fd164 (patch) | |
tree | e1143d42fc562326196b3eeead563c70449dc019 | |
parent | 22a26e6663008e1fc4d1467aaff7e775124bce31 (diff) |
x86: fix usage of bios intcall()
Some intcall() misuses the input biosregs as output in
cf06de7b9cdd3efee7a59dced1977b3c21d43732
This fixes the problem vga=ask boot option doesn't show enough modes.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
LKML-Reference: <20090701021307.GA3127@localhost.localdomain>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | arch/x86/boot/video-bios.c | 3 | ||||
-rw-r--r-- | arch/x86/boot/video-vesa.c | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/boot/video-bios.c b/arch/x86/boot/video-bios.c index d660be492363..49e0c18833e0 100644 --- a/arch/x86/boot/video-bios.c +++ b/arch/x86/boot/video-bios.c | |||
@@ -37,14 +37,13 @@ static int set_bios_mode(u8 mode) | |||
37 | ireg.al = mode; /* AH=0x00 Set Video Mode */ | 37 | ireg.al = mode; /* AH=0x00 Set Video Mode */ |
38 | intcall(0x10, &ireg, NULL); | 38 | intcall(0x10, &ireg, NULL); |
39 | 39 | ||
40 | |||
41 | ireg.ah = 0x0f; /* Get Current Video Mode */ | 40 | ireg.ah = 0x0f; /* Get Current Video Mode */ |
42 | intcall(0x10, &ireg, &oreg); | 41 | intcall(0x10, &ireg, &oreg); |
43 | 42 | ||
44 | do_restore = 1; /* Assume video contents were lost */ | 43 | do_restore = 1; /* Assume video contents were lost */ |
45 | 44 | ||
46 | /* Not all BIOSes are clean with the top bit */ | 45 | /* Not all BIOSes are clean with the top bit */ |
47 | new_mode = ireg.al & 0x7f; | 46 | new_mode = oreg.al & 0x7f; |
48 | 47 | ||
49 | if (new_mode == mode) | 48 | if (new_mode == mode) |
50 | return 0; /* Mode change OK */ | 49 | return 0; /* Mode change OK */ |
diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c index c700147d6ffb..275dd177f198 100644 --- a/arch/x86/boot/video-vesa.c +++ b/arch/x86/boot/video-vesa.c | |||
@@ -45,7 +45,7 @@ static int vesa_probe(void) | |||
45 | ireg.di = (size_t)&vginfo; | 45 | ireg.di = (size_t)&vginfo; |
46 | intcall(0x10, &ireg, &oreg); | 46 | intcall(0x10, &ireg, &oreg); |
47 | 47 | ||
48 | if (ireg.ax != 0x004f || | 48 | if (oreg.ax != 0x004f || |
49 | vginfo.signature != VESA_MAGIC || | 49 | vginfo.signature != VESA_MAGIC || |
50 | vginfo.version < 0x0102) | 50 | vginfo.version < 0x0102) |
51 | return 0; /* Not present */ | 51 | return 0; /* Not present */ |
@@ -70,7 +70,7 @@ static int vesa_probe(void) | |||
70 | ireg.di = (size_t)&vminfo; | 70 | ireg.di = (size_t)&vminfo; |
71 | intcall(0x10, &ireg, &oreg); | 71 | intcall(0x10, &ireg, &oreg); |
72 | 72 | ||
73 | if (ireg.ax != 0x004f) | 73 | if (oreg.ax != 0x004f) |
74 | continue; | 74 | continue; |
75 | 75 | ||
76 | if ((vminfo.mode_attr & 0x15) == 0x05) { | 76 | if ((vminfo.mode_attr & 0x15) == 0x05) { |