From patchwork Sat Mar 27 22:10:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 48755 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 61887B7CCD for ; Sun, 28 Mar 2010 09:14:58 +1100 (EST) Received: from localhost ([127.0.0.1]:34549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NveHP-0001vM-LE for incoming@patchwork.ozlabs.org; Sat, 27 Mar 2010 18:14:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NveD7-0000n2-AA for qemu-devel@nongnu.org; Sat, 27 Mar 2010 18:10:29 -0400 Received: from [140.186.70.92] (port=45990 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NveD5-0000mQ-LF for qemu-devel@nongnu.org; Sat, 27 Mar 2010 18:10:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NveD4-0007V5-BK for qemu-devel@nongnu.org; Sat, 27 Mar 2010 18:10:27 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:60597) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NveD4-0007Ux-6a for qemu-devel@nongnu.org; Sat, 27 Mar 2010 18:10:26 -0400 Received: by pvf33 with SMTP id 33so4983104pvf.4 for ; Sat, 27 Mar 2010 15:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=Rm7UPmXFLmV9ih8ZulxEVAoffc0uBBOcJLqI5Ecczis=; b=FEohAtKDlg5sv3sdU1txO8bQyBnHJd8WfCMGdCrgHyElQCa4FxanjPOVb9S2tgQuWj CVyt2wMMmFZ5XZ00pInG+FZ/+WSPFv3C7LAioUK6nf/6o3vu4XkdVykbJyHl3D4EnbIf ztHR8hFi0PWAv8IYNFmfBkYUnCnJf0ccy9+BM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=G2S82BrUCCxatTXWRuIExI35H8woHrmbOGIL7rH8eWrJrbiKdw5MgLJb6sAwzpMYnI fplEU8UldBnbOGk2RnlR65pfJ8VSRgIOnqhC0GZGMNhNnFiTKAWCH6wpoMcCzH2hpjYH EQaSTPoQzQIGv0jHiMBxit5dV/G1B+yQHX5Nk= MIME-Version: 1.0 Received: by 10.141.51.13 with HTTP; Sat, 27 Mar 2010 15:10:25 -0700 (PDT) Date: Sun, 28 Mar 2010 00:10:25 +0200 Received: by 10.141.12.9 with SMTP id p9mr2546412rvi.272.1269727825179; Sat, 27 Mar 2010 15:10:25 -0700 (PDT) Message-ID: From: Blue Swirl To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 2/7] Allow various header files to be included from non-CPU code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Allow balloon.h, gdbstub.h and kvm.h to be included from non-CPU code. Signed-off-by: Blue Swirl --- balloon.h | 2 -- gdbstub.h | 12 +++++++++--- kvm.h | 7 ++++--- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/balloon.h b/balloon.h index c3a1ad3..8c019eb 100644 --- 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); diff --git a/gdbstub.h b/gdbstub.h index 5740041..54d753c 100644 --- 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 fd8d0c1..4f77188 100644 --- a/kvm.h +++ b/kvm.h @@ -14,12 +14,12 @@ #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