File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ pub mod mair {
206206/// # Safety
207207///
208208/// - Supposed to land in `.bss`. Therefore, ensure that all initial member values boil down to "0".
209- static mut KERNEL_TABLES : SyncUnsafeCell < TranslationTable > =
209+ static KERNEL_TABLES : SyncUnsafeCell < TranslationTable > =
210210 SyncUnsafeCell :: new ( TranslationTable :: new ( ) ) ;
211211
212212static MMU : MemoryManagementUnit = MemoryManagementUnit ;
@@ -276,18 +276,15 @@ impl interface::Mmu for MemoryManagementUnit {
276276 // Prepare the memory attribute indirection register.
277277 self . setup_mair ( ) ;
278278
279+ let kernel_tables = & mut * KERNEL_TABLES . get ( ) ;
280+
279281 // Populate translation tables.
280- #[ allow( static_mut_refs) ]
281- KERNEL_TABLES
282- . get_mut ( )
282+ kernel_tables
283283 . populate_tt_entries ( )
284284 . map_err ( MmuEnableError :: Other ) ?;
285285
286286 // Set the "Translation Table Base Register".
287- TTBR0_EL1 . set_baddr (
288- #[ allow( static_mut_refs) ]
289- KERNEL_TABLES . get_mut ( ) . phys_base_address ( ) ,
290- ) ;
287+ TTBR0_EL1 . set_baddr ( kernel_tables. phys_base_address ( ) ) ;
291288
292289 self . configure_translation_control ( ) ;
293290
You can’t perform that action at this time.
0 commit comments