Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\mtrr\if.c Create Date:2022-07-28 08:05:30
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:mtrr_file_add

Proto:static int mtrr_file_add(unsigned long base, unsigned long size, unsigned int type, bool increment, struct file *file, int page)

Type:int

Parameter:

TypeParameterName
unsigned longbase
unsigned longsize
unsigned inttype
boolincrement
struct file *file
intpage
41  fcount = FILE_FCOUNT(file)
44  max = num_var_ranges
45  If (fcount == NULL) Then
46  fcount = kcalloc - allocate memory for an array. The memory is set to zero.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
47  If Not fcount Then Return -ENOMEM
49  FILE_FCOUNT(file) = fcount
51  If Not page Then
52  If base & PAGE_SIZE - 1 || size & PAGE_SIZE - 1 Then Return -EINVAL
54  base >>= PAGE_SHIFT determines the page size
55  size >>= PAGE_SHIFT determines the page size
57  reg = mtrr_add_page - Add a memory type region*@base: Physical base address of region in pages (in units of 4 kB!)*@size: Physical size of region in pages (4 kB)*@type: Type of MTRR desired*@increment: If this is true do usage counting on the region* Memory
58  If reg >= 0 Then ++fcount[reg]
60  Return reg
Caller
NameDescribe
mtrr_ioctl