nodepda.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
  7. */
  8. #ifndef _ASM_IA64_SN_NODEPDA_H
  9. #define _ASM_IA64_SN_NODEPDA_H
  10. #include <asm/irq.h>
  11. #include <asm/sn/arch.h>
  12. #include <asm/sn/intr.h>
  13. #include <asm/sn/bte.h>
  14. /*
  15. * NUMA Node-Specific Data structures are defined in this file.
  16. * In particular, this is the location of the node PDA.
  17. * A pointer to the right node PDA is saved in each CPU PDA.
  18. */
  19. /*
  20. * Node-specific data structure.
  21. *
  22. * One of these structures is allocated on each node of a NUMA system.
  23. *
  24. * This structure provides a convenient way of keeping together
  25. * all per-node data structures.
  26. */
  27. struct phys_cpuid {
  28. short nasid;
  29. char subnode;
  30. char slice;
  31. };
  32. struct nodepda_s {
  33. void *pdinfo; /* Platform-dependent per-node info */
  34. /*
  35. * The BTEs on this node are shared by the local cpus
  36. */
  37. struct bteinfo_s bte_if[MAX_BTES_PER_NODE]; /* Virtual Interface */
  38. struct timer_list bte_recovery_timer;
  39. spinlock_t bte_recovery_lock;
  40. /*
  41. * Array of pointers to the nodepdas for each node.
  42. */
  43. struct nodepda_s *pernode_pdaindr[MAX_COMPACT_NODES];
  44. /*
  45. * Array of physical cpu identifiers. Indexed by cpuid.
  46. */
  47. struct phys_cpuid phys_cpuid[NR_CPUS];
  48. spinlock_t ptc_lock ____cacheline_aligned_in_smp;
  49. };
  50. typedef struct nodepda_s nodepda_t;
  51. /*
  52. * Access Functions for node PDA.
  53. * Since there is one nodepda for each node, we need a convenient mechanism
  54. * to access these nodepdas without cluttering code with #ifdefs.
  55. * The next set of definitions provides this.
  56. * Routines are expected to use
  57. *
  58. * sn_nodepda - to access node PDA for the node on which code is running
  59. * NODEPDA(cnodeid) - to access node PDA for cnodeid
  60. */
  61. DECLARE_PER_CPU(struct nodepda_s *, __sn_nodepda);
  62. #define sn_nodepda __this_cpu_read(__sn_nodepda)
  63. #define NODEPDA(cnodeid) (sn_nodepda->pernode_pdaindr[cnodeid])
  64. /*
  65. * Check if given a compact node id the corresponding node has all the
  66. * cpus disabled.
  67. */
  68. #define is_headless_node(cnodeid) (nr_cpus_node(cnodeid) == 0)
  69. #endif /* _ASM_IA64_SN_NODEPDA_H */