函数逻辑报告 |
Source Code:mm\gup.c |
Create Date:2022-07-27 16:00:52 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:__get_user_pages() - pin user pages in memory*@tsk: task_struct of target task*@mm: mm_struct of target mm*@start: starting user address*@nr_pages: number of pages from start to pin*@gup_flags: flags modifying pin behaviour
函数原型:static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas, int *nonblocking)
返回类型:long
参数:
类型 | 参数 | 名称 |
---|---|---|
struct task_struct * | tsk | |
struct mm_struct * | mm | |
unsigned long | start | |
unsigned long | nr_pages | |
unsigned int | gup_flags | |
struct page ** | pages | |
struct vm_area_struct ** | vmas | |
int * | nonblocking |
791 | struct vm_area_struct * vma = NULL |
792 | struct follow_page_context ctx = {NULL} |
794 | 如果非nr_pages则返回:0 |
799 | VM_BUG_ON(!!pages != !!(gup_flags & do get_page on page )) |
806 | 如果非gup_flags按位与get_user_pages read/write w/o permission 的值则gup_flags或等于rce NUMA hinting page fault |
809 | 循环 |
811 | foll_flags等于gup_flags |
816 | vma等于find_extend_vma(mm, start) |
817 | 如果非vma且in_gate_area(mm, start)则 |
827 | 如果非vma或check_vma_flags(vma, gup_flags)则 |
831 | 如果is_vm_hugetlb_page(vma)则 |
838 | retry : |
843 | 如果fatal_signal_pending(当前进程)则 |
845 | 转到:out |
847 | cond_resched() |
850 | 如果非page则 |
855 | 转到:retry |
857 | ret等于0 |
862 | 转到:out |
864 | 转到:next_page |
866 | BUG() |
872 | 转到:next_page |
873 | 否则如果是错误则 |
877 | 如果pages则 |
883 | next_page : |
884 | 如果vmas则 |
888 | page_increm等于1加start右移PAGE_SHIFT determines the page size 位的值的反按位与page_mask的值 |
889 | 如果page_increm大于nr_pages则page_increm等于nr_pages |
891 | i加等于page_increm |
892 | start加等于page_increm乘PAGE_SIZE |
893 | nr_pages减等于page_increm |
895 | out : |
896 | 如果pgmap则put_dev_pagemap(pgmap) |
名称 | 描述 |
---|---|
__get_user_pages_locked | |
populate_vma_page_range | populate_vma_page_range() - populate a range of pages in the vma |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |