Skip to main content

PageFrame

Struct PageFrame 

Source
#[repr(C, align(32))]
pub struct PageFrame { pub flags: PageFlags, pub order: u8, pub next: u32, pub prev: u32, pub size_class: u8, pub rc: u16, pub freelist_va: usize, pub _pad: u8, }
Expand description

Metadata associated with a single physical page frame.

This structure stores per‑frame information required by the page frame manager, such as flags, allocation order, linked list pointers for free lists, reference count, and a pointer to the kernel virtual address of the freelist header (if any). It is guaranteed to be 32‑byte aligned.

Fields§

§flags: PageFlags

Page state flags (locked, dirty, reserved, etc.).

§order: u8

Allocation order (2^order pages). 0 means a single 4 KiB page.

§next: u32

Index of the next page frame in a linked list (e.g., free list).

§prev: u32

Index of the previous page frame in a linked list.

§size_class: u8

Size class index for slab allocators (if used).

§rc: u16

Reference count: number of users of this page frame.

§freelist_va: usize

Kernel virtual address of the freelist header (or 0 if none).

§_pad: u8

Padding to maintain alignment and reserved for future use.

Implementations§

Source§

impl PageFrame

Source

pub const fn new() -> Self

Creates a new, zeroed (default) page frame metadata structure.

All fields are initialised with their default values. The flags field is cloned from a zeroed instance of F.

§Panics

This function is const and will not panic.

Source

pub fn reset(&mut self)

Resets the page frame metadata to its default state.

This is equivalent to *self = PageFrame::new(). After calling this, all flags are cleared, and counters are set to zero.

Trait Implementations§

Source§

impl Debug for PageFrame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PageFrame

Source§

fn default() -> PageFrame

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.