OpenCores
URL https://opencores.org/ocsvn/or1k_soc_on_altera_embedded_dev_kit/or1k_soc_on_altera_embedded_dev_kit/trunk

Subversion Repositories or1k_soc_on_altera_embedded_dev_kit

[/] [or1k_soc_on_altera_embedded_dev_kit/] [trunk/] [linux-2.6/] [linux-2.6.24/] [arch/] [x86/] [lib/] [bitstr_64.c] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 xianfeng
#include <linux/module.h>
2
#include <linux/bitops.h>
3
 
4
/* Find string of zero bits in a bitmap */
5
unsigned long
6
find_next_zero_string(unsigned long *bitmap, long start, long nbits, int len)
7
{
8
        unsigned long n, end, i;
9
 
10
 again:
11
        n = find_next_zero_bit(bitmap, nbits, start);
12
        if (n == -1)
13
                return -1;
14
 
15
        /* could test bitsliced, but it's hardly worth it */
16
        end = n+len;
17
        if (end > nbits)
18
                return -1;
19
        for (i = n+1; i < end; i++) {
20
                if (test_bit(i, bitmap)) {
21
                        start = i+1;
22
                        goto again;
23
                }
24
        }
25
        return n;
26
}
27
 
28
EXPORT_SYMBOL(find_next_zero_string);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.