struct pci_info { uint8_t bus; uint8_t func; uint8_t slot; uint16_t device_id; uint16_t vendor_id; uint8_t rev_id; uint8_t subclass; uint8_t device_class; uint8_t prog_if; } __attribute__((packed)); size_t listpci(struct pci_info *addr, size_t len);
This syscall writes a list of all detected PCI devices in the system alongside
their identification information to the buffer contained at addr
, which
contains len
items.
The numbers returned for device and vendor IDs can be translated to human readable strings by the use of a PCI database, like The PCI ID Repository, distributed and maintained kindly by Albert Pool and Martin Mares.
The number of detected PCI devices is returned in success, and -1
in
failure, with the following errno:
EFAULT
: The array pointed by addr
is outside accessible memory.