Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is subject to the terms and conditions of the GNU General Public |
| 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. |
| 5 | * |
| 6 | * SGI specific setup. |
| 7 | * |
Dean Nelson | 2e34f07 | 2005-03-21 19:41:00 -0700 | [diff] [blame] | 8 | * Copyright (C) 1995-1997,1999,2001-2005 Silicon Graphics, Inc. All rights reserved. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) |
| 10 | */ |
| 11 | #ifndef _ASM_IA64_SN_ARCH_H |
| 12 | #define _ASM_IA64_SN_ARCH_H |
| 13 | |
Tony Luck | 8d7e351 | 2005-07-06 18:18:10 -0700 | [diff] [blame^] | 14 | #include <linux/numa.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <asm/types.h> |
| 16 | #include <asm/percpu.h> |
| 17 | #include <asm/sn/types.h> |
| 18 | #include <asm/sn/sn_cpuid.h> |
| 19 | |
| 20 | /* |
| 21 | * The following defines attributes of the HUB chip. These attributes are |
| 22 | * frequently referenced. They are kept in the per-cpu data areas of each cpu. |
| 23 | * They are kept together in a struct to minimize cache misses. |
| 24 | */ |
| 25 | struct sn_hub_info_s { |
| 26 | u8 shub2; |
| 27 | u8 nasid_shift; |
| 28 | u8 as_shift; |
| 29 | u8 shub_1_1_found; |
| 30 | u16 nasid_bitmask; |
| 31 | }; |
| 32 | DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info); |
| 33 | #define sn_hub_info (&__get_cpu_var(__sn_hub_info)) |
| 34 | #define is_shub2() (sn_hub_info->shub2) |
| 35 | #define is_shub1() (sn_hub_info->shub2 == 0) |
| 36 | |
| 37 | /* |
| 38 | * Use this macro to test if shub 1.1 wars should be enabled |
| 39 | */ |
| 40 | #define enable_shub_wars_1_1() (sn_hub_info->shub_1_1_found) |
| 41 | |
| 42 | |
| 43 | /* |
| 44 | * This is the maximum number of nodes that can be part of a kernel. |
| 45 | * Effectively, it's the maximum number of compact node ids (cnodeid_t). |
| 46 | * This is not necessarily the same as MAX_NASIDS. |
| 47 | */ |
| 48 | #define MAX_COMPACT_NODES 2048 |
| 49 | #define CPUS_PER_NODE 4 |
| 50 | |
Dean Nelson | 2e34f07 | 2005-03-21 19:41:00 -0700 | [diff] [blame] | 51 | |
| 52 | /* |
| 53 | * Compact node ID to nasid mappings kept in the per-cpu data areas of each |
| 54 | * cpu. |
| 55 | */ |
| 56 | DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]); |
| 57 | #define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0])) |
| 58 | |
| 59 | |
Dean Nelson | 7fbd2a5 | 2005-03-23 19:11:00 -0700 | [diff] [blame] | 60 | |
| 61 | extern u8 sn_partition_id; |
| 62 | extern u8 sn_system_size; |
| 63 | extern u8 sn_sharing_domain_size; |
| 64 | extern u8 sn_region_size; |
| 65 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | extern void sn_flush_all_caches(long addr, long bytes); |
| 67 | |
| 68 | #endif /* _ASM_IA64_SN_ARCH_H */ |