|
AquilaOS documentation
How it works, and its code
|
PCI configuration space through ECAM, the Enhanced Configuration Access Mechanism of PCI Express. More...
Go to the source code of this file.
Functions | |
| static uintptr_t | offset (struct pci_dev *dev, uint16_t reg) |
| Returns where register reg of dev is, from the start of the configuration space (the register rounded down to 4 bytes). | |
| uint32_t | pci_ecam_read (struct pci_host *host, struct pci_dev *dev, uint16_t reg) |
| Reads a 32-bit register of a function's configuration space. | |
| void | pci_ecam_write (struct pci_host *host, struct pci_dev *dev, uint16_t reg, uint32_t val) |
| Writes a 32-bit register of a function's configuration space. | |
PCI configuration space through ECAM, the Enhanced Configuration Access Mechanism of PCI Express.
Every function's 4 KiB of configuration space is in memory, one after the other, ordered by bus, device and function, from the host bridge's config address (which pci_host_set() mapped). Reading or writing a register is a plain memory access.
Definition in file ecam.c.
Returns where register reg of dev is, from the start of the configuration space (the register rounded down to 4 bytes).
Definition at line 17 of file ecam.c.
Referenced by pci_ecam_read(), and pci_ecam_write().
Reads a 32-bit register of a function's configuration space.
| host | the host bridge |
| dev | the function |
| reg | the register's offset (rounded down to 4 bytes) |
Definition at line 32 of file ecam.c.
References pci_host::config, io_in32(), offset(), pci_ecam_read(), and pci_host::size.
Referenced by pci_ecam_read().
Writes a 32-bit register of a function's configuration space.
A register past what the host mapped is left alone.
| host | the host bridge |
| dev | the function |
| reg | the register's offset (rounded down to 4 bytes) |
| val | the value to write |
Definition at line 51 of file ecam.c.
References pci_host::config, io_out32(), offset(), and pci_ecam_write().
Referenced by pci_ecam_write().