~ubuntu-branches/ubuntu/precise/linux-lowlatency/precise

« back to all changes in this revision

Viewing changes to lib/check_signature.c

  • Committer: Package Import Robot
  • Author(s): Alessio Igor Bogani
  • Date: 2011-10-26 11:13:05 UTC
  • Revision ID: package-import@ubuntu.com-20111026111305-tz023xykf0i6eosh
Tags: upstream-3.2.0
ImportĀ upstreamĀ versionĀ 3.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <linux/io.h>
 
2
#include <linux/module.h>
 
3
 
 
4
/**
 
5
 *      check_signature         -       find BIOS signatures
 
6
 *      @io_addr: mmio address to check
 
7
 *      @signature:  signature block
 
8
 *      @length: length of signature
 
9
 *
 
10
 *      Perform a signature comparison with the mmio address io_addr. This
 
11
 *      address should have been obtained by ioremap.
 
12
 *      Returns 1 on a match.
 
13
 */
 
14
 
 
15
int check_signature(const volatile void __iomem *io_addr,
 
16
                        const unsigned char *signature, int length)
 
17
{
 
18
        while (length--) {
 
19
                if (readb(io_addr) != *signature)
 
20
                        return 0;
 
21
                io_addr++;
 
22
                signature++;
 
23
        }
 
24
        return 1;
 
25
}
 
26
EXPORT_SYMBOL(check_signature);