]> git.proxmox.com Git - qemu.git/commitdiff
Allow various header files to be included from non-CPU code
authorBlue Swirl <blauwirbel@gmail.com>
Mon, 29 Mar 2010 19:23:47 +0000 (19:23 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Mon, 29 Mar 2010 19:23:47 +0000 (19:23 +0000)
Allow balloon.h, gdbstub.h and kvm.h to be included from
non-CPU code.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
balloon.h
gdbstub.h
kvm.h

index c3a1ad365d199c41932b48c33306d613f5796af3..8c019eb78b4b52b75e8ae93180b86c556442c7f9 100644 (file)
--- a/balloon.h
+++ b/balloon.h
@@ -14,8 +14,6 @@
 #ifndef _QEMU_BALLOON_H
 #define _QEMU_BALLOON_H
 
-#include "cpu-defs.h"
-
 typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target,
                                 MonitorCompletion cb, void *cb_data);
 
index 5740041c76c260a573bd43ae1e0f24fb04e44520..54d753cfd41484d5799aa4e239d75e843daffd7d 100644 (file)
--- a/gdbstub.h
+++ b/gdbstub.h
@@ -10,6 +10,7 @@
 #define GDB_WATCHPOINT_READ      3
 #define GDB_WATCHPOINT_ACCESS    4
 
+#ifdef NEED_CPU_H
 typedef void (*gdb_syscall_complete_cb)(CPUState *env,
                                         target_ulong ret, target_ulong err);
 
@@ -21,10 +22,7 @@ int gdb_queuesig (void);
 int gdb_handlesig (CPUState *, int);
 void gdb_exit(CPUState *, int);
 void gdb_signalled(CPUState *, int);
-int gdbserver_start(int);
 void gdbserver_fork(CPUState *);
-#else
-int gdbserver_start(const char *port);
 #endif
 /* Get or set a register.  Returns the size of the register.  */
 typedef int (*gdb_reg_cb)(CPUState *env, uint8_t *buf, int reg);
@@ -33,3 +31,11 @@ void gdb_register_coprocessor(CPUState *env,
                               int num_regs, const char *xml, int g_pos);
 
 #endif
+
+#ifdef CONFIG_USER_ONLY
+int gdbserver_start(int);
+#else
+int gdbserver_start(const char *port);
+#endif
+
+#endif
diff --git a/kvm.h b/kvm.h
index fd8d0c16c8e9f82823ee94613f96f3a83eac627e..4f77188e2682c2cbae20b8accf5f0eedd25e310b 100644 (file)
--- a/kvm.h
+++ b/kvm.h
 #ifndef QEMU_KVM_H
 #define QEMU_KVM_H
 
-#include "config.h"
+#include "config-host.h"
 #include "qemu-queue.h"
 
-#ifdef CONFIG_KVM
 extern int kvm_allowed;
 
+#ifdef CONFIG_KVM
 #define kvm_enabled() (kvm_allowed)
 #else
 #define kvm_enabled() (0)
@@ -31,6 +31,7 @@ struct kvm_run;
 
 int kvm_init(int smp_cpus);
 
+#ifdef NEED_CPU_H
 int kvm_init_vcpu(CPUState *env);
 
 int kvm_cpu_exec(CPUState *env);
@@ -160,5 +161,5 @@ static inline void cpu_synchronize_post_init(CPUState *env)
         kvm_cpu_synchronize_post_init(env);
     }
 }
-
+#endif
 #endif