const PAGE_SIZE
pub const PAGE_SIZE = 4096Purpose
Constant PAGE_SIZE, defining protocol or algorithm parameters.
#core/addrPhysical/virtual address, page/frame, explicit endianness, and borrowed zero-allocation slice types for baremetal kernels and device drivers.
const PAGE_SIZEpub const PAGE_SIZE = 4096Constant PAGE_SIZE, defining protocol or algorithm parameters.
const PAGE_SHIFTpub const PAGE_SHIFT = 12Constant PAGE_SHIFT, defining protocol or algorithm parameters.
struct PhysAddrpub struct PhysAddr {
pub raw u64
}Structure encapsulating raw.
raw u64phys_addrpub fn phys_addr(v u64) PhysAddrPhys address.
v u64PhysAddr — a value of this type
(PhysAddr) as_u64pub fn (a PhysAddr) as_u64() u64Operation on PhysAddr: as u64.
a PhysAddrPhysAddr instance used by this call (value receiver).u64 — a value of this type
(PhysAddr) is_nullpub fn (a PhysAddr) is_null() boolOperation on PhysAddr: whether it is null.
a PhysAddrPhysAddr instance used by this call (value receiver).bool — true or false
(PhysAddr) is_alignedpub fn (a PhysAddr) is_aligned(align u64) boolOperation on PhysAddr: whether it is aligned.
a PhysAddrPhysAddr instance used by this call (value receiver).align u64bool — true or false
(PhysAddr) align_downpub fn (a PhysAddr) align_down(align u64) PhysAddrOperation on PhysAddr: align down.
a PhysAddrPhysAddr instance used by this call (value receiver).align u64PhysAddr — a value of this type
(PhysAddr) align_uppub fn (a PhysAddr) align_up(align u64) PhysAddrOperation on PhysAddr: align up.
a PhysAddrPhysAddr instance used by this call (value receiver).align u64PhysAddr — a value of this type
(PhysAddr) addpub fn (a PhysAddr) add(off u64) PhysAddrOperation on PhysAddr: add.
a PhysAddrPhysAddr instance used by this call (value receiver).off u64PhysAddr — a value of this type
(PhysAddr) subpub fn (a PhysAddr) sub(off u64) PhysAddrOperation on PhysAddr: subtract.
a PhysAddrPhysAddr instance used by this call (value receiver).off u64PhysAddr — a value of this type
(PhysAddr) frame_indexpub fn (a PhysAddr) frame_index() u64Operation on PhysAddr: frame index.
a PhysAddrPhysAddr instance used by this call (value receiver).u64 — a value of this type
(PhysAddr) page_offsetpub fn (a PhysAddr) page_offset() u64Operation on PhysAddr: page offset.
a PhysAddrPhysAddr instance used by this call (value receiver).u64 — a value of this type
struct VirtAddrpub struct VirtAddr {
pub raw u64
}Structure encapsulating raw.
raw u64virt_addrpub fn virt_addr(v u64) VirtAddrVirt address.
v u64VirtAddr — a value of this type
(VirtAddr) as_u64pub fn (a VirtAddr) as_u64() u64Operation on VirtAddr: as u64.
a VirtAddrVirtAddr instance used by this call (value receiver).u64 — a value of this type
(VirtAddr) as_ptrpub fn (a VirtAddr) as_ptr() *raw u8Operation on VirtAddr: as ptr.
a VirtAddrVirtAddr instance used by this call (value receiver).*raw u8 — a value of this type
(VirtAddr) is_nullpub fn (a VirtAddr) is_null() boolOperation on VirtAddr: whether it is null.
a VirtAddrVirtAddr instance used by this call (value receiver).bool — true or false
(VirtAddr) is_alignedpub fn (a VirtAddr) is_aligned(align u64) boolOperation on VirtAddr: whether it is aligned.
a VirtAddrVirtAddr instance used by this call (value receiver).align u64bool — true or false
(VirtAddr) align_downpub fn (a VirtAddr) align_down(align u64) VirtAddrOperation on VirtAddr: align down.
a VirtAddrVirtAddr instance used by this call (value receiver).align u64VirtAddr — a value of this type
(VirtAddr) align_uppub fn (a VirtAddr) align_up(align u64) VirtAddrOperation on VirtAddr: align up.
a VirtAddrVirtAddr instance used by this call (value receiver).align u64VirtAddr — a value of this type
(VirtAddr) addpub fn (a VirtAddr) add(off u64) VirtAddrOperation on VirtAddr: add.
a VirtAddrVirtAddr instance used by this call (value receiver).off u64VirtAddr — a value of this type
(VirtAddr) subpub fn (a VirtAddr) sub(off u64) VirtAddrOperation on VirtAddr: subtract.
a VirtAddrVirtAddr instance used by this call (value receiver).off u64VirtAddr — a value of this type
(VirtAddr) page_offsetpub fn (a VirtAddr) page_offset() u64Operation on VirtAddr: page offset.
a VirtAddrVirtAddr instance used by this call (value receiver).u64 — a value of this type
(VirtAddr) p4_indexpub fn (a VirtAddr) p4_index() intOperation on VirtAddr: p4 index.
a VirtAddrVirtAddr instance used by this call (value receiver).int — index; see the description for its range and special values
(VirtAddr) p3_indexpub fn (a VirtAddr) p3_index() intOperation on VirtAddr: p3 index.
a VirtAddrVirtAddr instance used by this call (value receiver).int — index; see the description for its range and special values
(VirtAddr) p2_indexpub fn (a VirtAddr) p2_index() intOperation on VirtAddr: p2 index.
a VirtAddrVirtAddr instance used by this call (value receiver).int — index; see the description for its range and special values
(VirtAddr) p1_indexpub fn (a VirtAddr) p1_index() intOperation on VirtAddr: p1 index.
a VirtAddrVirtAddr instance used by this call (value receiver).int — index; see the description for its range and special values
(VirtAddr) is_canonical_x64pub fn (a VirtAddr) is_canonical_x64() boolOperation on VirtAddr: whether it is canonical x64.
a VirtAddrVirtAddr instance used by this call (value receiver).bool — true or false
struct PhysFramepub struct PhysFrame {
pub start u64
}Addr Protocol data frame encapsulation.
start u64phys_frame_containingpub fn phys_frame_containing(a PhysAddr) PhysFramePhys frame containing.
a PhysAddrPhysFrame — a value of this type
phys_frame_from_indexpub fn phys_frame_from_index(idx u64) PhysFramePhys frame from index.
idx u64PhysFrame — a value of this type
(PhysFrame) start_addrpub fn (f PhysFrame) start_addr() PhysAddrOperation on PhysFrame: start address.
f PhysFramePhysFrame instance used by this call (value receiver).PhysAddr — a value of this type
(PhysFrame) indexpub fn (f PhysFrame) index() u64Operation on PhysFrame: index of the first occurrence; -1 if missing.
f PhysFramePhysFrame instance used by this call (value receiver).u64 — a value of this type
struct Pagepub struct Page {
pub start u64
}Structure encapsulating start.
start u64page_containingpub fn page_containing(a VirtAddr) PagePage containing.
a VirtAddrPage — a value of this type
(Page) start_addrpub fn (p Page) start_addr() VirtAddrOperation on Page: start address.
p PagePage instance used by this call (value receiver).VirtAddr — a value of this type
bswap16pub fn bswap16(v u16) u16Execute bswap16.
v u16u16 — a value of this type
bswap32pub fn bswap32(v u32) u32Execute bswap32.
v u32u32 — a value of this type
bswap64pub fn bswap64(v u64) u64Execute bswap64.
v u64u64 — a value of this type
struct Le16pub struct Le16 {
pub raw u16
}Structure encapsulating raw.
raw u16le16_newpub fn le16_new(native u16) Le16Le16 new.
native u16Le16 — a value of this type
(Le16) to_nativepub fn (v Le16) to_native() u16Operation on Le16: convert to native.
v Le16Le16 instance used by this call (value receiver).u16 — a value of this type
(Le16) raw_bitspub fn (v Le16) raw_bits() u16Operation on Le16: raw bits.
v Le16Le16 instance used by this call (value receiver).u16 — a value of this type
struct Le32pub struct Le32 {
pub raw u32
}Structure encapsulating raw.
raw u32le32_newpub fn le32_new(native u32) Le32Le32 new.
native u32Le32 — a value of this type
(Le32) to_nativepub fn (v Le32) to_native() u32Operation on Le32: convert to native.
v Le32Le32 instance used by this call (value receiver).u32 — a value of this type
(Le32) raw_bitspub fn (v Le32) raw_bits() u32Operation on Le32: raw bits.
v Le32Le32 instance used by this call (value receiver).u32 — a value of this type
struct Le64pub struct Le64 {
pub raw u64
}Structure encapsulating raw.
raw u64le64_newpub fn le64_new(native u64) Le64Le64 new.
native u64Le64 — a value of this type
(Le64) to_nativepub fn (v Le64) to_native() u64Operation on Le64: convert to native.
v Le64Le64 instance used by this call (value receiver).u64 — a value of this type
(Le64) raw_bitspub fn (v Le64) raw_bits() u64Operation on Le64: raw bits.
v Le64Le64 instance used by this call (value receiver).u64 — a value of this type
struct Be16pub struct Be16 {
pub raw u16
}Structure encapsulating raw.
raw u16be16_newpub fn be16_new(native u16) Be16Be16 new.
native u16Be16 — a value of this type
(Be16) to_nativepub fn (v Be16) to_native() u16Operation on Be16: convert to native.
v Be16Be16 instance used by this call (value receiver).u16 — a value of this type
(Be16) raw_bitspub fn (v Be16) raw_bits() u16Operation on Be16: raw bits.
v Be16Be16 instance used by this call (value receiver).u16 — a value of this type
struct Be32pub struct Be32 {
pub raw u32
}Structure encapsulating raw.
raw u32be32_newpub fn be32_new(native u32) Be32Be32 new.
native u32Be32 — a value of this type
(Be32) to_nativepub fn (v Be32) to_native() u32Operation on Be32: convert to native.
v Be32Be32 instance used by this call (value receiver).u32 — a value of this type
(Be32) raw_bitspub fn (v Be32) raw_bits() u32Operation on Be32: raw bits.
v Be32Be32 instance used by this call (value receiver).u32 — a value of this type
struct Be64pub struct Be64 {
pub raw u64
}Structure encapsulating raw.
raw u64be64_newpub fn be64_new(native u64) Be64Be64 new.
native u64Be64 — a value of this type
(Be64) to_nativepub fn (v Be64) to_native() u64Operation on Be64: convert to native.
v Be64Be64 instance used by this call (value receiver).u64 — a value of this type
(Be64) raw_bitspub fn (v Be64) raw_bits() u64Operation on Be64: raw bits.
v Be64Be64 instance used by this call (value receiver).u64 — a value of this type
struct ByteSlicepub struct ByteSlice {
pub ptr *raw u8
pub len usize
}Structure encapsulating ptr, len.
ptr *raw u8len usizebyte_slicepub fn byte_slice(ptr *raw u8, len usize) ByteSliceByte slice.
ptr *raw u8len usizeByteSlice — a value of this type
(&ByteSlice) is_emptypub fn (s &ByteSlice) is_empty() boolOperation on &ByteSlice: whether it is empty.
s &ByteSliceByteSlice instance used by this call (borrow).bool — true or false
(&ByteSlice) getpub fn (s &ByteSlice) get(idx usize) u8Execute get on &ByteSlice.
s &ByteSliceByteSlice instance used by this call (borrow).idx usizeu8 — a value of this type
(&ByteSlice) get_orpub fn (s &ByteSlice) get_or(idx usize, fallback u8) u8Operation on &ByteSlice: read or.
s &ByteSliceByteSlice instance used by this call (borrow).idx usizefallback u8u8 — a value of this type
(&ByteSlice) subslicepub fn (s &ByteSlice) subslice(start usize, end usize) ByteSliceExecute subslice on &ByteSlice.
s &ByteSliceByteSlice instance used by this call (borrow).start usizeend usizeByteSlice — a value of this type
struct MutByteSlicepub struct MutByteSlice {
pub ptr *raw u8
pub len usize
}Structure encapsulating ptr, len.
ptr *raw u8len usizemut_byte_slicepub fn mut_byte_slice(ptr *raw u8, len usize) MutByteSliceMut byte slice.
ptr *raw u8len usizeMutByteSlice — a value of this type
(&MutByteSlice) is_emptypub fn (s &MutByteSlice) is_empty() boolOperation on &MutByteSlice: whether it is empty.
s &MutByteSliceMutByteSlice instance used by this call (borrow).bool — true or false
(&MutByteSlice) getpub fn (s &MutByteSlice) get(idx usize) u8Execute get on &MutByteSlice.
s &MutByteSliceMutByteSlice instance used by this call (borrow).idx usizeu8 — a value of this type
($&MutByteSlice) setpub fn (s $&MutByteSlice) set(idx usize, val u8) boolExecute set on $&MutByteSlice.
s $&MutByteSliceMutByteSlice instance used by this call (exclusive borrow).idx usizeval u8bool — true or false
($&MutByteSlice) fillpub fn (s $&MutByteSlice) fill(val u8)Execute fill on $&MutByteSlice.
s $&MutByteSliceMutByteSlice instance used by this call (exclusive borrow).val u8This call does not return a value.
($&MutByteSlice) copy_frompub fn (s $&MutByteSlice) copy_from(src &ByteSlice) usizeOperation on $&MutByteSlice: copy from.
s $&MutByteSliceMutByteSlice instance used by this call (exclusive borrow).src &ByteSliceusize — a value of this type
(&MutByteSlice) as_readonlypub fn (s &MutByteSlice) as_readonly() ByteSliceOperation on &MutByteSlice: as readonly.
s &MutByteSliceMutByteSlice instance used by this call (borrow).ByteSlice — a value of this type
(&MutByteSlice) subslicepub fn (s &MutByteSlice) subslice(start usize, end usize) MutByteSliceExecute subslice on &MutByteSlice.
s &MutByteSliceMutByteSlice instance used by this call (borrow).start usizeend usizeMutByteSlice — a value of this type