PCI: Difference between revisions

Jump to navigation Jump to search
36 bytes added ,  29 days ago
m
Bot: Replace deprecated source tag with syntaxhighlight
[unchecked revision][unchecked revision]
m (spelling)
m (Bot: Replace deprecated source tag with syntaxhighlight)
Line 64:
When a configuration access attempts to select a device that does not exist, the host bridge will complete the access without error, dropping all data on writes and returning all ones on reads. The following code segment illustrates the read of a non-existent device.
 
<sourcesyntaxhighlight lang="c">
uint16_t pciCheckVendor(uint8_t bus, uint8_t slot) {
uint16_t vendor, device;
Line 74:
} return (vendor);
}
</syntaxhighlight>
</source>
 
=== Configuration Space Access Mechanism #2 ===
Line 1,079:
Pseudo-code might look like this:
 
<sourcesyntaxhighlight lang="c">
void checkFunction(uint8_t bus, uint8_t device, uint8_t function) {
uint8_t baseClass;
Line 1,092:
}
}
</syntaxhighlight>
</source>
 
The final step is to handle systems with multiple PCI host controllers correctly. Start by checking if the device at bus 0, device 0 is a multi-function device. If it's not a multi-function device, then there is only one PCI host controller and bus 0, device 0, function 0 will be the PCI host controller responsible for bus 0. If it's a multi-function device, then bus 0, device 0, function 0 will be the PCI host controller responsible for bus 0; bus 0, device 0, function 1 will be the PCI host controller responsible for bus 1, etc (up to the number of functions supported).
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu