MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_aspace_page_put_phy

Function rt_aspace_page_put_phy

components/mm/mm_aspace.c:1719–1754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1717}
1718
1719rt_err_t rt_aspace_page_put_phy(rt_aspace_t aspace, void *page_va, void *buffer)
1720{
1721 rt_err_t rc = -RT_ERROR;
1722
1723 char *frame_ka = rt_hw_mmu_v2p(aspace, page_va);
1724 if (frame_ka != ARCH_MAP_FAILED)
1725 {
1726 frame_ka = rt_kmem_p2v(frame_ka);
1727 if (frame_ka)
1728 {
1729 rt_memcpy(frame_ka, buffer, ARCH_PAGE_SIZE);
1730 rc = RT_EOK;
1731 }
1732 else if (aspace == _current_uspace() || aspace == &rt_kernel_space)
1733 {
1734 /* direct IO */
1735 rt_memcpy(page_va, buffer, ARCH_PAGE_SIZE);
1736 rc = RT_EOK;
1737 }
1738 else
1739 {
1740 /* user memory region remap ? */
1741 LOG_W("%s(aspace=0x%lx,va=%p): Operation not support",
1742 __func__, aspace, page_va);
1743 rc = -RT_ENOSYS;
1744 }
1745 }
1746 else
1747 {
1748 LOG_W("%s(aspace=0x%lx,va=%p): PTE not existed",
1749 __func__, aspace, page_va);
1750 rc = -RT_ENOENT;
1751 }
1752
1753 return rc;
1754}
1755
1756rt_err_t rt_aspace_page_put(rt_aspace_t aspace, void *page_va, void *buffer)
1757{

Callers 2

rt_aspace_page_putFunction · 0.85
write_by_mteFunction · 0.85

Calls 3

rt_kmem_p2vFunction · 0.85
rt_memcpyFunction · 0.85
rt_hw_mmu_v2pFunction · 0.50

Tested by

no test coverage detected