11use crate :: frame_allocator:: FrameAllocator ;
22use bootloader:: bootinfo:: MemoryRegionType ;
33use fixedvec:: FixedVec ;
4+ use x86_64:: structures:: paging:: mapper:: { MapToError , MapperFlush , UnmapError } ;
45use x86_64:: structures:: paging:: {
5- Mapper , Page , PageSize , PageTableFlags , PhysFrame , Size4KiB , self , RecursivePageTable ,
6+ self , Mapper , Page , PageSize , PageTableFlags , PhysFrame , RecursivePageTable , Size4KiB ,
67} ;
7- use x86_64:: structures:: paging:: mapper:: { UnmapError , MapToError , MapperFlush } ;
88use x86_64:: { align_up, PhysAddr , VirtAddr } ;
99use xmas_elf:: program:: { self , ProgramHeader64 } ;
1010
@@ -68,7 +68,8 @@ pub(crate) fn map_segment(
6868 for frame in PhysFrame :: range_inclusive ( start_frame, end_frame) {
6969 let offset = frame - start_frame;
7070 let page = start_page + offset;
71- unsafe { map_page ( page, frame, page_table_flags, page_table, frame_allocator) ? } . flush ( ) ;
71+ unsafe { map_page ( page, frame, page_table_flags, page_table, frame_allocator) ? }
72+ . flush ( ) ;
7273 }
7374
7475 if mem_size > file_size {
@@ -93,7 +94,8 @@ pub(crate) fn map_segment(
9394 page_table,
9495 frame_allocator,
9596 ) ?
96- } . flush ( ) ;
97+ }
98+ . flush ( ) ;
9799
98100 type PageArray = [ u64 ; Size4KiB :: SIZE as usize / 8 ] ;
99101
@@ -123,7 +125,8 @@ pub(crate) fn map_segment(
123125 page_table,
124126 frame_allocator,
125127 ) ?
126- } . flush ( ) ;
128+ }
129+ . flush ( ) ;
127130 }
128131
129132 // Map additional frames.
@@ -136,7 +139,10 @@ pub(crate) fn map_segment(
136139 let frame = frame_allocator
137140 . allocate_frame ( MemoryRegionType :: Kernel )
138141 . ok_or ( MapToError :: FrameAllocationFailed ) ?;
139- unsafe { map_page ( page, frame, page_table_flags, page_table, frame_allocator) ? } . flush ( ) ;
142+ unsafe {
143+ map_page ( page, frame, page_table_flags, page_table, frame_allocator) ?
144+ }
145+ . flush ( ) ;
140146 }
141147
142148 // zero
0 commit comments