hw/ppc/spapr: Fix segfault when instantiating a 'pc-dimm' without 'memdev'
[qemu.git] / include / hw / nmi.h
blobd092c684a160fdc941ebeebb5217e61956ac4491
1 /*
2 * NMI monitor handler class and helpers definitions.
4 * Copyright IBM Corp., 2014
6 * Author: Alexey Kardashevskiy <aik@ozlabs.ru>
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.
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.
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/>.
22 #ifndef NMI_H
23 #define NMI_H
25 #include "qemu-common.h"
26 #include "qom/object.h"
28 #define TYPE_NMI "nmi"
30 #define NMI_CLASS(klass) \
31 OBJECT_CLASS_CHECK(NMIClass, (klass), TYPE_NMI)
32 #define NMI_GET_CLASS(obj) \
33 OBJECT_GET_CLASS(NMIClass, (obj), TYPE_NMI)
34 #define NMI(obj) \
35 INTERFACE_CHECK(NMI, (obj), TYPE_NMI)
37 typedef struct NMIState {
38 Object parent_obj;
39 } NMIState;
41 typedef struct NMIClass {
42 InterfaceClass parent_class;
44 void (*nmi_monitor_handler)(NMIState *n, int cpu_index, Error **errp);
45 } NMIClass;
47 void nmi_monitor_handle(int cpu_index, Error **errp);
49 #endif /* NMI_H */