arch.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. *
  8. * Copyright (C) 1995-1997,1999,2001-2005 Silicon Graphics, Inc. All rights reserved.
  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. #include <linux/numa.h>
  14. #include <asm/types.h>
  15. #include <asm/percpu.h>
  16. #include <asm/sn/types.h>
  17. #include <asm/sn/sn_cpuid.h>
  18. /*
  19. * This is the maximum number of NUMALINK nodes that can be part of a single
  20. * SSI kernel. This number includes C-brick, M-bricks, and TIOs. Nodes in
  21. * remote partitions are NOT included in this number.
  22. * The number of compact nodes cannot exceed size of a coherency domain.
  23. * The purpose of this define is to specify a node count that includes
  24. * all C/M/TIO nodes in an SSI system.
  25. *
  26. * SGI system can currently support up to 256 C/M nodes plus additional TIO nodes.
  27. *
  28. * Note: ACPI20 has an architectural limit of 256 nodes. When we upgrade
  29. * to ACPI3.0, this limit will be removed. The notion of "compact nodes"
  30. * should be deleted and TIOs should be included in MAX_NUMNODES.
  31. */
  32. #define MAX_COMPACT_NODES 512
  33. /*
  34. * Maximum number of nodes in all partitions and in all coherency domains.
  35. * This is the total number of nodes accessible in the numalink fabric. It
  36. * includes all C & M bricks, plus all TIOs.
  37. *
  38. * This value is also the value of the maximum number of NASIDs in the numalink
  39. * fabric.
  40. */
  41. #define MAX_NUMALINK_NODES 16384
  42. /*
  43. * The following defines attributes of the HUB chip. These attributes are
  44. * frequently referenced. They are kept in the per-cpu data areas of each cpu.
  45. * They are kept together in a struct to minimize cache misses.
  46. */
  47. struct sn_hub_info_s {
  48. u8 shub2;
  49. u8 nasid_shift;
  50. u8 as_shift;
  51. u8 shub_1_1_found;
  52. u16 nasid_bitmask;
  53. };
  54. DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
  55. #define sn_hub_info (&__get_cpu_var(__sn_hub_info))
  56. #define is_shub2() (sn_hub_info->shub2)
  57. #define is_shub1() (sn_hub_info->shub2 == 0)
  58. /*
  59. * Use this macro to test if shub 1.1 wars should be enabled
  60. */
  61. #define enable_shub_wars_1_1() (sn_hub_info->shub_1_1_found)
  62. /*
  63. * Compact node ID to nasid mappings kept in the per-cpu data areas of each
  64. * cpu.
  65. */
  66. DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]);
  67. #define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0]))
  68. extern u8 sn_partition_id;
  69. extern u8 sn_system_size;
  70. extern u8 sn_sharing_domain_size;
  71. extern u8 sn_region_size;
  72. extern void sn_flush_all_caches(long addr, long bytes);
  73. #endif /* _ASM_IA64_SN_ARCH_H */