Ver código fonte

[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 anos atrás
pai
commit
3c13d68f50
1 arquivos alterados com 3 adições e 4 exclusões
  1. 3
    4
      src/arch/i386/interface/pcbios/int13.c

+ 3
- 4
src/arch/i386/interface/pcbios/int13.c Ver arquivo

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

Carregando…
Cancelar
Salvar