[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 19/19] i386: hvf: cleanup x86_gen.h
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 19/19] i386: hvf: cleanup x86_gen.h |
Date: |
Wed, 20 Dec 2017 19:03:58 +0100 |
This only includes VM_PANIC now. No need to include it from headers.
Signed-off-by: Paolo Bonzini <address@hidden>
---
target/i386/hvf/panic.h | 45 ++++++++++++++++++++++++++++++++++++++++++++
target/i386/hvf/x86.h | 2 --
target/i386/hvf/x86_decode.c | 2 +-
target/i386/hvf/x86_emu.c | 2 +-
target/i386/hvf/x86_flags.c | 1 +
target/i386/hvf/x86_flags.h | 1 -
target/i386/hvf/x86_mmu.c | 1 +
target/i386/hvf/x86_mmu.h | 2 --
target/i386/hvf/x86_task.c | 1 +
9 files changed, 50 insertions(+), 7 deletions(-)
create mode 100644 target/i386/hvf/panic.h
diff --git a/target/i386/hvf/panic.h b/target/i386/hvf/panic.h
new file mode 100644
index 0000000000..411ef43a5b
--- /dev/null
+++ b/target/i386/hvf/panic.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2016 Veertu Inc,
+ * Copyright (C) 2017 Google Inc,
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef HVF_PANIC_H
+#define HVF_PANIC_H
+
+#define VM_PANIC(x) {\
+ printf("%s\n", x); \
+ abort(); \
+}
+
+#define VM_PANIC_ON(x) {\
+ if (x) { \
+ printf("%s\n", #x); \
+ abort(); \
+ } \
+}
+
+#define VM_PANIC_EX(...) {\
+ printf(__VA_ARGS__); \
+ abort(); \
+}
+
+#define VM_PANIC_ON_EX(x, ...) {\
+ if (x) { \
+ printf(__VA_ARGS__); \
+ abort(); \
+ } \
+}
+
+#endif
diff --git a/target/i386/hvf/x86.h b/target/i386/hvf/x86.h
index ae877f0022..103ec0976c 100644
--- a/target/i386/hvf/x86.h
+++ b/target/i386/hvf/x86.h
@@ -19,8 +19,6 @@
#ifndef HVF_X86_H
#define HVF_X86_H 1
-#include "x86_gen.h"
-
typedef struct x86_register {
union {
struct {
diff --git a/target/i386/hvf/x86_decode.c b/target/i386/hvf/x86_decode.c
index 71d0c3d115..bf93e8207d 100644
--- a/target/i386/hvf/x86_decode.c
+++ b/target/i386/hvf/x86_decode.c
@@ -19,10 +19,10 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
+#include "panic.h"
#include "x86_decode.h"
#include "string.h"
#include "vmx.h"
-#include "x86_gen.h"
#include "x86_mmu.h"
#include "x86_descr.h"
diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c
index 6abcea9d92..3ea18edc68 100644
--- a/target/i386/hvf/x86_emu.c
+++ b/target/i386/hvf/x86_emu.c
@@ -36,7 +36,7 @@
/////////////////////////////////////////////////////////////////////////
#include "qemu/osdep.h"
-
+#include "panic.h"
#include "qemu-common.h"
#include "x86_decode.h"
#include "x86.h"
diff --git a/target/i386/hvf/x86_flags.c b/target/i386/hvf/x86_flags.c
index 28398ae680..ee6d33f861 100644
--- a/target/i386/hvf/x86_flags.c
+++ b/target/i386/hvf/x86_flags.c
@@ -24,6 +24,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
+#include "panic.h"
#include "cpu.h"
#include "x86_flags.h"
#include "x86.h"
diff --git a/target/i386/hvf/x86_flags.h b/target/i386/hvf/x86_flags.h
index 13e5d5bd1a..8942745988 100644
--- a/target/i386/hvf/x86_flags.h
+++ b/target/i386/hvf/x86_flags.h
@@ -23,7 +23,6 @@
#ifndef __X86_FLAGS_H__
#define __X86_FLAGS_H__
-#include "x86_gen.h"
#include "cpu.h"
void lflags_to_rflags(CPUX86State *env);
void rflags_to_lflags(CPUX86State *env);
diff --git a/target/i386/hvf/x86_mmu.c b/target/i386/hvf/x86_mmu.c
index af11635fba..682e29774e 100644
--- a/target/i386/hvf/x86_mmu.c
+++ b/target/i386/hvf/x86_mmu.c
@@ -16,6 +16,7 @@
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
+#include "panic.h"
#include "qemu-common.h"
#include "x86.h"
diff --git a/target/i386/hvf/x86_mmu.h b/target/i386/hvf/x86_mmu.h
index ae02cb6916..0bd1acc94f 100644
--- a/target/i386/hvf/x86_mmu.h
+++ b/target/i386/hvf/x86_mmu.h
@@ -18,8 +18,6 @@
#ifndef __X86_MMU_H__
#define __X86_MMU_H__
-#include "x86_gen.h"
-
#define PT_PRESENT (1 << 0)
#define PT_WRITE (1 << 1)
#define PT_USER (1 << 2)
diff --git a/target/i386/hvf/x86_task.c b/target/i386/hvf/x86_task.c
index b6ce2a151b..f77edda580 100644
--- a/target/i386/hvf/x86_task.c
+++ b/target/i386/hvf/x86_task.c
@@ -7,6 +7,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
#include "qemu/osdep.h"
+#include "panic.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
--
2.14.3
- [Qemu-devel] [PULL 05/19] i386: hvf: implement hvf_get_supported_cpuid, (continued)
- [Qemu-devel] [PULL 05/19] i386: hvf: implement hvf_get_supported_cpuid, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 08/19] i386: hvf: refactor event injection code for hvf, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 03/19] i386: hvf: fix licensing issues; isolate task handling code (GPL v2-only), Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 09/19] i386: hvf: inject General Protection Fault when vmexit through vmcall, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 06/19] i386: refactor KVM cpuid code so that it applies to hvf as well, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 11/19] i386: hvf: header cleanup, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 10/19] i386: hvf: move all hvf files in the same directory, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 14/19] i386: hvf: remove ZERO_INIT macro, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 13/19] i386: hvf: remove more dead emulator code, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 15/19] i386: hvf: abort on decoding error, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 19/19] i386: hvf: cleanup x86_gen.h,
Paolo Bonzini <=
- [Qemu-devel] [PULL 16/19] i386: hvf: simplify flag handling, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 12/19] i386: hvf: unify register enums between HVF and the rest, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 17/19] i386: hvf: remove addr_t, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 18/19] i386: hvf: remove VM_PANIC from "in", Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 02/19] i386: hvf: add code base from Google's QEMU repository, Paolo Bonzini, 2017/12/20
- Re: [Qemu-devel] [PULL 00/19] Initial support for Hypervisor.framework, no-reply, 2017/12/20
- Re: [Qemu-devel] [PULL 00/19] Initial support for Hypervisor.framework, Peter Maydell, 2017/12/20
- Re: [Qemu-devel] [PULL 00/19] Initial support for Hypervisor.framework, no-reply, 2017/12/20