aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2022-09-18 13:35:58 +0100
committerMichael Brown <mcb30@ipxe.org>2022-09-18 13:35:58 +0100
commit9448ac544574dc11e1af204de39fcfddbbccb2af (patch)
tree89b97be0d8b8e395b0e94613fb81fa1eebfad144
parentbe667ba94822877036f6c80992554ed32314a1f2 (diff)
downloadipxe-9448ac544574dc11e1af204de39fcfddbbccb2af.zip
ipxe-9448ac544574dc11e1af204de39fcfddbbccb2af.tar.gz
ipxe-9448ac544574dc11e1af204de39fcfddbbccb2af.tar.bz2
[bios] Allow pcibios_discover() to return an empty range
Allow pcibios_discover() to return an empty range if the INT 1A,B101 PCI BIOS installation check call fails. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/arch/x86/interface/pcbios/pcibios.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/arch/x86/interface/pcbios/pcibios.c b/src/arch/x86/interface/pcbios/pcibios.c
index cf81863..6f31ce9 100644
--- a/src/arch/x86/interface/pcbios/pcibios.c
+++ b/src/arch/x86/interface/pcbios/pcibios.c
@@ -42,7 +42,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
static void pcibios_discover ( uint32_t busdevfn __unused,
struct pci_range *range ) {
int discard_a, discard_D;
- uint8_t max_bus;
+ uint16_t num_bus;
/* We issue this call using flat real mode, to work around a
* bug in some HP BIOSes.
@@ -50,10 +50,12 @@ static void pcibios_discover ( uint32_t busdevfn __unused,
__asm__ __volatile__ ( REAL_CODE ( "call flatten_real_mode\n\t"
"stc\n\t"
"int $0x1a\n\t"
+ "movzbw %%cl, %%cx\n\t"
+ "incw %%cx\n\t"
"jnc 1f\n\t"
"xorw %%cx, %%cx\n\t"
"\n1:\n\t" )
- : "=c" ( max_bus ), "=a" ( discard_a ),
+ : "=c" ( num_bus ), "=a" ( discard_a ),
"=D" ( discard_D )
: "a" ( PCIBIOS_INSTALLATION_CHECK >> 16 ),
"D" ( 0 )
@@ -61,7 +63,7 @@ static void pcibios_discover ( uint32_t busdevfn __unused,
/* Populate range */
range->start = PCI_BUSDEVFN ( 0, 0, 0, 0 );
- range->count = PCI_BUSDEVFN ( 0, ( max_bus + 1 ), 0, 0 );
+ range->count = PCI_BUSDEVFN ( 0, num_bus, 0, 0 );
}
/**