GNU Linux-libre 4.14.294-gnu1
[releases.git] / arch / mips / include / asm / mach-ip27 / topology.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_MACH_TOPOLOGY_H
3 #define _ASM_MACH_TOPOLOGY_H    1
4
5 #include <asm/sn/hub.h>
6 #include <asm/sn/types.h>
7 #include <asm/mmzone.h>
8
9 struct cpuinfo_ip27 {
10 //      cpuid_t         p_cpuid;        /* PROM assigned cpuid */
11         cnodeid_t       p_nodeid;       /* my node ID in compact-id-space */
12         nasid_t         p_nasid;        /* my node ID in numa-as-id-space */
13         unsigned char   p_slice;        /* Physical position on node board */
14 #if 0
15         unsigned long           loops_per_sec;
16         unsigned long           ipi_count;
17         unsigned long           irq_attempt[NR_IRQS];
18         unsigned long           smp_local_irq_count;
19         unsigned long           prof_multiplier;
20         unsigned long           prof_counter;
21 #endif
22 };
23
24 extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
25
26 #define cpu_to_node(cpu)        (sn_cpu_info[(cpu)].p_nodeid)
27 #define cpumask_of_node(node)   ((node) == -1 ?                         \
28                                  cpu_all_mask :                         \
29                                  &hub_data(node)->h_cpus)
30 struct pci_bus;
31 extern int pcibus_to_node(struct pci_bus *);
32
33 #define cpumask_of_pcibus(bus)  (cpu_online_mask)
34
35 extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
36
37 #define node_distance(from, to) (__node_distances[(from)][(to)])
38
39 #include <asm-generic/topology.h>
40
41 #endif /* _ASM_MACH_TOPOLOGY_H */