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