ia64/xen-unstable

changeset 2090:04070e921d35

bitkeeper revision 1.1149.2.2 (41125ca87nJjUEYoSsWzlx9ToYbRuA)

Put some memory into the DMA zone. Makes memory allocation for drivers
using a coherent_dma_mask happy.
author cl349@freefall.cl.cam.ac.uk
date Thu Aug 05 16:13:28 2004 +0000 (2004-08-05)
parents 78ef630c782c
children cfe6d46a6298
files linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c
line diff
     1.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c	Thu Aug 05 13:30:03 2004 +0000
     1.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c	Thu Aug 05 16:13:28 2004 +0000
     1.3 @@ -422,15 +422,21 @@ void zap_low_mappings (void)
     1.4  void __init zone_sizes_init(void)
     1.5  {
     1.6  	unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
     1.7 -	unsigned int high, low;
     1.8 +	unsigned int max_dma, high, low;
     1.9  	
    1.10 +	max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
    1.11  	low = max_low_pfn;
    1.12  	high = highend_pfn;
    1.13  	
    1.14 -	zones_size[ZONE_NORMAL] = low;
    1.15 +	if (low < max_dma)
    1.16 +		zones_size[ZONE_DMA] = low;
    1.17 +	else {
    1.18 +		zones_size[ZONE_DMA] = max_dma;
    1.19 +		zones_size[ZONE_NORMAL] = low - max_dma;
    1.20  #ifdef CONFIG_HIGHMEM
    1.21 -	zones_size[ZONE_HIGHMEM] = high - low;
    1.22 +		zones_size[ZONE_HIGHMEM] = high - low;
    1.23  #endif
    1.24 +	}
    1.25  	free_area_init(zones_size);	
    1.26  }
    1.27  #else