]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
x86 setup: fix asm constraints in vesa_store_edid
authorAndreas Schwab <schwab@suse.de>
Tue, 27 Jan 2009 20:45:57 +0000 (21:45 +0100)
committerH. Peter Anvin <hpa@linux.intel.com>
Tue, 27 Jan 2009 22:48:46 +0000 (14:48 -0800)
Impact: fix potential miscompile (currently believed non-manifest)

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

Signed-off-by: Andreas Schwab <schwab@suse.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/boot/video-vesa.c

index 75115849af330e057c71eecd845e4b799107a077..4a58c8ce3f6960534931409905103aa7465aa9d6 100644 (file)
@@ -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 */
 }