Ignore:
Timestamp:
Aug 2, 2017, 3:24:57 PM (7 years ago)
Author:
alain
Message:

RSeveral modifs in the page-fault handling.

File:
1 edited

Legend:

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

    r296 r313  
    3535
    3636//////////////////////////////////////////////////////////////////////////////////////////
    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//
    4041// For The TSAR architecture, the kernel pointers are identity mapped:
    4142// - the 32 bits PTR value is identical to the 32 bits LPA value,
     
    133134
    134135}  // end hal_core_init()
     136
     137///////////////////////////////////////////
     138inline 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////////////////////////////////////////
     150inline 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.