Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kcov_mmap

Proto:static int kcov_mmap(struct file *filep, struct vm_area_struct *vma)

Type:int

Parameter:

TypeParameterName
struct file *filep
struct vm_area_struct *vma
444  res = 0
446  kcov = private_data
450  area = vmalloc_user(The first byte after our end addresswithin vm_mm. - Our start address within vm_mm. )
451  If Not area Then Return -ENOMEM
454  spin_lock( & The lock protects mode, size, area and t. )
455  size = Size of arena (in long's). * sizeof(unsignedlong)
456  If mode != KCOV_MODE_INIT || Offset (within vm_file) in PAGE_SIZEunits != 0 || The first byte after our end addresswithin vm_mm. - Our start address within vm_mm. != size Then
458  res = -EINVAL
459  Go to exit
461  If Not Coverage buffer shared with user space. Then
462  Coverage buffer shared with user space. = area
463  Flags, see mm.h. |= Cannot expand with mremap()
464  spin_unlock( & The lock protects mode, size, area and t. )
465  When off < size cycle
470  Return 0
472  exit :
473  spin_unlock( & The lock protects mode, size, area and t. )
474  vfree(area)
475  Return res