Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\amd_nb.c Create Date:2022-07-28 08:43:46
Last Modify:2020-03-16 21:36:56 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:amd_cache_northbridges

Proto:int amd_cache_northbridges(void)

Type:int

Parameter:Nothing

221  misc_ids = amd_nb_misc_ids
222  link_ids = amd_nb_link_ids
223  root_ids = amd_root_ids
226  roots_per_misc = 0
227  misc_count = 0
228  root_count = 0
231  If num Then Return 0
234  If x86_vendor == X86_VENDOR_HYGON Then
235  root_ids = hygon_root_ids
236  misc_ids = hygon_nb_misc_ids
237  link_ids = hygon_nb_link_ids
240  misc = NULL
241  When ((misc = next_northbridge(misc, misc_ids)) != NULL) cycle
242  misc_count++
244  If Not misc_count Then Return -ENODEV
247  root = NULL
248  When ((root = next_northbridge(root, root_ids)) != NULL) cycle
249  root_count++
251  If root_count Then
252  roots_per_misc = root_count / misc_count
258  If Not roots_per_misc || root_count % roots_per_misc Then
259  pr_info("Unsupported AMD DF/PCI configuration found\n")
260  Return -ENODEV
264  nb = 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).
265  If Not nb Then Return -ENOMEM
268  nb = nb
269  num = misc_count
271  link = misc = root = NULL
272  When i < num cycle
273  root = root = next_northbridge(root, root_ids)
275  misc = misc = next_northbridge(misc, misc_ids)
277  link = link = next_northbridge(link, link_ids)
289  When j < roots_per_misc cycle root = next_northbridge(root, root_ids)
293  If amd_gart_present() Then flags |= AMD_NB_GART
299  If Not cpuid_edx(0x80000006) Then Return 0
306  If x86 == 0x10 && x86_model >= 0x8 && ( x86_model > 0x9 || x86_stepping >= 0x1 ) Then flags |= AMD_NB_L3_INDEX_DISABLE
312  If x86 == 0x15 Then flags |= AMD_NB_L3_INDEX_DISABLE
316  If x86 == 0x15 Then flags |= AMD_NB_L3_PARTITIONING
319  Return 0
Caller
NameDescribe
init_amd_nbs