@@ -14,8 +14,8 @@ use x86_64::{
14
14
pub struct UsedMemorySlice {
15
15
/// the physical start of the slice
16
16
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 ,
19
19
}
20
20
21
21
/// Abstraction trait for a memory region returned by the UEFI or BIOS firmware.
@@ -46,7 +46,7 @@ pub struct LegacyFrameAllocator<I, D, S> {
46
46
}
47
47
48
48
/// 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 ;
50
50
51
51
impl < I , D > LegacyFrameAllocator < I , D , Empty < UsedMemorySlice > >
52
52
where
@@ -212,15 +212,15 @@ where
212
212
bootloader : UsedMemorySlice {
213
213
start : min_frame. start_address ( ) . as_u64 ( ) ,
214
214
// 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 ( ) ,
216
216
} ,
217
217
kernel : UsedMemorySlice {
218
218
start : kernel_slice_start. as_u64 ( ) ,
219
- len : kernel_slice_len,
219
+ end : kernel_slice_len,
220
220
} ,
221
221
ramdisk : ramdisk_slice_start. map ( |start| UsedMemorySlice {
222
222
start : start. as_u64 ( ) ,
223
- len : ramdisk_slice_len,
223
+ end : ramdisk_slice_len,
224
224
} ) ,
225
225
state : KernelRamIterState :: Bootloader ,
226
226
}
@@ -243,7 +243,7 @@ where
243
243
}
244
244
245
245
for slice in used_slices. clone ( ) {
246
- let slice_end = slice. start + slice. len ;
246
+ let slice_end = slice. start + slice. end ;
247
247
if region. end <= slice. start || region. start >= slice_end {
248
248
// region and slice don't overlap
249
249
continue ;
0 commit comments