blob: 7c3debb47c87aba02aa87c46531aa188b0cf3412 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Chen, Gongd963cd92014-06-11 14:02:20 -07002#ifndef __RAS_H__
3#define __RAS_H__
4
Borislav Petkov011d8262017-03-27 11:33:02 +02005#include <asm/errno.h>
Tyler Baicar297b64c2017-06-21 12:17:12 -06006#include <linux/uuid.h>
Tyler Baicare9279e82017-06-21 12:17:13 -06007#include <linux/cper.h>
Borislav Petkov011d8262017-03-27 11:33:02 +02008
Chen, Gongd963cd92014-06-11 14:02:20 -07009#ifdef CONFIG_DEBUG_FS
10int ras_userspace_consumers(void);
11void ras_debugfs_init(void);
12int ras_add_daemon_trace(void);
13#else
14static inline int ras_userspace_consumers(void) { return 0; }
Borislav Petkov011d8262017-03-27 11:33:02 +020015static inline void ras_debugfs_init(void) { }
Chen, Gongd963cd92014-06-11 14:02:20 -070016static inline int ras_add_daemon_trace(void) { return 0; }
17#endif
18
Borislav Petkov011d8262017-03-27 11:33:02 +020019#ifdef CONFIG_RAS_CEC
20void __init cec_init(void);
21int __init parse_cec_param(char *str);
22int cec_add_elem(u64 pfn);
23#else
24static inline void __init cec_init(void) { }
25static inline int cec_add_elem(u64 pfn) { return -ENODEV; }
Chen, Gongd963cd92014-06-11 14:02:20 -070026#endif
Borislav Petkov011d8262017-03-27 11:33:02 +020027
Tyler Baicar297b64c2017-06-21 12:17:12 -060028#ifdef CONFIG_RAS
29void log_non_standard_event(const guid_t *sec_type,
30 const guid_t *fru_id, const char *fru_text,
31 const u8 sev, const u8 *err, const u32 len);
Tyler Baicare9279e82017-06-21 12:17:13 -060032void log_arm_hw_error(struct cper_sec_proc_arm *err);
Tyler Baicar297b64c2017-06-21 12:17:12 -060033#else
Arnd Bergmann06075122017-06-27 17:35:41 +020034static inline void
35log_non_standard_event(const guid_t *sec_type,
36 const guid_t *fru_id, const char *fru_text,
37 const u8 sev, const u8 *err, const u32 len)
38{ return; }
39static inline void
40log_arm_hw_error(struct cper_sec_proc_arm *err) { return; }
Tyler Baicar297b64c2017-06-21 12:17:12 -060041#endif
42
Borislav Petkov011d8262017-03-27 11:33:02 +020043#endif /* __RAS_H__ */