Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\nommu.c Create Date:2022-07-28 14:37:50
Last Modify:2020-03-17 21:26:27 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lease a mapping* - under NOMMU conditions the chunk to be unmapped must be backed by a single* VMA, though it need not cover the whole VMA

Proto:int do_munmap(struct mm_struct *mm, unsigned long start, size_t len, struct list_head *uf)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
unsigned longstart
size_tlen
struct list_head *uf
1492  len = align the pointer to the (next) page boundary (len)
1493  If len == 0 Then Return -EINVAL
1496  end = start + len
1499  vma = Look up the first VMA which satisfies addr < vm_end, NULL if none.
1500  If Not vma Then
1502  If limit < 5 Then
1503  pr_warn("munmap of memory not mmapped by process %d (%s): 0x%lx-0x%lx\n", pid, comm, start, start + len - 1)
1506  limit++
1508  Return -EINVAL
1512  If File we map to (can be NULL). Then
1513  Do
1519  When vma cycle
1520  Return -EINVAL
1521  Else
1523  If start == Our start address within vm_mm. && end == The first byte after our end addresswithin vm_mm. Then Go to erase_whole_vma
1525  If start < Our start address within vm_mm. || end > The first byte after our end addresswithin vm_mm. Then Return -EINVAL
1527  If offset_in_page(start) Then Return -EINVAL
1529  If end != The first byte after our end addresswithin vm_mm. && offset_in_page(end) Then Return -EINVAL
1533  If ret < 0 Then Return ret
1536  Return shrink a VMA by removing the specified chunk from either the beginning or* the end
1539  erase_whole_vma :
1540  delete a VMA from its owning mm_struct and address space
1541  destroy a VMA record
1542  Return 0
Caller
NameDescribe
vm_munmap