iomap.c (d4bbf7e7759afc172e2bfbc5c416324590049cdd) iomap.c (629a858160751b670e1376dab4788f0c84138cc6)
1/*
2 * iomap.c - Implement iomap interface for PA-RISC
3 * Copyright (c) 2004 Matthew Wilcox
4 */
5
6#include <linux/ioport.h>
7#include <linux/pci.h>
8#include <linux/export.h>

--- 422 unchanged lines hidden (view full) ---

431
432void ioport_unmap(void __iomem *addr)
433{
434 if (!INDIRECT_ADDR(addr)) {
435 iounmap(addr);
436 }
437}
438
1/*
2 * iomap.c - Implement iomap interface for PA-RISC
3 * Copyright (c) 2004 Matthew Wilcox
4 */
5
6#include <linux/ioport.h>
7#include <linux/pci.h>
8#include <linux/export.h>

--- 422 unchanged lines hidden (view full) ---

431
432void ioport_unmap(void __iomem *addr)
433{
434 if (!INDIRECT_ADDR(addr)) {
435 iounmap(addr);
436 }
437}
438
439/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
440void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
441{
442 resource_size_t start = pci_resource_start(dev, bar);
443 resource_size_t len = pci_resource_len(dev, bar);
444 unsigned long flags = pci_resource_flags(dev, bar);
445
446 if (!len || !start)
447 return NULL;
448 if (maxlen && len > maxlen)
449 len = maxlen;
450 if (flags & IORESOURCE_IO)
451 return ioport_map(start, len);
452 if (flags & IORESOURCE_MEM) {
453 if (flags & IORESOURCE_CACHEABLE)
454 return ioremap(start, len);
455 return ioremap_nocache(start, len);
456 }
457 /* What? */
458 return NULL;
459}
460
461void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
462{
463 if (!INDIRECT_ADDR(addr)) {
464 iounmap(addr);
465 }
466}
467
468EXPORT_SYMBOL(ioread8);

--- 9 unchanged lines hidden (view full) ---

478EXPORT_SYMBOL(ioread8_rep);
479EXPORT_SYMBOL(ioread16_rep);
480EXPORT_SYMBOL(ioread32_rep);
481EXPORT_SYMBOL(iowrite8_rep);
482EXPORT_SYMBOL(iowrite16_rep);
483EXPORT_SYMBOL(iowrite32_rep);
484EXPORT_SYMBOL(ioport_map);
485EXPORT_SYMBOL(ioport_unmap);
439void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
440{
441 if (!INDIRECT_ADDR(addr)) {
442 iounmap(addr);
443 }
444}
445
446EXPORT_SYMBOL(ioread8);

--- 9 unchanged lines hidden (view full) ---

456EXPORT_SYMBOL(ioread8_rep);
457EXPORT_SYMBOL(ioread16_rep);
458EXPORT_SYMBOL(ioread32_rep);
459EXPORT_SYMBOL(iowrite8_rep);
460EXPORT_SYMBOL(iowrite16_rep);
461EXPORT_SYMBOL(iowrite32_rep);
462EXPORT_SYMBOL(ioport_map);
463EXPORT_SYMBOL(ioport_unmap);
486EXPORT_SYMBOL(pci_iomap);
487EXPORT_SYMBOL(pci_iounmap);
464EXPORT_SYMBOL(pci_iounmap);