Skip to contentSkip to conversation

Fix asm constraints in vesa_store_edid

PATCH Applied Andreas Schwab 2 participants 2 messages Jan 27, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

As the comment explains, the VBE DDC call can clobber any register. Tell the compiler about that fact.

---
 arch/x86/boot/video-vesa.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
arch/x86/boot/video-vesa.c +5 -6
index 7511584..4a58c8c 100644
@@ -269,9 +269,8 @@ void vesa_store_edid(void)
 	   we genuinely have to assume all registers are destroyed here. */
 
 	asm("pushw %%es; movw %2,%%es; "INT10"; popw %%es"
-	    : "+a" (ax), "+b" (bx)
-	    :  "c" (cx), "D" (di)
-	    : "esi");
+	    : "+a" (ax), "+b" (bx), "+c" (cx), "+D" (di)
+	    : : "esi", "edx");
 
 	if (ax != 0x004f)
 		return;		/* No EDID */
@@ -285,9 +284,9 @@ void vesa_store_edid(void)
 	dx = 0;			/* EDID block number */
 	di =(size_t) &boot_params.edid_info; /* (ES:)Pointer to block */
 	asm(INT10
-	    : "+a" (ax), "+b" (bx), "+d" (dx), "=m" (boot_params.edid_info)
-	    : "c" (cx), "D" (di)
-	    : "esi");
+	    : "+a" (ax), "+b" (bx), "+d" (dx), "=m" (boot_params.edid_info),
+	      "+c" (cx), "+D" (di)
+	    : : "esi");
 #endif /* CONFIG_FIRMWARE_EDID */
 }
 
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
reviewer Applied
#1 lore raw
Quoted 4 lines · Andreas Schwab

As the comment explains, the VBE DDC call can clobber any register. Tell the compiler about that fact.

Applied to tip:x86/setup-v2; it should be in linux-next in the next day or two.

Thanks!

-hpa