X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=include%2Flinux%2Fio.h;h=81877ea39309aea73cef4a63a3212c69ab5c9131;hb=8d1413b28033c49c7f1a4d320e815d7a5531acee;hp=aa3f5af670b579bc9de78a9d1a4075daa6c039c2;hpb=63c422afe3739b68bec0b5c42807d1450c951caf;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/io.h b/include/linux/io.h index aa3f5af670b..81877ea3930 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -18,6 +18,7 @@ #ifndef _LINUX_IO_H #define _LINUX_IO_H +#include #include #include @@ -27,4 +28,31 @@ 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 */