* Aperture has to be naturally aligned. This means an 2GB aperture won't * have much chances to find a place in the lower 4GB of memory. * Unfortunately we cannot move it up because that would make the * IOMMU useless.
* Aperture has to be naturally aligned. This means an 2GB * aperture won't have much chances to find a place in the * lower 4GB of memory.  Unfortunately we cannot move it up * because that would make the IOMMU useless.
static u32 __init allocate_aperture(void) {#ifdef CONFIG_DISCONTIGMEM	pg_data_t *nd0 = NODE_DATA(0);#else	pg_data_t *nd0 = &contig_page_data;#endif		u32 aper_size;	void *p; 	if (fallback_aper_order > 7) 		fallback_aper_order = 7; 	aper_size = (32 * 1024 * 1024) << fallback_aper_order; 	/* 	 * Aperture has to be naturally aligned. This means an 2GB aperture won't 	 * have much chances to find a place in the lower 4GB of memory. 	 * Unfortunately we cannot move it up because that would make the 	 * IOMMU useless.	 */	p = __alloc_bootmem_node(nd0, aper_size, aper_size, 0); 	if (!p || __pa(p)+aper_size > 0xffffffff) {		printk("Cannot allocate aperture memory hole (%p,%uK)\n",		       p, aper_size>>10);		if (p)			free_bootmem_node(nd0, (unsigned long)p, aper_size); 		return 0;	}	printk("Mapping aperture over %d KB of RAM @ %lx\n",  	       aper_size >> 10, __pa(p)); 	return (u32)__pa(p); }