diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-03-19 13:25:53 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:02 -0400 |
commit | f6bc40290964b5fcb48c226ccafa4b7536d62663 (patch) | |
tree | 4b59929aaef9fa73a909b1700726074ef98a134e | |
parent | 4370ee4d3b7772158174bf6f0bf08359c2ccf54b (diff) |
x86: include mach_apic.h in smpboot_64.c and smpboot.c
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>
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/mpparse_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot_64.c | 1 | ||||
-rw-r--r-- | arch/x86/vdso/Makefile | 2 | ||||
-rw-r--r-- | include/asm-x86/apic.h | 1 | ||||
-rw-r--r-- | include/asm-x86/apicdef.h | 6 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_apic.h | 11 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_apicdef.h | 5 | ||||
-rw-r--r-- | include/asm-x86/smp_64.h | 9 |
10 files changed, 27 insertions, 16 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 2cdc9de9371d..956b60f3ebd5 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -40,6 +40,10 @@ | |||
40 | #include <asm/io.h> | 40 | #include <asm/io.h> |
41 | #include <asm/mpspec.h> | 41 | #include <asm/mpspec.h> |
42 | 42 | ||
43 | #ifdef CONFIG_X86_LOCAL_APIC | ||
44 | # include <mach_apic.h> | ||
45 | #endif | ||
46 | |||
43 | static int __initdata acpi_force = 0; | 47 | static int __initdata acpi_force = 0; |
44 | 48 | ||
45 | #ifdef CONFIG_ACPI | 49 | #ifdef CONFIG_ACPI |
diff --git a/arch/x86/kernel/mpparse_64.c b/arch/x86/kernel/mpparse_64.c index 529b1c22077e..03ef1a8b53e8 100644 --- a/arch/x86/kernel/mpparse_64.c +++ b/arch/x86/kernel/mpparse_64.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <asm/proto.h> | 30 | #include <asm/proto.h> |
31 | #include <asm/acpi.h> | 31 | #include <asm/acpi.h> |
32 | 32 | ||
33 | #include <mach_apic.h> | ||
34 | |||
33 | /* Have we found an MP table */ | 35 | /* Have we found an MP table */ |
34 | int smp_found_config; | 36 | int smp_found_config; |
35 | unsigned int __cpuinitdata maxcpus = NR_CPUS; | 37 | unsigned int __cpuinitdata maxcpus = NR_CPUS; |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 6978f1bf6533..253be86a88e4 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <asm/cpu.h> | 11 | #include <asm/cpu.h> |
12 | #include <asm/numa.h> | 12 | #include <asm/numa.h> |
13 | 13 | ||
14 | #include <mach_apic.h> | ||
15 | |||
14 | /* Number of siblings per CPU package */ | 16 | /* Number of siblings per CPU package */ |
15 | int smp_num_siblings = 1; | 17 | int smp_num_siblings = 1; |
16 | EXPORT_SYMBOL(smp_num_siblings); | 18 | EXPORT_SYMBOL(smp_num_siblings); |
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c index 7d1b4cb380db..8a59fa80f883 100644 --- a/arch/x86/kernel/smpboot_64.c +++ b/arch/x86/kernel/smpboot_64.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <asm/numa.h> | 61 | #include <asm/numa.h> |
62 | 62 | ||
63 | #include <mach_wakecpu.h> | 63 | #include <mach_wakecpu.h> |
64 | #include <mach_apic.h> | ||
64 | #include <smpboot_hooks.h> | 65 | #include <smpboot_hooks.h> |
65 | 66 | ||
66 | /* Set when the idlers are all forked */ | 67 | /* Set when the idlers are all forked */ |
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile index 0a8f4742ef51..17a6b057856b 100644 --- a/arch/x86/vdso/Makefile +++ b/arch/x86/vdso/Makefile | |||
@@ -39,7 +39,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE | |||
39 | 39 | ||
40 | CFL := $(PROFILING) -mcmodel=small -fPIC -g0 -O2 -fasynchronous-unwind-tables -m64 | 40 | CFL := $(PROFILING) -mcmodel=small -fPIC -g0 -O2 -fasynchronous-unwind-tables -m64 |
41 | 41 | ||
42 | $(vobjs): KBUILD_CFLAGS = $(CFL) | 42 | $(vobjs): KBUILD_CFLAGS += $(CFL) |
43 | 43 | ||
44 | targets += vdso-syms.lds | 44 | targets += vdso-syms.lds |
45 | obj-$(VDSO64-y) += vdso-syms.lds | 45 | obj-$(VDSO64-y) += vdso-syms.lds |
diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h index db5f7501aed6..424e1dfe13c9 100644 --- a/include/asm-x86/apic.h +++ b/include/asm-x86/apic.h | |||
@@ -128,7 +128,6 @@ extern void enable_NMI_through_LVT0(void); | |||
128 | * On 32bit this is mach-xxx local | 128 | * On 32bit this is mach-xxx local |
129 | */ | 129 | */ |
130 | #ifdef CONFIG_X86_64 | 130 | #ifdef CONFIG_X86_64 |
131 | extern void setup_apic_routing(void); | ||
132 | extern void early_init_lapic_mapping(void); | 131 | extern void early_init_lapic_mapping(void); |
133 | #endif | 132 | #endif |
134 | 133 | ||
diff --git a/include/asm-x86/apicdef.h b/include/asm-x86/apicdef.h index b0c6b285c916..674a2280e21e 100644 --- a/include/asm-x86/apicdef.h +++ b/include/asm-x86/apicdef.h | |||
@@ -12,12 +12,6 @@ | |||
12 | 12 | ||
13 | #define APIC_ID 0x20 | 13 | #define APIC_ID 0x20 |
14 | 14 | ||
15 | #ifdef CONFIG_X86_64 | ||
16 | # define APIC_ID_MASK (0xFFu<<24) | ||
17 | # define GET_APIC_ID(x) (((x)>>24)&0xFFu) | ||
18 | # define SET_APIC_ID(x) (((x)<<24)) | ||
19 | #endif | ||
20 | |||
21 | #define APIC_LVR 0x30 | 15 | #define APIC_LVR 0x30 |
22 | #define APIC_LVR_MASK 0xFF00FF | 16 | #define APIC_LVR_MASK 0xFF00FF |
23 | #define GET_APIC_VERSION(x) ((x)&0xFFu) | 17 | #define GET_APIC_VERSION(x) ((x)&0xFFu) |
diff --git a/include/asm-x86/mach-default/mach_apic.h b/include/asm-x86/mach-default/mach_apic.h index e3c2c1012c1c..e081bdccde2b 100644 --- a/include/asm-x86/mach-default/mach_apic.h +++ b/include/asm-x86/mach-default/mach_apic.h | |||
@@ -54,21 +54,27 @@ static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map) | |||
54 | return phys_map; | 54 | return phys_map; |
55 | } | 55 | } |
56 | 56 | ||
57 | #ifdef CONFIG_X86_64 | ||
58 | extern void setup_apic_routing(void); | ||
59 | #else | ||
57 | static inline void setup_apic_routing(void) | 60 | static inline void setup_apic_routing(void) |
58 | { | 61 | { |
59 | printk("Enabling APIC mode: %s. Using %d I/O APICs\n", | 62 | printk("Enabling APIC mode: %s. Using %d I/O APICs\n", |
60 | "Flat", nr_ioapics); | 63 | "Flat", nr_ioapics); |
61 | } | 64 | } |
65 | #endif | ||
62 | 66 | ||
63 | static inline int multi_timer_check(int apic, int irq) | 67 | static inline int multi_timer_check(int apic, int irq) |
64 | { | 68 | { |
65 | return 0; | 69 | return 0; |
66 | } | 70 | } |
67 | 71 | ||
72 | #ifdef CONFIG_X86_32 | ||
68 | static inline int apicid_to_node(int logical_apicid) | 73 | static inline int apicid_to_node(int logical_apicid) |
69 | { | 74 | { |
70 | return 0; | 75 | return 0; |
71 | } | 76 | } |
77 | #endif | ||
72 | 78 | ||
73 | /* Mapping from cpu number to logical apicid */ | 79 | /* Mapping from cpu number to logical apicid */ |
74 | static inline int cpu_to_logical_apicid(int cpu) | 80 | static inline int cpu_to_logical_apicid(int cpu) |
@@ -78,8 +84,13 @@ static inline int cpu_to_logical_apicid(int cpu) | |||
78 | 84 | ||
79 | static inline int cpu_present_to_apicid(int mps_cpu) | 85 | static inline int cpu_present_to_apicid(int mps_cpu) |
80 | { | 86 | { |
87 | #ifdef CONFIG_X86_64 | ||
88 | if (cpu_present(mps_cpu)) | ||
89 | return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu); | ||
90 | #else | ||
81 | if (mps_cpu < get_physical_broadcast()) | 91 | if (mps_cpu < get_physical_broadcast()) |
82 | return mps_cpu; | 92 | return mps_cpu; |
93 | #endif | ||
83 | else | 94 | else |
84 | return BAD_APICID; | 95 | return BAD_APICID; |
85 | } | 96 | } |
diff --git a/include/asm-x86/mach-default/mach_apicdef.h b/include/asm-x86/mach-default/mach_apicdef.h index ae9841319094..7b78275e6d33 100644 --- a/include/asm-x86/mach-default/mach_apicdef.h +++ b/include/asm-x86/mach-default/mach_apicdef.h | |||
@@ -3,7 +3,12 @@ | |||
3 | 3 | ||
4 | #include <asm/apic.h> | 4 | #include <asm/apic.h> |
5 | 5 | ||
6 | #ifdef CONFIG_X86_64 | ||
7 | #define APIC_ID_MASK (0xFFu<<24) | ||
8 | #define SET_APIC_ID(x) (((x)<<24)) | ||
9 | #else | ||
6 | #define APIC_ID_MASK (0xF<<24) | 10 | #define APIC_ID_MASK (0xF<<24) |
11 | #endif | ||
7 | 12 | ||
8 | static inline unsigned get_apic_id(unsigned long x) | 13 | static inline unsigned get_apic_id(unsigned long x) |
9 | { | 14 | { |
diff --git a/include/asm-x86/smp_64.h b/include/asm-x86/smp_64.h index 1b3c0f1de9a9..be870a4881fc 100644 --- a/include/asm-x86/smp_64.h +++ b/include/asm-x86/smp_64.h | |||
@@ -19,14 +19,6 @@ extern cpumask_t cpu_callin_map; | |||
19 | extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *), | 19 | extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *), |
20 | void *info, int wait); | 20 | void *info, int wait); |
21 | 21 | ||
22 | static inline int cpu_present_to_apicid(int mps_cpu) | ||
23 | { | ||
24 | if (cpu_present(mps_cpu)) | ||
25 | return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu); | ||
26 | else | ||
27 | return BAD_APICID; | ||
28 | } | ||
29 | |||
30 | #ifdef CONFIG_SMP | 22 | #ifdef CONFIG_SMP |
31 | 23 | ||
32 | #define raw_smp_processor_id() read_pda(cpunumber) | 24 | #define raw_smp_processor_id() read_pda(cpunumber) |
@@ -64,6 +56,7 @@ static __inline int logical_smp_processor_id(void) | |||
64 | return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); | 56 | return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); |
65 | } | 57 | } |
66 | 58 | ||
59 | #include <mach_apicdef.h> | ||
67 | static inline int hard_smp_processor_id(void) | 60 | static inline int hard_smp_processor_id(void) |
68 | { | 61 | { |
69 | /* we don't want to mark this access volatile - bad code generation */ | 62 | /* we don't want to mark this access volatile - bad code generation */ |