Ignore:
Timestamp:
Jan 18, 2016, 4:43:12 PM (9 years ago)
Author:
alain
Message:

We introduce the _v2p_add_pte1(), _v2p_add_pte2(),
_v2p_del_pte1(), _v2p_del_pte2() functions in the vmem.c file,
in order to support the mmap() and munmap() functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_common/vmem.c

    r752 r758  
    191191    ix2 = vpn & 0x1FF;          //  9 bits for ix2
    192192
     193#if GIET_DEBUG_VMEM
     194if ( _get_proctime() > GIET_DEBUG_VMEM )
     195_printf("\n@@@ _v2p_add_pte2() : enters for vpn = %x / ppn = %x / PTAB[%d,%d,%d]\n",
     196        vpn , ppn , vspace_id , x , y );
     197#endif
     198
    193199    // get page table physical base address
    194200    paddr_t      pt1_pbase = _ptabs_paddr[vspace_id][x][y];
     
    214220        _ptabs_next_pt2[vspace_id][x][y] = pt2_id + 1;
    215221
     222#if GIET_DEBUG_VMEM
     223if ( _get_proctime() > GIET_DEBUG_VMEM )
     224_printf("\n@@@ _v2p_add_pte2() new pt2_id = %d\n", pt2_id );
     225#endif
     226       
    216227        // check overflow
    217228        if (pt2_id == _ptabs_max_pt2)
     
    228239        // set PTD into PT1
    229240        _physical_write( pt1_pbase + 4*ix1, ptd);
     241
     242#if GIET_DEBUG_VMEM
     243if ( _get_proctime() > GIET_DEBUG_VMEM )
     244_printf("\n@@@ _v2p_add_pte2() : &ptd = %l / ptd = %x\n", pt1_pbase + 4*ix1, ptd );
     245#endif
     246
     247
    230248    }
    231249    else                       // valid PTD: compute PT2 base address
     
    238256    _physical_write(pte2_paddr     , (PTE_V | flags) );
    239257    _physical_write(pte2_paddr + 4 , ppn );
     258
     259#if GIET_DEBUG_VMEM
     260if ( _get_proctime() > GIET_DEBUG_VMEM )
     261_printf("\n@@@ _v2p_add_pte2() : pt1_pbase = %l / pt2_pbase = %l"
     262        " / &pte2 = %l / ppn = %x / flags = %x\n",
     263        pt1_pbase , pt2_pbase , pte2_paddr , ppn , PTE_V | flags );
     264#endif
    240265
    241266    // release lock protecting PTAB[vspace_id][x][y]
Note: See TracChangeset for help on using the changeset viewer.