2 # define e820 machine_e820
3 # include <asm/hypervisor.h>
5 #include <linux/ioport.h>
8 static void resource_clip(struct resource *res, resource_size_t start,
11 resource_size_t low = 0, high = 0;
13 if (res->end < start || res->start > end)
14 return; /* no conflict */
16 if (res->start < start)
17 low = start - res->start;
20 high = res->end - end;
22 /* Keep the area above or below the conflict, whichever is larger */
29 static void remove_e820_regions(struct resource *avail)
32 struct e820entry *entry;
34 for (i = 0; i < e820.nr_map; i++) {
37 resource_clip(avail, entry->addr,
38 entry->addr + entry->size - 1);
42 void arch_remove_reservations(struct resource *avail)
45 if (!is_initial_xendomain())
48 /* Trim out BIOS areas (low 1MB and high 2MB) and E820 regions */
49 if (avail->flags & IORESOURCE_MEM) {
50 if (avail->start < BIOS_END)
51 avail->start = BIOS_END;
52 resource_clip(avail, BIOS_ROM_BASE, BIOS_ROM_END);
54 remove_e820_regions(avail);