Skip to contentSkip to conversation

ppc32: Fix CONFIG_PRINTK=n building

PATCH In review Tom Rini 4 participants 4 messages Nov 8, 2005 – Nov 9, 2005

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 ppc32: Fix CONFIG_PRINTK=n building

The following patch is needed to allow PRINTK=n to work on ppc32.

Direct calls to printk from asm files can't be magically removed so we have to do it manually.

arch/ppc/kernel/fpu.S +2 -0
Index: linux-2.6.14/arch/ppc/kernel/fpu.S
===================================================================
@@ -91,7 +91,9 @@ KernelFP:
 	ori	r3,r3,86f@l
 	mr	r4,r2			/* current */
 	lwz	r5,_NIP(r1)
+#ifdef CONFIG_PRINTK
 	bl	printk
+#endif
 	b	ret_from_except
 86:	.string	"floating point used in kernel (task=%p, pc=%x)\n"
 	.align	4,0
arch/ppc/kernel/head.S +2 -0
Index: linux-2.6.14/arch/ppc/kernel/head.S
===================================================================
@@ -846,7 +846,9 @@ KernelAltiVec:
 	ori	r3,r3,87f@l
 	mr	r4,r2		/* current */
 	lwz	r5,_NIP(r1)
+#ifdef CONFIG_PRINTK
 	bl	printk
+#endif
 	b	ret_from_except
 87:	.string	"AltiVec used in kernel  (task=%p, pc=%x)  \n"
 	.align	4,0
arch/ppc/kernel/head_fsl_booke.S +2 -0
Index: linux-2.6.14/arch/ppc/kernel/head_fsl_booke.S
===================================================================
@@ -906,7 +906,9 @@ KernelSPE:
 	ori	r3,r3,87f@l
 	mr	r4,r2		/* current */
 	lwz	r5,_NIP(r1)
+#ifdef CONFIG_PRINTK
 	bl	printk
+#endif
 	b	ret_from_except
 87:	.string	"SPE used in kernel  (task=%p, pc=%x)  \n"
 	.align	4,0
Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#1 lore raw
Quoted 10 lines · Tom Rini

The following patch is needed to allow PRINTK=n to work on ppc32.

Direct calls to printk from asm files can't be magically removed so we have to do it manually.

Index: linux-2.6.14/arch/ppc/kernel/fpu.S
===================================================================
--- linux-2.6.14.orig/arch/ppc/kernel/fpu.S

This file doesn't exist in mainline. 2.6.14 is too old as a reference for ppc patches due to the arch/powerpc/ merge.

-Matt

#3 lore raw
In reply to Tom Rini
Quoted 4 lines · Tom Rini

The following patch is needed to allow PRINTK=n to work on ppc32.

Direct calls to printk from asm files can't be magically removed so we have to do it manually.

Nak. We are using arch/powerpc/kernel/fpu.S now (even for ARCH=ppc) and it doesn't do the printk in assembler.

In general I'd prefer to move the printk calls to C code rather than adding these ifdefs.

Paul.