Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions libcpu/aarch64/common/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

/* restrict virtual address on usage of RT_NULL */
#ifndef KERNEL_VADDR_START
#define KERNEL_VADDR_START 0x1000
#define KERNEL_VADDR_START (ARCH_RAM_OFFSET + ARCH_TEXT_OFFSET)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个似乎更多偏向于Kconfig中进行配置了。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARCH_RAM_OFFSET 和 ARCH_TEXT_OFFSET 就是 Kconfig 配置出来的

#endif

volatile unsigned long MMUTable[512] __attribute__((aligned(4 * 1024)));
Expand Down Expand Up @@ -283,7 +283,9 @@ void *rt_hw_mmu_map(rt_aspace_t aspace, void *v_addr, void *p_addr, size_t size,

while (remaining_sz)
{
if (((rt_ubase_t)v_addr & ARCH_SECTION_MASK) || (remaining_sz < ARCH_SECTION_SIZE))
if (((rt_ubase_t)v_addr & ARCH_SECTION_MASK) ||
((rt_ubase_t)p_addr & ARCH_SECTION_MASK) ||
(remaining_sz < ARCH_SECTION_SIZE))
{
/* legacy 4k mapping */
stride = ARCH_PAGE_SIZE;
Expand Down