Paul Mundt | b241cb0 | 2007-06-06 17:52:19 +0900 | [diff] [blame] | 1 | #ifndef __ASM_SH_MMZONE_H |
| 2 | #define __ASM_SH_MMZONE_H |
| 3 | |
| 4 | #ifdef __KERNEL__ |
| 5 | |
| 6 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
Paul Mundt | 6bff159 | 2008-09-12 22:41:30 +0900 | [diff] [blame] | 7 | #include <linux/numa.h> |
| 8 | |
Paul Mundt | b241cb0 | 2007-06-06 17:52:19 +0900 | [diff] [blame] | 9 | extern struct pglist_data *node_data[]; |
| 10 | #define NODE_DATA(nid) (node_data[nid]) |
| 11 | |
Paul Mundt | b241cb0 | 2007-06-06 17:52:19 +0900 | [diff] [blame] | 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 */ |
Magnus Damm | 0146ba7 | 2008-04-23 20:56:44 +0900 | [diff] [blame] | 41 | void __init __add_active_range(unsigned int nid, unsigned long start_pfn, |
| 42 | unsigned long end_pfn); |
Paul Mundt | 4bc277a | 2010-05-11 13:32:19 +0900 | [diff] [blame] | 43 | /* arch/sh/mm/init.c */ |
| 44 | void __init allocate_pgdat(unsigned int nid); |
Paul Mundt | b241cb0 | 2007-06-06 17:52:19 +0900 | [diff] [blame] | 45 | |
| 46 | #endif /* __KERNEL__ */ |
| 47 | #endif /* __ASM_SH_MMZONE_H */ |