1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- /*
- * Copyright 2012 Institute of Communication and Computer Systems (ICCS)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
- /**
- * @file bitmap_rb.h
- * @author Ioannis Koutras (joko@microlab.ntua.gr)
- * @date September 2012
- * @brief Bitmap-organized raw block structure and creation function.
- */
- #ifndef BITMAP_RB_H
- #define BITMAP_RB_H
- #include "dmm_config.h"
- #include <inttypes.h>
- #include <stddef.h> /* for size_t */
- /** The data type of the bitmap array element */
- #define BMAP_EL_TYPE uint64_t
- /** The size of bitmap array element */
- #define BMAP_EL_SIZE sizeof(BMAP_EL_TYPE)
- /** The size of bitmap array element in bits */
- #define BMAP_EL_SIZE_BITS (BMAP_EL_SIZE * 8)
- /** Bitmap's initial value */
- #define BMAP_EL_INIT_VAL ~((BMAP_EL_TYPE) 0))
- /** How many bytes per cell should be used */
- #define BITMAP_RESOLUTION 256
- /** Bitmap-organized raw block header data structure */
- typedef struct bitmap_rb_s {
- size_t bytes_per_cell; /**< The raw block's resolution */
- size_t elements; /**< The necessary amount of bitmap elements */
- /* FIXME - As long as the bitmap arrays are fixed-sized,
- * this is also fixed */
- BMAP_EL_TYPE bmap; /**< The bitmap vector */
- } bitmap_rb_t;
- /** Chunk header data structure */
- typedef struct chunk_header_s {
- size_t num_of_cells; /**< The number of occupied cells. */
- size_t requested_size; /**< The requested size. */
- } chunk_header_t;
- /** The size of the chunk header in bitmap-organised raw blocks */
- #define CHUNK_HDR_SIZE sizeof(chunk_header_t)
- #endif /* BITMAP_RB_H */
|