Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__install_special_mapping

Proto:static struct vm_area_struct *__install_special_mapping(struct mm_struct *mm, unsigned long addr, unsigned long len, unsigned long vm_flags, void *priv, const struct vm_operations_struct *ops)

Type:struct vm_area_struct

Parameter:

TypeParameterName
struct mm_struct *mm
unsigned longaddr
unsigned longlen
unsigned longvm_flags
void *priv
const struct vm_operations_struct *ops
3381  vma = vm_area_alloc(mm)
3382  If Value for the false possibility is greater at compile time(vma == NULL) Then Return ERR_PTR( - ENOMEM)
3385  Our start address within vm_mm. = addr
3386  The first byte after our end addresswithin vm_mm. = addr + len
3388  Flags, see mm.h. = vm_flags | def_flags | Cannot expand with mremap() | VM_SOFTDIRTY
3389  Access permissions of this VMA. = vm_get_page_prot(Flags, see mm.h. )
3391  Function pointers to deal with this struct. = ops
3392  was vm_pte (shared mem) = priv
3394  ret = Insert vm structure into process list sorted by address* and into the inode's i_mmap tree. If vm_file is non-NULL* then i_mmap_rwsem is taken here.
3395  If ret Then Go to out
3398  vm_stat_account(mm, Flags, see mm.h. , len >> PAGE_SHIFT determines the page size )
3400  perf_event_mmap(vma)
3402  Return vma
3404  out :
3405  vm_area_free(vma)
3406  Return ERR_PTR(ret)
Caller
NameDescribe
_install_special_mappingCalled with mm->mmap_sem held for writing.* Insert a new vma covering the given region, with the given flags.* Its pages are supplied by the given array of struct page *.* The array can be shorter than len >> PAGE_SHIFT if it's null-terminated.
install_special_mapping