x86: fix usage of bios intcall()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- arch/x86/boot/video-bios.c | 3 +-- arch/x86/boot/video-vesa.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)
arch/x86/boot/video-bios.c +1 -2
@@ -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 */
arch/x86/boot/video-vesa.c +2 -2
@@ -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 ) {
Could someone review this patch?
Quoted 53 lines · Akinobu Mita
Some
intcall()misuses the input biosregs as output incf06de7b9cdd3efee7a59dced1977b3c21d43732This fixes the problem vga=ask boot option doesn't show enough modes.
Signed-off-by Akinobu Mita <[email protected]>--- arch/x86/boot/video-bios.c | 3 +-- arch/x86/boot/video-vesa.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)arch/x86/boot/video-bios.c +1
-2@@ -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 */ arch/x86/boot/video-vesa.c +2
-2@@ -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 ) {
Commit-ID: febe04de3be4bf66f9339d8847db2806d99fd164 Gitweb: http://git.kernel.org/tip/febe04de3be4bf66f9339d8847db2806d99fd164 Author: Akinobu Mita <[email protected]> AuthorDate: Wed, 1 Jul 2009 11:13:07 +0900 Committer: H. Peter Anvin <[email protected]> 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 <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by H. Peter Anvin <[email protected]>
--- arch/x86/boot/video-bios.c | 3 +-- arch/x86/boot/video-vesa.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)
arch/x86/boot/video-bios.c +1 -2
@@ -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 */
arch/x86/boot/video-vesa.c +2 -2
@@ -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 ) {