u64 end;
res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map);
++++ e820_res = res;
for (i = 0; i < e820.nr_map; i++) {
end = e820.map[i].addr + e820.map[i].size - 1;
--- --#ifndef CONFIG_RESOURCES_64BIT
--- -- if (end > 0x100000000ULL) {
+++ ++ if (end != (resource_size_t)end) {
res++;
continue;
}
__early_set_fixmap(idx, 0, __pgprot(0));
}
----
---- int __initdata early_ioremap_nested;
----
++++ static void *prev_map[FIX_BTMAPS_SLOTS] __initdata;
++++ static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata;
static int __init check_early_ioremap_leak(void)
{
---- if (!early_ioremap_nested)
- return 0;
++++ int count = 0;
++++ int i;
+++
- printk(KERN_WARNING
++++ for (i = 0; i < FIX_BTMAPS_SLOTS; i++)
++++ if (prev_map[i])
++++ count++;
++++
++++ if (!count)
+ return 0;
+ WARN(1, KERN_WARNING
"Debug warning: early ioremap leak of %d areas detected.\n",
--- early_ioremap_nested);
- early_ioremap_nested);
++++ count);
printk(KERN_WARNING
- "please boot with early_ioremap_debug and report the dmesg.\n");
- WARN_ON(1);
+ "please boot with early_ioremap_debug and report the dmesg.\n");
return 1;
}
unsigned long offset;
unsigned int nrpages;
enum fixed_addresses idx;
---- int nesting;
++++ int i, slot;
++
-- nesting = --early_ioremap_nested;
-- if (WARN_ON(nesting < 0))
++++ slot = -1;
++++ for (i = 0; i < FIX_BTMAPS_SLOTS; i++) {
++++ if (prev_map[i] == addr) {
++++ slot = i;
++++ break;
++++ }
++++ }
++++
++++ if (slot < 0) {
++++ printk(KERN_INFO "early_iounmap(%p, %08lx) not found slot\n",
++++ addr, size);
++++ WARN_ON(1);
++ + return;
++++ }
++
-- nesting = --early_ioremap_nested;
-- if (WARN_ON(nesting < 0))
++++ if (prev_size[slot] != size) {
++++ printk(KERN_INFO "early_iounmap(%p, %08lx) [%d] size not consistent %08lx\n",
++++ addr, size, slot, prev_size[slot]);
++++ WARN_ON(1);
+ return;
++++ }
if (early_ioremap_debug) {
printk(KERN_INFO "early_iounmap(%p, %08lx) [%d]\n", addr,
}
EXPORT_SYMBOL(pci_bus_assign_resources);
-- printk(KERN_INFO "bus: %02x index %x %s: [%llx, %llx]\n", bus->number, i, (res->flags & IORESOURCE_IO)? "io port":"mmio", res->start, res->end);
+ static void pci_bus_dump_res(struct pci_bus *bus)
+ {
+ int i;
+
+ for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
+ struct resource *res = bus->resource[i];
+ if (!res)
+ continue;
+
+++ printk(KERN_INFO "bus: %02x index %x %s: [%llx, %llx]\n",
+++ bus->number, i,
+++ (res->flags & IORESOURCE_IO) ? "io port" : "mmio",
+++ (unsigned long long) res->start,
+++ (unsigned long long) res->end);
+ }
+ }
+
+ static void pci_bus_dump_resources(struct pci_bus *bus)
+ {
+ struct pci_bus *b;
+ struct pci_dev *dev;
+
+
+ pci_bus_dump_res(bus);
+
+ list_for_each_entry(dev, &bus->devices, bus_list) {
+ b = dev->subordinate;
+ if (!b)
+ continue;
+
+ pci_bus_dump_resources(b);
+ }
+ }
+
void __init
pci_assign_unassigned_resources(void)
{
extern int request_resource(struct resource *root, struct resource *new);
extern int release_resource(struct resource *new);
++ + extern void reserve_region_with_split(struct resource *root,
++ + resource_size_t start, resource_size_t end,
++ + const char *name);
extern int insert_resource(struct resource *parent, struct resource *new);
+ extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new);
extern int allocate_resource(struct resource *root, struct resource *new,
resource_size_t size, resource_size_t min,
resource_size_t max, resource_size_t align,