coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mca_common_bert.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <amdblocks/mca.h>
4 #include <cper.h>
5 #include <types.h>
6 #include "mca_common_defs.h"
7 
9 {
10  int error = mca_err_type(mci->sts);
11 
12  if (error == MCA_ERRTYPE_BUS)
13  return X86_PROCESSOR_BUS_CHK;
14  if (error == MCA_ERRTYPE_INT)
15  return X86_PROCESSOR_MS_CHK;
16  if (error == MCA_ERRTYPE_MEM)
18  if (error == MCA_ERRTYPE_TLB)
19  return X86_PROCESSOR_TLB_CHK;
20 
21  return X86_PROCESSOR_MS_CHK; /* unrecognized */
22 }
23 
24 /* Fill additional information in the Generic Processor Error Section. */
26  struct mca_bank_status *mci)
27 {
28  int type = mca_err_type(mci->sts);
29 
30  if (type == MCA_ERRTYPE_BUS) /* try to map MCA errors to CPER types */
32  else if (type == MCA_ERRTYPE_INT)
34  else if (type == MCA_ERRTYPE_MEM)
36  else if (type == MCA_ERRTYPE_TLB)
38  else
41 }
#define GENPROC_ERRTYPE_TLB
Definition: cper.h:134
cper_x86_check_type
Definition: cper.h:200
@ X86_PROCESSOR_MS_CHK
Definition: cper.h:204
@ X86_PROCESSOR_CACHE_CHK
Definition: cper.h:201
@ X86_PROCESSOR_BUS_CHK
Definition: cper.h:203
@ X86_PROCESSOR_TLB_CHK
Definition: cper.h:202
#define GENPROC_ERRTYPE_CACHE
Definition: cper.h:133
#define GENPROC_VALID_PROC_ERR_TYPE
Definition: cper.h:106
#define GENPROC_ERRTYPE_UNKNOWN
Definition: cper.h:132
#define GENPROC_ERRTYPE_BUS
Definition: cper.h:135
#define GENPROC_ERRTYPE_UARCH
Definition: cper.h:136
static enum mca_err_code_types mca_err_type(msr_t reg)
Definition: msr.h:316
@ MCA_ERRTYPE_INT
Definition: msr.h:313
@ MCA_ERRTYPE_BUS
Definition: msr.h:312
@ MCA_ERRTYPE_TLB
Definition: msr.h:310
@ MCA_ERRTYPE_MEM
Definition: msr.h:311
unsigned int type
Definition: edid.c:57
void fill_generic_section(cper_proc_generic_error_section_t *sec, struct mca_bank_status *mci)
enum cper_x86_check_type error_to_chktype(struct mca_bank_status *mci)
msr_t sts
Definition: mca.h:11