nodedata.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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) 2000 Silicon Graphics, Inc. All rights reserved.
  7. * Copyright (c) 2002 NEC Corp.
  8. * Copyright (c) 2002 Erich Focht <efocht@ess.nec.de>
  9. * Copyright (c) 2002 Kimio Suganuma <k-suganuma@da.jp.nec.com>
  10. */
  11. #ifndef _ASM_IA64_NODEDATA_H
  12. #define _ASM_IA64_NODEDATA_H
  13. #include <linux/numa.h>
  14. #include <asm/percpu.h>
  15. #include <asm/mmzone.h>
  16. #ifdef CONFIG_NUMA
  17. /*
  18. * Node Data. One of these structures is located on each node of a NUMA system.
  19. */
  20. struct pglist_data;
  21. struct ia64_node_data {
  22. short active_cpu_count;
  23. short node;
  24. struct pglist_data *pg_data_ptrs[MAX_NUMNODES];
  25. };
  26. /*
  27. * Return a pointer to the node_data structure for the executing cpu.
  28. */
  29. #define local_node_data (local_cpu_data->node_data)
  30. /*
  31. * Given a node id, return a pointer to the pg_data_t for the node.
  32. *
  33. * NODE_DATA - should be used in all code not related to system
  34. * initialization. It uses pernode data structures to minimize
  35. * offnode memory references. However, these structure are not
  36. * present during boot. This macro can be used once cpu_init
  37. * completes.
  38. */
  39. #define NODE_DATA(nid) (local_node_data->pg_data_ptrs[nid])
  40. /*
  41. * LOCAL_DATA_ADDR - This is to calculate the address of other node's
  42. * "local_node_data" at hot-plug phase. The local_node_data
  43. * is pointed by per_cpu_page. Kernel usually use it for
  44. * just executing cpu. However, when new node is hot-added,
  45. * the addresses of local data for other nodes are necessary
  46. * to update all of them.
  47. */
  48. #define LOCAL_DATA_ADDR(pgdat) \
  49. ((struct ia64_node_data *)((u64)(pgdat) + \
  50. L1_CACHE_ALIGN(sizeof(struct pglist_data))))
  51. #endif /* CONFIG_NUMA */
  52. #endif /* _ASM_IA64_NODEDATA_H */