2 * common EDAC components that must be in kernel
4 * Author: Dave Jiang <djiang@mvista.com>
6 * 2007 (c) MontaVista Software, Inc.
7 * 2010 (c) Advanced Micro Devices Inc.
8 * Borislav Petkov <bp@alien8.de>
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
15 #include <linux/module.h>
16 #include <linux/edac.h>
17 #include <linux/atomic.h>
18 #include <linux/device.h>
20 int edac_op_state
= EDAC_OPSTATE_INVAL
;
21 EXPORT_SYMBOL_GPL(edac_op_state
);
23 atomic_t edac_handlers
= ATOMIC_INIT(0);
24 EXPORT_SYMBOL_GPL(edac_handlers
);
26 int edac_err_assert
= 0;
27 EXPORT_SYMBOL_GPL(edac_err_assert
);
29 int edac_report_status
= EDAC_REPORTING_ENABLED
;
30 EXPORT_SYMBOL_GPL(edac_report_status
);
32 static int __init
edac_report_setup(char *str
)
37 if (!strncmp(str
, "on", 2))
38 set_edac_report_status(EDAC_REPORTING_ENABLED
);
39 else if (!strncmp(str
, "off", 3))
40 set_edac_report_status(EDAC_REPORTING_DISABLED
);
41 else if (!strncmp(str
, "force", 5))
42 set_edac_report_status(EDAC_REPORTING_FORCE
);
46 __setup("edac_report=", edac_report_setup
);
49 * called to determine if there is an EDAC driver interested in
50 * knowing an event (such as NMI) occurred
52 int edac_handler_set(void)
54 if (edac_op_state
== EDAC_OPSTATE_POLL
)
57 return atomic_read(&edac_handlers
);
59 EXPORT_SYMBOL_GPL(edac_handler_set
);
62 * handler for NMI type of interrupts to assert error
64 void edac_atomic_assert_error(void)
68 EXPORT_SYMBOL_GPL(edac_atomic_assert_error
);