函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\mtrr\cleanup.c Create Date:2022-07-27 09:06:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:mtrr_trim_uncached_memory - trim RAM not covered by MTRRs*@end_pfn: ending page frame number* Some buggy BIOSes don't setup the MTRRs properly for systems with certain* memory configurations

函数原型:int __init mtrr_trim_uncached_memory(unsigned long end_pfn)

返回类型:int

参数:

类型参数名称
unsigned longend_pfn
879  highest_pfn等于0
889  如果非is_cpu(INTEL)或disable_mtrr_trim则返回:0
892  Access to machine-specific registers (available on 586 and better only)* Note: the rd* operations modify the parameters directly (without using* pointer indirection), this allows gcc to optimize better(MSR_MTRRdefType, def, dummy)
893  def与等于0xff
894  如果def不等于MTRR memory types, which are defined in SDM 则返回:0
898  memset(range_state, 0, range_state的长度)
899 i小于num_var_ranges循环
900  get(i, & base, & size, & type)
901  base_pfn等于base
902  size_pfn等于size
903  type等于type
907 i小于num_var_ranges循环
908  type等于type
909  如果type不等于MTRR_TYPE_WRBACK则继续下一循环
911  base等于base_pfn
912  size等于size_pfn
913  如果highest_pfn小于basesizehighest_pfn等于basesize
918  如果非highest_pfn
919  打印信息("CPU MTRRs all blank - virtualized system.\n")
920  返回:0
924  memset(num, 0, num的长度)
925 i小于num_var_ranges循环
926  type等于type
927  如果type大于等于MTRR_NUM_TYPES则继续下一循环
929  size等于size_pfn
930  如果非sizetype等于MTRR_NUM_TYPES
932  num[type]自加
936  如果非num[MTRR_TYPE_WRBACK]则返回:0
940  如果num[MTRR_TYPE_WRBACK]加num[MTRR memory types, which are defined in SDM ]不等于num_var_rangesnum[MTRR_NUM_TYPES]则返回:0
944  memset(range, 0, range的长度)
945  nr_range等于0
946  如果mtrr_tom2
947  start等于1ULL左移32减PAGE_SHIFT determines the page size
948  end等于mtrr_tom2右移PAGE_SHIFT determines the page size
949  如果highest_pfn小于endhighest_pfn等于end
951  nr_range自加
953  nr_range等于x86_get_mtrr_mem_range(range, nr_range, 0, 0)
956  total_trim_size等于0
957  如果starttotal_trim_size加等于real_trim_memory(0, start)
961 i小于nr_range减1循环
962  如果end小于starttotal_trim_size加等于real_trim_memory(end, start)
968  i等于nr_range减1
969  如果end小于end_pfntotal_trim_size加等于real_trim_memory(end, end_pfn)
973  如果total_trim_size
974  打印警告信息("WARNING: BIOS bug: CPU MTRRs don't cover all of memory, losing %lluMB of RAM.\n", total_trim_size >> 20)
977  如果非changed_by_mtrr_cleanupWARN_ON(1)
980  打印信息("update e820 for mtrr\n")
981  e820__update_table_print()
983  返回:1
986  返回:0