xref: /OK3568_Linux_fs/kernel/arch/mips/include/asm/mach-ip27/topology.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef _ASM_MACH_TOPOLOGY_H
3*4882a593Smuzhiyun #define _ASM_MACH_TOPOLOGY_H	1
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun #include <asm/sn/types.h>
6*4882a593Smuzhiyun #include <asm/mmzone.h>
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun struct cpuinfo_ip27 {
9*4882a593Smuzhiyun 	nasid_t		p_nasid;	/* my node ID in numa-as-id-space */
10*4882a593Smuzhiyun 	unsigned short	p_speed;	/* cpu speed in MHz */
11*4882a593Smuzhiyun 	unsigned char	p_slice;	/* Physical position on node board */
12*4882a593Smuzhiyun };
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun #define cpu_to_node(cpu)	(cputonasid(cpu))
17*4882a593Smuzhiyun #define cpumask_of_node(node)	((node) == -1 ?				\
18*4882a593Smuzhiyun 				 cpu_all_mask :				\
19*4882a593Smuzhiyun 				 &hub_data(node)->h_cpus)
20*4882a593Smuzhiyun struct pci_bus;
21*4882a593Smuzhiyun extern int pcibus_to_node(struct pci_bus *);
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun #define cpumask_of_pcibus(bus)	(cpumask_of_node(pcibus_to_node(bus)))
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun extern unsigned char __node_distances[MAX_NUMNODES][MAX_NUMNODES];
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun #define node_distance(from, to) (__node_distances[(from)][(to)])
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun #include <asm-generic/topology.h>
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun #endif /* _ASM_MACH_TOPOLOGY_H */
32