pub unsafe fn current() -> Self {
        let cr3 = PAddr::from(x86::controlregs::cr3());
        assert_ne!(cr3, PAddr::zero());
        let pml4 = transmute::<VAddr, &PML4>(paddr_to_kernel_vaddr(cr3));
        ReadOnlyPageTable { pml4 }
    }
/// Get read-only access to the current page-table.
///
/// # Safety
/// Be aware, pretty unsafe. We need to ensure that the current page-table
/// is not modified or aliased mutably during the lifetime of this object.
///
/// Generally only use this for debugging and sanity checking memory
/// accesses for kernel GDB where it's clear we are in a state where won't
/// make modification to PTs.
///
/// Otherwise, access through NR/VSpace object is the way to go.
///
/// # TODO
/// We should have better type-safety for this to help with unsafety.
/// Ideally using some token that is consumed on every page-table switch.
Get read-only access to the current page-table.
Get read - only access to the current page - table .
pub unsafe fn current() -> Self {
        let cr3 = PAddr::from(x86::controlregs::cr3());
        assert_ne!(cr3, PAddr::zero());
        let pml4 = transmute::<VAddr, &PML4>(paddr_to_kernel_vaddr(cr3));
        ReadOnlyPageTable { pml4 }
    }
pub unsafe fn current ( ) -> Self { let cr3 = PAddr :: from ( x86 :: controlregs :: cr3 ( ) ) ; assert_ne ! ( cr3 PAddr zero ( ) ) ; let pml4 = transmute :: < VAddr , & PML4 > ( paddr_to_kernel_vaddr ( cr3 ) ) ; ReadOnlyPageTable { pml4 } }
Get read-only access to the current page-table.
Get read - only access to the current page - table .
safety
Be aware, pretty unsafe. We need to ensure that the current page-table
is not modified or aliased mutably during the lifetime of this object.

Generally only use this for debugging and sanity checking memory
accesses for kernel GDB where it's clear we are in a state where won't
make modification to PTs.

Otherwise, access through NR/VSpace object is the way to go.
Be aware pretty unsafe . We need to ensure that the current page - table is not modified or aliased mutably during the lifetime of this object . Generally only use this for debugging and sanity checking memory accesses for kernel GDB where it ' s clear we are in a state where won ' t make modification to PTs . Otherwise access through NR / VSpace object is the way to go .
todo
We should have better type-safety for this to help with unsafety.
Ideally using some token that is consumed on every page-table switch.
We should have better type - safety for this to help with unsafety . Ideally using some token that is consumed on every page - table switch .