From b2478843a943a6d248802299b430aa623bf3ea9b Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Sun, 9 Feb 2014 15:54:31 +0000 Subject: [PATCH] Pass the pagetable used from locore.S to initarm to allow it to map data in as required. --- sys/arm/arm/locore.S | 4 +++- sys/arm/include/cpu.h | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/arm/arm/locore.S b/sys/arm/arm/locore.S index 354871b9341f..f111cc173563 100644 --- a/sys/arm/arm/locore.S +++ b/sys/arm/arm/locore.S @@ -221,7 +221,7 @@ mmu_done: ldr pc, .Lvirt_done virt_done: - mov r1, #24 /* loader info size is 24 bytes also second arg */ + mov r1, #28 /* loader info size is 28 bytes also second arg */ subs sp, sp, r1 /* allocate arm_boot_params struct on stack */ bic sp, sp, #7 /* align stack to 8 bytes */ mov r0, sp /* loader info pointer is first arg */ @@ -232,6 +232,8 @@ virt_done: str fp, [r0, #16] /* store r3 from boot loader */ ldr r5, =KERNPHYSADDR /* load KERNPHYSADDR as the physical address */ str r5, [r0, #20] /* store the physical address */ + ldr r5, Lstartup_pagetable + str r5, [r0, #24] /* store the pagetable address */ mov fp, #0 /* trace back starts here */ bl _C_LABEL(initarm) /* Off we go */ diff --git a/sys/arm/include/cpu.h b/sys/arm/include/cpu.h index 88dbcdba88ec..c6f708824bbc 100644 --- a/sys/arm/include/cpu.h +++ b/sys/arm/include/cpu.h @@ -35,6 +35,11 @@ get_cyclecount(void) extern vm_offset_t vector_page; +/* + * Params passed into initarm. If you change the size of this you will + * need to update locore.S to allocate more memory on the stack before + * it calls initarm. + */ struct arm_boot_params { register_t abp_size; /* Size of this structure */ register_t abp_r0; /* r0 from the boot loader */ @@ -42,6 +47,7 @@ struct arm_boot_params { register_t abp_r2; /* r2 from the boot loader */ register_t abp_r3; /* r3 from the boot loader */ vm_offset_t abp_physaddr; /* The kernel physical address */ + vm_offset_t abp_pagetable; /* The early page table */ }; void arm_vector_init(vm_offset_t, int);