File tree Expand file tree Collapse file tree 1 file changed +13
-17
lines changed
src/structures/paging/mapper Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -226,24 +226,20 @@ pub trait Mapper<S: PageSize> {
226226 Self : Sized ,
227227 A : FrameAllocator < Size4KiB > + ?Sized ,
228228 {
229- assert_eq ! ( pages. count( ) , frames. count( ) ) ;
229+ let parent_table_flags = flags
230+ & ( PageTableFlags :: PRESENT
231+ | PageTableFlags :: WRITABLE
232+ | PageTableFlags :: USER_ACCESSIBLE ) ;
230233
231- pages
232- . zip ( frames)
233- . try_for_each ( |( page, frame) | {
234- unsafe { self . map_to ( page, frame, flags, frame_allocator) }
235- . map ( |_| ( ) )
236- . map_err ( |e| {
237- (
238- e,
239- MapperFlushRange :: new ( PageRange {
240- start : pages. start ,
241- end : page,
242- } ) ,
243- )
244- } )
245- } )
246- . map ( |_| MapperFlushRange :: new ( pages) )
234+ unsafe {
235+ self . map_to_range_with_table_flags (
236+ pages,
237+ frames,
238+ flags,
239+ parent_table_flags,
240+ frame_allocator,
241+ )
242+ }
247243 }
248244
249245 /// Creates a new mapping in the page table.
You can’t perform that action at this time.
0 commit comments