nodepda.h 2.3 KB

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