Changeset 315 for trunk/kernel/mm/page.c


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

    r296 r315  
    232232}
    233233
    234 //////////////////////////////
    235 void page_copy(  page_t * dst,
    236                  page_t * src )
    237 {
    238         uint32_t  size;
    239         void    * src_base;
    240         void    * dst_base;
    241 
    242         assert( (dst->order == src->order) , __FUNCTION__ , "src size != dst size\n" );
    243 
    244         size = (1 << dst->order) * CONFIG_PPM_PAGE_SIZE;
    245         src_base = ppm_page2vaddr( src );
    246         dst_base = ppm_page2vaddr( dst );
    247 
    248         memcpy( dst_base , src_base , size );
    249 }
    250 
    251234///////////////////////////////
    252235void page_zero( page_t * page )
    253236{
    254         uint32_t   size;
    255         void     * base;
    256 
    257         size = (1 << page->order) * CONFIG_PPM_PAGE_SIZE;
    258         base = ppm_page2vaddr( page );
    259 
    260         memset( base , 0 , size );
     237        uint32_t   size = (1 << page->order) * CONFIG_PPM_PAGE_SIZE;
     238
     239        xptr_t base_xp = ppm_page2base( XPTR( local_cxy , page ) );
     240
     241        memset( GET_PTR( base_xp ) , 0 , size );
    261242}
    262243
     
    266247        printk("*** Page %d : base = %x / flags = %x / order = %d / count = %d\n",
    267248                page->index,
    268                 ppm_page2vaddr( page ),
     249                GET_PTR( ppm_page2base( XPTR( local_cxy , page ) ) ),
    269250                page->flags,
    270251                page->order,
Note: See TracChangeset for help on using the changeset viewer.