|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH] Use pfn_to_page in initial memory mapping
the mem_map structure is only visible in the flatmem memory model. We
should be a little bit more agnostic on this.
A patch follows.
--
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"
# HG changeset patch
# User Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>
# Node ID 9a9e51d2ca56a15f9c9e8bb23658a715defe2e97
# Parent 20204db0891b0b7c10959822e3283656c3600500
[LINUX] Use pfn_to_page instead of relying in memory assumptions
This makes usage agnostic on the memory model being used.
Signed-off-by: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>
diff -r 20204db0891b -r 9a9e51d2ca56
linux-2.6-xen-sparse/arch/i386/mm/init-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c Thu Nov 2 18:52:04 2006
+++ b/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c Tue Nov 7 04:41:14 2006
@@ -663,8 +663,8 @@
totalram_pages += free_all_bootmem();
/* XEN: init and count low-mem pages outside initial allocation. */
for (pfn = xen_start_info->nr_pages; pfn < max_low_pfn; pfn++) {
- ClearPageReserved(&mem_map[pfn]);
- set_page_count(&mem_map[pfn], 1);
+ ClearPageReserved(pfn_to_page(pfn));
+ set_page_count(pfn_to_page(pfn), 1);
totalram_pages++;
}
diff -r 20204db0891b -r 9a9e51d2ca56
linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c Thu Nov 2 18:52:04 2006
+++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c Tue Nov 7 04:41:14 2006
@@ -913,8 +913,8 @@
#endif
/* XEN: init and count pages outside initial allocation. */
for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) {
- ClearPageReserved(&mem_map[pfn]);
- set_page_count(&mem_map[pfn], 1);
+ ClearPageReserved(pfn_to_page(pfn));
+ set_page_count(pfn_to_page(pfn), 1);
totalram_pages++;
}
reservedpages = end_pfn - totalram_pages - e820_hole_size(0, end_pfn);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-devel] [PATCH] Use pfn_to_page in initial memory mapping,
Glauber de Oliveira Costa <=
|
|
|
|
|