Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\resctrl\pseudo_lock.c Create Date:2022-07-28 08:14:21
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:pseudo_lock_dev_mmap

Proto:static int pseudo_lock_dev_mmap(struct file *filp, struct vm_area_struct *vma)

Type:int

Parameter:

TypeParameterName
struct file *filp
struct vm_area_struct *vma
1473  vsize = The first byte after our end addresswithin vm_mm. - Our start address within vm_mm.
1474  off = Offset (within vm_file) in PAGE_SIZEunits << PAGE_SHIFT determines the page size
1480  mutex_lock( & Mutex to protect rdtgroup access. )
1482  rdtgrp = needed for tty driver, and maybe others
1483  WARN_ON(!rdtgrp)
1484  If Not rdtgrp Then
1485  mutex_unlock( & Mutex to protect rdtgroup access. )
1486  Return -ENODEV
1489  plr = plr
1491  If Not d Then
1492  mutex_unlock( & Mutex to protect rdtgroup access. )
1493  Return -ENODEV
1502  If Not pumask_subset - (*src1p & ~*src2p) == 0*@src1p: the first input*@src2p: the second input* Returns 1 if *@src1p is a subset of *@src2p, else returns 0 Then
1503  mutex_unlock( & Mutex to protect rdtgroup access. )
1504  Return -EINVAL
1507  physical = __pa(kmem) >> PAGE_SHIFT determines the page size
1508  psize = size - off
1510  If off > size Then
1511  mutex_unlock( & Mutex to protect rdtgroup access. )
1512  Return -ENOSPC
1519  If Not (Flags, see mm.h. & VM_SHARED) Then
1520  mutex_unlock( & Mutex to protect rdtgroup access. )
1521  Return -EINVAL
1524  If vsize > psize Then
1525  mutex_unlock( & Mutex to protect rdtgroup access. )
1526  Return -ENOSPC
1529  memset(kmem + off, 0, vsize)
1531  If remap_pfn_range(vma, Our start address within vm_mm. , physical + Offset (within vm_file) in PAGE_SIZEunits , vsize, Access permissions of this VMA. ) Then
1533  mutex_unlock( & Mutex to protect rdtgroup access. )
1534  Return -EAGAIN
1536  Function pointers to deal with this struct. = pseudo_mmap_ops
1537  mutex_unlock( & Mutex to protect rdtgroup access. )
1538  Return 0