xref: /openbmc/qemu/include/hw/nmi.h (revision 64bc77eb2c0809f11860cfe53d47e9c6f77e85f3)
19cb805fdSAlexey Kardashevskiy /*
29cb805fdSAlexey Kardashevskiy  *  NMI monitor handler class and helpers definitions.
39cb805fdSAlexey Kardashevskiy  *
49cb805fdSAlexey Kardashevskiy  *  Copyright IBM Corp., 2014
59cb805fdSAlexey Kardashevskiy  *
69cb805fdSAlexey Kardashevskiy  *  Author: Alexey Kardashevskiy <aik@ozlabs.ru>
79cb805fdSAlexey Kardashevskiy  *
89cb805fdSAlexey Kardashevskiy  *  This program is free software; you can redistribute it and/or modify
99cb805fdSAlexey Kardashevskiy  *  it under the terms of the GNU General Public License as published by
109cb805fdSAlexey Kardashevskiy  *  the Free Software Foundation; either version 2 of the License,
119cb805fdSAlexey Kardashevskiy  *  or (at your option) any later version.
129cb805fdSAlexey Kardashevskiy  *
139cb805fdSAlexey Kardashevskiy  *  This program is distributed in the hope that it will be useful,
149cb805fdSAlexey Kardashevskiy  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
159cb805fdSAlexey Kardashevskiy  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
169cb805fdSAlexey Kardashevskiy  *  GNU General Public License for more details.
179cb805fdSAlexey Kardashevskiy  *
189cb805fdSAlexey Kardashevskiy  *  You should have received a copy of the GNU General Public License
199cb805fdSAlexey Kardashevskiy  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
209cb805fdSAlexey Kardashevskiy  */
219cb805fdSAlexey Kardashevskiy 
229cb805fdSAlexey Kardashevskiy #ifndef NMI_H
23175de524SMarkus Armbruster #define NMI_H
249cb805fdSAlexey Kardashevskiy 
259cb805fdSAlexey Kardashevskiy #include "qom/object.h"
269cb805fdSAlexey Kardashevskiy 
279cb805fdSAlexey Kardashevskiy #define TYPE_NMI "nmi"
289cb805fdSAlexey Kardashevskiy 
299cb805fdSAlexey Kardashevskiy #define NMI_CLASS(klass) \
309cb805fdSAlexey Kardashevskiy      OBJECT_CLASS_CHECK(NMIClass, (klass), TYPE_NMI)
319cb805fdSAlexey Kardashevskiy #define NMI_GET_CLASS(obj) \
329cb805fdSAlexey Kardashevskiy     OBJECT_GET_CLASS(NMIClass, (obj), TYPE_NMI)
339cb805fdSAlexey Kardashevskiy #define NMI(obj) \
34*64bc77ebSPhilippe Mathieu-Daudé      INTERFACE_CHECK(NMIState, (obj), TYPE_NMI)
359cb805fdSAlexey Kardashevskiy 
36aa1b35b9SMarc-André Lureau typedef struct NMIState NMIState;
379cb805fdSAlexey Kardashevskiy 
389cb805fdSAlexey Kardashevskiy typedef struct NMIClass {
399cb805fdSAlexey Kardashevskiy     InterfaceClass parent_class;
409cb805fdSAlexey Kardashevskiy 
419cb805fdSAlexey Kardashevskiy     void (*nmi_monitor_handler)(NMIState *n, int cpu_index, Error **errp);
429cb805fdSAlexey Kardashevskiy } NMIClass;
439cb805fdSAlexey Kardashevskiy 
449cb805fdSAlexey Kardashevskiy void nmi_monitor_handle(int cpu_index, Error **errp);
459cb805fdSAlexey Kardashevskiy 
469cb805fdSAlexey Kardashevskiy #endif /* NMI_H */
47