Commit febe04de authored by Akinobu Mita's avatar Akinobu Mita Committed by H. Peter Anvin

x86: fix usage of bios intcall()

Some intcall() misuses the input biosregs as output in
cf06de7b

This fixes the problem vga=ask boot option doesn't show enough modes.
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
LKML-Reference: <20090701021307.GA3127@localhost.localdomain>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent 22a26e66
...@@ -37,14 +37,13 @@ static int set_bios_mode(u8 mode) ...@@ -37,14 +37,13 @@ static int set_bios_mode(u8 mode)
ireg.al = mode; /* AH=0x00 Set Video Mode */ ireg.al = mode; /* AH=0x00 Set Video Mode */
intcall(0x10, &ireg, NULL); intcall(0x10, &ireg, NULL);
ireg.ah = 0x0f; /* Get Current Video Mode */ ireg.ah = 0x0f; /* Get Current Video Mode */
intcall(0x10, &ireg, &oreg); intcall(0x10, &ireg, &oreg);
do_restore = 1; /* Assume video contents were lost */ do_restore = 1; /* Assume video contents were lost */
/* Not all BIOSes are clean with the top bit */ /* Not all BIOSes are clean with the top bit */
new_mode = ireg.al & 0x7f; new_mode = oreg.al & 0x7f;
if (new_mode == mode) if (new_mode == mode)
return 0; /* Mode change OK */ return 0; /* Mode change OK */
......
...@@ -45,7 +45,7 @@ static int vesa_probe(void) ...@@ -45,7 +45,7 @@ static int vesa_probe(void)
ireg.di = (size_t)&vginfo; ireg.di = (size_t)&vginfo;
intcall(0x10, &ireg, &oreg); intcall(0x10, &ireg, &oreg);
if (ireg.ax != 0x004f || if (oreg.ax != 0x004f ||
vginfo.signature != VESA_MAGIC || vginfo.signature != VESA_MAGIC ||
vginfo.version < 0x0102) vginfo.version < 0x0102)
return 0; /* Not present */ return 0; /* Not present */
...@@ -70,7 +70,7 @@ static int vesa_probe(void) ...@@ -70,7 +70,7 @@ static int vesa_probe(void)
ireg.di = (size_t)&vminfo; ireg.di = (size_t)&vminfo;
intcall(0x10, &ireg, &oreg); intcall(0x10, &ireg, &oreg);
if (ireg.ax != 0x004f) if (oreg.ax != 0x004f)
continue; continue;
if ((vminfo.mode_attr & 0x15) == 0x05) { if ((vminfo.mode_attr & 0x15) == 0x05) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment