2 * Implement the sparc64 iomap interfaces
5 #include <linux/module.h>
8 /* Create a virtual mapping cookie for an IO port range */
9 void __iomem
*ioport_map(unsigned long port
, unsigned int nr
)
11 return (void __iomem
*) (unsigned long) port
;
14 void ioport_unmap(void __iomem
*addr
)
18 EXPORT_SYMBOL(ioport_map
);
19 EXPORT_SYMBOL(ioport_unmap
);
21 /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
22 void __iomem
*pci_iomap(struct pci_dev
*dev
, int bar
, unsigned long maxlen
)
24 resource_size_t start
= pci_resource_start(dev
, bar
);
25 resource_size_t len
= pci_resource_len(dev
, bar
);
26 unsigned long flags
= pci_resource_flags(dev
, bar
);
30 if (maxlen
&& len
> maxlen
)
32 if (flags
& IORESOURCE_IO
)
33 return ioport_map(start
, len
);
34 if (flags
& IORESOURCE_MEM
) {
35 if (flags
& IORESOURCE_CACHEABLE
)
36 return ioremap(start
, len
);
37 return ioremap_nocache(start
, len
);
43 void pci_iounmap(struct pci_dev
*dev
, void __iomem
* addr
)
47 EXPORT_SYMBOL(pci_iomap
);
48 EXPORT_SYMBOL(pci_iounmap
);