/* called with domain->lock held Used to reserve address ranges in the aperture (e.g. for exclusion ranges.  */
static void dma_ops_reserve_addresses(struct dma_ops_domain *dom, unsigned long start_page, unsigned int pages)
/* called with domain->lock held Used to reserve address ranges in the aperture (e.g. for exclusion ranges.  */
static void dma_ops_reserve_addresses(struct dma_ops_domain *dom, unsigned long start_page, unsigned int pages)
{
	unsigned int i, last_page = dom->aperture_size >> PAGE_SHIFT;
	if (start_page + pages > last_page)
		pages = last_page - start_page;
	for (i = start_page; i < start_page + pages; ++i) {
		int index = i / APERTURE_RANGE_PAGES;
		int page  = i % APERTURE_RANGE_PAGES;
		__set_bit(page, dom->aperture[index]->bitmap);
	}
}