Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\mtrr\generic.c Create Date:2022-07-28 08:06:21
Last Modify:2022-05-18 17:45:43 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:generic_set_mtrr - set variable MTRR register on the local CPU.*@reg: The register to set.*@base: The base address of the region.*@size: The size of the region. If this is 0 the region is disabled.*@type: The type of the region.* Returns nothing.

Proto:static void generic_set_mtrr(unsigned int reg, unsigned long base, unsigned long size, mtrr_type type)

Type:void

Parameter:

TypeParameterName
unsigned intreg
unsigned longbase
unsigned longsize
mtrr_typetype
837  vr = var_ranges[reg]
839  local_irq_save(flags)
840  Since we are disabling the cache don't allow any interrupts,* they would run extremely slow and would only increase the pain.* The caller must ensure that local interrupts are disabled and* are reenabled after post_set() has been called.
842  If size == 0 Then
847  Doesn't attempt to pass an error out to MTRR users* because it's quite complicated in some cases and probably not* worth it because the best error handling is to ignore it.
848  memset(vr, 0, sizeof(structmtrr_var_range))
849  Else
850  base_lo = base << PAGE_SHIFT determines the page size | type
851  base_hi = (base & size_and_mask) >> 32 - PAGE_SHIFT determines the page size
852  mask_lo = -size << PAGE_SHIFT determines the page size | 0x800
853  mask_hi = (-size & size_and_mask) >> 32 - PAGE_SHIFT determines the page size
855  Doesn't attempt to pass an error out to MTRR users* because it's quite complicated in some cases and probably not* worth it because the best error handling is to ignore it.
856  Doesn't attempt to pass an error out to MTRR users* because it's quite complicated in some cases and probably not* worth it because the best error handling is to ignore it.
859  post_set()
860  local_irq_restore(flags)