blob: 15a8496960e6a9987105939832b13c94f33aebaa [file] [log] [blame]
Paul Mundtb241cb02007-06-06 17:52:19 +09001#ifndef __ASM_SH_MMZONE_H
2#define __ASM_SH_MMZONE_H
3
4#ifdef __KERNEL__
5
6#ifdef CONFIG_NEED_MULTIPLE_NODES
Paul Mundt6bff1592008-09-12 22:41:30 +09007#include <linux/numa.h>
8
Paul Mundtb241cb02007-06-06 17:52:19 +09009extern struct pglist_data *node_data[];
10#define NODE_DATA(nid) (node_data[nid])
11
Paul Mundtb241cb02007-06-06 17:52:19 +090012static 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
23static 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 */
29void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end);
30#else
31static inline void
32setup_bootmem_node(int nid, unsigned long start, unsigned long end)
33{
34}
35#endif /* CONFIG_NEED_MULTIPLE_NODES */
36
37/* Platform specific mem init */
38void __init plat_mem_setup(void);
39
40/* arch/sh/kernel/setup.c */
Magnus Damm0146ba72008-04-23 20:56:44 +090041void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
42 unsigned long end_pfn);
Paul Mundt4bc277a2010-05-11 13:32:19 +090043/* arch/sh/mm/init.c */
44void __init allocate_pgdat(unsigned int nid);
Paul Mundtb241cb02007-06-06 17:52:19 +090045
46#endif /* __KERNEL__ */
47#endif /* __ASM_SH_MMZONE_H */