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

HHDM (Higher-Half Direct Map) translation helpers — implementation. More...

Include dependency graph for core.cxx:

Functions

auto zxfoundation::memory::hhdm::phys_coverage_end () noexcept -> u64
 Return the exclusive physical end covered by the active HHDM.
auto zxfoundation::memory::hhdm::phys_range_is_mapped (u64 phys, u64 bytes) noexcept -> bool
 Test whether a physical range is covered by the active HHDM.
auto zxfoundation::memory::hhdm::phys_to_virt (u64 phys) noexcept -> u64
 Translate a physical address (raw integer) to its HHDM virtual counterpart.
auto zxfoundation::memory::hhdm::set_phys_coverage_end (u64 phys_end) noexcept -> void
 Record the physical end covered by the active loader-built HHDM.
auto zxfoundation::memory::hhdm::virt_to_phys (u64 virt) noexcept -> u64
 Translate an HHDM virtual address back to its physical counterpart.

Variables

no_export u64 zxfoundation::memory::hhdm::detail::g_phys_coverage_end {0U}

Detailed Description

HHDM (Higher-Half Direct Map) translation helpers — implementation.

SPDX-License-Identifier: Apache-2.0

Function Documentation

◆ phys_coverage_end()

auto zxfoundation::memory::hhdm::phys_coverage_end ( ) ->u64
nodiscardexportnoexcept

Return the exclusive physical end covered by the active HHDM.

Returns
Exclusive physical coverage end, or zero if no contract has been recorded.

◆ phys_range_is_mapped()

auto zxfoundation::memory::hhdm::phys_range_is_mapped ( u64 phys,
u64 bytes )->bool
nodiscardexportnoexcept

Test whether a physical range is covered by the active HHDM.

Parameters
[in]physPhysical start address.
[in]bytesRange size in bytes.
Returns
True when the full physical interval has a direct-map translation.
Warning
A zero recorded coverage end is treated as not covered so callers fail closed.

◆ phys_to_virt()

auto zxfoundation::memory::hhdm::phys_to_virt ( u64 phys) ->u64
nodiscardexportnoexcept

Translate a physical address (raw integer) to its HHDM virtual counterpart.

Parameters
[in]physRaw physical address.
Returns
HHDM virtual address: phys + KERNEL_VIRTUAL_OFFSET.

◆ set_phys_coverage_end()

auto zxfoundation::memory::hhdm::set_phys_coverage_end ( u64 phys_end) ->void
exportnoexcept

Record the physical end covered by the active loader-built HHDM.

Parameters
[in]phys_endExclusive physical end address translated by the current HHDM DAT.
Note
The value is supplied by ZXFL after it constructs the initial DAT tables.
Warning
This function records coverage only; it does not alter DAT tables or flush translations.

◆ virt_to_phys()

auto zxfoundation::memory::hhdm::virt_to_phys ( u64 virt) ->u64
nodiscardexportnoexcept

Translate an HHDM virtual address back to its physical counterpart.

Parameters
[in]virtHHDM virtual address (must be >= KERNEL_VIRTUAL_OFFSET).
Returns
Physical address: virt - KERNEL_VIRTUAL_OFFSET.