函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory.c Create Date:2022-07-27 16:08:28
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:map_pfn_range - remap kernel memory to userspace*@vma: user vma to map to*@addr: target user address to start at*@pfn: physical address of kernel memory*@size: size of map area*@prot: page protection flags for this mapping

函数原型:int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn, unsigned long size, pgprot_t prot)

返回类型:int

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longaddr
unsigned longpfn
unsigned longsize
pgprot_tprot
1919  end等于addr align the pointer to the (next) page boundary (size)
1920  mm等于The address space we belong to.
1921  remap_pfn等于pfn
1942  如果is_cow_mapping(Flags, see mm.h. )则
1943  如果addr不等于Our start address within vm_mm. end不等于The first byte after our end addresswithin vm_mm. 则返回:负EINVAL
1945  Offset (within vm_file) in PAGE_SIZEunits 等于pfn
1948  err等于track_pfn_remap(vma, & prot, remap_pfn, addr, align the pointer to the (next) page boundary (size))
1949  如果err则返回:负EINVAL
1952  Flags, see mm.h. 或等于Memory mapped I/O or similar 按位或Page-ranges managed without "struct page", just pure PFN 按位或Cannot expand with mremap() 按位或Do not include in the core dump
1954  BUG_ON(addr >= end)
1955  pfn减等于addr右移PAGE_SHIFT determines the page size
1956  pgd等于a shortcut to get a pgd_t in a given mm(mm, addr)
1957  flush_cache_range(vma, addr, end)
1958  循环
1959  next等于When walking page tables, get the address of the next boundary,* or the end address of the range if that comes earlier. Although no* vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.(addr, end)
1960  err等于remap_p4d_range(mm, pgd, addr, next, pfn + (addr >> PAGE_SHIFT determines the page size ), prot)
1962  如果err退出
1964 pgd自加, addr等于next, addr不等于end循环
1966  如果erruntrack_pfn(vma, remap_pfn, align the pointer to the (next) page boundary (size))
1969  返回:err
调用者
名称描述
dma_direct_mmap
__dma_mmap_from_coherent