diff options
author | Mike Travis <travis@sgi.com> | 2016-04-29 17:54:04 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-05-04 02:48:47 -0400 |
commit | e0ee1c97c3b1cabc3651d7bcf39c1f54d736fd20 (patch) | |
tree | 7803a218e0a1cb908a6777583666ec478273f672 /arch/x86/include/asm/uv | |
parent | eb1e3461b8912ce4794fd2b7b414338a59461601 (diff) |
x86/platform/UV: Add UV Architecture Defines
Add defines to control which UV architectures are supported, and modify the
'if (is_uvX_*)' functions to return constant 0 for those not supported.
This will help optimize code paths when support for specific UV arches
is removed.
Tested-by: John Estabrook <estabrook@sgi.com>
Tested-by: Gary Kroening <gfk@sgi.com>
Tested-by: Nathan Zimmer <nzimmer@sgi.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Dimitri Sivanich <sivanich@sgi.com>
Cc: Andrew Banman <abanman@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russ Anderson <rja@sgi.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20160429215402.897143440@asylum.americas.sgi.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/uv')
-rw-r--r-- | arch/x86/include/asm/uv/uv_hub.h | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index 38166ade0ca1..6660c09af3f8 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
@@ -178,22 +178,43 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); | |||
178 | #define UV3_HUB_REVISION_BASE 5 | 178 | #define UV3_HUB_REVISION_BASE 5 |
179 | #define UV4_HUB_REVISION_BASE 7 | 179 | #define UV4_HUB_REVISION_BASE 7 |
180 | 180 | ||
181 | #ifdef UV1_HUB_IS_SUPPORTED | ||
181 | static inline int is_uv1_hub(void) | 182 | static inline int is_uv1_hub(void) |
182 | { | 183 | { |
183 | return uv_hub_info->hub_revision < UV2_HUB_REVISION_BASE; | 184 | return uv_hub_info->hub_revision < UV2_HUB_REVISION_BASE; |
184 | } | 185 | } |
186 | #else | ||
187 | static inline int is_uv1_hub(void) | ||
188 | { | ||
189 | return 0; | ||
190 | } | ||
191 | #endif | ||
185 | 192 | ||
193 | #ifdef UV2_HUB_IS_SUPPORTED | ||
186 | static inline int is_uv2_hub(void) | 194 | static inline int is_uv2_hub(void) |
187 | { | 195 | { |
188 | return ((uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE) && | 196 | return ((uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE) && |
189 | (uv_hub_info->hub_revision < UV3_HUB_REVISION_BASE)); | 197 | (uv_hub_info->hub_revision < UV3_HUB_REVISION_BASE)); |
190 | } | 198 | } |
199 | #else | ||
200 | static inline int is_uv2_hub(void) | ||
201 | { | ||
202 | return 0; | ||
203 | } | ||
204 | #endif | ||
191 | 205 | ||
206 | #ifdef UV3_HUB_IS_SUPPORTED | ||
192 | static inline int is_uv3_hub(void) | 207 | static inline int is_uv3_hub(void) |
193 | { | 208 | { |
194 | return ((uv_hub_info->hub_revision >= UV3_HUB_REVISION_BASE) && | 209 | return ((uv_hub_info->hub_revision >= UV3_HUB_REVISION_BASE) && |
195 | (uv_hub_info->hub_revision < UV4_HUB_REVISION_BASE)); | 210 | (uv_hub_info->hub_revision < UV4_HUB_REVISION_BASE)); |
196 | } | 211 | } |
212 | #else | ||
213 | static inline int is_uv3_hub(void) | ||
214 | { | ||
215 | return 0; | ||
216 | } | ||
217 | #endif | ||
197 | 218 | ||
198 | #ifdef UV4_HUB_IS_SUPPORTED | 219 | #ifdef UV4_HUB_IS_SUPPORTED |
199 | static inline int is_uv4_hub(void) | 220 | static inline int is_uv4_hub(void) |
@@ -207,15 +228,20 @@ static inline int is_uv4_hub(void) | |||
207 | } | 228 | } |
208 | #endif | 229 | #endif |
209 | 230 | ||
210 | static inline int is_uv_hub(void) | 231 | static inline int is_uvx_hub(void) |
211 | { | 232 | { |
212 | return uv_hub_info->hub_revision; | 233 | if (uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE) |
234 | return uv_hub_info->hub_revision; | ||
235 | |||
236 | return 0; | ||
213 | } | 237 | } |
214 | 238 | ||
215 | /* code common to uv2/3/4 only */ | 239 | static inline int is_uv_hub(void) |
216 | static inline int is_uvx_hub(void) | ||
217 | { | 240 | { |
218 | return uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE; | 241 | #ifdef UV1_HUB_IS_SUPPORTED |
242 | return uv_hub_info->hub_revision; | ||
243 | #endif | ||
244 | return is_uvx_hub(); | ||
219 | } | 245 | } |
220 | 246 | ||
221 | union uvh_apicid { | 247 | union uvh_apicid { |