[fixup] add cache maintenance ops;

fix bugs on cache maintenance when starting user app
This commit is contained in:
wangxiaoyao
2023-02-21 08:48:49 +08:00
committed by guo
parent f84d89b0ca
commit 484a0d602e
27 changed files with 162 additions and 94 deletions
+19
View File
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-03-29 quanzhao the first version
*/
#ifndef __CACHE_H__
#define __CACHE_H__
static inline void rt_hw_icache_invalidate_all(void)
{
__asm__ volatile("mcr p15, 0, %0, c7, c5, 0"::"r"(0ul));
}
#endif /* __CACHE_H__ */
+1 -1
View File
@@ -337,7 +337,7 @@ void rt_hw_aspace_switch(rt_aspace_t aspace)
if (aspace != &rt_kernel_space)
{
void *pgtbl = aspace->page_table;
pgtbl = _rt_kmem_v2p(pgtbl);
pgtbl = rt_kmem_v2p(pgtbl);
rt_hw_mmu_switch(pgtbl);
-13
View File
@@ -112,19 +112,6 @@ void *rt_hw_mmu_v2p(struct rt_aspace *aspace, void *vaddr);
void rt_hw_mmu_kernel_map_init(struct rt_aspace *aspace, size_t vaddr_start, size_t size);
void *rt_hw_mmu_tbl_get();
static inline void *_rt_kmem_v2p(void *vaddr)
{
return rt_hw_mmu_v2p(&rt_kernel_space, vaddr);
}
static inline void *rt_kmem_v2p(void *vaddr)
{
MM_PGTBL_LOCK(&rt_kernel_space);
void *paddr = _rt_kmem_v2p(vaddr);
MM_PGTBL_UNLOCK(&rt_kernel_space);
return paddr;
}
int rt_hw_mmu_control(struct rt_aspace *aspace, void *vaddr, size_t size, enum rt_mmu_cntl cmd);
#endif