xref: /qemu/target/i386/hvf/panic.h (revision 8af82b8e81db9ac32ff1822d5beef0b246dac3d1)
1c97d6d2cSSergio Andres Gomez Del Real /*
2c97d6d2cSSergio Andres Gomez Del Real  * Copyright (C) 2016 Veertu Inc,
3c97d6d2cSSergio Andres Gomez Del Real  * Copyright (C) 2017 Google Inc,
4c97d6d2cSSergio Andres Gomez Del Real  *
5c97d6d2cSSergio Andres Gomez Del Real  * This program is free software; you can redistribute it and/or
6996feed4SSergio Andres Gomez Del Real  * modify it under the terms of the GNU Lesser General Public
7996feed4SSergio Andres Gomez Del Real  * License as published by the Free Software Foundation; either
8*8af82b8eSChetan Pant  * version 2.1 of the License, or (at your option) any later version.
9c97d6d2cSSergio Andres Gomez Del Real  *
10c97d6d2cSSergio Andres Gomez Del Real  * This program is distributed in the hope that it will be useful,
11c97d6d2cSSergio Andres Gomez Del Real  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12996feed4SSergio Andres Gomez Del Real  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13996feed4SSergio Andres Gomez Del Real  * Lesser General Public License for more details.
14c97d6d2cSSergio Andres Gomez Del Real  *
15996feed4SSergio Andres Gomez Del Real  * You should have received a copy of the GNU Lesser General Public
16996feed4SSergio Andres Gomez Del Real  * License along with this program; if not, see <http://www.gnu.org/licenses/>.
17c97d6d2cSSergio Andres Gomez Del Real  */
18895f9fdfSPaolo Bonzini #ifndef HVF_PANIC_H
19895f9fdfSPaolo Bonzini #define HVF_PANIC_H
20c97d6d2cSSergio Andres Gomez Del Real 
21c97d6d2cSSergio Andres Gomez Del Real #define VM_PANIC(x) {\
22c97d6d2cSSergio Andres Gomez Del Real     printf("%s\n", x); \
23c97d6d2cSSergio Andres Gomez Del Real     abort(); \
24c97d6d2cSSergio Andres Gomez Del Real }
25c97d6d2cSSergio Andres Gomez Del Real 
26c97d6d2cSSergio Andres Gomez Del Real #define VM_PANIC_ON(x) {\
27c97d6d2cSSergio Andres Gomez Del Real     if (x) { \
28c97d6d2cSSergio Andres Gomez Del Real         printf("%s\n", #x); \
29c97d6d2cSSergio Andres Gomez Del Real         abort(); \
30c97d6d2cSSergio Andres Gomez Del Real     } \
31c97d6d2cSSergio Andres Gomez Del Real }
32c97d6d2cSSergio Andres Gomez Del Real 
33c97d6d2cSSergio Andres Gomez Del Real #define VM_PANIC_EX(...) {\
34c97d6d2cSSergio Andres Gomez Del Real     printf(__VA_ARGS__); \
35c97d6d2cSSergio Andres Gomez Del Real     abort(); \
36c97d6d2cSSergio Andres Gomez Del Real }
37c97d6d2cSSergio Andres Gomez Del Real 
38c97d6d2cSSergio Andres Gomez Del Real #define VM_PANIC_ON_EX(x, ...) {\
39c97d6d2cSSergio Andres Gomez Del Real     if (x) { \
40c97d6d2cSSergio Andres Gomez Del Real         printf(__VA_ARGS__); \
41c97d6d2cSSergio Andres Gomez Del Real         abort(); \
42c97d6d2cSSergio Andres Gomez Del Real     } \
43c97d6d2cSSergio Andres Gomez Del Real }
44c97d6d2cSSergio Andres Gomez Del Real 
45c97d6d2cSSergio Andres Gomez Del Real #endif
46