ZXFoundation™ 26h2
Loading...
Searching...
No Matches
core.cxxm File Reference

Reverse-map (rmap) implementation — core interface. More...

import std;
import lib.error;
import zxfoundation.memory.vm.types;
import zxfoundation.memory.rmap.types;
import zxfoundation.base.types;
Include dependency graph for core.cxxm:

Functions

auto zxfoundation::memory::rmap::collect_peers (u64 phys, vm::vm_region &self, u32 self_slot, peer_ref *out, u32 cap) noexcept -> u32
 Collect rmap identities without dereferencing VM page slots.
auto zxfoundation::memory::rmap::count_refs (u64 phys) noexcept -> u32
 Count how many VMA slots currently reference phys.
auto zxfoundation::memory::rmap::for_each_phys (u64 phys, visitor visit) noexcept -> u32
 Walk every VMA slot that references phys.
auto zxfoundation::memory::rmap::init (u64 max_pfn) noexcept -> std::expected< void, lib::kernel_error >
 Allocate the reverse-map heads for max_pfn frames.
auto zxfoundation::memory::rmap::insert (vm::vm_region &rgn, u32 slot_index, u64 phys) noexcept -> std::expected< void, lib::kernel_error >
 Insert a reverse-map link: "slot @p slot_index in @p rgn maps @p phys".
auto zxfoundation::memory::rmap::invalidate_peers (u64 phys, vm::vm_region &self, u32 self_slot) noexcept -> std::expected< peer_invalidation_result, lib::kernel_error >
 Invalidate every peer mapping of phys except self.
auto zxfoundation::memory::rmap::rebind (vm::vm_region &from, u32 from_slot, vm::vm_region &to, u32 to_slot, u64 phys) noexcept -> bool
 Rebind an existing rmap entry after a VMA split without allocating.
auto zxfoundation::memory::rmap::release_slot_pin (vm::vm_page_slot &slot) noexcept -> std::expected< bool, lib::kernel_error >
auto zxfoundation::memory::rmap::remove (vm::vm_region &rgn, u32 slot_index, u64 phys) noexcept -> void
 Remove the link matching (rgn, slot_index, phys).

Variables

constexpr u32 zxfoundation::memory::rmap::RMAP_LOCK_STRIPE = 256U
 Number of striped locks.

Detailed Description

Reverse-map (rmap) implementation — core interface.

SPDX-License-Identifier: Apache-2.0

Function Documentation

◆ invalidate_peers()

auto zxfoundation::memory::rmap::invalidate_peers ( u64 phys,
vm::vm_region & self,
u32 self_slot )->std::expected< peer_invalidation_result, lib::kernel_error >
exportnoexcept

Invalidate every peer mapping of phys except self.

Precondition
Caller holds self.owning_space->lock when self has an owning space.

◆ rebind()

auto zxfoundation::memory::rmap::rebind ( vm::vm_region & from,
u32 from_slot,
vm::vm_region & to,
u32 to_slot,
u64 phys )->bool
nodiscardexportnoexcept

Rebind an existing rmap entry after a VMA split without allocating.

Returns
false when the old entry was absent or did not match.