Message ID | 20200904081949.5594-3-linus.walleij@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | RFC: ARM section mapping debug prints | expand |
On Fri, 4 Sep 2020, Linus Walleij wrote: > We might need to use lr as we want to be able to call > the debug print functions, so save lr to r11 and restore > lr from r11 in __create_page_tables. > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > --- > arch/arm/kernel/head.S | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S > index 2bfdf33aa74c..8b089c4c0d17 100644 > --- a/arch/arm/kernel/head.S > +++ b/arch/arm/kernel/head.S > @@ -171,10 +171,11 @@ ENDPROC(stext) > * r8 = phys_offset, r9 = cpuid, r10 = procinfo > * > * Returns: > - * r0, r3, r5-r7 corrupted > + * r0, r3, r5-r7, r11 corrupted > * r4 = physical page table address > */ > __create_page_tables: > + mov r11, lr @ we need to be able to call prints > pgtbl r4, r8 @ page table address > > /* > @@ -350,6 +351,7 @@ __create_page_tables: > #ifdef CONFIG_ARM_LPAE > sub r4, r4, #0x1000 @ point to the PGD table > #endif > + mov lr, r11 > ret lr Here you could simply do "ret r11". > ENDPROC(__create_page_tables) > .ltorg > -- > 2.26.2 > >
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 2bfdf33aa74c..8b089c4c0d17 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -171,10 +171,11 @@ ENDPROC(stext) * r8 = phys_offset, r9 = cpuid, r10 = procinfo * * Returns: - * r0, r3, r5-r7 corrupted + * r0, r3, r5-r7, r11 corrupted * r4 = physical page table address */ __create_page_tables: + mov r11, lr @ we need to be able to call prints pgtbl r4, r8 @ page table address /* @@ -350,6 +351,7 @@ __create_page_tables: #ifdef CONFIG_ARM_LPAE sub r4, r4, #0x1000 @ point to the PGD table #endif + mov lr, r11 ret lr ENDPROC(__create_page_tables) .ltorg
We might need to use lr as we want to be able to call the debug print functions, so save lr to r11 and restore lr from r11 in __create_page_tables. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- arch/arm/kernel/head.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)