|
19 | 19 | #include <linux/topology.h>
|
20 | 20 | #include <asm/types.h>
|
21 | 21 | #include <asm/percpu.h>
|
| 22 | +#include <asm/uv/uv.h> |
22 | 23 | #include <asm/uv/uv_mmrs.h>
|
23 | 24 | #include <asm/uv/bios.h>
|
24 | 25 | #include <asm/irq_vectors.h>
|
@@ -243,83 +244,61 @@ static inline int uv_hub_info_check(int version)
|
243 | 244 | #define UV4_HUB_REVISION_BASE 7
|
244 | 245 | #define UV4A_HUB_REVISION_BASE 8 /* UV4 (fixed) rev 2 */
|
245 | 246 |
|
246 |
| -#ifdef UV1_HUB_IS_SUPPORTED |
| 247 | +/* WARNING: UVx_HUB_IS_SUPPORTED defines are deprecated and will be removed */ |
247 | 248 | static inline int is_uv1_hub(void)
|
248 | 249 | {
|
249 |
| - return uv_hub_info->hub_revision < UV2_HUB_REVISION_BASE; |
250 |
| -} |
| 250 | +#ifdef UV1_HUB_IS_SUPPORTED |
| 251 | + return is_uv_hubbed(uv(1)); |
251 | 252 | #else
|
252 |
| -static inline int is_uv1_hub(void) |
253 |
| -{ |
254 | 253 | return 0;
|
255 |
| -} |
256 | 254 | #endif
|
| 255 | +} |
257 | 256 |
|
258 |
| -#ifdef UV2_HUB_IS_SUPPORTED |
259 | 257 | static inline int is_uv2_hub(void)
|
260 | 258 | {
|
261 |
| - return ((uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE) && |
262 |
| - (uv_hub_info->hub_revision < UV3_HUB_REVISION_BASE)); |
263 |
| -} |
| 259 | +#ifdef UV2_HUB_IS_SUPPORTED |
| 260 | + return is_uv_hubbed(uv(2)); |
264 | 261 | #else
|
265 |
| -static inline int is_uv2_hub(void) |
266 |
| -{ |
267 | 262 | return 0;
|
268 |
| -} |
269 | 263 | #endif
|
| 264 | +} |
270 | 265 |
|
271 |
| -#ifdef UV3_HUB_IS_SUPPORTED |
272 | 266 | static inline int is_uv3_hub(void)
|
273 | 267 | {
|
274 |
| - return ((uv_hub_info->hub_revision >= UV3_HUB_REVISION_BASE) && |
275 |
| - (uv_hub_info->hub_revision < UV4_HUB_REVISION_BASE)); |
276 |
| -} |
| 268 | +#ifdef UV3_HUB_IS_SUPPORTED |
| 269 | + return is_uv_hubbed(uv(3)); |
277 | 270 | #else
|
278 |
| -static inline int is_uv3_hub(void) |
279 |
| -{ |
280 | 271 | return 0;
|
281 |
| -} |
282 | 272 | #endif
|
| 273 | +} |
283 | 274 |
|
284 | 275 | /* First test "is UV4A", then "is UV4" */
|
285 |
| -#ifdef UV4A_HUB_IS_SUPPORTED |
286 |
| -static inline int is_uv4a_hub(void) |
287 |
| -{ |
288 |
| - return (uv_hub_info->hub_revision >= UV4A_HUB_REVISION_BASE); |
289 |
| -} |
290 |
| -#else |
291 | 276 | static inline int is_uv4a_hub(void)
|
292 | 277 | {
|
| 278 | +#ifdef UV4A_HUB_IS_SUPPORTED |
| 279 | + if (is_uv_hubbed(uv(4))) |
| 280 | + return (uv_hub_info->hub_revision == UV4A_HUB_REVISION_BASE); |
| 281 | +#endif |
293 | 282 | return 0;
|
294 | 283 | }
|
295 |
| -#endif |
296 | 284 |
|
297 |
| -#ifdef UV4_HUB_IS_SUPPORTED |
298 | 285 | static inline int is_uv4_hub(void)
|
299 | 286 | {
|
300 |
| - return uv_hub_info->hub_revision >= UV4_HUB_REVISION_BASE; |
301 |
| -} |
| 287 | +#ifdef UV4_HUB_IS_SUPPORTED |
| 288 | + return is_uv_hubbed(uv(4)); |
302 | 289 | #else
|
303 |
| -static inline int is_uv4_hub(void) |
304 |
| -{ |
305 | 290 | return 0;
|
306 |
| -} |
307 | 291 | #endif
|
| 292 | +} |
308 | 293 |
|
309 | 294 | static inline int is_uvx_hub(void)
|
310 | 295 | {
|
311 |
| - if (uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE) |
312 |
| - return uv_hub_info->hub_revision; |
313 |
| - |
314 |
| - return 0; |
| 296 | + return (is_uv_hubbed(-2) >= uv(2)); |
315 | 297 | }
|
316 | 298 |
|
317 | 299 | static inline int is_uv_hub(void)
|
318 | 300 | {
|
319 |
| -#ifdef UV1_HUB_IS_SUPPORTED |
320 |
| - return uv_hub_info->hub_revision; |
321 |
| -#endif |
322 |
| - return is_uvx_hub(); |
| 301 | + return is_uv1_hub() || is_uvx_hub(); |
323 | 302 | }
|
324 | 303 |
|
325 | 304 | union uvh_apicid {
|
|
0 commit comments