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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [arch/] [x86_64/] [lib/] [bitstr.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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