aboutsummaryrefslogtreecommitdiff
path: root/include/linux/numa.h
blob: a42df804679ea48af796fef66b552dd3c0eb7733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_NUMA_H
#define _LINUX_NUMA_H
#include <linux/types.h>

#ifdef CONFIG_NODES_SHIFT
#define NODES_SHIFT     CONFIG_NODES_SHIFT
#else
#define NODES_SHIFT     0
#endif

#define MAX_NUMNODES    (1 << NODES_SHIFT)

#define	NUMA_NO_NODE	(-1)

/* optionally keep NUMA memory info available post init */
#ifdef CONFIG_NUMA_KEEP_MEMINFO
#define __initdata_or_meminfo
#else
#define __initdata_or_meminfo __initdata
#endif

#ifdef CONFIG_NUMA
/* Generic implementation available */
int numa_map_to_online_node(int node);

/*
 * Optional architecture specific implementation, users need a "depends
 * on $ARCH"
 */
int phys_to_target_node(phys_addr_t addr);
#else
static inline int numa_map_to_online_node(int node)
{
	return NUMA_NO_NODE;
}

static inline int phys_to_target_node(phys_addr_t addr)
{
	return NUMA_NO_NODE;
}
#endif

#endif /* _LINUX_NUMA_H */