Changeset 313 for trunk/hal/tsar_mips32/core/hal_ppm.c
- Timestamp:
- Aug 2, 2017, 3:24:57 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/core/hal_ppm.c
r296 r313 35 35 36 36 ////////////////////////////////////////////////////////////////////////////////////////// 37 // This file contains the TSAR specific code for cores registers, 38 // and for physical memory allocators initialisation in a given cluster. 39 37 // This file contains the TSAR specific code for : 38 // - cores registers initialisation, 39 // - memory allocators initialisation. 40 // 40 41 // For The TSAR architecture, the kernel pointers are identity mapped: 41 42 // - the 32 bits PTR value is identical to the 32 bits LPA value, … … 133 134 134 135 } // end hal_core_init() 136 137 /////////////////////////////////////////// 138 inline ppn_t hal_page2ppn( xptr_t page_xp ) 139 { 140 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 141 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.