Ver Fonte

log: do not unnecessarily include qom/cpu.h

Split the bits that require it to exec/log.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1452174932-28657-8-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Paolo Bonzini há 9 anos atrás
pai
commit
508127e243

+ 1 - 0
bsd-user/main.c

@@ -33,6 +33,7 @@
 #include "tcg.h"
 #include "tcg.h"
 #include "qemu/timer.h"
 #include "qemu/timer.h"
 #include "qemu/envlist.h"
 #include "qemu/envlist.h"
+#include "exec/log.h"
 
 
 int singlestep;
 int singlestep;
 unsigned long mmap_min_addr;
 unsigned long mmap_min_addr;

+ 1 - 0
cpu-exec.c

@@ -27,6 +27,7 @@
 #include "exec/address-spaces.h"
 #include "exec/address-spaces.h"
 #include "qemu/rcu.h"
 #include "qemu/rcu.h"
 #include "exec/tb-hash.h"
 #include "exec/tb-hash.h"
+#include "exec/log.h"
 #if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY)
 #if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY)
 #include "hw/i386/apic.h"
 #include "hw/i386/apic.h"
 #endif
 #endif

+ 1 - 0
exec.c

@@ -52,6 +52,7 @@
 
 
 #include "exec/memory-internal.h"
 #include "exec/memory-internal.h"
 #include "exec/ram_addr.h"
 #include "exec/ram_addr.h"
+#include "exec/log.h"
 
 
 #include "qemu/range.h"
 #include "qemu/range.h"
 #ifndef _WIN32
 #ifndef _WIN32

+ 1 - 0
hw/acpi/cpu_hotplug.c

@@ -12,6 +12,7 @@
 #include "qemu/osdep.h"
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/hw.h"
 #include "hw/acpi/cpu_hotplug.h"
 #include "hw/acpi/cpu_hotplug.h"
