// SPDX-License-Identifier: GPL-2.0 /* * system.c - a driver for reserving pnp system resources * * Some code is based on pnpbios_core.c * Copyright 2002 Adam Belay <ambx1@neo.rr.com> * (c) Copyright 2007 Hewlett-Packard Development Company, L.P. * Bjorn Helgaas <bjorn.helgaas@hp.com>
*/
regionid = kmalloc(16, GFP_KERNEL); if (!regionid) return;
snprintf(regionid, 16, "pnp %s", pnpid); if (port)
res = request_region(start, end - start + 1, regionid); else
res = request_mem_region(start, end - start + 1, regionid); if (res)
res->flags &= ~IORESOURCE_BUSY; else
kfree(regionid);
/* * Failures at this point are usually harmless. pci quirks for * example do reserve stuff they know about too, so we may well * have double reservations.
*/
dev_info(&dev->dev, "%pR %s reserved\n", r,
res ? "has been" : "could not be");
}
staticvoid reserve_resources_of_dev(struct pnp_dev *dev)
{ struct resource *res; int i;
for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_IO, i)); i++) { if (res->flags & IORESOURCE_DISABLED) continue; if (res->start == 0) continue; /* disabled */ if (res->start < 0x100) /* * Below 0x100 is only standard PC hardware * (pics, kbd, timer, dma, ...) * We should not get resource conflicts there, * and the kernel reserves these anyway * (see arch/i386/kernel/setup.c). * So, do nothing
*/ continue; if (res->end < res->start) continue; /* invalid */
reserve_range(dev, res, 1);
}
for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_MEM, i)); i++) { if (res->flags & IORESOURCE_DISABLED) continue;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.