File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/* SPDX-License-Identifier: GPL-2.0 */
22#ifndef _LINUX_NUMA_H
33#define _LINUX_NUMA_H
4+ #include <linux/init.h>
45#include <linux/types.h>
56
67#ifdef CONFIG_NODES_SHIFT
2223#endif
2324
2425#ifdef CONFIG_NUMA
25- #include <linux/printk.h>
2626#include <asm/sparsemem.h>
2727
2828/* Generic implementation available */
2929int numa_nearest_node (int node , unsigned int state );
3030
3131#ifndef memory_add_physaddr_to_nid
32- static inline int memory_add_physaddr_to_nid (u64 start )
33- {
34- pr_info_once ("Unknown online node for memory at 0x%llx, assuming node 0\n" ,
35- start );
36- return 0 ;
37- }
32+ int memory_add_physaddr_to_nid (u64 start );
3833#endif
34+
3935#ifndef phys_to_target_node
40- static inline int phys_to_target_node (u64 start )
41- {
42- pr_info_once ("Unknown target node for memory at 0x%llx, assuming node 0\n" ,
43- start );
44- return 0 ;
45- }
36+ int phys_to_target_node (u64 start );
4637#endif
38+
4739#ifndef numa_fill_memblks
4840static inline int __init numa_fill_memblks (u64 start , u64 end )
4941{
5042 return NUMA_NO_MEMBLK ;
5143}
5244#endif
45+
5346#else /* !CONFIG_NUMA */
5447static inline int numa_nearest_node (int node , unsigned int state )
5548{
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ obj-$(CONFIG_SHADOW_CALL_STACK) += scs.o
114114obj-$(CONFIG_HAVE_STATIC_CALL) += static_call.o
115115obj-$(CONFIG_HAVE_STATIC_CALL_INLINE) += static_call_inline.o
116116obj-$(CONFIG_CFI_CLANG) += cfi.o
117+ obj-$(CONFIG_NUMA) += numa.o
117118
118119obj-$(CONFIG_PERF_EVENTS) += events/
119120
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: GPL-2.0-or-later
2+
3+ #include <linux/printk.h>
4+ #include <linux/numa.h>
5+
6+ /* Stub functions: */
7+
8+ #ifndef memory_add_physaddr_to_nid
9+ int memory_add_physaddr_to_nid (u64 start )
10+ {
11+ pr_info_once ("Unknown online node for memory at 0x%llx, assuming node 0\n" ,
12+ start );
13+ return 0 ;
14+ }
15+ EXPORT_SYMBOL_GPL (memory_add_physaddr_to_nid );
16+ #endif
17+
18+ #ifndef phys_to_target_node
19+ int phys_to_target_node (u64 start )
20+ {
21+ pr_info_once ("Unknown target node for memory at 0x%llx, assuming node 0\n" ,
22+ start );
23+ return 0 ;
24+ }
25+ EXPORT_SYMBOL_GPL (phys_to_target_node );
26+ #endif
You can’t perform that action at this time.
0 commit comments