+#include "qom/cpu.h"
 
 
 static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned int size)
 static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned int size)
 {
 {

+ 1 - 0
hw/timer/a9gtimer.c

@@ -25,6 +25,7 @@
 #include "qemu/timer.h"
 #include "qemu/timer.h"
 #include "qemu/bitops.h"
 #include "qemu/bitops.h"
 #include "qemu/log.h"
 #include "qemu/log.h"
+#include "qom/cpu.h"
 
 
 #ifndef A9_GTIMER_ERR_DEBUG
 #ifndef A9_GTIMER_ERR_DEBUG
 #define A9_GTIMER_ERR_DEBUG 0
 #define A9_GTIMER_ERR_DEBUG 0

+ 60 - 0
include/exec/log.h

@@ -0,0 +1,60 @@
+#ifndef QEMU_EXEC_LOG_H
+#define QEMU_EXEC_LOG_H
+
+#include "qemu/log.h"
+#include "qom/cpu.h"
+#include "disas/disas.h"
+
+/* cpu_dump_state() logging functions: */
+/**
+ * log_cpu_state:
+ * @cpu: The CPU whose state is to be logged.
+ * @flags: Flags what to log.
+ *
+ * Logs the output of cpu_dump_state().
+ */
+static inline void log_cpu_state(CPUState *cpu, int flags)
+{
+    if (qemu_log_enabled()) {
+        cpu_dump_state(cpu, qemu_logfile, fprintf, flags);
+    }
+}
+
+/**
+ * log_cpu_state_mask:
+ * @mask: Mask when to log.
+ * @cpu: The CPU whose state is to be logged.
+ * @flags: Flags what to log.
+ *
+ * Logs the output of cpu_dump_state() if loglevel includes @mask.
+ */
+static inline void log_cpu_state_mask(int mask, CPUState *cpu, int flags)
+{
+    if (qemu_loglevel & mask) {
+        log_cpu_state(cpu, flags);
+    }
+}
+
+#ifdef NEED_CPU_H
+/* disas() and target_disas() to qemu_logfile: */
+static inline void log_target_disas(CPUState *cpu, target_ulong start,
+                                    target_ulong len, int flags)
+{
+    target_disas(qemu_logfile, cpu, start, len, flags);
+}
+
+static inline void log_disas(void *code, unsigned long size)
+{
+    disas(qemu_logfile, code, size);
+}
+
+#if defined(CONFIG_USER_ONLY)
+/* page_dump() output to the log file: */
+static inline void log_page_dump(void)
+{
+    page_dump(qemu_logfile);
+}
+#endif
+#endif
+
+#endif

+ 0 - 59
include/qemu/log.h

@@ -5,10 +5,6 @@
 #include <stdbool.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdio.h>
 #include "qemu/compiler.h"
 #include "qemu/compiler.h"
-#include "qom/cpu.h"
-#ifdef NEED_CPU_H
-#include "disas/disas.h"
-#endif
 
 
 /* Private global variables, don't use */
 /* Private global variables, don't use */
 extern FILE *qemu_logfile;
 extern FILE *qemu_logfile;
@@ -78,61 +74,6 @@ qemu_log_vprintf(const char *fmt, va_list va)
 void GCC_FMT_ATTR(2, 3) qemu_log_mask(int mask, const char *fmt, ...);
 void GCC_FMT_ATTR(2, 3) qemu_log_mask(int mask, const char *fmt, ...);
 
 
 
 
-/* Special cases: */
-
-/* cpu_dump_state() logging functions: */
-/**
- * log_cpu_state:
- * @cpu: The CPU whose state is to be logged.
- * @flags: Flags what to log.
- *
- * Logs the output of cpu_dump_state().
- */
-static inline void log_cpu_state(CPUState *cpu, int flags)
-{
-    if (qemu_log_enabled()) {
-        cpu_dump_state(cpu, qemu_logfile, fprintf, flags);
-    }
-}
-
-/**
- * log_cpu_state_mask:
- * @mask: Mask when to log.
- * @cpu: The CPU whose state is to be logged.
- * @flags: Flags what to log.
- *
- * Logs the output of cpu_dump_state() if loglevel includes @mask.
- */
-static inline void log_cpu_state_mask(int mask, CPUState *cpu, int flags)
-{
-    if (qemu_loglevel & mask) {
-        log_cpu_state(cpu, flags);
-    }
-}
-
-#ifdef NEED_CPU_H
-/* disas() and target_disas() to qemu_logfile: */
-static inline void log_target_disas(CPUState *cpu, target_ulong start,
-                                    target_ulong len, int flags)
-{
-    target_disas(qemu_logfile, cpu, start, len, flags);
-}
-
-static inline void log_disas(void *code, unsigned long size)
-{
-    disas(qemu_logfile, code, size);
-}
-
-#if defined(CONFIG_USER_ONLY)
-/* page_dump() output to the log file: */
-static inline void log_page_dump(void)
-{
-    page_dump(qemu_logfile);
-}
-#endif
-#endif
-
-
 /* Maintenance: */
 /* Maintenance: */
 
 
 /* fflush() the log file */
 /* fflush() the log file */

+ 1 - 0
linux-user/main.c

@@ -28,6 +28,7 @@
 #include "qemu/timer.h"
 #include "qemu/timer.h"
 #include "qemu/envlist.h"
 #include "qemu/envlist.h"
 #include "elf.h"
 #include "elf.h"
+#include "exec/log.h"
 
 
 char *exec_path;
 char *exec_path;
 
 

+ 1 - 0
qom/cpu.c

@@ -23,6 +23,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/kvm.h"
 #include "qemu/notify.h"
 #include "qemu/notify.h"
 #include "qemu/log.h"
 #include "qemu/log.h"
+#include "exec/log.h"
 #include "qemu/error-report.h"
 #include "qemu/error-report.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/sysemu.h"
 
 

+ 1 - 0
target-alpha/translate.c

@@ -28,6 +28,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 #undef ALPHA_DEBUG_DISAS
 #undef ALPHA_DEBUG_DISAS

+ 1 - 0
target-arm/translate-a64.c

@@ -31,6 +31,7 @@
 
 
 #include "exec/helper-proto.h"
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
+#include "exec/log.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
 
 

+ 1 - 0
target-arm/translate.c

@@ -32,6 +32,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 #define ENABLE_ARCH_4T    arm_dc_feature(s, ARM_FEATURE_V4T)
 #define ENABLE_ARCH_4T    arm_dc_feature(s, ARM_FEATURE_V4T)

+ 1 - 0
target-cris/translate.c

@@ -35,6 +35,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 #define DISAS_CRIS 0
 #define DISAS_CRIS 0

+ 1 - 0
target-i386/seg_helper.c

@@ -23,6 +23,7 @@
 #include "qemu/log.h"
 #include "qemu/log.h"
 #include "exec/helper-proto.h"
 #include "exec/helper-proto.h"
 #include "exec/cpu_ldst.h"
 #include "exec/cpu_ldst.h"
+#include "exec/log.h"
 
 
 //#define DEBUG_PCALL
 //#define DEBUG_PCALL
 
 

+ 1 - 0
target-i386/smm_helper.c

@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/helper-proto.h"
+#include "exec/log.h"
 
 
 /* SMM support */
 /* SMM support */
 
 

+ 1 - 0
target-i386/translate.c

@@ -28,6 +28,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 #define PREFIX_REPZ   0x01
 #define PREFIX_REPZ   0x01

+ 1 - 0
target-lm32/helper.c

@@ -22,6 +22,7 @@
 #include "qemu/host-utils.h"
 #include "qemu/host-utils.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/sysemu.h"
 #include "exec/semihost.h"
 #include "exec/semihost.h"
+#include "exec/log.h"
 
 
 int lm32_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw,
 int lm32_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw,
                               int mmu_idx)
                               int mmu_idx)

