Ignore:
Timestamp:
Aug 3, 2017, 10:15:18 AM (5 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/kern/thread.c

    r296 r315  
    8282        page      = kmem_alloc( &req );
    8383
     84        if( page == NULL ) return NULL;
     85
    8486    // return pointer on new thread descriptor
    85         if( page == NULL ) return NULL;
    86     else               return (thread_t *)ppm_page2vaddr( page );
    87 }
     87    xptr_t base_xp = ppm_page2base( XPTR(local_cxy , page ) );
     88    return (thread_t *)GET_PTR( base_xp );
     89
     90}  // end thread_alloc()
     91 
    8892
    8993/////////////////////////////////////////////////////////////////////////////////////
     
    100104    kmem_req_t   req;
    101105
     106    xptr_t base_xp = ppm_base2page( XPTR(local_cxy , thread ) );
     107
    102108    req.type  = KMEM_PAGE;
    103     req.ptr   = ppm_vaddr2page( thread );
     109    req.ptr   = GET_PTR( base_xp );
    104110    kmem_free( &req );
    105111}
Note: See TracChangeset for help on using the changeset viewer.