Files
kernel/include/linux/numa.h
T

69 lines
1.4 KiB
C
Raw Normal View History

/* SPDX-License-Identifier: GPL-2.0 */
2005-04-16 15:20:36 -07:00
#ifndef _LINUX_NUMA_H
#define _LINUX_NUMA_H
2023-12-11 13:27:00 -05:00
#include <linux/init.h>
#include <linux/types.h>
2005-04-16 15:20:36 -07:00
2006-04-10 22:53:53 -07:00
#ifdef CONFIG_NODES_SHIFT
#define NODES_SHIFT CONFIG_NODES_SHIFT
#else
2005-04-16 15:20:36 -07:00
#define NODES_SHIFT 0
#endif
#define MAX_NUMNODES (1 << NODES_SHIFT)
#define NUMA_NO_NODE (-1)
2023-07-10 13:02:58 -07:00
#define NUMA_NO_MEMBLK (-1)
2020-02-16 12:01:04 -08:00
/* 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
#include <asm/sparsemem.h>
/* Generic implementation available */
2023-08-19 07:12:33 -07:00
int numa_nearest_node(int node, unsigned int state);
#ifndef memory_add_physaddr_to_nid
2023-12-11 13:27:00 -05:00
int memory_add_physaddr_to_nid(u64 start);
#endif
2023-12-11 13:27:00 -05:00
#ifndef phys_to_target_node
2023-12-11 13:27:00 -05:00
int phys_to_target_node(u64 start);
#endif
2023-12-11 13:27:00 -05:00
2023-07-10 13:02:58 -07:00
#ifndef numa_fill_memblks
static inline int __init numa_fill_memblks(u64 start, u64 end)
{
return NUMA_NO_MEMBLK;
}
#endif
2023-12-11 13:27:00 -05:00
#else /* !CONFIG_NUMA */
2023-08-19 07:12:33 -07:00
static inline int numa_nearest_node(int node, unsigned int state)
{
return NUMA_NO_NODE;
}
2023-08-19 07:12:33 -07:00
static inline int memory_add_physaddr_to_nid(u64 start)
{
return 0;
}
static inline int phys_to_target_node(u64 start)
{
return 0;
}
#endif
2023-08-19 07:12:33 -07:00
#define numa_map_to_online_node(node) numa_nearest_node(node, N_ONLINE)
#ifdef CONFIG_HAVE_ARCH_NODE_DEV_GROUP
extern const struct attribute_group arch_node_dev_group;
#endif
2005-04-16 15:20:36 -07:00
#endif /* _LINUX_NUMA_H */