diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-28 06:43:18 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-28 17:20:25 -0500 |
commit | a27a621001f4c3e57caf47feff4b014577fd01c6 (patch) | |
tree | 0f14c4c8eaff3c11142672f16a63e7b6e42d81a7 /arch/x86/include | |
parent | d83093b50416f4ca59d3a84b2ddc217748214d64 (diff) |
x86: refactor ->check_phys_apicid_present() subarch methods
- spread out the namespace to per driver methods
- extend it to 64-bit as well so that we can use
apic->check_phys_apicid_present() unconditionally
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/bigsmp/apic.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/es7000/apic.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/genapic.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-default/mach_apic.h | 18 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-generic/mach_apic.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/numaq/apic.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/summit/apic.h | 2 |
7 files changed, 22 insertions, 14 deletions
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h index 2fa70032e3b4..5ba4118fcdf2 100644 --- a/arch/x86/include/asm/bigsmp/apic.h +++ b/arch/x86/include/asm/bigsmp/apic.h | |||
@@ -99,13 +99,13 @@ static inline void bigsmp_setup_portio_remap(void) | |||
99 | { | 99 | { |
100 | } | 100 | } |
101 | 101 | ||
102 | static inline void enable_apic_mode(void) | 102 | static inline int bigsmp_check_phys_apicid_present(int boot_cpu_physical_apicid) |
103 | { | 103 | { |
104 | return 1; | ||
104 | } | 105 | } |
105 | 106 | ||
106 | static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) | 107 | static inline void enable_apic_mode(void) |
107 | { | 108 | { |
108 | return (1); | ||
109 | } | 109 | } |
110 | 110 | ||
111 | /* As we are using single CPU as destination, pick only one CPU here */ | 111 | /* As we are using single CPU as destination, pick only one CPU here */ |
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h index c5b0eb51e53a..717c27f8da61 100644 --- a/arch/x86/include/asm/es7000/apic.h +++ b/arch/x86/include/asm/es7000/apic.h | |||
@@ -126,9 +126,9 @@ static inline physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map) | |||
126 | return physids_promote(0xff); | 126 | return physids_promote(0xff); |
127 | } | 127 | } |
128 | 128 | ||
129 | |||
130 | extern unsigned int boot_cpu_physical_apicid; | 129 | extern unsigned int boot_cpu_physical_apicid; |
131 | static inline int check_phys_apicid_present(int cpu_physical_apicid) | 130 | |
131 | static inline int es7000_check_phys_apicid_present(int cpu_physical_apicid) | ||
132 | { | 132 | { |
133 | boot_cpu_physical_apicid = read_apic_id(); | 133 | boot_cpu_physical_apicid = read_apic_id(); |
134 | return (1); | 134 | return (1); |
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h index 2cb14d51e459..f292fd02ebab 100644 --- a/arch/x86/include/asm/genapic.h +++ b/arch/x86/include/asm/genapic.h | |||
@@ -110,6 +110,7 @@ DECLARE_PER_CPU(int, x2apic_extra_bits); | |||
110 | extern void default_setup_apic_routing(void); | 110 | extern void default_setup_apic_routing(void); |
111 | 111 | ||
112 | extern int default_cpu_present_to_apicid(int mps_cpu); | 112 | extern int default_cpu_present_to_apicid(int mps_cpu); |
113 | extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid); | ||
113 | #endif | 114 | #endif |
114 | 115 | ||
115 | #endif /* _ASM_X86_GENAPIC_64_H */ | 116 | #endif /* _ASM_X86_GENAPIC_64_H */ |
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h index 54c20e19e280..0a824d3a2238 100644 --- a/arch/x86/include/asm/mach-default/mach_apic.h +++ b/arch/x86/include/asm/mach-default/mach_apic.h | |||
@@ -118,13 +118,26 @@ static inline int __default_cpu_present_to_apicid(int mps_cpu) | |||
118 | return BAD_APICID; | 118 | return BAD_APICID; |
119 | } | 119 | } |
120 | 120 | ||
121 | static inline int | ||
122 | __default_check_phys_apicid_present(int boot_cpu_physical_apicid) | ||
123 | { | ||
124 | return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map); | ||
125 | } | ||
126 | |||
121 | #ifdef CONFIG_X86_32 | 127 | #ifdef CONFIG_X86_32 |
122 | static inline int default_cpu_present_to_apicid(int mps_cpu) | 128 | static inline int default_cpu_present_to_apicid(int mps_cpu) |
123 | { | 129 | { |
124 | return __default_cpu_present_to_apicid(mps_cpu); | 130 | return __default_cpu_present_to_apicid(mps_cpu); |
125 | } | 131 | } |
132 | |||
133 | static inline int | ||
134 | default_check_phys_apicid_present(int boot_cpu_physical_apicid) | ||
135 | { | ||
136 | return __default_check_phys_apicid_present(boot_cpu_physical_apicid); | ||
137 | } | ||
126 | #else | 138 | #else |
127 | extern int default_cpu_present_to_apicid(int mps_cpu); | 139 | extern int default_cpu_present_to_apicid(int mps_cpu); |
140 | extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid); | ||
128 | #endif | 141 | #endif |
129 | 142 | ||
130 | static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid) | 143 | static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid) |
@@ -132,11 +145,6 @@ static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid) | |||
132 | return physid_mask_of_physid(phys_apicid); | 145 | return physid_mask_of_physid(phys_apicid); |
133 | } | 146 | } |
134 | 147 | ||
135 | static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) | ||
136 | { | ||
137 | return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map); | ||
138 | } | ||
139 | |||
140 | static inline void enable_apic_mode(void) | 148 | static inline void enable_apic_mode(void) |
141 | { | 149 | { |
142 | } | 150 | } |
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h index 393a97c5685f..efd762d951ac 100644 --- a/arch/x86/include/asm/mach-generic/mach_apic.h +++ b/arch/x86/include/asm/mach-generic/mach_apic.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #include <asm/genapic.h> | 4 | #include <asm/genapic.h> |
5 | 5 | ||
6 | #define check_phys_apicid_present (apic->check_phys_apicid_present) | ||
7 | #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) | 6 | #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) |
8 | #define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) | 7 | #define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) |
9 | #define enable_apic_mode (apic->enable_apic_mode) | 8 | #define enable_apic_mode (apic->enable_apic_mode) |
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h index 6b626519cd75..3be735e2ab90 100644 --- a/arch/x86/include/asm/numaq/apic.h +++ b/arch/x86/include/asm/numaq/apic.h | |||
@@ -92,9 +92,9 @@ static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid) | |||
92 | 92 | ||
93 | extern void *xquad_portio; | 93 | extern void *xquad_portio; |
94 | 94 | ||
95 | static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) | 95 | static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid) |
96 | { | 96 | { |
97 | return (1); | 97 | return 1; |
98 | } | 98 | } |
99 | 99 | ||
100 | static inline void enable_apic_mode(void) | 100 | static inline void enable_apic_mode(void) |
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h index 131343b0b757..fe578f6df782 100644 --- a/arch/x86/include/asm/summit/apic.h +++ b/arch/x86/include/asm/summit/apic.h | |||
@@ -120,7 +120,7 @@ static inline void summit_setup_portio_remap(void) | |||
120 | { | 120 | { |
121 | } | 121 | } |
122 | 122 | ||
123 | static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) | 123 | static inline int summit_check_phys_apicid_present(int boot_cpu_physical_apicid) |
124 | { | 124 | { |
125 | return 1; | 125 | return 1; |
126 | } | 126 | } |