@@ -14,8 +14,8 @@ use x86_64::{
1414pub struct UsedMemorySlice {
1515 /// the physical start of the slice
1616 pub start : u64 ,
17- /// the length of the slice
18- pub len : u64 ,
17+ /// The physical end address (exclusive) of the region.
18+ pub end : u64 ,
1919}
2020
2121/// Abstraction trait for a memory region returned by the UEFI or BIOS firmware.
@@ -46,7 +46,7 @@ pub struct LegacyFrameAllocator<I, D, S> {
4646}
4747
4848/// Start address of the first frame that is not part of the lower 1MB of frames
49- const LOWER_MEMORY_END_PAGE : u64 = 0x100_000 ;
49+ const LOWER_MEMORY_END_PAGE : u64 = 0x10_0000 ;
5050
5151impl < I , D > LegacyFrameAllocator < I , D , Empty < UsedMemorySlice > >
5252where
@@ -212,15 +212,15 @@ where
212212 bootloader : UsedMemorySlice {
213213 start : min_frame. start_address ( ) . as_u64 ( ) ,
214214 // TODO: unit test that this is not an off by 1
215- len : next_free. start_address ( ) - min_frame. start_address ( ) ,
215+ end : next_free. start_address ( ) - min_frame. start_address ( ) ,
216216 } ,
217217 kernel : UsedMemorySlice {
218218 start : kernel_slice_start. as_u64 ( ) ,
219- len : kernel_slice_len,
219+ end : kernel_slice_len,
220220 } ,
221221 ramdisk : ramdisk_slice_start. map ( |start| UsedMemorySlice {
222222 start : start. as_u64 ( ) ,
223- len : ramdisk_slice_len,
223+ end : ramdisk_slice_len,
224224 } ) ,
225225 state : KernelRamIterState :: Bootloader ,
226226 }
@@ -243,7 +243,7 @@ where
243243 }
244244
245245 for slice in used_slices. clone ( ) {
246- let slice_end = slice. start + slice. len ;
246+ let slice_end = slice. start + slice. end ;
247247 if region. end <= slice. start || region. start >= slice_end {
248248 // region and slice don't overlap
249249 continue ;
0 commit comments