Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / sh / include / asm / mmzone.h
blobcbaee1d1b673205ffc111df768ebcd0a8049469a
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_SH_MMZONE_H
3 #define __ASM_SH_MMZONE_H
5 #ifdef __KERNEL__
7 #ifdef CONFIG_NEED_MULTIPLE_NODES
8 #include <linux/numa.h>
10 extern struct pglist_data *node_data[];
11 #define NODE_DATA(nid) (node_data[nid])
13 static inline int pfn_to_nid(unsigned long pfn)
15 int nid;
17 for (nid = 0; nid < MAX_NUMNODES; nid++)
18 if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid))
19 break;
21 return nid;
24 static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
26 return NODE_DATA(pfn_to_nid(pfn));
29 /* arch/sh/mm/numa.c */
30 void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end);
31 #else
32 static inline void
33 setup_bootmem_node(int nid, unsigned long start, unsigned long end)
36 #endif /* CONFIG_NEED_MULTIPLE_NODES */
38 /* Platform specific mem init */
39 void __init plat_mem_setup(void);
41 /* arch/sh/kernel/setup.c */
42 void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
43 unsigned long end_pfn);
44 /* arch/sh/mm/init.c */
45 void __init allocate_pgdat(unsigned int nid);
47 #endif /* __KERNEL__ */
48 #endif /* __ASM_SH_MMZONE_H */