blob: fff41bebc69a245a7f13685139234b690ab28ebd [file] [log] [blame]
Alexey Kardashevskiy9cb805f2014-08-20 22:16:33 +10001/*
2 * NMI monitor handler class and helpers definitions.
3 *
4 * Copyright IBM Corp., 2014
5 *
6 * Author: Alexey Kardashevskiy <aik@ozlabs.ru>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License,
11 * or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef NMI_H
Markus Armbruster175de522016-06-29 15:29:06 +020023#define NMI_H
Alexey Kardashevskiy9cb805f2014-08-20 22:16:33 +100024
Alexey Kardashevskiy9cb805f2014-08-20 22:16:33 +100025#include "qom/object.h"
26
27#define TYPE_NMI "nmi"
28
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040029typedef struct NMIClass NMIClass;
Eduardo Habkost8110fa12020-08-31 17:07:33 -040030DECLARE_CLASS_CHECKERS(NMIClass, NMI,
31 TYPE_NMI)
Alexey Kardashevskiy9cb805f2014-08-20 22:16:33 +100032#define NMI(obj) \
Philippe Mathieu-Daudé64bc77e2019-12-07 10:48:23 +010033 INTERFACE_CHECK(NMIState, (obj), TYPE_NMI)
Alexey Kardashevskiy9cb805f2014-08-20 22:16:33 +100034
Marc-André Lureauaa1b35b2018-12-04 18:20:06 +040035typedef struct NMIState NMIState;
Alexey Kardashevskiy9cb805f2014-08-20 22:16:33 +100036
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040037struct NMIClass {
Alexey Kardashevskiy9cb805f2014-08-20 22:16:33 +100038 InterfaceClass parent_class;
39
40 void (*nmi_monitor_handler)(NMIState *n, int cpu_index, Error **errp);
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040041};
Alexey Kardashevskiy9cb805f2014-08-20 22:16:33 +100042
43void nmi_monitor_handle(int cpu_index, Error **errp);
Alexey Kardashevskiy9cb805f2014-08-20 22:16:33 +100044
45#endif /* NMI_H */