From 313857e9b7bfd0e7b91cf16356d7cd942dfcf728 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Thu, 6 Feb 2014 20:17:58 +0000 Subject: [PATCH] Pass the kernel physical address to initarm through the boot param struct. --- sys/arm/arm/locore.S | 4 +++- sys/arm/include/cpu.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/arm/arm/locore.S b/sys/arm/arm/locore.S index 609c31021128..fc68ac5aa9a3 100644 --- a/sys/arm/arm/locore.S +++ b/sys/arm/arm/locore.S @@ -216,7 +216,7 @@ mmu_done: ldr pc, .Lvirt_done virt_done: - mov r1, #20 /* loader info size is 20 bytes also second arg */ + mov r1, #24 /* loader info size is 24 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 */ @@ -225,6 +225,8 @@ virt_done: str r8, [r0, #8] /* Store r1 from boot loader */ str ip, [r0, #12] /* store r2 from boot loader */ 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 */ 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 95779e1d9a57..88dbcdba88ec 100644 --- a/sys/arm/include/cpu.h +++ b/sys/arm/include/cpu.h @@ -41,6 +41,7 @@ struct arm_boot_params { register_t abp_r1; /* r1 from the boot loader */ 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 */ }; void arm_vector_init(vm_offset_t, int);