Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory.c Create Date:2022-07-28 14:41:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:maps a range of physical memory into the requested pages. the old* mappings are removed. any references to nonexistent pages results* in null mappings (currently treated as "copy-on-access")

Proto:static int remap_pte_range(struct mm_struct *mm, pmd_t *pmd, unsigned long addr, unsigned long end, unsigned long pfn, pgprot_t prot)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
pmd_t *pmd
unsigned longaddr
unsigned longend
unsigned longpfn
pgprot_tprot
1815  err = 0
1817  pte = pte_alloc_map_lock(mm, pmd, addr, & ptl)
1818  If Not pte Then Return -ENOMEM
1820  A facility to provide lazy MMU batching()
1821  Do
1822  BUG_ON(!pte_none( * pte))
1823  If Not pfn_modify_allowed(pfn, prot) Then
1824  err = -EACCES
1825  Break
1827  set_pte_at(mm, addr, pte, pte_mkspecial(pfn_pte(pfn, prot)))
1828  pfn++
1829  When pte++, addr += PAGE_SIZE , addr != end cycle
1830  arch_leave_lazy_mmu_mode()
1831  pte_unmap_unlock(pte - 1, ptl)
1832  Return err
Caller
NameDescribe
remap_pmd_range