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/kernel/mm/mapper.c

    r313 r315  
    349349
    350350        // compute pointer in mapper
    351         map_ptr = (uint8_t *)ppm_page2vaddr( page ) + page_offset;
     351        xptr_t base_xp = ppm_page2base( XPTR( local_cxy, page ) );
     352        map_ptr = (uint8_t *)GET_PTR( base_xp ) + page_offset;
    352353
    353354        // compute pointer in buffer
     
    446447        if ( page == NULL ) return EINVAL;
    447448
     449        // get page base address
     450        uint8_t * base = (uint8_t *)GET_PTR( XPTR( local_cxy , page ) );
     451       
    448452        // compute source and destination pointers
    449453        if( to_buffer )
    450454        {
    451             dst_ptr = buf_ptr + done;
    452             src_ptr = (uint8_t *)ppm_page2vaddr( page ) + page_offset;
     455            dst_ptr = buffer_ptr + done;
     456            src_ptr = base + page_offset;
    453457        }
    454458        else
    455459        {
    456             src_ptr = buf_ptr + done;
    457             dst_ptr = (uint8_t *)ppm_page2vaddr( page ) + page_offset;
     460            src_ptr = buffer_ptr + done;
     461            dst_ptr = base + page_offset;
    458462
    459463            page_do_dirty( page );
Note: See TracChangeset for help on using the changeset viewer.