topology.h 915 Bytes
Newer Older
1 2 3
#ifndef _ASM_PPC64_TOPOLOGY_H
#define _ASM_PPC64_TOPOLOGY_H

4
#include <linux/config.h>
5 6 7 8
#include <asm/mmzone.h>

#ifdef CONFIG_NUMA

9
static inline int cpu_to_node(int cpu)
Andrew Morton's avatar
Andrew Morton committed
10 11 12 13 14 15 16 17 18 19 20 21 22
{
	int node;

	node = numa_cpu_lookup_table[cpu];

#ifdef DEBUG_NUMA
	if (node == -1)
		BUG();
#endif

	return node;
}

23
#define memblk_to_node(memblk)	(memblk)
Andrew Morton's avatar
Andrew Morton committed
24

25
#define parent_node(node)	(node)
Andrew Morton's avatar
Andrew Morton committed
26

27
static inline cpumask_t node_to_cpumask(int node)
Andrew Morton's avatar
Andrew Morton committed
28
{
29 30
	return numa_cpumask_lookup_table[node];
}
Andrew Morton's avatar
Andrew Morton committed
31

32 33
static inline int node_to_first_cpu(int node)
{
34 35 36
	cpumask_t tmp;
	tmp = node_to_cpumask(node);
	return first_cpu(tmp);
37
}
Andrew Morton's avatar
Andrew Morton committed
38

39
#define node_to_memblk(node)	(node)
Andrew Morton's avatar
Andrew Morton committed
40

41
#define pcibus_to_cpumask(bus)	(cpu_online_map)
Andrew Morton's avatar
Andrew Morton committed
42

43 44
#define nr_cpus_node(node)	(nr_cpus_in_node[node])

45 46 47
/* Cross-node load balancing interval. */
#define NODE_BALANCE_RATE 10

Andrew Morton's avatar
Andrew Morton committed
48 49
#else /* !CONFIG_NUMA */

50
#include <asm-generic/topology.h>
Andrew Morton's avatar
Andrew Morton committed
51 52

#endif /* CONFIG_NUMA */
53 54

#endif /* _ASM_PPC64_TOPOLOGY_H */