1*9cb805fdSAlexey Kardashevskiy /* 2*9cb805fdSAlexey Kardashevskiy * NMI monitor handler class and helpers definitions. 3*9cb805fdSAlexey Kardashevskiy * 4*9cb805fdSAlexey Kardashevskiy * Copyright IBM Corp., 2014 5*9cb805fdSAlexey Kardashevskiy * 6*9cb805fdSAlexey Kardashevskiy * Author: Alexey Kardashevskiy <aik@ozlabs.ru> 7*9cb805fdSAlexey Kardashevskiy * 8*9cb805fdSAlexey Kardashevskiy * This program is free software; you can redistribute it and/or modify 9*9cb805fdSAlexey Kardashevskiy * it under the terms of the GNU General Public License as published by 10*9cb805fdSAlexey Kardashevskiy * the Free Software Foundation; either version 2 of the License, 11*9cb805fdSAlexey Kardashevskiy * or (at your option) any later version. 12*9cb805fdSAlexey Kardashevskiy * 13*9cb805fdSAlexey Kardashevskiy * This program is distributed in the hope that it will be useful, 14*9cb805fdSAlexey Kardashevskiy * but WITHOUT ANY WARRANTY; without even the implied warranty of 15*9cb805fdSAlexey Kardashevskiy * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16*9cb805fdSAlexey Kardashevskiy * GNU General Public License for more details. 17*9cb805fdSAlexey Kardashevskiy * 18*9cb805fdSAlexey Kardashevskiy * You should have received a copy of the GNU General Public License 19*9cb805fdSAlexey Kardashevskiy * along with this program; if not, see <http://www.gnu.org/licenses/>. 20*9cb805fdSAlexey Kardashevskiy */ 21*9cb805fdSAlexey Kardashevskiy 22*9cb805fdSAlexey Kardashevskiy #ifndef NMI_H 23*9cb805fdSAlexey Kardashevskiy #define NMI_H 1 24*9cb805fdSAlexey Kardashevskiy 25*9cb805fdSAlexey Kardashevskiy #include "qemu-common.h" 26*9cb805fdSAlexey Kardashevskiy #include "qom/object.h" 27*9cb805fdSAlexey Kardashevskiy 28*9cb805fdSAlexey Kardashevskiy #define TYPE_NMI "nmi" 29*9cb805fdSAlexey Kardashevskiy 30*9cb805fdSAlexey Kardashevskiy #define NMI_CLASS(klass) \ 31*9cb805fdSAlexey Kardashevskiy OBJECT_CLASS_CHECK(NMIClass, (klass), TYPE_NMI) 32*9cb805fdSAlexey Kardashevskiy #define NMI_GET_CLASS(obj) \ 33*9cb805fdSAlexey Kardashevskiy OBJECT_GET_CLASS(NMIClass, (obj), TYPE_NMI) 34*9cb805fdSAlexey Kardashevskiy #define NMI(obj) \ 35*9cb805fdSAlexey Kardashevskiy INTERFACE_CHECK(NMI, (obj), TYPE_NMI) 36*9cb805fdSAlexey Kardashevskiy 37*9cb805fdSAlexey Kardashevskiy typedef struct NMIState { 38*9cb805fdSAlexey Kardashevskiy Object parent_obj; 39*9cb805fdSAlexey Kardashevskiy } NMIState; 40*9cb805fdSAlexey Kardashevskiy 41*9cb805fdSAlexey Kardashevskiy typedef struct NMIClass { 42*9cb805fdSAlexey Kardashevskiy InterfaceClass parent_class; 43*9cb805fdSAlexey Kardashevskiy 44*9cb805fdSAlexey Kardashevskiy void (*nmi_monitor_handler)(NMIState *n, int cpu_index, Error **errp); 45*9cb805fdSAlexey Kardashevskiy } NMIClass; 46*9cb805fdSAlexey Kardashevskiy 47*9cb805fdSAlexey Kardashevskiy void nmi_monitor_handle(int cpu_index, Error **errp); 48*9cb805fdSAlexey Kardashevskiy 49*9cb805fdSAlexey Kardashevskiy #endif /* NMI_H */ 50