@@ -2,7 +2,7 @@ use core::marker::PhantomData;
22use  core:: { ptr,  slice} ; 
33
44use  crate :: proto:: console:: text; 
5- use  crate :: { CStr16 ,  Char16 ,  Handle ,  Result ,  ResultExt ,  Status ,   Completion } ; 
5+ use  crate :: { CStr16 ,  Char16 ,  Completion ,   Handle ,  Result ,  ResultExt ,  Status } ; 
66
77use  super :: boot:: { BootServices ,  MemoryDescriptor } ; 
88use  super :: runtime:: RuntimeServices ; 
@@ -217,7 +217,11 @@ impl SystemTable<Runtime> {
217217/// # Safety 
218218/// 
219219/// Setting new virtual memory map is unsafe and may cause undefined behaviors. 
220- pub  unsafe  fn  set_virtual_address_map ( self ,  map :  & mut  [ MemoryDescriptor ] ,  new_system_table_virtual_addr :  u64 )  -> Result < Self >  { 
220+ pub  unsafe  fn  set_virtual_address_map ( 
221+  self , 
222+  map :  & mut  [ MemoryDescriptor ] , 
223+  new_system_table_virtual_addr :  u64 , 
224+  )  -> Result < Self >  { 
221225 // Unsafe Code Guidelines guarantees that there is no padding in an array or a slice 
222226 // between its elements if the element type is `repr(C)`, which is our case. 
223227 // 
@@ -226,12 +230,25 @@ impl SystemTable<Runtime> {
226230 let  entry_size = core:: mem:: size_of :: < MemoryDescriptor > ( ) ; 
227231 let  entry_version = crate :: table:: boot:: MEMORY_DESCRIPTOR_VERSION ; 
228232 let  map_ptr = map. as_mut_ptr ( ) ; 
229-  let  result:  Result  = ( self . table . runtime . set_virtual_address_map ) ( map_size,  entry_size,  entry_version,  map_ptr) . into ( ) ; 
233+  let  result:  Result  = ( self . table . runtime . set_virtual_address_map ) ( 
234+  map_size, 
235+  entry_size, 
236+  entry_version, 
237+  map_ptr, 
238+  ) 
239+  . into ( ) ; 
230240 match  result { 
231241 Ok ( completion)  => { 
232-  let  new_table_ref = & mut  * ( new_system_table_virtual_addr as  usize  as  * mut  SystemTableImpl ) ; 
233-  Ok ( Completion :: new ( completion. status ( ) ,  Self  {  table :  new_table_ref,  _marker :  PhantomData  } ) ) 
234-  } , 
242+  let  new_table_ref =
243+  & mut  * ( new_system_table_virtual_addr as  usize  as  * mut  SystemTableImpl ) ; 
244+  Ok ( Completion :: new ( 
245+  completion. status ( ) , 
246+  Self  { 
247+  table :  new_table_ref, 
248+  _marker :  PhantomData , 
249+  } , 
250+  ) ) 
251+  } 
235252 Err ( err)  => Err ( err) , 
236253 } 
237254 } 
0 commit comments