1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2014 Intel Corporation
6 * Chen, Gong <gong.chen@linux.intel.com>
9 #include <linux/init.h>
10 #include <linux/ras.h>
11 #include <linux/uuid.h>
13 #if IS_ENABLED(CONFIG_AMD_ATL)
15 * Once set, this function pointer should never be unset.
17 * The library module will set this pointer if it successfully loads. The module
18 * should not be unloaded except for testing and debug purposes.
20 static unsigned long (*amd_atl_umc_na_to_spa
)(struct atl_err
*err
);
22 void amd_atl_register_decoder(unsigned long (*f
)(struct atl_err
*))
24 amd_atl_umc_na_to_spa
= f
;
26 EXPORT_SYMBOL_GPL(amd_atl_register_decoder
);
28 void amd_atl_unregister_decoder(void)
30 amd_atl_umc_na_to_spa
= NULL
;
32 EXPORT_SYMBOL_GPL(amd_atl_unregister_decoder
);
34 unsigned long amd_convert_umc_mca_addr_to_sys_addr(struct atl_err
*err
)
36 if (!amd_atl_umc_na_to_spa
)
39 return amd_atl_umc_na_to_spa(err
);
41 EXPORT_SYMBOL_GPL(amd_convert_umc_mca_addr_to_sys_addr
);
42 #endif /* CONFIG_AMD_ATL */
44 #define CREATE_TRACE_POINTS
45 #define TRACE_INCLUDE_PATH ../../include/ras
46 #include <ras/ras_event.h>
48 void log_non_standard_event(const guid_t
*sec_type
, const guid_t
*fru_id
,
49 const char *fru_text
, const u8 sev
, const u8
*err
,
52 trace_non_standard_event(sec_type
, fru_id
, fru_text
, sev
, err
, len
);
55 void log_arm_hw_error(struct cper_sec_proc_arm
*err
)
60 static int __init
ras_init(void)
65 rc
= ras_add_daemon_trace();
69 subsys_initcall(ras_init
);
71 #if defined(CONFIG_ACPI_EXTLOG) || defined(CONFIG_ACPI_EXTLOG_MODULE)
72 EXPORT_TRACEPOINT_SYMBOL_GPL(extlog_mem_event
);
74 EXPORT_TRACEPOINT_SYMBOL_GPL(mc_event
);
75 EXPORT_TRACEPOINT_SYMBOL_GPL(non_standard_event
);
76 EXPORT_TRACEPOINT_SYMBOL_GPL(arm_event
);
78 static int __init
parse_ras_param(char *str
)
86 __setup("ras", parse_ras_param
);