x86: include mach_apic.h in smpboot_64.c and smpboot.c
authorGlauber de Oliveira Costa <gcosta@redhat.com>
Wed, 19 Mar 2008 17:25:53 +0000 (14:25 -0300)
committerIngo Molnar <mingo@elte.hu>
Thu, 17 Apr 2008 15:41:02 +0000 (17:41 +0200)
After the inclusion, a lot of files needs fixing for conflicts,
some of them in the headers themselves, to accomodate for both
i386 and x86_64 versions.

[ mingo@elte.hu: build fix ]

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/mpparse_64.c
arch/x86/kernel/smpboot.c
arch/x86/kernel/smpboot_64.c
arch/x86/vdso/Makefile
include/asm-x86/apic.h
include/asm-x86/apicdef.h
include/asm-x86/mach-default/mach_apic.h
include/asm-x86/mach-default/mach_apicdef.h
include/asm-x86/smp_64.h

index 2cdc9de9371dd0d941406c11af288a8582c4e475..956b60f3ebd51c505856b0e97622f9add7f2c86e 100644 (file)
 #include <asm/io.h>
 #include <asm/mpspec.h>
 
+#ifdef CONFIG_X86_LOCAL_APIC
+# include <mach_apic.h>
+#endif
+
 static int __initdata acpi_force = 0;
 
 #ifdef CONFIG_ACPI
index 529b1c22077e03f8020283a40c44eee8ae8cfd89..03ef1a8b53e8efd81ad67b49ce85e1e16ac378f8 100644 (file)
@@ -30,6 +30,8 @@
 #include <asm/proto.h>
 #include <asm/acpi.h>
 
+#include <mach_apic.h>
+
 /* Have we found an MP table */
 int smp_found_config;
 unsigned int __cpuinitdata maxcpus = NR_CPUS;
index 6978f1bf65334da30867b14f3d10283cdc4bd284..253be86a88e4a5f6bcba54f85e1fa0988eb508a8 100644 (file)
@@ -11,6 +11,8 @@
 #include <asm/cpu.h>
 #include <asm/numa.h>
 
+#include <mach_apic.h>
+
 /* Number of siblings per CPU package */
 int smp_num_siblings = 1;
 EXPORT_SYMBOL(smp_num_siblings);
index 7d1b4cb380db1991a586e8d4fa602759e0c027b0..8a59fa80f8832cd58810b3e5a46c03232d946e9d 100644 (file)
@@ -61,6 +61,7 @@
 #include <asm/numa.h>
 
 #include <mach_wakecpu.h>
+#include <mach_apic.h>
 #include <smpboot_hooks.h>
 
 /* Set when the idlers are all forked */
index 0a8f4742ef519f2aa2b43d7318fed524eede671d..17a6b057856b6f6759eb358d7060b5b682861440 100644 (file)
@@ -39,7 +39,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
 
 CFL := $(PROFILING) -mcmodel=small -fPIC -g0 -O2 -fasynchronous-unwind-tables -m64
 
-$(vobjs): KBUILD_CFLAGS = $(CFL)
+$(vobjs): KBUILD_CFLAGS += $(CFL)
 
 targets += vdso-syms.lds
 obj-$(VDSO64-y)                        += vdso-syms.lds
index db5f7501aed6ae256561c6aca232df7bdcdad698..424e1dfe13c9a234ca312cec713aa00b3d92d941 100644 (file)
@@ -128,7 +128,6 @@ extern void enable_NMI_through_LVT0(void);
  * On 32bit this is mach-xxx local
  */
 #ifdef CONFIG_X86_64
-extern void setup_apic_routing(void);
 extern void early_init_lapic_mapping(void);
 #endif
 
index b0c6b285c9160307f323f0481aeed604cc4cea91..674a2280e21e42a158fc4c1f05ed9bd0778e027f 100644 (file)
 
 #define        APIC_ID         0x20
 
-#ifdef CONFIG_X86_64
-# define       APIC_ID_MASK            (0xFFu<<24)
-# define       GET_APIC_ID(x)          (((x)>>24)&0xFFu)
-# define       SET_APIC_ID(x)          (((x)<<24))
-#endif
-
 #define        APIC_LVR        0x30
 #define                APIC_LVR_MASK           0xFF00FF
 #define                GET_APIC_VERSION(x)     ((x)&0xFFu)
index e3c2c1012c1cd458324a6f25e4e0fb115d1920ab..e081bdccde2bb4219018bc90e56bb86c9ab87975 100644 (file)
@@ -54,21 +54,27 @@ static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
        return phys_map;
 }
 
+#ifdef CONFIG_X86_64
+extern void setup_apic_routing(void);
+#else
 static inline void setup_apic_routing(void)
 {
        printk("Enabling APIC mode:  %s.  Using %d I/O APICs\n",
                                        "Flat", nr_ioapics);
 }
+#endif
 
 static inline int multi_timer_check(int apic, int irq)
 {
        return 0;
 }
 
+#ifdef CONFIG_X86_32
 static inline int apicid_to_node(int logical_apicid)
 {
        return 0;
 }
+#endif
 
 /* Mapping from cpu number to logical apicid */
 static inline int cpu_to_logical_apicid(int cpu)
@@ -78,8 +84,13 @@ static inline int cpu_to_logical_apicid(int cpu)
 
 static inline int cpu_present_to_apicid(int mps_cpu)
 {
+#ifdef CONFIG_X86_64
+       if (cpu_present(mps_cpu))
+               return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
+#else
        if (mps_cpu < get_physical_broadcast())
                return  mps_cpu;
+#endif
        else
                return BAD_APICID;
 }
index ae9841319094223e4ba81d09f929841cd5035b5e..7b78275e6d33d270608b1480e127614da7472bd3 100644 (file)
@@ -3,7 +3,12 @@
 
 #include <asm/apic.h>
 
+#ifdef CONFIG_X86_64
+#define        APIC_ID_MASK            (0xFFu<<24)
+#define        SET_APIC_ID(x)          (((x)<<24))
+#else
 #define                APIC_ID_MASK            (0xF<<24)
+#endif
 
 static inline unsigned get_apic_id(unsigned long x) 
 { 
index 1b3c0f1de9a939eb084d1a24c0eb55bae7e160bc..be870a4881fce36179a2c3a7e655006da778ff12 100644 (file)
@@ -19,14 +19,6 @@ extern cpumask_t cpu_callin_map;
 extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *),
                                  void *info, int wait);
 
-static inline int cpu_present_to_apicid(int mps_cpu)
-{
-       if (cpu_present(mps_cpu))
-               return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
-       else
-               return BAD_APICID;
-}
-
 #ifdef CONFIG_SMP
 
 #define raw_smp_processor_id() read_pda(cpunumber)
@@ -64,6 +56,7 @@ static __inline int logical_smp_processor_id(void)
        return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
 }
 
+#include <mach_apicdef.h>
 static inline int hard_smp_processor_id(void)
 {
        /* we don't want to mark this access volatile - bad code generation */