Changeset 637 for trunk/kernel/mm
- Timestamp:
- Jul 18, 2019, 2:06:55 PM (5 years ago)
- Location:
- trunk/kernel/mm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/mapper.c
r635 r637 442 442 if ( page_xp == XPTR_NULL ) return -1; 443 443 444 // compute cluster and pointers on page in mapper 445 xptr_t map_xp = ppm_page2base( page_xp ); 446 uint8_t * map_ptr = GET_PTR( map_xp ); 447 cxy_t map_cxy = GET_CXY( map_xp ); 444 // compute extended pointer in kernel mapper 445 xptr_t map_xp = ppm_page2base( page_xp ) + page_offset; 448 446 449 447 #if (DEBUG_MAPPER_MOVE_USER & 1) … … 458 456 if( to_buffer ) 459 457 { 460 hal_copy_to_uspace( map_cxy , map_ptr + page_offset , buf_ptr, page_bytes );458 hal_copy_to_uspace( buf_ptr , map_xp , page_bytes ); 461 459 462 460 #if DEBUG_MAPPER_MOVE_USER & 1 … … 464 462 printk("\n[%s] thread[%x,%x] moved %d bytes / mapper %s (%x,%x) -> user buffer(%x,%x)\n", 465 463 __FUNCTION__, this->process->pid, this->trdid, page_bytes, 466 name, map_cxy, map_ptr + page_offset, local_cxy, buf_ptr );464 name, GET_CXY(map_xp), GET_PTR(map_xp), local_cxy, buf_ptr ); 467 465 #endif 468 466 … … 471 469 { 472 470 ppm_page_do_dirty( page_xp ); 473 hal_copy_from_uspace( map_ cxy , map_ptr + page_offset, buf_ptr , page_bytes );471 hal_copy_from_uspace( map_xp , buf_ptr , page_bytes ); 474 472 475 473 #if DEBUG_MAPPER_MOVE_USER & 1 … … 477 475 printk("\n[%s] thread[%x,%x] moved %d bytes / user buffer(%x,%x) -> mapper %s (%x,%x)\n", 478 476 __FUNCTION__, this->process->pid, this->trdid, page_bytes, 479 local_cxy, buf_ptr, name, map_cxy, map_ptr + page_offset);477 local_cxy, buf_ptr, name, GET_CXY(map_xp), GET_PTR(map_xp) ); 480 478 mapper_display_page( mapper_xp , page_id, 128 ); 481 479 #endif -
trunk/kernel/mm/ppm.c
r636 r637 533 533 page_xp = XPTR( page_cxy , page_ptr ); 534 534 535 536 535 // get local pointer on PPM (same in all clusters) 537 536 ppm_t * ppm = &LOCAL_CLUSTER->ppm; … … 568 567 buddy_index = current_index ^ (1 << current_order); 569 568 buddy_ptr = pages_tbl + buddy_index; 569 570 // get buddy order 571 buddy_order = hal_remote_l32( XPTR( page_cxy , &buddy_ptr->order ) ); 570 572 571 573 // exit loop if buddy not found
Note: See TracChangeset
for help on using the changeset viewer.