函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory.c Create Date:2022-07-27 16:11:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Access another process' address space as given in mm. If non-NULL, use the* given task for page fault accounting.

函数原型:int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, unsigned long addr, void *buf, int len, unsigned int gup_flags)

返回类型:int

参数:

类型参数名称
struct task_struct *tsk
struct mm_struct *mm
unsigned longaddr
void *buf
intlen
unsigned intgup_flags
4466  old_buf等于buf
4467  write等于gup_flags按位与check pte is writable
4469  如果down_read_killable( & mmap_sem)则返回:0
4473 len循环
4476  struct page * page = NULL
4478  ret等于get_user_pages_remote() - pin user pages in memory*@tsk: the task_struct to use for page fault accounting, or* NULL if faults are not to be recorded
4480  如果ret小于等于0则
4482  退出
4498  否则
4499  bytes等于len
4500  offset等于addr按位与PAGE_SIZE减1
4501  如果bytes大于PAGE_SIZEoffsetbytes等于PAGE_SIZEoffset
4504  maddr等于kmap(page)
4505  如果write
4509  否则
4513  kunmap(page)
4514  put_page(page)
4516  len减等于bytes
4517  buf加等于bytes
4518  addr加等于bytes
4520  lease a read lock
4522  返回:bufold_buf
调用者
名称描述
access_remote_vmaccess_remote_vm - access another process' address space*@mm: the mm_struct of the target address space*@addr: start address to access*@buf: source or destination buffer*@len: number of bytes to transfer*@gup_flags: flags modifying lookup behaviour
access_process_vmAccess another process' address space.* Source/target buffer must be kernel space,* Do not walk the page table directly, use get_user_pages