diff options
-rw-r--r-- | arch/i386/mm/discontig.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c index 1726b4096b10..85d2fcbe1079 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/i386/mm/discontig.c | |||
@@ -146,6 +146,21 @@ static void __init find_max_pfn_node(int nid) | |||
146 | BUG(); | 146 | BUG(); |
147 | } | 147 | } |
148 | 148 | ||
149 | /* Find the owning node for a pfn. */ | ||
150 | int early_pfn_to_nid(unsigned long pfn) | ||
151 | { | ||
152 | int nid; | ||
153 | |||
154 | for_each_node(nid) { | ||
155 | if (node_end_pfn[nid] == 0) | ||
156 | break; | ||
157 | if (node_start_pfn[nid] <= pfn && node_end_pfn[nid] >= pfn) | ||
158 | return nid; | ||
159 | } | ||
160 | |||
161 | return 0; | ||
162 | } | ||
163 | |||
149 | /* | 164 | /* |
150 | * Allocate memory for the pg_data_t for this node via a crude pre-bootmem | 165 | * Allocate memory for the pg_data_t for this node via a crude pre-bootmem |
151 | * method. For node zero take this from the bottom of memory, for | 166 | * method. For node zero take this from the bottom of memory, for |