* [PATCH] x86: fix usage of bios intcall()
@ 2009-07-01 2:13 Akinobu Mita
2009-07-04 2:14 ` Akinobu Mita
2009-07-04 20:07 ` [tip:x86/urgent] " tip-bot for Akinobu Mita
0 siblings, 2 replies; 3+ messages in thread
From: Akinobu Mita @ 2009-07-01 2:13 UTC (permalink / raw)
To: linux-kernel; +Cc: mingo, tglx, hpa
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>
---
arch/x86/boot/video-bios.c | 3 +--
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 d660be4..49e0c18 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)
ireg.al = mode; /* AH=0x00 Set Video Mode */
intcall(0x10, &ireg, NULL);
-
ireg.ah = 0x0f; /* Get Current Video Mode */
intcall(0x10, &ireg, &oreg);
do_restore = 1; /* Assume video contents were lost */
/* Not all BIOSes are clean with the top bit */
- new_mode = ireg.al & 0x7f;
+ new_mode = oreg.al & 0x7f;
if (new_mode == mode)
return 0; /* Mode change OK */
diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
index c700147..275dd17 100644
--- a/arch/x86/boot/video-vesa.c
+++ b/arch/x86/boot/video-vesa.c
@@ -45,7 +45,7 @@ static int vesa_probe(void)
ireg.di = (size_t)&vginfo;
intcall(0x10, &ireg, &oreg);
- if (ireg.ax != 0x004f ||
+ if (oreg.ax != 0x004f ||
vginfo.signature != VESA_MAGIC ||
vginfo.version < 0x0102)
return 0; /* Not present */
@@ -70,7 +70,7 @@ static int vesa_probe(void)
ireg.di = (size_t)&vminfo;
intcall(0x10, &ireg, &oreg);
- if (ireg.ax != 0x004f)
+ if (oreg.ax != 0x004f)
continue;
if ((vminfo.mode_attr & 0x15) == 0x05) {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86: fix usage of bios intcall()
2009-07-01 2:13 [PATCH] x86: fix usage of bios intcall() Akinobu Mita
@ 2009-07-04 2:14 ` Akinobu Mita
2009-07-04 20:07 ` [tip:x86/urgent] " tip-bot for Akinobu Mita
1 sibling, 0 replies; 3+ messages in thread
From: Akinobu Mita @ 2009-07-04 2:14 UTC (permalink / raw)
To: linux-kernel; +Cc: mingo, tglx, hpa
Could someone review this patch?
On Wed, Jul 01, 2009 at 11:13:07AM +0900, Akinobu Mita wrote:
> 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>
> ---
> arch/x86/boot/video-bios.c | 3 +--
> 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 d660be4..49e0c18 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)
> ireg.al = mode; /* AH=0x00 Set Video Mode */
> intcall(0x10, &ireg, NULL);
>
> -
> ireg.ah = 0x0f; /* Get Current Video Mode */
> intcall(0x10, &ireg, &oreg);
>
> do_restore = 1; /* Assume video contents were lost */
>
> /* Not all BIOSes are clean with the top bit */
> - new_mode = ireg.al & 0x7f;
> + new_mode = oreg.al & 0x7f;
>
> if (new_mode == mode)
> return 0; /* Mode change OK */
> diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
> index c700147..275dd17 100644
> --- a/arch/x86/boot/video-vesa.c
> +++ b/arch/x86/boot/video-vesa.c
> @@ -45,7 +45,7 @@ static int vesa_probe(void)
> ireg.di = (size_t)&vginfo;
> intcall(0x10, &ireg, &oreg);
>
> - if (ireg.ax != 0x004f ||
> + if (oreg.ax != 0x004f ||
> vginfo.signature != VESA_MAGIC ||
> vginfo.version < 0x0102)
> return 0; /* Not present */
> @@ -70,7 +70,7 @@ static int vesa_probe(void)
> ireg.di = (size_t)&vminfo;
> intcall(0x10, &ireg, &oreg);
>
> - if (ireg.ax != 0x004f)
> + if (oreg.ax != 0x004f)
> continue;
>
> if ((vminfo.mode_attr & 0x15) == 0x05) {
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:x86/urgent] x86: fix usage of bios intcall()
2009-07-01 2:13 [PATCH] x86: fix usage of bios intcall() Akinobu Mita
2009-07-04 2:14 ` Akinobu Mita
@ 2009-07-04 20:07 ` tip-bot for Akinobu Mita
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Akinobu Mita @ 2009-07-04 20:07 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, akinobu.mita, tglx
Commit-ID: febe04de3be4bf66f9339d8847db2806d99fd164
Gitweb: http://git.kernel.org/tip/febe04de3be4bf66f9339d8847db2806d99fd164
Author: Akinobu Mita <akinobu.mita@gmail.com>
AuthorDate: Wed, 1 Jul 2009 11:13:07 +0900
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Sat, 4 Jul 2009 12:56:32 -0700
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>
---
arch/x86/boot/video-bios.c | 3 +--
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 d660be4..49e0c18 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)
ireg.al = mode; /* AH=0x00 Set Video Mode */
intcall(0x10, &ireg, NULL);
-
ireg.ah = 0x0f; /* Get Current Video Mode */
intcall(0x10, &ireg, &oreg);
do_restore = 1; /* Assume video contents were lost */
/* Not all BIOSes are clean with the top bit */
- new_mode = ireg.al & 0x7f;
+ new_mode = oreg.al & 0x7f;
if (new_mode == mode)
return 0; /* Mode change OK */
diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
index c700147..275dd17 100644
--- a/arch/x86/boot/video-vesa.c
+++ b/arch/x86/boot/video-vesa.c
@@ -45,7 +45,7 @@ static int vesa_probe(void)
ireg.di = (size_t)&vginfo;
intcall(0x10, &ireg, &oreg);
- if (ireg.ax != 0x004f ||
+ if (oreg.ax != 0x004f ||
vginfo.signature != VESA_MAGIC ||
vginfo.version < 0x0102)
return 0; /* Not present */
@@ -70,7 +70,7 @@ static int vesa_probe(void)
ireg.di = (size_t)&vminfo;
intcall(0x10, &ireg, &oreg);
- if (ireg.ax != 0x004f)
+ if (oreg.ax != 0x004f)
continue;
if ((vminfo.mode_attr & 0x15) == 0x05) {
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-04 20:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 2:13 [PATCH] x86: fix usage of bios intcall() Akinobu Mita
2009-07-04 2:14 ` Akinobu Mita
2009-07-04 20:07 ` [tip:x86/urgent] " tip-bot for Akinobu Mita
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.