函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\nommu.c Create Date:2022-07-27 16:04:08
Last Modify:2020-03-17 21:26:27 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:int do_munmap(struct mm_struct *mm, unsigned long start, size_t len, struct list_head *uf)

返回类型:int

参数:

类型参数名称
struct mm_struct *mm
unsigned longstart
size_tlen
struct list_head *uf
1492  len等于 align the pointer to the (next) page boundary (len)
1493  如果len恒等于0则返回:负EINVAL
1496  end等于startlen
1499  vma等于Look up the first VMA which satisfies addr < vm_end, NULL if none.
1500  如果非vma
1502  如果limit小于5则
1503  打印警告信息("munmap of memory not mmapped by process %d (%s): 0x%lx-0x%lx\n", pid, comm, start, start + len - 1)
1506  limit自加
1508  返回:负EINVAL
1512  如果File we map to (can be NULL).
1513  循环
1514  如果start大于Our start address within vm_mm. 则返回:负EINVAL
1519 vma循环
1520  返回:负EINVAL
1521  否则
1523  如果start恒等于Our start address within vm_mm. end恒等于The first byte after our end addresswithin vm_mm. 则转到:erase_whole_vma
1525  如果start小于Our start address within vm_mm. end大于The first byte after our end addresswithin vm_mm. 则返回:负EINVAL
1527  如果offset_in_page(start)则返回:负EINVAL
1529  如果end不等于The first byte after our end addresswithin vm_mm. offset_in_page(end)则返回:负EINVAL
1533  如果ret小于0则返回:ret
1536  返回: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  返回:0
调用者
名称描述
vm_munmap
ksys_shmdtdetach and kill segment if marked destroyed.* The work is done in shm_close.