xref: /openbmc/linux/arch/sh/include/asm/mmzone.h (revision ca55b2fe)
1 #ifndef __ASM_SH_MMZONE_H
2 #define __ASM_SH_MMZONE_H
3 
4 #ifdef __KERNEL__
5 
6 #ifdef CONFIG_NEED_MULTIPLE_NODES
7 #include <linux/numa.h>
8 
9 extern struct pglist_data *node_data[];
10 #define NODE_DATA(nid)		(node_data[nid])
11 
12 static inline int pfn_to_nid(unsigned long pfn)
13 {
14 	int nid;
15 
16 	for (nid = 0; nid < MAX_NUMNODES; nid++)
17 		if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid))
18 			break;
19 
20 	return nid;
21 }
22 
23 static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
24 {
25 	return NODE_DATA(pfn_to_nid(pfn));
26 }
27 
28 /* arch/sh/mm/numa.c */
29 void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end);
30 #else
31 static inline void
32 setup_bootmem_node(int nid, unsigned long start, unsigned long end)
33 {
34 }
35 #endif /* CONFIG_NEED_MULTIPLE_NODES */
36 
37 /* Platform specific mem init */
38 void __init plat_mem_setup(void);
39 
40 /* arch/sh/kernel/setup.c */
41 void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
42 			       unsigned long end_pfn);
43 /* arch/sh/mm/init.c */
44 void __init allocate_pgdat(unsigned int nid);
45 
46 #endif /* __KERNEL__ */
47 #endif /* __ASM_SH_MMZONE_H */
48