topology.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2002, Erich Focht, NEC
  4. *
  5. * All rights reserved.
  6. */
  7. #ifndef _ASM_IA64_TOPOLOGY_H
  8. #define _ASM_IA64_TOPOLOGY_H
  9. #include <asm/acpi.h>
  10. #include <asm/numa.h>
  11. #include <asm/smp.h>
  12. #ifdef CONFIG_NUMA
  13. /* Nodes w/o CPUs are preferred for memory allocations, see build_zonelists */
  14. #define PENALTY_FOR_NODE_WITH_CPUS 255
  15. /*
  16. * Nodes within this distance are eligible for reclaim by zone_reclaim() when
  17. * zone_reclaim_mode is enabled.
  18. */
  19. #define RECLAIM_DISTANCE 15
  20. /*
  21. * Returns a bitmask of CPUs on Node 'node'.
  22. */
  23. #define cpumask_of_node(node) ((node) == -1 ? \
  24. cpu_all_mask : \
  25. &node_to_cpu_mask[node])
  26. /*
  27. * Determines the node for a given pci bus
  28. */
  29. #define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node
  30. void build_cpu_to_node_map(void);
  31. #endif /* CONFIG_NUMA */
  32. #ifdef CONFIG_SMP
  33. #define topology_physical_package_id(cpu) (cpu_data(cpu)->socket_id)
  34. #define topology_core_id(cpu) (cpu_data(cpu)->core_id)
  35. #define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
  36. #define topology_sibling_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
  37. #endif
  38. extern void arch_fix_phys_package_id(int num, u32 slot);
  39. #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
  40. cpu_all_mask : \
  41. cpumask_of_node(pcibus_to_node(bus)))
  42. #include <asm-generic/topology.h>
  43. #endif /* _ASM_IA64_TOPOLOGY_H */