Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / arch / x86 / include / asm / apic.h
index 5b7d5137e167cc7fb8d2770ad93a5447abccb0fa..a279d98ea95e9880d93fee697b3efd30646f9b5b 100644 (file)
@@ -303,8 +303,6 @@ struct apic {
 
        void (*setup_apic_routing)(void);
        int (*multi_timer_check)(int apic, int irq);
-       int (*apicid_to_node)(int logical_apicid);
-       int (*cpu_to_logical_apicid)(int cpu);
        int (*cpu_present_to_apicid)(int mps_cpu);
        void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap);
        void (*setup_portio_remap)(void);
@@ -352,6 +350,23 @@ struct apic {
        void (*icr_write)(u32 low, u32 high);
        void (*wait_icr_idle)(void);
        u32 (*safe_wait_icr_idle)(void);
+
+#ifdef CONFIG_X86_32
+       /*
+        * Called very early during boot from get_smp_config().  It should
+        * return the logical apicid.  x86_[bios]_cpu_to_apicid is
+        * initialized before this function is called.
+        *
+        * If logical apicid can't be determined that early, the function
+        * may return BAD_APICID.  Logical apicid will be configured after
+        * init_apic_ldr() while bringing up CPUs.  Note that NUMA affinity
+        * won't be applied properly during early boot in this case.
+        */
+       int (*x86_32_early_logical_apicid)(int cpu);
+
+       /* determine CPU -> NUMA node mapping */
+       int (*x86_32_numa_cpu_node)(int cpu);
+#endif
 };
 
 /*
@@ -499,6 +514,11 @@ extern struct apic apic_noop;
 
 extern struct apic apic_default;
 
+static inline int noop_x86_32_early_logical_apicid(int cpu)
+{
+       return BAD_APICID;
+}
+
 /*
  * Set up the logical destination ID.
  *
@@ -518,7 +538,7 @@ static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
        return cpuid_apic >> index_msb;
 }
 
-extern int default_apicid_to_node(int logical_apicid);
+extern int default_x86_32_numa_cpu_node(int cpu);
 
 #endif
 
@@ -554,12 +574,6 @@ static inline void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_ma
        *retmap = *phys_map;
 }
 
-/* Mapping from cpu number to logical apicid */
-static inline int default_cpu_to_logical_apicid(int cpu)
-{
-       return 1 << cpu;
-}
-
 static inline int __default_cpu_present_to_apicid(int mps_cpu)
 {
        if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
@@ -592,8 +606,4 @@ extern int default_check_phys_apicid_present(int phys_apicid);
 
 #endif /* CONFIG_X86_LOCAL_APIC */
 
-#ifdef CONFIG_X86_32
-extern u8 cpu_2_logical_apicid[NR_CPUS];
-#endif
-
 #endif /* _ASM_X86_APIC_H */