diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-11-16 10:20:33 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-11-22 14:20:36 +0100 |
| commit | 45bf10f2ac489cc8253eb2f145c569edc16fc45a (patch) | |
| tree | 0812a89514b78e2c3a9e2efe95393a1de71d2211 /kernel/src/filesystem/devfs/filesystem.cpp | |
| parent | a15cd3183c35534561644bb1f615beb824ca6817 (diff) | |
| download | kernel-45bf10f2ac489cc8253eb2f145c569edc16fc45a.tar.xz kernel-45bf10f2ac489cc8253eb2f145c569edc16fc45a.zip | |
kapi/memory: replace mmio_region API with mmio_window
Previously, allocation and mapping of MMIO regions was a multi-step
process. The MMIO region API required its users to track and manage the
lifetime of an MMIO region allocation manually. The new MMIO window API
simplifies this by providing a single-step mapping interface and
automatic lifetime management.
Additionally, the new API adds strict bounds and alignment checks, to
ensure that all MMIO accesses are within the requested range. The new
API enforces these constraints at runtime via a system panic. Other
contract violations, such as zero-sized mappings, are handled via
runtime error codes.
The new kapi::memory::mmio_window preserves the in-page offset of the
hardware base within the window and bases all accesses on this offset.
This means no user intervention is required to handle hardware ranges
that are not aligned to a natural page boundary. The original pointer
adjustment logic has been moved into the mmio_window class.
Previous consumers of the region API (x86_64 LAPIC, PCIe) have been
updated to the new mmio_window API. The behavior of the PCIe scan
implementation has changed in that no windows are kept alive beyond the
execution of the scan, since there are no consumers that would require
persistent MMIO windows.
Tests for the new infrastructure have been added, including a test
support seam to allow for deinitialization of the MMIO subsystem in
tests.
Diffstat (limited to 'kernel/src/filesystem/devfs/filesystem.cpp')
0 files changed, 0 insertions, 0 deletions
