coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mca.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <amdblocks/mca.h>
4 #include <cpu/x86/msr.h>
5 #include <types.h>
6 
7 static const char *const mca_bank_name[] = {
8  [0] = "Load-store unit",
9  [1] = "Instruction fetch unit",
10  [2] = "L2 cache unit",
11  [3] = "Decode unit",
12  [4] = "",
13  [5] = "Execution unit",
14  [6] = "Floating point unit",
15  [7] = "L3 cache unit",
16  [8] = "L3 cache unit",
17  [9] = "L3 cache unit",
18  [10] = "L3 cache unit",
19  [11] = "L3 cache unit",
20  [12] = "L3 cache unit",
21  [13] = "L3 cache unit",
22  [14] = "L3 cache unit",
23  [15] = "UMC",
24  [16] = "UMC",
25  [17] = "SMU",
26  [18] = "PSP",
27  [19] = "PB",
28  [20] = "CS",
29  [21] = "CS",
30  [22] = "PIE",
31 };
32 
34 {
36 }
37 
38 bool mca_is_valid_bank(unsigned int bank)
39 {
40  return (bank < ARRAY_SIZE(mca_bank_name) && mca_bank_name[bank] != NULL);
41 }
42 
43 const char *mca_get_bank_name(unsigned int bank)
44 {
45  if (mca_is_valid_bank(bank))
46  return mca_bank_name[bank];
47  else
48  return "";
49 }
#define ARRAY_SIZE(a)
Definition: helpers.h:12
bool mca_has_expected_bank_count(void)
Definition: mca.c:38
const char * mca_get_bank_name(unsigned int bank)
Definition: mca.c:48
bool mca_is_valid_bank(unsigned int bank)
Definition: mca.c:43
static unsigned int mca_get_bank_count(void)
Definition: msr.h:169
static const char *const mca_bank_name[]
Definition: mca.c:7
#define NULL
Definition: stddef.h:19