4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6 * Generic bitmap manager.
8 * Copyright (C) 2005-2006 Texas Instruments, Inc.
10 * This package is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 #define GB_NOBITS (~0)
23 #include <dspbridge/host_os.h>
28 * ======== gb_clear ========
29 * Clear the bit in position bitn in the bitmap map. Bit positions are
33 extern void gb_clear(struct gb_t_map
*map
, u32 bitn
);
36 * ======== gb_create ========
37 * Create a bit map with len bits. Initially all bits are cleared.
40 extern struct gb_t_map
*gb_create(u32 len
);
43 * ======== gb_delete ========
44 * Delete previously created bit map
47 extern void gb_delete(struct gb_t_map
*map
);
50 * ======== gb_findandset ========
51 * Finds a clear bit, sets it, and returns the position
54 extern u32
gb_findandset(struct gb_t_map
*map
);
57 * ======== gb_minclear ========
58 * gb_minclear returns the minimum clear bit position. If no bit is
59 * clear, gb_minclear returns -1.
61 extern u32
gb_minclear(struct gb_t_map
*map
);
64 * ======== gb_set ========
65 * Set the bit in position bitn in the bitmap map. Bit positions are
69 extern void gb_set(struct gb_t_map
*map
, u32 bitn
);
72 * ======== gb_test ========
73 * Returns TRUE if the bit in position bitn is set in map; otherwise
74 * gb_test returns FALSE. Bit positions are zero based.
77 extern bool gb_test(struct gb_t_map
*map
, u32 bitn
);