Alexey Kardashevskiy | 9cb805f | 2014-08-20 22:16:33 +1000 | [diff] [blame] | 1 | /* |
| 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 Armbruster | 175de52 | 2016-06-29 15:29:06 +0200 | [diff] [blame] | 23 | #define NMI_H |
Alexey Kardashevskiy | 9cb805f | 2014-08-20 22:16:33 +1000 | [diff] [blame] | 24 | |
Alexey Kardashevskiy | 9cb805f | 2014-08-20 22:16:33 +1000 | [diff] [blame] | 25 | #include "qom/object.h" |
| 26 | |
| 27 | #define TYPE_NMI "nmi" |
| 28 | |
Eduardo Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 29 | typedef struct NMIClass NMIClass; |
Eduardo Habkost | 8110fa1 | 2020-08-31 17:07:33 -0400 | [diff] [blame] | 30 | DECLARE_CLASS_CHECKERS(NMIClass, NMI, |
| 31 | TYPE_NMI) |
Alexey Kardashevskiy | 9cb805f | 2014-08-20 22:16:33 +1000 | [diff] [blame] | 32 | #define NMI(obj) \ |
Philippe Mathieu-Daudé | 64bc77e | 2019-12-07 10:48:23 +0100 | [diff] [blame] | 33 | INTERFACE_CHECK(NMIState, (obj), TYPE_NMI) |
Alexey Kardashevskiy | 9cb805f | 2014-08-20 22:16:33 +1000 | [diff] [blame] | 34 | |
Marc-André Lureau | aa1b35b | 2018-12-04 18:20:06 +0400 | [diff] [blame] | 35 | typedef struct NMIState NMIState; |
Alexey Kardashevskiy | 9cb805f | 2014-08-20 22:16:33 +1000 | [diff] [blame] | 36 | |
Eduardo Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 37 | struct NMIClass { |
Alexey Kardashevskiy | 9cb805f | 2014-08-20 22:16:33 +1000 | [diff] [blame] | 38 | InterfaceClass parent_class; |
| 39 | |
| 40 | void (*nmi_monitor_handler)(NMIState *n, int cpu_index, Error **errp); |
Eduardo Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 41 | }; |
Alexey Kardashevskiy | 9cb805f | 2014-08-20 22:16:33 +1000 | [diff] [blame] | 42 | |
| 43 | void nmi_monitor_handle(int cpu_index, Error **errp); |
Alexey Kardashevskiy | 9cb805f | 2014-08-20 22:16:33 +1000 | [diff] [blame] | 44 | |
| 45 | #endif /* NMI_H */ |