diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2012-06-29 01:55:20 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2012-06-29 01:55:20 +0000 |
commit | 540fcf6aed4a988f378d076fb10a04070a5437bc (patch) | |
tree | 4067fe8922bf1990b67591c88dc7d2aae89d7c78 /sys/powerpc | |
parent | 89f56f08d4effab33a84a9fae36af117d8264c36 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/powerpc/aim/locore32.S | 7 | ||||
-rw-r--r-- | sys/powerpc/aim/locore64.S | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/sys/powerpc/aim/locore32.S b/sys/powerpc/aim/locore32.S index 9ad74fa..80c3c08 100644 --- a/sys/powerpc/aim/locore32.S +++ b/sys/powerpc/aim/locore32.S @@ -164,13 +164,14 @@ __start: bl OF_initial_setup + lis 3,kernel_text@ha + addi 3,3,kernel_text@l + lis 4,end@ha addi 4,4,end@l + add 4,4,3 mr 5,4 - lis 3,kernel_text@ha - addi 3,3,kernel_text@l - /* Restore the argument pointer and length */ mr 6,20 mr 7,21 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 |