@@ -48,15 +48,18 @@ impl UsedLevel4Entries {
48
48
49
49
// The bootload needs to access the frame buffer.
50
50
if let Some ( frame_buffer) = framebuffer {
51
- used. mark_range_as_used ( frame_buffer. addr . as_u64 ( ) , frame_buffer. info . byte_len ) ;
51
+ used. mark_range_as_used (
52
+ frame_buffer. addr . as_u64 ( ) ,
53
+ frame_buffer. info . byte_len as u64 ,
54
+ ) ;
52
55
}
53
56
54
57
// Mark the statically configured ranges from the config as used.
55
58
56
59
if let Some ( config:: Mapping :: FixedAddress ( physical_memory_offset) ) =
57
60
config. mappings . physical_memory
58
61
{
59
- used. mark_range_as_used ( physical_memory_offset, max_phys_addr. as_u64 ( ) . into_usize ( ) ) ;
62
+ used. mark_range_as_used ( physical_memory_offset, max_phys_addr. as_u64 ( ) ) ;
60
63
}
61
64
62
65
if let Some ( config:: Mapping :: FixedAddress ( recursive_address) ) =
@@ -76,12 +79,12 @@ impl UsedLevel4Entries {
76
79
let memory_regions_layout = Layout :: array :: < MemoryRegion > ( regions) . unwrap ( ) ;
77
80
let ( combined, _) = boot_info_layout. extend ( memory_regions_layout) . unwrap ( ) ;
78
81
79
- used. mark_range_as_used ( boot_info_address, combined. size ( ) ) ;
82
+ used. mark_range_as_used ( boot_info_address, combined. size ( ) as u64 ) ;
80
83
}
81
84
82
85
if let config:: Mapping :: FixedAddress ( framebuffer_address) = config. mappings . framebuffer {
83
86
if let Some ( framebuffer) = framebuffer {
84
- used. mark_range_as_used ( framebuffer_address, framebuffer. info . byte_len ) ;
87
+ used. mark_range_as_used ( framebuffer_address, framebuffer. info . byte_len as u64 ) ;
85
88
}
86
89
}
87
90
@@ -111,14 +114,9 @@ impl UsedLevel4Entries {
111
114
}
112
115
113
116
/// Marks all p4 entries in the range `[address..address+size)` as used.
114
- ///
115
- /// `size` can be a `u64` or `usize`.
116
- fn mark_range_as_used < S > ( & mut self , address : u64 , size : S )
117
- where
118
- VirtAddr : core:: ops:: Add < S , Output = VirtAddr > ,
119
- {
117
+ fn mark_range_as_used ( & mut self , address : u64 , size : u64 ) {
120
118
let start = VirtAddr :: new ( address) ;
121
- let end_inclusive = ( start + size) - 1usize ;
119
+ let end_inclusive = ( start + size) - 1 ;
122
120
let start_page = Page :: < Size4KiB > :: containing_address ( start) ;
123
121
let end_page_inclusive = Page :: < Size4KiB > :: containing_address ( end_inclusive) ;
124
122
0 commit comments