函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\mtrr\generic.c Create Date:2022-07-27 09:06:32
Last Modify:2022-05-18 17:45:43 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:static void generic_set_mtrr(unsigned int reg, unsigned long base, unsigned long size, mtrr_type type)

返回类型:void

参数:

类型参数名称
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  如果size恒等于0则
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  否则
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)