|
miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
|
#include <miniOS/types.h>

Go to the source code of this file.
Classes | |
| struct | pci_device_t |
Macros | |
| #define | PCI_MAX_DEVICES 64 |
Functions | |
| void | pci_init (void) |
| uint32_t | pci_config_read32 (uint8_t bus, uint8_t dev, uint8_t fn, uint8_t off) |
| void | pci_config_write32 (uint8_t bus, uint8_t dev, uint8_t fn, uint8_t off, uint32_t val) |
Variables | |
| pci_device_t | pci_devices [PCI_MAX_DEVICES] |
| int | pci_device_count |
| #define PCI_MAX_DEVICES 64 |
Maximum number of PCI devices tracked by the kernel.




| void pci_init | ( | void | ) |
pci_init() - Enumerate PCI bus 0 and populate /sys/bus/pci/devices/.
Scans bus 0, slots 0-31, respecting the multi-function bit. Fills pci_devices[] with every non-empty function. Prints the device count via printk(). Then creates /sys/bus/pci/devices/<domain>:<bus>:<dev>.<fn>/ directories with vendor, device, class, subsystem_vendor, subsystem_device attribute files.
Must be called after sysfs_init() and before ata_init().
pci_init() - Enumerate PCI bus 0 and populate /sys/bus/pci/devices/.
Scans all 32 device slots on bus 0. For multi-function devices (header type bit 7 set), iterates functions 0-7; single-function devices use only fn 0. Each discovered function is stored in pci_devices[pci_device_count++]. Capped at PCI_MAX_DEVICES.


|
extern |
Number of valid entries in pci_devices[]; set by pci_init().
|
extern |
Global array of discovered PCI devices; populated by pci_init().