Ignore:
Timestamp:
Aug 3, 2017, 10:15:18 AM (7 years ago)
Author:
alain
Message:

Redefine the fuctions ppm_base2page() / ppm_page2base() / ppm_page2ppn() / ppm_ppn2page() / ppm_base2ppn() / ppm_ppn2base(),
to use explicitely extended pointers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/core/hal_ppm.c

    r313 r315  
    135135}  // end hal_core_init()
    136136
    137 ///////////////////////////////////////////
    138 inline ppn_t hal_page2ppn( xptr_t page_xp )
    139 {
    140         ppm_t  * ppm      = &LOCAL_CLUSTER->ppm;
    141137
    142     cxy_t    page_cxy = GET_CXY( page_xp );
    143     page_t * page_ptr = (page_t *)GET_PTR( page_xp );
    144 
    145     return (ppn_t)(page_ptr - ppm->pages_tbl) | (ppn_t)(page_cxy << 20);
    146 
    147 }  // end hal_page2ppn()
    148 
    149 ////////////////////////////////////////
    150 inline xptr_t  hal_ppn2page( ppn_t ppn )
    151 {
    152         ppm_t  * ppm      = &LOCAL_CLUSTER->ppm;
    153 
    154     cxy_t    page_cxy = (ppn & 0xFFF00000) >> 20;
    155     page_t * page_ptr = &ppm->pages_tbl[ppn & 0x000FFFFF];
    156 
    157     return XPTR( page_xy , page_ptr );
    158 
    159 }  // end hal_ppn2page
    160 
    161 
Note: See TracChangeset for help on using the changeset viewer.