⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

free_user_page_table_frames

Function free_user_page_table_frames 

Source
pub fn free_user_page_table_frames(l4_phys: u64) -> usize
Expand description

Free all user-space page table frames in a page table hierarchy.

Walks the L4 table and for each user-space L4 entry (indices 0..256), recursively frees L3, L2, and L1 table frames. Kernel-space entries (indices 256..512) are left untouched because they are shared across all address spaces (copied from the boot page tables).

Finally, frees the L4 frame itself.

Returns the number of frames freed.