aboutsummaryrefslogtreecommitdiff
path: root/kernel/kapi/memory.cpp
AgeCommit message (Collapse)AuthorFilesLines
33 hourskapi/memory: replace mmio_region API with mmio_windowFelix Morgner1-87/+0
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.
33 hourskapi/memory: carry hw_base offset forward in mappingFelix Morgner1-1/+2
33 hoursmemory: harden MMIO mappings and update docs.Felix Morgner1-0/+7
33 hoursmemory: improve MMIO allocation/mapping robustnessFelix Morgner1-23/+56
33 hourskapi/memory: map MMIO regions more securelyFelix Morgner1-1/+1
33 hourskapi/memory: unmap MMIO regions on releaseFelix Morgner1-0/+10
33 hourskapi/memory: fix page unmap logicFelix Morgner1-4/+4
Previously, the page mapper was expected to automatically free all frames that had become unused. However, this only works if all mappings refer to plain memory frames. In the case of MMIO frames, the mapper would still try to release the frame via the global frame allocator, which is incorrect, leading to undefined behavior in the worst case. This problem was discovered during work the PCI/PCIe subsystem, since we want to unmap any unused buses during enumeration.
2026-09-10kernel: replace some more plain pointersFelix Morgner1-4/+4
2026-09-10x86_64: replace raw pointers with observer_ptrFelix Morgner1-4/+6
2026-08-29chore: normalize panic messagesFelix Morgner1-5/+5
2026-08-18kstd: flatten units namespaceFelix Morgner1-1/+1
2026-08-18kstd: clean up unitsFelix Morgner1-1/+1
2026-07-09kstd: rename kstd header to include hppFelix Morgner1-2/+2
2026-04-23chore: banish relative includesFelix Morgner1-4/+4
2026-04-23chore: organize includesFelix Morgner1-2/+2
2026-04-08kapi: return region pair for MMIO allocationFelix Morgner1-7/+18
2026-04-08kapi: add basic support for MMIO mappingFelix Morgner1-0/+25
2026-04-01kernel/tests: implement basic simulated memoryFelix Morgner1-2/+6
2026-03-18kstd: introduce strong type for memory amountsFelix Morgner1-3/+7
2026-03-16x86_64/memory: fix page table flag settingFelix Morgner1-1/+1
2026-03-16kapi/memory: support additional address arithmeticFelix Morgner1-2/+1
2026-03-16kernel/memory: implement basic free-list heapFelix Morgner1-5/+4
2026-03-14kapi/memory: introduce layout constant headerFelix Morgner1-1/+1
2026-03-13kernel/memory: implement basic bitmap allocatorFelix Morgner1-3/+53
2026-01-16chore: restructure namespacesFelix Morgner1-0/+94