arch.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. * The following defines attributes of the HUB chip. These attributes are
  20. * frequently referenced. They are kept in the per-cpu data areas of each cpu.
  21. * They are kept together in a struct to minimize cache misses.
  22. */
  23. struct sn_hub_info_s {
  24. u8 shub2;
  25. u8 nasid_shift;
  26. u8 as_shift;
  27. u8 shub_1_1_found;
  28. u16 nasid_bitmask;
  29. };
  30. DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
  31. #define sn_hub_info (&__get_cpu_var(__sn_hub_info))
  32. #define is_shub2() (sn_hub_info->shub2)
  33. #define is_shub1() (sn_hub_info->shub2 == 0)
  34. /*
  35. * Use this macro to test if shub 1.1 wars should be enabled
  36. */
  37. #define enable_shub_wars_1_1() (sn_hub_info->shub_1_1_found)
  38. /*
  39. * This is the maximum number of nodes that can be part of a kernel.
  40. * Effectively, it's the maximum number of compact node ids (cnodeid_t).
  41. * This is not necessarily the same as MAX_NASIDS.
  42. */
  43. #define MAX_COMPACT_NODES 2048
  44. #define CPUS_PER_NODE 4
  45. /*
  46. * Compact node ID to nasid mappings kept in the per-cpu data areas of each
  47. * cpu.
  48. */
  49. DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]);
  50. #define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0]))
  51. extern u8 sn_partition_id;
  52. extern u8 sn_system_size;
  53. extern u8 sn_sharing_domain_size;
  54. extern u8 sn_region_size;
  55. extern void sn_flush_all_caches(long addr, long bytes);
  56. #endif /* _ASM_IA64_SN_ARCH_H */