+ 1 - 0
target-lm32/translate.c

@@ -29,6 +29,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 #define DISAS_LM32 1
 #define DISAS_LM32 1

+ 1 - 0
target-m68k/translate.c

@@ -29,6 +29,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 //#define DEBUG_DISPATCH 1
 //#define DEBUG_DISPATCH 1

+ 1 - 0
target-microblaze/helper.c

@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "cpu.h"
 #include "qemu/host-utils.h"
 #include "qemu/host-utils.h"
+#include "exec/log.h"
 
 
 #define D(x)
 #define D(x)
 
 

+ 1 - 0
target-microblaze/translate.c

@@ -28,6 +28,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 #define SIM_COMPAT 0
 #define SIM_COMPAT 0

+ 1 - 0
target-mips/helper.c

@@ -21,6 +21,7 @@
 #include "cpu.h"
 #include "cpu.h"
 #include "sysemu/kvm.h"
 #include "sysemu/kvm.h"
 #include "exec/cpu_ldst.h"
 #include "exec/cpu_ldst.h"
+#include "exec/log.h"
 
 
 enum {
 enum {
     TLBRET_XI = -6,
     TLBRET_XI = -6,

+ 1 - 0
target-mips/translate.c

@@ -33,6 +33,7 @@
 #include "exec/semihost.h"
 #include "exec/semihost.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 #define MIPS_DEBUG_DISAS 0
 #define MIPS_DEBUG_DISAS 0
 
 

+ 1 - 0
target-moxie/translate.c

@@ -31,6 +31,7 @@
 
 
 #include "exec/helper-proto.h"
 #include "exec/helper-proto.h"
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
+#include "exec/log.h"
 
 
 /* This is the state at translation time.  */
 /* This is the state at translation time.  */
 typedef struct DisasContext {
 typedef struct DisasContext {

+ 1 - 0
target-openrisc/translate.c

@@ -32,6 +32,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 #define OPENRISC_DISAS
 #define OPENRISC_DISAS

+ 1 - 0
target-ppc/mmu-hash32.c

@@ -24,6 +24,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/kvm.h"
 #include "kvm_ppc.h"
 #include "kvm_ppc.h"
 #include "mmu-hash32.h"
 #include "mmu-hash32.h"
+#include "exec/log.h"
 
 
 //#define DEBUG_BAT
 //#define DEBUG_BAT
 
 

+ 1 - 0
target-ppc/mmu-hash64.c

@@ -25,6 +25,7 @@
 #include "qemu/error-report.h"
 #include "qemu/error-report.h"
 #include "kvm_ppc.h"
 #include "kvm_ppc.h"
 #include "mmu-hash64.h"
 #include "mmu-hash64.h"
+#include "exec/log.h"
 
 
 //#define DEBUG_SLB
 //#define DEBUG_SLB
 
 

+ 1 - 0
target-ppc/mmu_helper.c

@@ -24,6 +24,7 @@
 #include "mmu-hash64.h"
 #include "mmu-hash64.h"
 #include "mmu-hash32.h"
 #include "mmu-hash32.h"
 #include "exec/cpu_ldst.h"
 #include "exec/cpu_ldst.h"
+#include "exec/log.h"
 
 
 //#define DEBUG_MMU
 //#define DEBUG_MMU
 //#define DEBUG_BATS
 //#define DEBUG_BATS

+ 1 - 0
target-ppc/translate.c

@@ -29,6 +29,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 #define CPU_SINGLE_STEP 0x1
 #define CPU_SINGLE_STEP 0x1

+ 1 - 0
target-s390x/translate.c

@@ -44,6 +44,7 @@ static TCGv_ptr cpu_env;
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 /* Information that (most) every instruction needs to manipulate.  */
 /* Information that (most) every instruction needs to manipulate.  */

+ 1 - 0
target-sh4/helper.c

@@ -19,6 +19,7 @@
 #include "qemu/osdep.h"
 #include "qemu/osdep.h"
 
 
 #include "cpu.h"
 #include "cpu.h"
+#include "exec/log.h"
 
 
 #if !defined(CONFIG_USER_ONLY)
 #if !defined(CONFIG_USER_ONLY)
 #include "hw/sh4/sh_intc.h"
 #include "hw/sh4/sh_intc.h"

+ 1 - 0
target-sh4/translate.c

@@ -29,6 +29,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 typedef struct DisasContext {
 typedef struct DisasContext {

+ 1 - 0
target-sparc/int32_helper.c

@@ -21,6 +21,7 @@
 #include "cpu.h"
 #include "cpu.h"
 #include "trace.h"
 #include "trace.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/sysemu.h"
+#include "exec/log.h"
 
 
 #define DEBUG_PCALL
 #define DEBUG_PCALL
 
 

+ 1 - 0
target-sparc/int64_helper.c

@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/helper-proto.h"
+#include "exec/log.h"
 #include "trace.h"
 #include "trace.h"
 
 
 #define DEBUG_PCALL
 #define DEBUG_PCALL

+ 1 - 0
target-sparc/translate.c

@@ -29,6 +29,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 #define DEBUG_DISAS
 #define DEBUG_DISAS

+ 1 - 0
target-tilegx/translate.c

@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "cpu.h"
 #include "qemu/log.h"
 #include "qemu/log.h"
+#include "exec/log.h"
 #include "disas/disas.h"
 #include "disas/disas.h"
 #include "tcg-op.h"
 #include "tcg-op.h"
 #include "exec/cpu_ldst.h"
 #include "exec/cpu_ldst.h"

+ 1 - 0
target-tricore/translate.c

@@ -28,6 +28,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "tricore-opcodes.h"
 #include "tricore-opcodes.h"
+#include "exec/log.h"
 
 
 /*
 /*
  * TCG registers
  * TCG registers

+ 1 - 0
target-unicore32/translate.c

@@ -20,6 +20,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 /* internal defines */
 /* internal defines */

+ 1 - 0
target-xtensa/translate.c

@@ -43,6 +43,7 @@
 #include "exec/helper-gen.h"
 #include "exec/helper-gen.h"
 
 
 #include "trace-tcg.h"
 #include "trace-tcg.h"
+#include "exec/log.h"
 
 
 
 
 typedef struct DisasContext {
 typedef struct DisasContext {

+ 1 - 0
tcg/tcg.c

@@ -60,6 +60,7 @@
 #endif
 #endif
 
 
 #include "elf.h"
 #include "elf.h"
+#include "exec/log.h"
 
 
 /* Forward declarations for functions declared in tcg-target.c and used here. */
 /* Forward declarations for functions declared in tcg-target.c and used here. */
 static void tcg_target_init(TCGContext *s);
 static void tcg_target_init(TCGContext *s);

+ 1 - 0
translate-all.c

@@ -55,6 +55,7 @@
 #include "translate-all.h"
 #include "translate-all.h"
 #include "qemu/bitmap.h"
 #include "qemu/bitmap.h"
 #include "qemu/timer.h"
 #include "qemu/timer.h"
+#include "exec/log.h"
 
 
 //#define DEBUG_TB_INVALIDATE
 //#define DEBUG_TB_INVALIDATE
 //#define DEBUG_FLUSH
 //#define DEBUG_FLUSH