From 76d8416e72989e4394fd44c0644e50fe9e5f198a Mon Sep 17 00:00:00 2001 From: wangqinglin <53550140+HelloByeAll@users.noreply.github.com> Date: Mon, 12 Jun 2023 19:49:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Daarch64-qemu=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98=20(#7661)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libcpu/aarch64/common/mmu.c | 10 +++++----- libcpu/aarch64/cortex-a/entry_point.S | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libcpu/aarch64/common/mmu.c b/libcpu/aarch64/common/mmu.c index 19c74390e7..e6a98e4741 100644 --- a/libcpu/aarch64/common/mmu.c +++ b/libcpu/aarch64/common/mmu.c @@ -771,19 +771,19 @@ void rt_hw_mem_setup_early(unsigned long *tbl0, unsigned long *tbl1, unsigned long size, unsigned long pv_off) { int ret; - - /* setup pv off */ - rt_kmem_pvoff_set(pv_off); + unsigned long count = (size + ARCH_SECTION_MASK) >> ARCH_SECTION_SHIFT; + unsigned long normal_attr = MMU_MAP_CUSTOM(MMU_AP_KAUN, NORMAL_MEM); #ifdef RT_USING_SMART unsigned long va = KERNEL_VADDR_START; #else extern unsigned char __start; unsigned long va = (unsigned long) &__start; + va = RT_ALIGN_DOWN(va, 0x200000); #endif - unsigned long count = (size + ARCH_SECTION_MASK) >> ARCH_SECTION_SHIFT; - unsigned long normal_attr = MMU_MAP_CUSTOM(MMU_AP_KAUN, NORMAL_MEM); + /* setup pv off */ + rt_kmem_pvoff_set(pv_off); /* clean the first two pages */ rt_memset((char *)tbl0, 0, ARCH_PAGE_SIZE); diff --git a/libcpu/aarch64/cortex-a/entry_point.S b/libcpu/aarch64/cortex-a/entry_point.S index 611f36da71..9e4adddac7 100644 --- a/libcpu/aarch64/cortex-a/entry_point.S +++ b/libcpu/aarch64/cortex-a/entry_point.S @@ -134,7 +134,7 @@ __start: mov x3,0 #endif - ldr x2, =0x01000000 /* map 16M memory for kernel space */ + ldr x2, =0x10000000 /* map 256M memory for kernel space */ bl rt_hw_mem_setup_early ldr x30, =after_mmu_enable /* set LR to after_mmu_enable function, it's a v_addr */