summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim/locore64.S
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2012-06-29 01:55:20 +0000
committerrpaulo <rpaulo@FreeBSD.org>2012-06-29 01:55:20 +0000
commit540fcf6aed4a988f378d076fb10a04070a5437bc (patch)
tree4067fe8922bf1990b67591c88dc7d2aae89d7c78 /sys/powerpc/aim/locore64.S
parent89f56f08d4effab33a84a9fae36af117d8264c36 (diff)
downloadFreeBSD-src-540fcf6aed4a988f378d076fb10a04070a5437bc.zip
FreeBSD-src-540fcf6aed4a988f378d076fb10a04070a5437bc.tar.gz
The `end' symbol doesn't match the end of the kernel image because it's
relative to the start address (unless the start address is 0, which is not the case). This is currently not a problem because all powerpc architectures are using loader(8) which passes metadata to the kernel including the correct `endkernel' address. If we don't use loader(8), register 4 and 5 will have the size of the kernel ELF file, not its end address. We fix that simply by adding `kernel_text' to `end' to compute `endkernel'. Discussed with: nathanw
Diffstat (limited to 'sys/powerpc/aim/locore64.S')
-rw-r--r--sys/powerpc/aim/locore64.S7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/powerpc/aim/locore64.S b/sys/powerpc/aim/locore64.S
index 83d9048..65c4999 100644
--- a/sys/powerpc/aim/locore64.S
+++ b/sys/powerpc/aim/locore64.S
@@ -164,13 +164,14 @@ ASENTRY_NOPROF(__start)
bl OF_initial_setup
nop
+ lis 3,kernbase@ha
+ addi 3,3,kernbase@l
+
lis 4,end@ha
addi 4,4,end@l
+ add 4,4,3
mr 5,4
- lis 3,kernbase@ha
- addi 3,3,kernbase@l
-
/* Restore the argument pointer and length */
mr 6,20
mr 7,21
OpenPOWER on IntegriCloud