X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=include%2Flinux%2Fio.h;h=6c7f0ba0d5faf473b6c2ffb60d1a0c957c007059;hb=50d11d190afa4e21284b735bb0a092036f298f0b;hp=9e419ebfc98b86c009ec2a51823bc880d0c226cd;hpb=7f25377043925554cb9f3f9d8ada3390f71a5d10;p=safe%2Fjmp%2Flinux-2.6 diff --git a/include/linux/io.h b/include/linux/io.h index 9e419eb..6c7f0ba 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -27,53 +27,44 @@ struct device; void __iowrite32_copy(void __iomem *to, const void *from, size_t count); void __iowrite64_copy(void __iomem *to, const void *from, size_t count); +#ifdef CONFIG_MMU int ioremap_page_range(unsigned long addr, unsigned long end, unsigned long phys_addr, pgprot_t prot); +#else +static inline int ioremap_page_range(unsigned long addr, unsigned long end, + unsigned long phys_addr, pgprot_t prot) +{ + return 0; +} +#endif /* * Managed iomap interface */ +#ifdef CONFIG_HAS_IOPORT void __iomem * devm_ioport_map(struct device *dev, unsigned long port, unsigned int nr); void devm_ioport_unmap(struct device *dev, void __iomem *addr); +#else +static inline void __iomem *devm_ioport_map(struct device *dev, + unsigned long port, + unsigned int nr) +{ + return NULL; +} -void __iomem * devm_ioremap(struct device *dev, unsigned long offset, +static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr) +{ +} +#endif + +void __iomem *devm_ioremap(struct device *dev, resource_size_t offset, unsigned long size); -void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset, +void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset, unsigned long size); void devm_iounmap(struct device *dev, void __iomem *addr); - -void __iomem * pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); -void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); -void __iomem * const * pcim_iomap_table(struct pci_dev *pdev); - -int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name); - -/** - * check_signature - find BIOS signatures - * @io_addr: mmio address to check - * @signature: signature block - * @length: length of signature - * - * Perform a signature comparison with the mmio address io_addr. This - * address should have been obtained by ioremap. - * Returns 1 on a match. - */ - -static inline int check_signature(const volatile void __iomem *io_addr, - const unsigned char *signature, int length) -{ - int retval = 0; - do { - if (readb(io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - } while (length); - retval = 1; -out: - return retval; -} +int check_signature(const volatile void __iomem *io_addr, + const unsigned char *signature, int length); +void devm_ioremap_release(struct device *dev, void *res); #endif /* _LINUX_IO_H */