Changeset 7 for trunk/kernel/mm/kcm.h
- Timestamp:
- Apr 26, 2017, 2:15:50 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/kcm.h
r1 r7 39 39 * contain one single object. 40 40 * The various KCM allocators themselves are not statically allocated in the cluster 41 * manager, but are dynamically allocated when required, using the specificKCM41 * manager, but are dynamically allocated when required, using the embedded KCM 42 42 * allocator defined in the cluster manager, to allocate the other ones... 43 43 ***************************************************************************************/ … … 64 64 /**************************************************************************************** 65 65 * This structure defines a KCM-page descriptor. 66 * A KCM-page can contain severalblocks.67 * This descriptor is stored in the first block slot.66 * A KCM-page can contain up to (CONFIG_PPM_PAGE_SIZE / CONFIG_CACHE_LINE_SIZE) blocks. 67 * This kcm page descriptor is stored in the first slot of the page. 68 68 ***************************************************************************************/ 69 69 70 70 typedef struct kcm_page_s 71 71 { 72 BITMAP ( bitmap , 16 ); /*! at most 16 blocks in a page (1 if free) */73 uint8_t * b lk_tbl; /*! pointer on first free block in page*/72 BITMAP ( bitmap , CONFIG_KCM_BLOCKS_MAX ); 73 uint8_t * base; /*! pointer on first block in page */ 74 74 kcm_t * kcm; /*! owner KCM allocator */ 75 uint8_t unused; /*! first free block index in page */ 75 list_entry_t list; /*! [active / busy / free] list member */ 76 page_t * page; /*! pointer on the physical page descriptor */ 76 77 uint8_t refcount; /*! number of allocated blocks */ 77 78 uint8_t busy; /*! page busy if non zero */ 78 79 uint8_t active; /*! page active if non zero */ 79 list_entry_t list; /*! [active / busy / free] list member */ 80 page_t * page; /*! pointer on the physical page descriptor */ 80 uint8_t unused; /*! */ 81 81 } 82 82 kcm_page_t; … … 88 88 * @ type : KCM allocator type. 89 89 ***************************************************************************************/ 90 error_t kcm_init( kcm_t* kcm,91 uint32_ttype );90 void kcm_init( kcm_t * kcm, 91 uint32_t type ); 92 92 93 93 /**************************************************************************************** … … 96 96 * @ kcm : pointer on KCM manager to destroy. 97 97 ***************************************************************************************/ 98 void kcm_destroy( kcm_t 98 void kcm_destroy( kcm_t * kcm ); 99 99 100 100 /**************************************************************************************** … … 102 102 * The object size must be smaller than one page size. 103 103 **************************************************************************************** 104 * @ kcm : pointer on the selected KCM allocator 104 * @ kcm : pointer on the selected KCM allocator 105 * @ return pointer on allocated block if success / return NULL if failure 105 106 ***************************************************************************************/ 106 107 void * kcm_alloc( kcm_t * kcm );
Note: See TracChangeset
for help on using the changeset viewer.