Changeset 50 for trunk/kernel/mm/kcm.h
- Timestamp:
- Jun 26, 2017, 3:15:11 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/kcm.h
r23 r50 36 36 * This structure defines a generic Kernel Cache Manager, that is a block allocator, 37 37 * for fixed size objects. It exists a specific KCM allocator for each object type. 38 * The actual allocated block size is the smallest multiple of 64 bytes that can 39 * contain one single object. 38 * The actual allocated block size is the smallest multiple of the KCM slot, that 39 * contain one single object. The KCM slot is typically 64 bytes, as it must be large 40 * enough to store the kcm_page descriptor, defined below. 40 41 * The various KCM allocators themselves are not statically allocated in the cluster 41 42 * manager, but are dynamically allocated when required, using the embedded KCM … … 46 47 { 47 48 spinlock_t lock; /*! protect exclusive access to allocator */ 48 uint32_t block_size; /*! actual block size (bytes)*/49 uint32_t blocks_nr; /*! number of blocks per page*/49 uint32_t block_size; /*! rounded block size (bytes) */ 50 uint32_t blocks_nr; /*! max number of blocks per page */ 50 51 51 52 list_entry_t active_root; /*! root of active pages list */ … … 64 65 /**************************************************************************************** 65 66 * This structure defines a KCM-page descriptor. 66 * A KCM-page c an contain up to (CONFIG_PPM_PAGE_SIZE / CONFIG_CACHE_LINE_SIZE) blocks.67 * A KCM-page contains at most (CONFIG_PPM_PAGE_SIZE / CONFIG_KCM_SLOT_SIZE) blocks. 67 68 * This kcm page descriptor is stored in the first slot of the page. 68 69 ***************************************************************************************/ … … 70 71 typedef struct kcm_page_s 71 72 { 72 uint32_t bitmap[BITMAP_SIZE(CONFIG_KCM_BLOCKS_MAX)]; 73 uint8_t * base; /*! pointer on first block in page */ 74 kcm_t * kcm; /*! owner KCM allocator */ 73 uint32_t bitmap[2]; /*! at most 64 blocks in a single page */ 75 74 list_entry_t list; /*! [active / busy / free] list member */ 75 kcm_t * kcm; /*! pointer on kcm allocator */ 76 76 page_t * page; /*! pointer on the physical page descriptor */ 77 uint8_t refcount; /*! number of allocated blocks */ 78 uint8_t busy; /*! page busy if non zero */ 79 uint8_t active; /*! page active if non zero */ 80 uint8_t unused; /*! */ 77 uint32_t count; /*! number of allocated blocks */ 78 uint32_t busy; /*! page busy if non zero */ 79 uint32_t active; /*! page active if non zero */ 81 80 } 82 81 kcm_page_t;
Note: See TracChangeset
for help on using the changeset viewer.