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
This commit is contained in:
parent
df7e35725b
commit
0381f4905f
@ -164,13 +164,14 @@ __start:
|
|||||||
|
|
||||||
bl OF_initial_setup
|
bl OF_initial_setup
|
||||||
|
|
||||||
lis 4,end@ha
|
|
||||||
addi 4,4,end@l
|
|
||||||
mr 5,4
|
|
||||||
|
|
||||||
lis 3,kernel_text@ha
|
lis 3,kernel_text@ha
|
||||||
addi 3,3,kernel_text@l
|
addi 3,3,kernel_text@l
|
||||||
|
|
||||||
|
lis 4,end@ha
|
||||||
|
addi 4,4,end@l
|
||||||
|
add 4,4,3
|
||||||
|
mr 5,4
|
||||||
|
|
||||||
/* Restore the argument pointer and length */
|
/* Restore the argument pointer and length */
|
||||||
mr 6,20
|
mr 6,20
|
||||||
mr 7,21
|
mr 7,21
|
||||||
|
@ -164,13 +164,14 @@ ASENTRY_NOPROF(__start)
|
|||||||
bl OF_initial_setup
|
bl OF_initial_setup
|
||||||
nop
|
nop
|
||||||
|
|
||||||
lis 4,end@ha
|
|
||||||
addi 4,4,end@l
|
|
||||||
mr 5,4
|
|
||||||
|
|
||||||
lis 3,kernbase@ha
|
lis 3,kernbase@ha
|
||||||
addi 3,3,kernbase@l
|
addi 3,3,kernbase@l
|
||||||
|
|
||||||
|
lis 4,end@ha
|
||||||
|
addi 4,4,end@l
|
||||||
|
add 4,4,3
|
||||||
|
mr 5,4
|
||||||
|
|
||||||
/* Restore the argument pointer and length */
|
/* Restore the argument pointer and length */
|
||||||
mr 6,20
|
mr 6,20
|
||||||
mr 7,21
|
mr 7,21
|
||||||
|
Loading…
x
Reference in New Issue
Block a user