X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fio.h;h=81877ea39309aea73cef4a63a3212c69ab5c9131;hb=aec3694b987900de7ab789ea5749d673e0d634c4;hp=420e2fdf26f654a4d89b7853340783dad432fffe;hpb=af57d238aa2107e1b45d8dacad6e50db938f0567;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/io.h b/include/linux/io.h index 420e2fdf26f..81877ea3930 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -18,9 +18,41 @@ #ifndef _LINUX_IO_H #define _LINUX_IO_H +#include #include +#include void __iowrite32_copy(void __iomem *to, const void *from, size_t count); void __iowrite64_copy(void __iomem *to, const void *from, size_t count); +int ioremap_page_range(unsigned long addr, unsigned long end, + unsigned long phys_addr, pgprot_t prot); + +/** + * 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; +} + #endif /* _LINUX_IO_H */