Linux 6.13-rc4
[linux.git] / arch / sh / include / asm / mmzone.h
blob63f88b465e394503d70779bb279308bb9f0b1808
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_SH_MMZONE_H
3 #define __ASM_SH_MMZONE_H
5 #ifdef CONFIG_NUMA
6 #include <linux/numa.h>
8 static inline int pfn_to_nid(unsigned long pfn)
10 int nid;
12 for (nid = 0; nid < MAX_NUMNODES; nid++)
13 if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid))
14 break;
16 return nid;
19 static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
21 return NODE_DATA(pfn_to_nid(pfn));
24 /* arch/sh/mm/numa.c */
25 void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end);
26 #else
27 static inline void
28 setup_bootmem_node(int nid, unsigned long start, unsigned long end)
31 #endif /* CONFIG_NUMA */
33 /* Platform specific mem init */
34 void __init plat_mem_setup(void);
36 /* arch/sh/kernel/setup.c */
37 void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
38 unsigned long end_pfn);
39 /* arch/sh/mm/init.c */
40 void __init allocate_pgdat(unsigned int nid);
42 #endif /* __ASM_SH_MMZONE_H */