44#if !defined (_RTEMS_RFS_BITMAPS_H_)
45#define _RTEMS_RFS_BITMAPS_H_
56#define RTEMS_RFS_BITMAP_CLEAR_ZERO 0
58#if RTEMS_RFS_BITMAP_CLEAR_ZERO
62#define RTEMS_RFS_BITMAP_BIT_CLEAR 0
63#define RTEMS_RFS_BITMAP_BIT_SET 1
64#define RTEMS_RFS_BITMAP_ELEMENT_SET (RTEMS_RFS_BITMAP_ELEMENT_FULL_MASK)
65#define RTEMS_RFS_BITMAP_ELEMENT_CLEAR (0)
66#define RTEMS_RFS_BITMAP_SET_BITS(_t, _b) ((_t) | (_b))
67#define RTEMS_RFS_BITMAP_CLEAR_BITS(_t, _b) ((_t) & ~(_b))
68#define RTEMS_RFS_BITMAP_TEST_BIT(_t, _b) (((_t) & (1 << (_b))) != 0 ? true : false)
73#define RTEMS_RFS_BITMAP_BIT_CLEAR 1
74#define RTEMS_RFS_BITMAP_BIT_SET 0
75#define RTEMS_RFS_BITMAP_ELEMENT_SET (0)
76#define RTEMS_RFS_BITMAP_ELEMENT_CLEAR (RTEMS_RFS_BITMAP_ELEMENT_FULL_MASK)
77#define RTEMS_RFS_BITMAP_SET_BITS(_t, _b) ((_t) & ~(_b))
78#define RTEMS_RFS_BITMAP_CLEAR_BITS(_t, _b) ((_t) | (_b))
79#define RTEMS_RFS_BITMAP_TEST_BIT(_t, _b) (((_t) & (1 << (_b))) == 0 ? true : false)
85#define RTEMS_RFS_BITMAP_INVERT_MASK(_mask) (~(_mask))
92#define RTEMS_RFS_BITMAP_ELEMENT_FULL_MASK (0xffffffffUL)
98#define RTEMS_RFS_BITMAP_SEARCH_WINDOW (rtems_rfs_bitmap_element_bits () * 64)
113#define RTEMS_RFS_ELEMENT_BITS_POWER_2 (5)
139#define rtems_rfs_bitmap_numof_bits(_bytes) (8 * (_bytes))
145#define rtems_rfs_bitmap_element_bits() \
146 rtems_rfs_bitmap_numof_bits (sizeof (rtems_rfs_bitmap_element))
151#define rtems_rfs_bitmap_search_element_bits() \
152 (rtems_rfs_bitmap_element_bits() * rtems_rfs_bitmap_element_bits())
157#define rtems_rfs_bitmap_elements(_bits) \
158 ((((_bits) - 1) / rtems_rfs_bitmap_element_bits()) + 1)
163#define rtems_rfs_bitmap_release_buffer(_fs, _bm) \
164 rtems_rfs_buffer_handle_release (_fs, (_bm)->buffer)
174#define rtems_rfs_bitmap_map_index(_b) \
175 ((_b) >> RTEMS_RFS_ELEMENT_BITS_POWER_2)
181#define rtems_rfs_bitmap_map_offset(_b) \
182 ((_b) & ((1 << RTEMS_RFS_ELEMENT_BITS_POWER_2) - 1))
187#define rtems_rfs_bitmap_map_size(_c) ((_c)->size)
192#define rtems_rfs_bitmap_map_free(_c) ((_c)->free)
197#define rtems_rfs_bitmap_map_handle(_c) ((_c)->buffer)
202#define rtems_rfs_bitmap_map_block(_c) ((_c)->block)
uint32_t rtems_rfs_bitmap_element
Definition: rtems-rfs-bitmaps.h:108
int rtems_rfs_bitmap_map_set(rtems_rfs_bitmap_control *control, rtems_rfs_bitmap_bit bit)
Definition: rtems-rfs-bitmaps.c:209
int rtems_rfs_bitmap_create_search(rtems_rfs_bitmap_control *control)
Definition: rtems-rfs-bitmaps.c:612
int rtems_rfs_bitmap_map_clear_all(rtems_rfs_bitmap_control *control)
Definition: rtems-rfs-bitmaps.c:344
rtems_rfs_bitmap_element rtems_rfs_bitmap_mask(unsigned int size)
Definition: rtems-rfs-bitmaps.c:192
int rtems_rfs_bitmap_map_set_all(rtems_rfs_bitmap_control *control)
Definition: rtems-rfs-bitmaps.c:315
int rtems_rfs_bitmap_open(rtems_rfs_bitmap_control *control, rtems_rfs_file_system *fs, rtems_rfs_buffer_handle *buffer, size_t size, rtems_rfs_buffer_block block)
Definition: rtems-rfs-bitmaps.c:680
int rtems_rfs_bitmap_map_alloc(rtems_rfs_bitmap_control *control, rtems_rfs_bitmap_bit seed, bool *allocate, rtems_rfs_bitmap_bit *bit)
Definition: rtems-rfs-bitmaps.c:536
struct rtems_rfs_bitmap_control_s rtems_rfs_bitmap_control
int rtems_rfs_bitmap_close(rtems_rfs_bitmap_control *control)
Definition: rtems-rfs-bitmaps.c:703
int rtems_rfs_bitmap_map_clear(rtems_rfs_bitmap_control *control, rtems_rfs_bitmap_bit bit)
Definition: rtems-rfs-bitmaps.c:255
rtems_rfs_bitmap_element rtems_rfs_bitmap_mask_section(unsigned int start, unsigned int end)
Definition: rtems-rfs-bitmaps.c:200
int rtems_rfs_bitmap_map_test(rtems_rfs_bitmap_control *control, rtems_rfs_bitmap_bit bit, bool *state)
Definition: rtems-rfs-bitmaps.c:297
int32_t rtems_rfs_bitmap_bit
Definition: rtems-rfs-bitmaps.h:103
rtems_rfs_bitmap_element * rtems_rfs_bitmap_map
Definition: rtems-rfs-bitmaps.h:118
Maps Blocks to the Media Interface Layers.
uint32_t rtems_rfs_buffer_block
Definition: rtems-rfs-buffer.h:81
RTEMS File Systems Data Forward Declaration.
Manages the Trace and Debugging Features of the RTEMS RFS File System.
Definition: rtems-rfs-file-system.h:135
Definition: intercom.c:87
Definition: rtems-rfs-bitmaps.h:124
Definition: rtems-rfs-buffer.h:111