Skip to contentSkip to conversation

ARM: fix v7M build for !CONFIG_PRINTK

PATCH New Rob Herring 2 participants 3 messages Jan 12, 2015 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: fix v7M build for !CONFIG_PRINTK

Minimal builds for v7M are broken when printk is disabled. The caller is assembly so add the necessary ifdef around the call.

---
 arch/arm/kernel/entry-v7m.S | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/kernel/entry-v7m.S +2 -0
index 2260f18..8944f49 100644
@@ -22,10 +22,12 @@
 
 __invalid_entry:
 	v7m_exception_entry
+#ifdef CONFIG_PRINTK
 	adr	r0, strerr
 	mrs	r1, ipsr
 	mov	r2, lr
 	bl	printk
+#endif
 	mov	r0, sp
 	bl	show_regs
 1:	b	1b
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/1 ARM: fix v7M build for !CONFIG_PRINTK

arch/arm/kernel/entry-v7m.S line 33

Quoted 13 lines · On Sunday 11 January 2015 22:25:49 Rob Herring wrote:

__invalid_entry:
v7m_exception_entry

arch/arm/kernel/entry-v7m.S +2 -0
+#ifdef CONFIG_PRINTK
        adr     r0, strerr
        mrs     r1, ipsr
        mov     r2, lr
        bl      printk
+#endif
        mov     r0, sp
        bl      show_regs
 1:     b       1b

Should the show_regs call be commented out as well? While the function is still there without printk support, I believe it doesn't actually do anything.

Arnd

#2 lore raw

PATCH 1/1 ARM: fix v7M build for !CONFIG_PRINTK

Quoted 18 lines · Arnd Bergmann

arch/arm/kernel/entry-v7m.S line 33

Quoted 13 lines · On Sunday 11 January 2015 22:25:49 Rob Herring wrote:

__invalid_entry:
v7m_exception_entry

arch/arm/kernel/entry-v7m.S +2 -0
+#ifdef CONFIG_PRINTK
        adr     r0, strerr
        mrs     r1, ipsr
        mov     r2, lr
        bl      printk
+#endif
        mov     r0, sp
        bl      show_regs
 1:     b       1b

Should the show_regs call be commented out as well? While the function is still there without printk support, I believe it doesn't actually do anything.

It does still call unwind_backtrace which still constructs the backtrace from looking at the disassembly output. That's probably not too useful unless it is saved to memory that could be examined with a debugger. One would probably just enable printk at that point though.

Rob