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