Browse Source

[int13] Fix compilation on some versions of gcc

Using __from_text16() and __from_data16() in inline asm constraints
sometimes defeats gcc's ability to simplify expressions down to
compile-time constants.

Reported-by: Jason Kohles <jkohles@palantir.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
3c13d68f50
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      src/arch/i386/interface/pcbios/int13.c

+ 3
- 4
src/arch/i386/interface/pcbios/int13.c View File

@@ -1499,16 +1499,15 @@ static void int13_hook_vector ( void ) {
1499 1499
 			     "cmpb $0x08, -1(%%bp)\n\t"
1500 1500
 			     "jne 3f\n\t"
1501 1501
 			     "testb $0x80, %%dl\n\t"
1502
-			     "movb %%cs:%c1, %%dl\n\t"
1502
+			     "movb %%cs:num_drives, %%dl\n\t"
1503 1503
 			     "jnz 3f\n\t"
1504
-			     "movb %%cs:%c2, %%dl\n\t"
1504
+			     "movb %%cs:num_fdds, %%dl\n\t"
1505 1505
 			     /* Return */
1506 1506
 			     "\n3:\n\t"
1507 1507
 			     "movw %%bp, %%sp\n\t"
1508 1508
 			     "popw %%bp\n\t"
1509 1509
 			     "iret\n\t" )
1510
-	       : : "i" ( int13 ), "i" ( __from_text16 ( &num_drives ) ),
1511
-		   "i" ( __from_text16 ( &num_fdds ) ) );
1510
+	       : : "i" ( int13 ) );
1512 1511
 
1513 1512
 	hook_bios_interrupt ( 0x13, ( unsigned int ) int13_wrapper,
1514 1513
 			      &int13_vector );

Loading…
Cancel
Save