ZXFoundation™ 26h2
Loading...
Searching...
No Matches
zxfoundation.memory.pmm.types Module Reference

Data Structures

struct  zxfoundation::memory::pmm::allocation_request
 Node-aware allocation request used by the PMM compatibility wrappers. More...
struct  zxfoundation::memory::pmm::allocation_result
 Node-aware allocation result. More...
class  zxfoundation::memory::pmm::folio< State >
 Move-only, typestate-tracked physical memory allocation. More...
struct  zxfoundation::memory::pmm::frame_desc
 Compact per-physical-frame metadata record. More...
struct  zxfoundation::memory::pmm::pcp_list
 One order-specific free list within the PCP. More...
struct  zxfoundation::memory::pmm::pcp_pool
 Per-CPU page cache block. More...

Enumerations

enum  zxfoundation::memory::pmm::frame_flags : u8 {
  ff_none = 0 , zxfoundation::memory::pmm::ff_suspect = 1U << 0 , zxfoundation::memory::pmm::ff_offline = 1U << 1 , zxfoundation::memory::pmm::ff_zeroed = 1U << 2 ,
  zxfoundation::memory::pmm::ff_shared = 1U << 3 , ff_head = 1U << 4
}
 Per-frame status flags. More...
enum class  zxfoundation::memory::pmm::frame_owner : u8 {
  none = 0 , reserved = 1 , buddy = 2 , slab = 3 ,
  domain = 4 , page_table = 5 , stack = 6 , device = 7 ,
  reserved_typed_view = 8
}
 Which subsystem currently owns a physical frame. More...
enum class  zxfoundation::memory::pmm::page_init : u8 { uninitialized = 0 , zeroed = 1 }
 Replaces GFP_ZERO.
enum class  zxfoundation::memory::pmm::purpose : u8 {
  generic = 0 , lowcore = 1 , stack = 2 , page_table = 3 ,
  device_dma = 4 , heap = 5 , slab = 6 , frame_desc = 7 ,
  file_cache = 8 , reserved_swap = 9
}
 Semantic purpose; stored in frame_desc for reverse-lookup. More...
enum class  zxfoundation::memory::pmm::zone : u8 { dma31 = 0 , normal = 1 , count = 2 }
 Physical address zone. More...

Typedefs

using zxfoundation::memory::pmm::folio_active = folio<lifecycle_state::active>
using zxfoundation::memory::pmm::folio_embryo = folio<lifecycle_state::embryo>

Functions

 folio (u64 base, u32 ord, purpose p, zone z) noexcept
auto into_folio () const noexcept -> folio_embryo
 Convert the result into an embryo folio typestate value.
auto load_flags (std::memory_order mo=std::memory_order::acquire) const noexcept -> u8
 Atomically read flags.
auto make_active () &&noexcept -> folio< lifecycle_state::active >
 Advance embryo → active, consuming this folio.
 operator bool () const noexcept
auto or_flags (u8 bits) noexcept -> void
 Atomically OR bits into flags (used for MCCK ff_offline / ff_suspect).
auto order () const noexcept -> u8
auto owner () const noexcept -> frame_owner
auto page_count () const noexcept -> u64
auto pfn () const noexcept -> u64
auto set (u8 o, frame_owner ow, u8 numa=0, u8 fl=ff_none) noexcept -> void
 Initialize all fields in one call.
auto set_order (u8 o) noexcept -> void
auto set_owner (frame_owner ow) noexcept -> void
auto size_bytes () const noexcept -> u64
auto store_flags (u8 val, std::memory_order mo=std::memory_order::release) noexcept -> void
 Atomically write flags (used by set() and paths that already hold the zone lock).
auto virt () const noexcept -> void *

Variables

u32 _pad {0}
u8 _r0 {0}
u16 _r1 {0}
u32 count {0}
 Number of pages currently in this list.
std::atomic< u8 > flags {0}
u64 head_phys {0}
 Physical base of the chain head; 0 = empty.
page_init init {page_init::uninitialized}
pcp_list lists [numa::MAX_NUMA_NODES][static_cast< u32 >(zone::count)][PCP_MAX_ORDER+1] {}
constexpr u64 zxfoundation::memory::pmm::MAX_FRAMES = (MAX_PHYS_GB << 30) >> PAGE_SHIFT
constexpr u32 zxfoundation::memory::pmm::MAX_ORDER = 10
 Largest block: 2^10 pages = 4 MiB.
constexpr u64 zxfoundation::memory::pmm::MAX_PHYS_GB = 512ULL
zone mem_zone {zone::normal}
zone mem_zone {zone::normal}
zone mem_zone {zone::normal}
u8 numa_node {0}
 NUMA node that owns this frame for free, rollback, and PCP placement.
std::atomic< u32 > object_generation {0}
 SCOMS generation paired with object_id.
std::atomic< u32 > object_id {scoms::kobject::KOBJECT_ID_INVALID}
u32 order {0U}
u32 order {0U}
u32 order {0}
std::atomic< u8 > order_owner {0}
constexpr u32 zxfoundation::memory::pmm::PCP_BATCH = 16
 Pages bulk-moved between PCP and buddy per refill/drain call.
constexpr u32 zxfoundation::memory::pmm::PCP_HIGH = 128
 Per-list high-watermark. A drain is triggered when count > PCP_HIGH.
constexpr u32 zxfoundation::memory::pmm::PCP_MAX_ORDER = 3
 Maximum order served by the per-CPU page cache (2^3 pages = 32 KiB).
u64 phys_base {0ULL}
u64 phys_base {0}
numa::allocation_policy placement {}
numa::placement_result placement {}
template<purpose P>
constexpr u64 zxfoundation::memory::pmm::purpose_align = PAGE_SIZE
template<>
constexpr u64 zxfoundation::memory::pmm::purpose_align< purpose::lowcore > = 8192ULL
template<purpose P>
constexpr zone zxfoundation::memory::pmm::purpose_zone = zone::normal
template<>
constexpr zone zxfoundation::memory::pmm::purpose_zone< purpose::device_dma > = zone::dma31
template<>
constexpr zone zxfoundation::memory::pmm::purpose_zone< purpose::lowcore > = zone::dma31
template<>
constexpr zone zxfoundation::memory::pmm::purpose_zone< purpose::stack > = zone::dma31
std::atomic< u16 > refcount {0}
 Accessed exclusively via __atomic* builtins in pmm.cxxm.
purpose use {purpose::generic}
purpose use {purpose::generic}
purpose use {purpose::generic}
constexpr u64 zxfoundation::memory::pmm::ZONE_DMA_LIMIT = 2ULL << 30
 z/Architecture CCW/CDA 31-bit addressing constraint.

Files

file  zxfoundation/memory/pmm.zcomponent/types.cxxm
 Physical memory manager type definitions.