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>
This commit is contained in:
parent
eb1e3461b8
commit
e0ee1c97c3
@ -178,22 +178,43 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
|
||||
#define UV3_HUB_REVISION_BASE 5
|
||||
#define UV4_HUB_REVISION_BASE 7
|
||||
|
||||
#ifdef UV1_HUB_IS_SUPPORTED
|
||||
static inline int is_uv1_hub(void)
|
||||
{
|
||||
return uv_hub_info->hub_revision < UV2_HUB_REVISION_BASE;
|
||||
}
|
||||
#else
|
||||
static inline int is_uv1_hub(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef UV2_HUB_IS_SUPPORTED
|
||||
static inline int is_uv2_hub(void)
|
||||
{
|
||||
return ((uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE) &&
|
||||
(uv_hub_info->hub_revision < UV3_HUB_REVISION_BASE));
|
||||
}
|
||||
#else
|
||||
static inline int is_uv2_hub(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef UV3_HUB_IS_SUPPORTED
|
||||
static inline int is_uv3_hub(void)
|
||||
{
|
||||
return ((uv_hub_info->hub_revision >= UV3_HUB_REVISION_BASE) &&
|
||||
(uv_hub_info->hub_revision < UV4_HUB_REVISION_BASE));
|
||||
}
|
||||
#else
|
||||
static inline int is_uv3_hub(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef UV4_HUB_IS_SUPPORTED
|
||||
static inline int is_uv4_hub(void)
|
||||
@ -207,15 +228,20 @@ static inline int is_uv4_hub(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int is_uv_hub(void)
|
||||
{
|
||||
return uv_hub_info->hub_revision;
|
||||
}
|
||||
|
||||
/* code common to uv2/3/4 only */
|
||||
static inline int is_uvx_hub(void)
|
||||
{
|
||||
return uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE;
|
||||
if (uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE)
|
||||
return uv_hub_info->hub_revision;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int is_uv_hub(void)
|
||||
{
|
||||
#ifdef UV1_HUB_IS_SUPPORTED
|
||||
return uv_hub_info->hub_revision;
|
||||
#endif
|
||||
return is_uvx_hub();
|
||||
}
|
||||
|
||||
union uvh_apicid {
|
||||
|
Loading…
Reference in New Issue
Block a user