Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:The mincore(2) system call

Proto:SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len, unsigned char __user *, vec)

Type:

Parameter:Nothing

259  start = Architectures that support memory tagging (assigning tags to memory regions,* embedding these tags into addresses that point to these memory regions, and* checking that the memory and the pointer tags match on memory accesses)(start)
262  If start & ~PAGE_MASK Then Return -EINVAL
266  If Not access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.((void__user * )start, len) Then Return -ENOMEM
270  pages = len >> PAGE_SHIFT determines the page size
271  pages += offset_in_page(len) != 0
273  If Not access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(vec, pages) Then Return -EFAULT
276  tmp = __get_free_page(GFP_USER)
277  If Not tmp Then Return -EAGAIN
280  retval = 0
281  When pages cycle
286  lock for reading
287  retval = Do a chunk of "sys_mincore()". We've already checked* all the arguments, we hold the mmap semaphore: we should* just return the amount of info we're asked for.
288  lease a read lock
290  If retval <= 0 Then Break
292  If copy_to_user(vec, tmp, retval) Then
293  retval = -EFAULT
294  Break
296  pages -= retval
297  vec += retval
298  start += retval << PAGE_SHIFT determines the page size
299  retval = 0
301  free_page((unsignedlong)tmp)
302  Return retval