aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/memblock.h1
-rw-r--r--arch/x86/mm/memblock.c10
-rw-r--r--arch/x86/mm/numa_64.c2
-rw-r--r--include/linux/bootmem.h2
-rw-r--r--mm/nobootmem.c8
5 files changed, 6 insertions, 17 deletions
diff --git a/arch/x86/include/asm/memblock.h b/arch/x86/include/asm/memblock.h
index d2a5a59bd358..6c72ecaee577 100644
--- a/arch/x86/include/asm/memblock.h
+++ b/arch/x86/include/asm/memblock.h
@@ -8,7 +8,6 @@ void memblock_x86_free_range(u64 start, u64 end);
8struct range; 8struct range;
9int __get_free_all_memory_range(struct range **range, int nodeid, 9int __get_free_all_memory_range(struct range **range, int nodeid,
10 unsigned long start_pfn, unsigned long end_pfn); 10 unsigned long start_pfn, unsigned long end_pfn);
11int get_free_all_memory_range(struct range **rangep, int nodeid);
12 11
13u64 memblock_x86_hole_size(u64 start, u64 end); 12u64 memblock_x86_hole_size(u64 start, u64 end);
14u64 memblock_x86_free_memory_in_range(u64 addr, u64 limit); 13u64 memblock_x86_free_memory_in_range(u64 addr, u64 limit);
diff --git a/arch/x86/mm/memblock.c b/arch/x86/mm/memblock.c
index 648d47d52a86..0e8442a9baff 100644
--- a/arch/x86/mm/memblock.c
+++ b/arch/x86/mm/memblock.c
@@ -89,16 +89,6 @@ int __init __get_free_all_memory_range(struct range **rangep, int nodeid,
89 return nr_range; 89 return nr_range;
90} 90}
91 91
92int __init get_free_all_memory_range(struct range **rangep, int nodeid)
93{
94 unsigned long end_pfn = -1UL;
95
96#ifdef CONFIG_X86_32
97 end_pfn = max_low_pfn;
98#endif
99 return __get_free_all_memory_range(rangep, nodeid, 0, end_pfn);
100}
101
102static u64 __init __memblock_x86_memory_in_range(u64 addr, u64 limit, bool get_free) 92static u64 __init __memblock_x86_memory_in_range(u64 addr, u64 limit, bool get_free)
103{ 93{
104 int i, count; 94 int i, count;
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index dd27f401f0a0..92e27119ee1a 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -19,7 +19,7 @@ unsigned long __init numa_free_all_bootmem(void)
19 for_each_online_node(i) 19 for_each_online_node(i)
20 pages += free_all_bootmem_node(NODE_DATA(i)); 20 pages += free_all_bootmem_node(NODE_DATA(i));
21 21
22 pages += free_all_memory_core_early(MAX_NUMNODES); 22 pages += free_low_memory_core_early(MAX_NUMNODES);
23 23
24 return pages; 24 return pages;
25} 25}
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index ab344a521105..66d3e954eb6c 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -44,7 +44,7 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,
44 unsigned long endpfn); 44 unsigned long endpfn);
45extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); 45extern unsigned long init_bootmem(unsigned long addr, unsigned long memend);
46 46
47unsigned long free_all_memory_core_early(int nodeid); 47extern unsigned long free_low_memory_core_early(int nodeid);
48extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); 48extern unsigned long free_all_bootmem_node(pg_data_t *pgdat);
49extern unsigned long free_all_bootmem(void); 49extern unsigned long free_all_bootmem(void);
50 50
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
index c78162668bc4..2037a8a04761 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -106,7 +106,7 @@ static void __init __free_pages_memory(unsigned long start, unsigned long end)
106 __free_pages_bootmem(pfn_to_page(i), 0); 106 __free_pages_bootmem(pfn_to_page(i), 0);
107} 107}
108 108
109unsigned long __init free_all_memory_core_early(int nodeid) 109unsigned long __init free_low_memory_core_early(int nodeid)
110{ 110{
111 int i; 111 int i;
112 u64 start, end; 112 u64 start, end;
@@ -114,7 +114,7 @@ unsigned long __init free_all_memory_core_early(int nodeid)
114 struct range *range = NULL; 114 struct range *range = NULL;
115 int nr_range; 115 int nr_range;
116 116
117 nr_range = get_free_all_memory_range(&range, nodeid); 117 nr_range = __get_free_all_memory_range(&range, nodeid, 0, max_low_pfn);
118 118
119 for (i = 0; i < nr_range; i++) { 119 for (i = 0; i < nr_range; i++) {
120 start = range[i].start; 120 start = range[i].start;
@@ -136,7 +136,7 @@ unsigned long __init free_all_bootmem_node(pg_data_t *pgdat)
136{ 136{
137 register_page_bootmem_info_node(pgdat); 137 register_page_bootmem_info_node(pgdat);
138 138
139 /* free_all_memory_core_early(MAX_NUMNODES) will be called later */ 139 /* free_low_memory_core_early(MAX_NUMNODES) will be called later */
140 return 0; 140 return 0;
141} 141}
142 142
@@ -154,7 +154,7 @@ unsigned long __init free_all_bootmem(void)
154 * Use MAX_NUMNODES will make sure all ranges in early_node_map[] 154 * Use MAX_NUMNODES will make sure all ranges in early_node_map[]
155 * will be used instead of only Node0 related 155 * will be used instead of only Node0 related
156 */ 156 */
157 return free_all_memory_core_early(MAX_NUMNODES); 157 return free_low_memory_core_early(MAX_NUMNODES);
158} 158}
159 159
160/** 160/**