Changeset 606 for trunk/kernel/mm/vmm.c
- Timestamp:
- Dec 3, 2018, 12:20:18 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/vmm.c
r595 r606 1507 1507 error_t error; 1508 1508 xptr_t page_xp; // extended pointer on physical page descriptor 1509 page_t * page_ptr; // local pointer on physical page descriptor 1510 uint32_t index; // missing page index in vseg mapper 1509 uint32_t page_id; // missing page index in vseg mapper 1511 1510 uint32_t type; // vseg type; 1512 1511 1513 1512 type = vseg->type; 1514 index= vpn - vseg->vpn_base;1513 page_id = vpn - vseg->vpn_base; 1515 1514 1516 1515 #if DEBUG_VMM_GET_ONE_PPN … … 1518 1517 thread_t * this = CURRENT_THREAD; 1519 1518 if( DEBUG_VMM_GET_ONE_PPN < cycle ) 1520 printk("\n[%s] thread[%x,%x] enter for vpn %x / type %s / index%d / cycle %d\n",1521 __FUNCTION__, this->process->pid, this->trdid, vpn, vseg_type_str(type), index, cycle );1519 printk("\n[%s] thread[%x,%x] enter for vpn %x / type %s / page_id %d / cycle %d\n", 1520 __FUNCTION__, this->process->pid, this->trdid, vpn, vseg_type_str(type), page_id, cycle ); 1522 1521 #endif 1523 1522 … … 1531 1530 "mapper not defined for a FILE vseg\n" ); 1532 1531 1533 // get mapper cluster and local pointer 1534 cxy_t mapper_cxy = GET_CXY( mapper_xp ); 1535 mapper_t * mapper_ptr = GET_PTR( mapper_xp ); 1536 1537 // get page descriptor from mapper 1538 if( mapper_cxy == local_cxy ) // mapper is local 1539 { 1540 page_ptr = mapper_get_page( mapper_ptr , index ); 1541 } 1542 else // mapper is remote 1543 { 1544 rpc_mapper_get_page_client( mapper_cxy , mapper_ptr , index , &page_ptr ); 1545 } 1546 1547 if ( page_ptr == NULL ) return EINVAL; 1548 1549 page_xp = XPTR( mapper_cxy , page_ptr ); 1532 // get extended pointer on page descriptor 1533 page_xp = mapper_remote_get_page( mapper_xp , page_id ); 1534 1535 if ( page_xp == XPTR_NULL ) return EINVAL; 1550 1536 } 1551 1537 … … 1569 1555 "mapper not defined for a CODE or DATA vseg\n" ); 1570 1556 1571 // get mapper cluster and local pointer1572 cxy_t mapper_cxy = GET_CXY( mapper_xp );1573 mapper_t * mapper_ptr = GET_PTR( mapper_xp );1574 1575 1557 // compute missing page offset in vseg 1576 uint32_t offset = index<< CONFIG_PPM_PAGE_SHIFT;1558 uint32_t offset = page_id << CONFIG_PPM_PAGE_SHIFT; 1577 1559 1578 1560 // compute missing page offset in .elf file … … 1615 1597 __FUNCTION__, this->process->pid, this->trdid, vpn ); 1616 1598 #endif 1617 if( mapper_cxy == local_cxy ) 1618 { 1619 error = mapper_move_kernel( mapper_ptr, 1620 true, // to_buffer 1621 elf_offset, 1622 base_xp, 1623 CONFIG_PPM_PAGE_SIZE ); 1624 } 1625 else 1626 { 1627 rpc_mapper_move_buffer_client( mapper_cxy, 1628 mapper_ptr, 1629 true, // to buffer 1630 false, // kernel buffer 1631 elf_offset, 1632 base_xp, 1633 CONFIG_PPM_PAGE_SIZE, 1634 &error ); 1635 } 1599 error = mapper_move_kernel( mapper_xp, 1600 true, // to_buffer 1601 elf_offset, 1602 base_xp, 1603 CONFIG_PPM_PAGE_SIZE ); 1636 1604 if( error ) return EINVAL; 1637 1605 } … … 1649 1617 #endif 1650 1618 // initialize mapper part 1651 if( mapper_cxy == local_cxy ) 1652 { 1653 error = mapper_move_kernel( mapper_ptr, 1654 true, // to buffer 1655 elf_offset, 1656 base_xp, 1657 file_size - offset ); 1658 } 1659 else 1660 { 1661 rpc_mapper_move_buffer_client( mapper_cxy, 1662 mapper_ptr, 1663 true, // to buffer 1664 false, // kernel buffer 1665 elf_offset, 1666 base_xp, 1667 file_size - offset, 1668 &error ); 1669 } 1619 error = mapper_move_kernel( mapper_xp, 1620 true, // to buffer 1621 elf_offset, 1622 base_xp, 1623 file_size - offset ); 1670 1624 if( error ) return EINVAL; 1671 1625
Note: See TracChangeset
for help on using the changeset viewer.