1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2384740dcSRalf Baechle #ifndef _ASM_MACH_TOPOLOGY_H
3384740dcSRalf Baechle #define _ASM_MACH_TOPOLOGY_H	1
4384740dcSRalf Baechle 
5384740dcSRalf Baechle #include <asm/sn/types.h>
6384740dcSRalf Baechle #include <asm/mmzone.h>
7384740dcSRalf Baechle 
8384740dcSRalf Baechle struct cpuinfo_ip27 {
9384740dcSRalf Baechle 	nasid_t		p_nasid;	/* my node ID in numa-as-id-space */
10d31f9e64SThomas Bogendoerfer 	unsigned short	p_speed;	/* cpu speed in MHz */
11384740dcSRalf Baechle 	unsigned char	p_slice;	/* Physical position on node board */
12384740dcSRalf Baechle };
13384740dcSRalf Baechle 
14384740dcSRalf Baechle extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
15384740dcSRalf Baechle 
164bf841ebSThomas Bogendoerfer #define cpu_to_node(cpu)	(cputonasid(cpu))
17d797396fSAnton Blanchard #define cpumask_of_node(node)	((node) == -1 ?				\
18d797396fSAnton Blanchard 				 cpu_all_mask :				\
19d797396fSAnton Blanchard 				 &hub_data(node)->h_cpus)
20384740dcSRalf Baechle struct pci_bus;
21384740dcSRalf Baechle extern int pcibus_to_node(struct pci_bus *);
22384740dcSRalf Baechle 
23a57140e9SThomas Bogendoerfer #define cpumask_of_pcibus(bus)	(cpumask_of_node(pcibus_to_node(bus)))
24384740dcSRalf Baechle 
25c80b4896SThomas Bogendoerfer extern unsigned char __node_distances[MAX_NUMNODES][MAX_NUMNODES];
26384740dcSRalf Baechle 
27384740dcSRalf Baechle #define node_distance(from, to) (__node_distances[(from)][(to)])
28384740dcSRalf Baechle 
29384740dcSRalf Baechle #include <asm-generic/topology.h>
30384740dcSRalf Baechle 
31384740dcSRalf Baechle #endif /* _ASM_MACH_TOPOLOGY_H */
32