svn commit: r305096 - head/sys/arm/arm
Olivier Houchard
cognet at FreeBSD.org
Tue Aug 30 23:30:28 UTC 2016
Author: cognet
Date: Tue Aug 30 23:30:26 2016
New Revision: 305096
URL: https://svnweb.freebsd.org/changeset/base/305096
Log:
Some old arm ports don't load the kernel at the beginning of the memory,
because the bootloader, ie redboot, won't let them do so, and so used the
memory before the kernel for early memory allocation, such as pagetables,
stacks, etc...
Make a bit of an effort to try to get that memory mapped.
Modified:
head/sys/arm/arm/locore-v4.S
Modified: head/sys/arm/arm/locore-v4.S
==============================================================================
--- head/sys/arm/arm/locore-v4.S Tue Aug 30 22:48:05 2016 (r305095)
+++ head/sys/arm/arm/locore-v4.S Tue Aug 30 23:30:26 2016 (r305096)
@@ -195,6 +195,16 @@ Lunmapped:
ldr r2, =(KERNVIRTADDR)
mov r3, #64
bl build_pagetables
+#if defined(PHYSADDR) && (KERNVIRTADDR != KERNBASE)
+/*
+ * If the kernel wasn't loaded at the beginning of the ram, map the memory
+ * before the kernel too, as some ports use that for pagetables, stack, etc...
+ */
+ ldr r1, =PHYSADDR
+ ldr r2, =KERNBASE
+ ldr r3, =((KERNVIRTADDR - KERNBASE) / L1_S_SIZE)
+ bl build_pagetables
+#endif
/* Create a device mapping for early_printf if specified. */
#if defined(SOCDEV_PA) && defined(SOCDEV_VA)
More information about the svn-src-head
mailing list