Skip to contentSkip to conversation

x86/devicetree: Fix build for amd64

PATCH Superseded Ricardo Ribalda Delgado 2 participants 2 messages Feb 2, 2015 x86

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/devicetree: Fix build for amd64

apic_force_enable is not defined for amd64.

Without this patch:

LD init/built-in.o
arch/x86/built-in.o: In function `dtb_lapic_setup':
kernel/devicetree.c:155:
undefined reference to `apic_force_enable' Makefile:923: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

---

v2: Suggested by: Jiang Liu <[email protected]>

How about defining a version of apic_force_enable() for X86_64 in apic.h which just return failure?

 arch/x86/kernel/apic/apic.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/x86/kernel/apic/apic.c +6 -0
index 29b5b18..8d5a320 100644
@@ -1679,6 +1679,12 @@ static int __init detect_init_APIC(void)
 	mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
 	return 0;
 }
+
+int __init apic_force_enable(unsigned long addr)
+{
+	return -1;
+}
+
 #else
 
 static int __init apic_verify(void)
Signature · 1 line
2.1.4
#1 lore raw
Quoted 14 lines · Ricardo Ribalda Delgado

apic_force_enable is not defined for amd64.

Without this patch:

LD init/built-in.o
arch/x86/built-in.o: In function `dtb_lapic_setup':
kernel/devicetree.c:155:
undefined reference to `apic_force_enable' Makefile:923: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

---

Quoted 7 lines

v2: Suggested by: Jiang Liu <[email protected]>

How about defining a version of apic_force_enable() for X86_64 in apic.h which just return failure?

 arch/x86/kernel/apic/apic.c | 6 ++++++
 1 file changed, 6 insertions(+)

I think the original suggestion made sense, move your stuff to apic.h so
that the call is optimised away rather than keeping it here.

Maciej