Changeset 7 for trunk/kernel/mm/kcm.h


Ignore:
Timestamp:
Apr 26, 2017, 2:15:50 PM (7 years ago)
Author:
alain
Message:

Various bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/kcm.h

    r1 r7  
    3939 * contain one single object.
    4040 * The various KCM allocators themselves are not statically allocated in the cluster
    41  * manager, but are dynamically allocated when required, using the specific KCM
     41 * manager, but are dynamically allocated when required, using the embedded KCM
    4242 * allocator defined in the cluster manager, to allocate the other ones...
    4343 ***************************************************************************************/
     
    6464/****************************************************************************************
    6565 * This structure defines a KCM-page descriptor.
    66  * A KCM-page can contain several blocks.
    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.
    6868 ***************************************************************************************/
    6969
    7070typedef struct kcm_page_s
    7171{
    72         BITMAP          ( bitmap , 16 );       /*! at most 16 blocks in a page (1 if free) */
    73         uint8_t       * blk_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          */
    7474        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 */
    7677        uint8_t         refcount;              /*! number of allocated blocks              */
    7778        uint8_t         busy;                  /*! page busy if non zero                   */
    7879        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;                /*!                                         */
    8181}
    8282kcm_page_t;
     
    8888 * @ type     : KCM allocator type.
    8989 ***************************************************************************************/
    90 error_t kcm_init( kcm_t       * kcm,
    91                           uint32_t      type );
     90void kcm_init( kcm_t    * kcm,
     91                   uint32_t   type );
    9292
    9393/****************************************************************************************
     
    9696 * @ kcm      : pointer on KCM manager to destroy.
    9797 ***************************************************************************************/
    98 void kcm_destroy( kcm_t       * kcm );
     98void kcm_destroy( kcm_t  * kcm );
    9999
    100100/****************************************************************************************
     
    102102 * The object size must be smaller than one page size.
    103103 ****************************************************************************************
    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
    105106 ***************************************************************************************/
    106107void * kcm_alloc( kcm_t * kcm );
Note: See TracChangeset for help on using the changeset viewer.