numa.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. * This file contains NUMA specific prototypes and definitions.
  7. *
  8. * 2002/08/05 Erich Focht <efocht@ess.nec.de>
  9. *
  10. */
  11. #ifndef _ASM_IA64_NUMA_H
  12. #define _ASM_IA64_NUMA_H
  13. #ifdef CONFIG_NUMA
  14. #include <linux/cache.h>
  15. #include <linux/cpumask.h>
  16. #include <linux/numa.h>
  17. #include <linux/smp.h>
  18. #include <linux/threads.h>
  19. #include <asm/mmzone.h>
  20. extern u16 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
  21. extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
  22. extern pg_data_t *pgdat_list[MAX_NUMNODES];
  23. /* Stuff below this line could be architecture independent */
  24. extern int num_node_memblks; /* total number of memory chunks */
  25. /*
  26. * List of node memory chunks. Filled when parsing SRAT table to
  27. * obtain information about memory nodes.
  28. */
  29. struct node_memblk_s {
  30. unsigned long start_paddr;
  31. unsigned long size;
  32. int nid; /* which logical node contains this chunk? */
  33. int bank; /* which mem bank on this node */
  34. };
  35. struct node_cpuid_s {
  36. u16 phys_id; /* id << 8 | eid */
  37. int nid; /* logical node containing this CPU */
  38. };
  39. extern struct node_memblk_s node_memblk[NR_NODE_MEMBLKS];
  40. extern struct node_cpuid_s node_cpuid[NR_CPUS];
  41. /*
  42. * ACPI 2.0 SLIT (System Locality Information Table)
  43. * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
  44. *
  45. * This is a matrix with "distances" between nodes, they should be
  46. * proportional to the memory access latency ratios.
  47. */
  48. extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
  49. #define node_distance(from,to) (numa_slit[(from) * MAX_NUMNODES + (to)])
  50. extern int paddr_to_nid(unsigned long paddr);
  51. #define local_nodeid (cpu_to_node_map[smp_processor_id()])
  52. extern void map_cpu_to_node(int cpu, int nid);
  53. extern void unmap_cpu_from_node(int cpu, int nid);
  54. extern void numa_clear_node(int cpu);
  55. #else /* !CONFIG_NUMA */
  56. #define map_cpu_to_node(cpu, nid) do{}while(0)
  57. #define unmap_cpu_from_node(cpu, nid) do{}while(0)
  58. #define paddr_to_nid(addr) 0
  59. #define numa_clear_node(cpu) do { } while (0)
  60. #endif /* CONFIG_NUMA */
  61. #endif /* _ASM_IA64_NUMA_H */