xref: /openbmc/linux/arch/ia64/include/asm/topology.h (revision 4f9b16a6)
17f30491cSTony Luck /*
27f30491cSTony Luck  * Copyright (C) 2002, Erich Focht, NEC
37f30491cSTony Luck  *
47f30491cSTony Luck  * All rights reserved.
57f30491cSTony Luck  *
67f30491cSTony Luck  * This program is free software; you can redistribute it and/or modify
77f30491cSTony Luck  * it under the terms of the GNU General Public License as published by
87f30491cSTony Luck  * the Free Software Foundation; either version 2 of the License, or
97f30491cSTony Luck  * (at your option) any later version.
107f30491cSTony Luck  */
117f30491cSTony Luck #ifndef _ASM_IA64_TOPOLOGY_H
127f30491cSTony Luck #define _ASM_IA64_TOPOLOGY_H
137f30491cSTony Luck 
147f30491cSTony Luck #include <asm/acpi.h>
157f30491cSTony Luck #include <asm/numa.h>
167f30491cSTony Luck #include <asm/smp.h>
177f30491cSTony Luck 
187f30491cSTony Luck #ifdef CONFIG_NUMA
197f30491cSTony Luck 
207f30491cSTony Luck /* Nodes w/o CPUs are preferred for memory allocations, see build_zonelists */
217f30491cSTony Luck #define PENALTY_FOR_NODE_WITH_CPUS 255
227f30491cSTony Luck 
237f30491cSTony Luck /*
244f9b16a6SMel Gorman  * Nodes within this distance are eligible for reclaim by zone_reclaim() when
254f9b16a6SMel Gorman  * zone_reclaim_mode is enabled.
267f30491cSTony Luck  */
277f30491cSTony Luck #define RECLAIM_DISTANCE 15
287f30491cSTony Luck 
297f30491cSTony Luck /*
307f30491cSTony Luck  * Returns a bitmask of CPUs on Node 'node'.
317f30491cSTony Luck  */
321d1e9f04SAnton Blanchard #define cpumask_of_node(node) ((node) == -1 ?				\
331d1e9f04SAnton Blanchard 			       cpu_all_mask :				\
341d1e9f04SAnton Blanchard 			       &node_to_cpu_mask[node])
357f30491cSTony Luck 
367f30491cSTony Luck /*
377f30491cSTony Luck  * Returns the number of the node containing Node 'nid'.
387f30491cSTony Luck  * Not implemented here. Multi-level hierarchies detected with
397f30491cSTony Luck  * the help of node_distance().
407f30491cSTony Luck  */
417f30491cSTony Luck #define parent_node(nid) (nid)
427f30491cSTony Luck 
437f30491cSTony Luck /*
447f30491cSTony Luck  * Determines the node for a given pci bus
457f30491cSTony Luck  */
467f30491cSTony Luck #define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node
477f30491cSTony Luck 
487f30491cSTony Luck void build_cpu_to_node_map(void);
497f30491cSTony Luck 
507f30491cSTony Luck #endif /* CONFIG_NUMA */
517f30491cSTony Luck 
527f30491cSTony Luck #ifdef CONFIG_SMP
537f30491cSTony Luck #define topology_physical_package_id(cpu)	(cpu_data(cpu)->socket_id)
547f30491cSTony Luck #define topology_core_id(cpu)			(cpu_data(cpu)->core_id)
55333af153SRusty Russell #define topology_core_cpumask(cpu)		(&cpu_core_map[cpu])
56333af153SRusty Russell #define topology_thread_cpumask(cpu)		(&per_cpu(cpu_sibling_map, cpu))
577f30491cSTony Luck #endif
587f30491cSTony Luck 
597f30491cSTony Luck extern void arch_fix_phys_package_id(int num, u32 slot);
607f30491cSTony Luck 
61fbb776c3SRusty Russell #define cpumask_of_pcibus(bus)	(pcibus_to_node(bus) == -1 ?		\
62fbb776c3SRusty Russell 				 cpu_all_mask :				\
6336c401a4SIngo Molnar 				 cpumask_of_node(pcibus_to_node(bus)))
64fbb776c3SRusty Russell 
657f30491cSTony Luck #include <asm-generic/topology.h>
667f30491cSTony Luck 
677f30491cSTony Luck #endif /* _ASM_IA64_TOPOLOGY_H */
68