Changeset 352 for trunk/kernel


Ignore:
Timestamp:
Aug 9, 2017, 10:46:05 AM (7 years ago)
Author:
max@…
Message:

Don't compute kcm_page twice.

File:
1 edited

Legend:

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

    r315 r352  
    9191// It changes the kcm_page status if required.
    9292/////////////////////////////////////////////////////////////////////////////////////
    93 // @ kcm   : pointer on kcm allocator.
    94 // @ ptr   : pointer on block to be released.
    95 /////////////////////////////////////////////////////////////////////////////////////
    96 static void kcm_put_block ( kcm_t * kcm,
    97                             void  * ptr )
    98 {
    99         kcm_page_t * kcm_page;
     93// @ kcm      : pointer on kcm allocator.
     94// @ kcm_page : pointer on kcm_page.
     95// @ ptr      : pointer on block to be released.
     96/////////////////////////////////////////////////////////////////////////////////////
     97static void kcm_put_block ( kcm_t      * kcm,
     98                            kcm_page_t * kcm_page,
     99                            void       * ptr )
     100{
    100101        uint32_t     index;
    101 
    102         // compute pointer on kcm_page from block pointer
    103         kcm_page = (kcm_page_t*)((intptr_t)ptr & ~CONFIG_PPM_PAGE_MASK);
    104102
    105103        // compute block index from block pointer
     
    343341
    344342        // release block
    345         kcm_put_block( kcm , ptr );
     343        kcm_put_block( kcm , kcm_page , ptr );
    346344
    347345        // release lock
Note: See TracChangeset for help on using the changeset viewer.