aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorDanilo Krummrich <[email protected]>2024-12-19 17:04:12 +0000
committerGreg Kroah-Hartman <[email protected]>2024-12-20 16:19:26 +0000
commitbf9651f84b4e49ca006fd8b5534f16a38dae875c (patch)
treea903dc00bb4f7e36cbb0cf4f49acd84bccb42cff /rust/helpers/helpers.c
parentrust: pci: add basic PCI device / driver abstractions (diff)
downloadkernel-bf9651f84b4e49ca006fd8b5534f16a38dae875c.tar.gz
kernel-bf9651f84b4e49ca006fd8b5534f16a38dae875c.zip
rust: pci: implement I/O mappable `pci::Bar`
Implement `pci::Bar`, `pci::Device::iomap_region` and `pci::Device::iomap_region_sized` to allow for I/O mappings of PCI BARs. To ensure that a `pci::Bar`, and hence the I/O memory mapping, can't out-live the PCI device, the `pci::Bar` type is always embedded into a `Devres` container, such that the `pci::Bar` is revoked once the device is unbound and hence the I/O mapped memory is unmapped. A `pci::Bar` can be requested with (`pci::Device::iomap_region_sized`) or without (`pci::Device::iomap_region`) a const generic representing the minimal requested size of the I/O mapped memory region. In case of the latter only runtime checked I/O reads / writes are possible. Co-developed-by: Philipp Stanner <[email protected]> Signed-off-by: Philipp Stanner <[email protected]> Signed-off-by: Danilo Krummrich <[email protected]> Tested-by: Dirk Behme <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions