[syslinux] [PATCH] pci: Introduce slot and function information

H. Peter Anvin hpa at zytor.com
Mon Jul 14 12:55:27 PDT 2008


Sebastian Herbszt wrote:
> 
>> Given that, I'm thinking that we should do one of two things: either 
>> retain the fixed-sized arrays, but size them appropriately, *and* just 
>> make the array slot used strictly based on device address (i.e. 
>> dev:func in this case) -- in that case, there is no need to store any 
>> of that -- 
> 
> The first part means change pci_device[MAX_PCI_DEVICES] to
> pci_device[MAX_PCI_DEVICES*MAX_PCI_FUNC] in pci.h.
> And the second part means assign pci_device[12*3] for device 12 function 3?
> 

pci_device[MAX_PCI_DEVICES][MAX_PCI_FUNC]

and

pci_device[12][3]

(== pci_device[12*MAX_PCI_FUNC+3])

but yes...

>>   or use dynamically allocated linked lists.
> 
> I have given it a try and my current code is pretty broken now. Guess 
> the first approach would be easier.
> How much do you care about a stable api?

Well, it's worse than that.  We have fixed arrays in struct 
pci_device_list, too, and those are sized to MAX_PCI_DEVICES, but don't 
have *any* hardware limits on them; rather, they seem to be totally 
arbitrary.  This does seem to require API changes no matter what.

	-hpa




More information about the Syslinux mailing list