Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:map_vmalloc_range_partial - map vmalloc pages to userspace*@vma: vma to cover*@uaddr: target user address to start at*@kaddr: virtual address of vmalloc kernel memory*@size: size of map area* Returns: 0 for success, -Exxx on failure* This function checks

Proto:int remap_vmalloc_range_partial(struct vm_area_struct *vma, unsigned long uaddr, void *kaddr, unsigned long size)

Type:int

Parameter:

TypeParameterName
struct vm_area_struct *vma
unsigned longuaddr
void *kaddr
unsigned longsize
3065  size = align the pointer to the (next) page boundary (size)
3067  If Not st whether an address (unsigned long or pointer) is aligned to PAGE_SIZE (uaddr) || Not st whether an address (unsigned long or pointer) is aligned to PAGE_SIZE (kaddr) Then Return -EINVAL
3070  area = d_vm_area - find a continuous kernel virtual area*@addr: base address* Search for the kernel VM area starting at @addr, and return it
3071  If Not area Then Return -EINVAL
3074  If Not (flags & (suitable for remap_vmalloc_range | dma_alloc_coherent )) Then Return -EINVAL
3077  If kaddr + size > addr + Lowlevel-APIs (not for driver use!) Then Return -EINVAL
3080  Do
3081  page = Walk a vmap address to the struct page it maps.
3084  ret = vm_insert_page - insert single page into user vma*@vma: user vma to map to*@addr: target user address of this page*@page: source kernel page* This allows drivers to insert individual pages they've allocated* into a user vma.
3085  If ret Then Return ret
3088  uaddr += PAGE_SIZE
3089  kaddr += PAGE_SIZE
3090  size -= PAGE_SIZE
3091  When size > 0 cycle
3093  Flags, see mm.h. |= Cannot expand with mremap() | Do not include in the core dump
3095  Return 0
Caller
NameDescribe
remap_vmalloc_rangemap_vmalloc_range - map vmalloc pages to userspace*@vma: vma to cover (map full range of vma)*@addr: vmalloc memory*@pgoff: number of pages into addr before first page to map* Returns: 0 for success, -Exxx on failure* This function checks that addr is a