[PATCH] save registers around VESA BIOS calls

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: H. Peter Anvin <hpa@...>
Cc: <linux-kernel@...>
Date: Friday, August 31, 2007 - 12:18 pm

On 11:05 Fri 31 Aug     , Will Simoneau wrote:
as
ks,
up
7.

Apparently some VESA BIOS implementations clobber our registers when called.
Tell gcc about it.

This makes my Dell Inspiron 5150 boot correctly instead of hanging.

Signed-off-by: Will Simoneau <simoneau@ele.uri.edu>

---

--- linux-2.6/arch/i386/boot/video-vesa.c.old	2007-08-31 11:51:40.478575122=
 -0400
+++ linux-2.6/arch/i386/boot/video-vesa.c	2007-08-31 11:51:10.980602450 -04=
00
@@ -39,9 +39,11 @@
=20
 	vginfo.signature =3D VBE2_MAGIC;
=20
-	/* Optimistically assume a VESA BIOS is register-clean... */
 	ax =3D 0x4f00;
-	asm("int $0x10" : "+a" (ax), "=3Dm" (vginfo) : "D" (&vginfo));
+	asm("int $0x10"
+	    : "+a" (ax), "=3Dm" (vginfo)
+	    : "D" (&vginfo)
+	    : "ebx", "ecx", "edx", "esi");
=20
 	if (ax !=3D 0x004f ||
 	    vginfo.signature !=3D VESA_MAGIC ||
@@ -66,7 +68,8 @@
 		ax =3D 0x4f01;
 		asm("int $0x10"
 		    : "+a" (ax), "=3Dm" (vminfo)
-		    : "c" (mode), "D" (&vminfo));
+		    : "c" (mode), "D" (&vminfo)
+		    : "ebx", "edx", "esi");
=20
 		if (ax !=3D 0x004f)
 			continue;
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
new x86 setup code hangs on Dell Inspiron 5150, Will Simoneau, (Thu Aug 30, 9:56 pm)
Re: new x86 setup code hangs on Dell Inspiron 5150, H. Peter Anvin, (Fri Aug 31, 1:45 am)
Re: new x86 setup code hangs on Dell Inspiron 5150, H. Peter Anvin, (Fri Aug 31, 2:41 am)
Re: new x86 setup code hangs on Dell Inspiron 5150, Will Simoneau, (Fri Aug 31, 11:05 am)
[PATCH] save registers around VESA BIOS calls, Will Simoneau, (Fri Aug 31, 12:18 pm)
Re: [PATCH] save registers around VESA BIOS calls, H. Peter Anvin, (Fri Aug 31, 12:26 pm)