ia64/xen-unstable

changeset 12272:8f552314e45a

[LINUX] Use pfn_to_page instead of relying in memory assumptions

This makes usage agnostic wrt the memory model being used.

Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
author kfraser@localhost.localdomain
date Tue Nov 07 09:28:18 2006 +0000 (2006-11-07)
parents f95c943adbeb
children b223ba940ed1
files linux-2.6-xen-sparse/arch/i386/mm/init-xen.c linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c	Tue Nov 07 00:02:52 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c	Tue Nov 07 09:28:18 2006 +0000
     1.3 @@ -663,8 +663,8 @@ void __init mem_init(void)
     1.4  	totalram_pages += free_all_bootmem();
     1.5  	/* XEN: init and count low-mem pages outside initial allocation. */
     1.6  	for (pfn = xen_start_info->nr_pages; pfn < max_low_pfn; pfn++) {
     1.7 -		ClearPageReserved(&mem_map[pfn]);
     1.8 -		set_page_count(&mem_map[pfn], 1);
     1.9 +		ClearPageReserved(pfn_to_page(pfn));
    1.10 +		set_page_count(pfn_to_page(pfn), 1);
    1.11  		totalram_pages++;
    1.12  	}
    1.13  
     2.1 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Tue Nov 07 00:02:52 2006 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Tue Nov 07 09:28:18 2006 +0000
     2.3 @@ -913,8 +913,8 @@ void __init mem_init(void)
     2.4  #endif
     2.5  	/* XEN: init and count pages outside initial allocation. */
     2.6  	for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) {
     2.7 -		ClearPageReserved(&mem_map[pfn]);
     2.8 -		set_page_count(&mem_map[pfn], 1);
     2.9 +		ClearPageReserved(pfn_to_page(pfn));
    2.10 +		set_page_count(pfn_to_page(pfn), 1);
    2.11  		totalram_pages++;
    2.12  	}
    2.13  	reservedpages = end_pfn - totalram_pages - e820_hole_size(0, end_pfn);