Skip to main content

pte_index_bit_offset

Function pte_index_bit_offset 

Source
pub exec fn pte_index_bit_offset<C: PagingConstsTrait>(level: PagingLevel) -> usize
Expand description
requires
1 <= level <= NR_LEVELS,
returns
pte_index_bit_offset_spec::<C>(level),

The bit offset of the entry offset part in a virtual address.

This function returns the bit offset of the least significant bit. Take x86-64 as an example, the pte_index_bit_offset(2) should return 21, which is 12 (the 4KiB in-page offset) plus 9 (index width in the level-1 table).