aboutsummaryrefslogtreecommitdiffstats
path: root/com32/include/sys
diff options
context:
space:
mode:
authorSebastian Herbszt <herbszt@gmx.de>2008-06-11 22:53:01 +0200
committerH. Peter Anvin <hpa@zytor.com>2008-06-13 09:19:57 -0700
commiteab6f0763744c964eded45b48ec41cb6c1f65cdb (patch)
tree49d2c82074cc796ecede0e0e682751b715343caf /com32/include/sys
parent2c1e6e2be80c54fcf36f89e9de9ab1a5fba5df87 (diff)
downloadsyslinux-eab6f0763744c964eded45b48ec41cb6c1f65cdb.tar.gz
syslinux-eab6f0763744c964eded45b48ec41cb6c1f65cdb.tar.xz
syslinux-eab6f0763744c964eded45b48ec41cb6c1f65cdb.zip
pci: fix off-by-one error and introduce MAX_PCI_FUNC
In include/sys/pci.h we have #define MAX_PCI_BUSES 255 and struct pci_bus_list { struct pci_bus pci_bus[MAX_PCI_BUSES]; uint8_t count; }; And in lib/pci/scan.c for (bus = 0; bus <= MAX_PCI_BUSES; bus++) { pci_bus_list->pci_bus[bus].pci_device_count = 0; Fix possible overflows and introduce MAX_PCI_FUNC. - Sebastian
Diffstat (limited to 'com32/include/sys')
-rw-r--r--com32/include/sys/pci.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/com32/include/sys/pci.h b/com32/include/sys/pci.h
index a49475b6..3b07ae7c 100644
--- a/com32/include/sys/pci.h
+++ b/com32/include/sys/pci.h
@@ -4,8 +4,9 @@
#include <inttypes.h>
#include <sys/io.h>
+#define MAX_PCI_FUNC 8
#define MAX_PCI_DEVICES 32
-#define MAX_PCI_BUSES 255
+#define MAX_PCI_BUSES 256
typedef uint32_t pciaddr_t;