Expand description
Metadata management of frames.
You can picture a globally shared, static, gigantic array of metadata
initialized for each frame.
Each entry in this array holds the metadata for a single frame.
There would be a dedicated small
“heap” space in each slot for dynamic metadata. You can store anything as
the metadata of a frame as long as it’s Sync
.
§Implementation
The slots are placed in the metadata pages mapped to a certain virtual address in the kernel space. So finding the metadata of a frame often comes with no costs since the translation is a simple arithmetic operation.
Modules§
- mapping 🔒
- The metadata of each physical page is linear mapped to fixed virtual addresses
in
FRAME_METADATA_RANGE
.
Macros§
- impl_
frame_ meta_ for - Makes a structure usable as a frame metadata.
- mark_
ranges 🔒
Structs§
- Kernel
Meta - The metadata of physical pages that contains the kernel itself.
- Meta
Page Meta - The metadata of frames that holds metadata of frames.
- Meta
Slot 🔒 - Reserved
Memory Meta - Reserved memory metadata. Maybe later used as I/O memory.
- Unusable
Memory Meta - Unusable memory metadata. Cannot be used for any purposes.
Enums§
- GetFrame
Error - The error type for getting the frame from a physical address.
Constants§
- FRAME_
METADATA_ MAX_ ALIGN - The maximum alignment in bytes of the metadata of a frame.
- FRAME_
METADATA_ MAX_ SIZE - The maximum number of bytes of the metadata of a frame.
- META_
SLOT_ 🔒SIZE - REF_
COUNT_ 🔒MAX - REF_
COUNT_ 🔒UNIQUE - REF_
COUNT_ 🔒UNUSED
Traits§
- AnyFrame
Meta - All frame metadata types must implement this trait.
Functions§
- add_
temp_ 🔒linear_ mapping - Adds a temporary linear mapping for the metadata frames.
- alloc_
meta_ 🔒frames - get_
slot 🔒 - Gets the reference to a metadata slot.
- init 🔒 ⚠
- Initializes the metadata of all physical frames.
- is_
initialized 🔒 - Returns whether the global frame allocator is initialized.
- mark_
unusable_ 🔒ranges