Module mem

Source
Expand description

Physical memory information.

Macros§

pa
Alias for PhysAddr::from_usize.
va
Alias for VirtAddr::from_usize.

Structs§

Aligned4K
A wrapper type for aligning a value to 4K bytes.
MemRegionFlags
The flags of a physical memory region.
PhysAddr
A physical memory address.
PhysMemRegion
A physical memory region.
VirtAddr
A virtual memory address.

Constants§

DEFAULT_MMIO_FLAGS
The default flags for a MMIO region (readable, writable, device, and reserved).
DEFAULT_RAM_FLAGS
The default flags for a normal memory region (readable, writable and allocatable).
DEFAULT_RESERVED_FLAGS
The default flags for a reserved memory region (readable, writable, and reserved).
PAGE_SIZE_4K
The size of a 4K page (4096 bytes).

Traits§

MemIf
Physical memory interface.

Functions§

check_sorted_ranges_overlap
Checks if the given ranges are overlapping.
mmio_ranges
Returns all device memory (MMIO) ranges on the platform.
phys_ram_ranges
Returns all physical memory (RAM) ranges on the platform.
phys_to_virt
Translates a physical address to a virtual address.
ranges_difference
Removes a portion of ranges from the given ranges.
reserved_phys_ram_ranges
Returns all reserved physical memory ranges on the platform.
total_ram_size
Returns the total size of physical memory (RAM) on the platform.
virt_to_phys
Translates a virtual address to a physical address.

Type Aliases§

OverlapErr
The error type for overlapping check.
RawRange
The raw memory range with start and size.