Преглед изворни кода

[api] rt_hw_kernel_mmu_switch 改为rt_hw_mmu_ktbl_set

wangxiaoyao пре 3 година
родитељ
комит
e27c7bdf3f

+ 1 - 1
bsp/qemu-virt64-aarch64/drivers/secondary_cpu.c

@@ -21,7 +21,7 @@ void rt_hw_secondary_cpu_bsp_start(void)
 {
     rt_hw_spin_lock(&_cpus_lock);
 
-    rt_hw_kernel_mmu_switch((unsigned long)MMUTable);
+    rt_hw_mmu_ktbl_set((unsigned long)MMUTable);
 
     // interrupt init
     rt_hw_vector_init();

+ 2 - 2
libcpu/aarch64/common/mmu.c

@@ -465,7 +465,7 @@ void rt_hw_mmu_setmtt(unsigned long vaddrStart,
     _kernel_map_fixed((unsigned long *)MMUTable, vaddrStart, paddrStart, count, attr);
 }
 
-void rt_hw_kernel_mmu_switch(unsigned long tbl)
+void rt_hw_mmu_ktbl_set(unsigned long tbl)
 {
 #ifdef RT_USING_LWP
     tbl += PV_OFFSET;
@@ -487,7 +487,7 @@ void rt_hw_mmu_setup(struct mem_desc *mdesc, int desc_nr)
         mdesc++;
     }
     rt_hw_cpu_dcache_ops(RT_HW_CACHE_FLUSH, (void *)MMUTable, sizeof MMUTable);
-    rt_hw_kernel_mmu_switch((unsigned long)MMUTable);
+    rt_hw_mmu_ktbl_set((unsigned long)MMUTable);
 }
 
 /**

+ 1 - 1
libcpu/aarch64/common/mmu.h

@@ -133,7 +133,7 @@ void *rt_hw_mmu_map(rt_mmu_info *mmu_info, void* p_addr, size_t size, size_t att
 void rt_hw_mmu_unmap(rt_mmu_info *mmu_info, void* v_addr, size_t size);
 void *rt_hw_mmu_v2p(rt_mmu_info *mmu_info, void* v_addr);
 
-void rt_hw_kernel_mmu_switch(unsigned long tbl);
+void rt_hw_mmu_ktbl_set(unsigned long tbl);
 void *rt_hw_mmu_tbl_get();
 void rt_hw_mmu_switch(void *mmu_table);
 

+ 0 - 2
libcpu/risc-v/virt64/mmu.c

@@ -29,8 +29,6 @@ void rt_hw_cpu_icache_invalidate_all();
 void rt_hw_cpu_dcache_flush_all();
 void rt_hw_cpu_dcache_clean(void *addr, rt_size_t size);
 
-static rt_mutex_t mm_lock;
-
 volatile rt_ubase_t MMUTable[__SIZE(VPN2_BIT)] __attribute__((aligned(4 * 1024)));
 
 static void rt_hw_cpu_tlb_invalidate()