mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-20 09:28:49 +08:00
[fixup] add cache maintenance ops;
fix bugs on cache maintenance when starting user app
This commit is contained in:
@@ -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__ */
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user