Device Tree support for x86_64 kernel? Unresolved symbol apic_force_enable

Bob Paauwe bob.j.paauwe at intel.com
Mon Mar 3 12:57:49 EST 2014


Background:

I'm working on a project that needs device tree like capability. Using
the device tree OF driver works well and I don't want to create something
that closely duplicates that functionality.  

When building a 32bit kernel, all works fine. However when building a
64bit kernel, the linking stage fails with an unresolved symbol: 
  apic_force_enable

This symbol is getting called from arch/x86/kernel/devicetree.c and is
defined in arch/x86/kernel/apic/apic.c but only when !CONFIG_X86_64

I see two possible fixes but as I'm unfamiliar with this area of the
kernel I don't know which would be a better choice.

1) in arch/x86/kernel/apic/apic.c, define the apic_force_enable() 
   function in the X86_64 bit path and have it return 0.  Something like:

   
   int __init apic_force_enable(unsigned long addr)
   {
      return 0;
   }

2) wrap the call to apic_force_enable with a #ifndef CONFIG_X86_64 in
   devicetree.c. Something like :

   #ifndef CONFIG_X86_64
         if (apic_force_enable(r.start))
            return;
   #else
         return;
   #endif

I've been using #1 successfully in my development and it seems like it
would be the best choice long term.  I'm looking for some validation
that this makes sense and if so, I'll submit a patch to lkm with the
fix.



More information about the Kernelnewbies mailing list