Function report |
Source Code:mm\gup.c |
Create Date:2022-07-28 14:34:47 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:get_gate_page
Proto:static int get_gate_page(struct mm_struct *mm, unsigned long address, unsigned int gup_flags, struct vm_area_struct **vma, struct page **page)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct mm_struct * | mm | |
unsigned long | address | |
unsigned int | gup_flags | |
struct vm_area_struct ** | vma | |
struct page ** | page |
572 | If gup_flags & check pte is writable Then Return -EFAULT |
574 | If address > TASK_SIZE Then pgd = a shortcut which implies the use of the kernel's pgd, instead* of a process's(address) |
576 | Else pgd = pgd_offset_gate(mm, address) |
578 | If The "pgd_xxx()" functions here are trivial for a folded two-level* setup: the p4d is never bad, and a p4d always exists (as it's folded* into the pgd entry) Then Return -EFAULT |
580 | p4d = p4d_offset(pgd, address) |
581 | If The "p4d_xxx()" functions here are trivial for a folded two-level* setup: the pud is never bad, and a pud always exists (as it's folded* into the p4d entry) Then Return -EFAULT |
583 | pud = pud_offset(p4d, address) |
584 | If The "pud_xxx()" functions here are trivial for a folded two-level* setup: the pmd is never bad, and a pmd always exists (as it's folded* into the pud entry) Then Return -EFAULT |
586 | pmd = pmd_offset(pud, address) |
587 | If Not pmd_present( * pmd) Then Return -EFAULT |
589 | VM_BUG_ON(pmd_trans_huge( * pmd)) |
590 | pte = pte_offset_map(pmd, address) |
593 | vma = get_gate_vma(mm) |
596 | page = vm_normal_page( * vma, address, * pte) |
597 | If Not page Then |
598 | If gup_flags & give error on hole if it would be zero || Not is_zero_pfn(pte_pfn( * pte)) Then Go to unmap |
602 | If Value for the false possibility is greater at compile time(!try_get_page( * page)) Then |
606 | out : |
607 | ret = 0 |
608 | unmap : |
610 | Return ret |
Name | Describe |
---|---|
__get_user_pages | __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 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |