#include <stdint.h>
- See also
- https://wiki.osdev.org/PCI
This module manages the Peripheral Component Interconnect (PCI) bus.
◆ pci_get_device()
| pci_device_t pci_get_device |
( |
uint16_t | vendor_id, |
|
|
uint16_t | device_id ) |
Given a vendor_id and device_id, this function returns the corresponding PCI device if it exists.
- Parameters
-
| vendor_id | ID of the manufacturer of the device |
| device_id | ID of the particular device |
- Returns
- the PCI device or a zero'ed structure
- Todo
- This is the minimal amount of code to retrieve a PCI device when there is only one with the same vendor and device IDs and no function.
◆ pci_read()
| uint32_t pci_read |
( |
pci_device_t | device, |
|
|
uint32_t | field, |
|
|
uint8_t | size ) |
Reads a field from the configuration space.
- Parameters
-
| device | the PCI device |
| field | the field to read |
| size | the size of the value for the field to read |
- Returns
- the value for the field read
◆ pci_write()
| void pci_write |
( |
pci_device_t | device, |
|
|
uint32_t | field, |
|
|
uint32_t | value ) |
Writes a value to a field in the configuration space.
- Parameters
-
| device | the PCI device |
| field | the field to update |
| value | the new value for the field |