函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:add a VMA into a process's mm_struct in the appropriate place in the list* and tree and add to the address space's page tree also if not an anonymous* page* - should be called with mm->mmap_sem held writelocked

函数原型:static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma)

返回类型:void

参数:

类型参数名称
struct mm_struct *mm
struct vm_area_struct *vma
599  BUG_ON(!vm_region)
601  number of VMAs 自加
602  The address space we belong to. 等于mm
605  如果File we map to (can be NULL).
606  mapping等于f_mapping
608  i_mmap_lock_write(mapping)
609  flush_dcache_mmap_lock(mapping)
610  vma_interval_tree_insert(vma, & i_mmap)
611  flush_dcache_mmap_unlock(mapping)
612  i_mmap_unlock_write(mapping)
616  parent = rb_prev = NULL
617  p等于rb_node
618 p循环
619  parent等于p
620  pvma等于rb_entry(parent, structvm_area_struct, vm_rb)
624  如果Our start address within vm_mm. 小于Our start address within vm_mm. p等于rb_left
627  rb_prev等于parent
628  p等于rb_right
629  否则如果The first byte after our end addresswithin vm_mm. 小于The first byte after our end addresswithin vm_mm. p等于rb_left
632  rb_prev等于parent
633  p等于rb_right
634  否则如果vma小于pvmap等于rb_left
636  否则如果vma大于pvma
637  rb_prev等于parent
638  p等于rb_right
639  否则BUG()
643  rb_link_node( & vm_rb, parent, p)
644  rb_insert_color( & vm_rb, & mm_rb)
647  prev = NULL
648  如果rb_prevprev等于rb_entry(rb_prev, structvm_area_struct, vm_rb)
651  __vma_link_list(mm, vma, prev)
调用者
名称描述
do_mmaphandle mapping creation for uClinux
split_vmasplit a vma into two pieces at address 'addr', a new vma is allocated either* for the first part or the tail.
shrink_vmashrink a VMA by removing the specified chunk from either the beginning or* the end