From patchwork Fri Mar 1 13:33:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 224333 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 299AF2C02A4 for ; Sat, 2 Mar 2013 00:34:41 +1100 (EST) Received: from localhost ([::1]:56027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBQ6g-00031p-Cp for incoming@patchwork.ozlabs.org; Fri, 01 Mar 2013 08:34:38 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBQ67-00031b-SY for qemu-devel@nongnu.org; Fri, 01 Mar 2013 08:34:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UBQ66-0007Ms-B1 for qemu-devel@nongnu.org; Fri, 01 Mar 2013 08:34:03 -0500 Received: from mail-qa0-f50.google.com ([209.85.216.50]:37757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBQ66-0007Ml-5T for qemu-devel@nongnu.org; Fri, 01 Mar 2013 08:34:02 -0500 Received: by mail-qa0-f50.google.com with SMTP id dx4so2152065qab.2 for ; Fri, 01 Mar 2013 05:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=RIrqB7Lgu6a6/StD8ADlMlRZ3XqpJYPQedA4F0RirLo=; b=ZXX8sQIHvdtRNwM0WO/Ba8jYw1CnAn8onXaqHgKF6Vc9Z/ooipnz83dtXk6b8tlcKj cuUxhXORh9PxfIMdL285HN/MJboCwWLZs9X91sJ+sdUQgXxeLiIPixcSm6LrCVwniEYp cbPsYE6qKO+z8gy24bXDVzt0ik4iAdYEQRbXqF/cvkuie+0fAMLBVX/N9iDv2d7We5Lo oVnI4skSa90KFZhIRoQbzJIRdEqWHyU/ylu0pC+WTtprrkjkJc15Cq9CWTeKabtlXI5T AbA9afewfPM9R75Wuirn1ULn0NGH9HPnseFsiIj77vE4ck13zavcy5tC5kxnZxdcnpQB 86/w== X-Received: by 10.229.176.16 with SMTP id bc16mr3723755qcb.43.1362144841720; Fri, 01 Mar 2013 05:34:01 -0800 (PST) Received: from yakj.usersys.redhat.com (93-34-176-20.ip50.fastwebnet.it. [93.34.176.20]) by mx.google.com with ESMTPS id hr1sm19338754qeb.3.2013.03.01.05.34.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 01 Mar 2013 05:34:01 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 1 Mar 2013 14:33:33 +0100 Message-Id: <1362144829-26979-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1362144829-26979-1-git-send-email-pbonzini@redhat.com> References: <1362144829-26979-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.216.50 Cc: peter.maydell@linaro.org, afaerber@suse.de Subject: [Qemu-devel] [PATCH 02/18] hw: move fifo.[ch] to libqemuutil X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org fifo.c is generic code that can be easily unit tested. So it belongs in libqemuutil. Signed-off-by: Paolo Bonzini --- hw/Makefile.objs | 1 - hw/xilinx_spi.c | 2 +- hw/xilinx_spips.c | 2 +- include/migration/vmstate.h | 2 ++ hw/fifo.h => include/qemu/fifo8.h | 2 +- util/Makefile.objs | 1 + hw/fifo.c => util/fifo8.c | 3 ++- 7 files changed, 8 insertions(+), 5 deletions(-) rename hw/fifo.h => include/qemu/fifo8.h (98%) rename hw/fifo.c => util/fifo8.c (97%) diff --git a/hw/Makefile.objs b/hw/Makefile.objs index 5750332..6e2275b 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -44,7 +44,6 @@ common-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o endif common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o common-obj-$(CONFIG_SDHCI) += sdhci.o -common-obj-y += fifo.o common-obj-y += pam.o # PPC devices diff --git a/hw/xilinx_spi.c b/hw/xilinx_spi.c index be581c2..e73c9bd 100644 --- a/hw/xilinx_spi.c +++ b/hw/xilinx_spi.c @@ -27,7 +27,7 @@ #include "sysbus.h" #include "sysemu/sysemu.h" #include "qemu/log.h" -#include "fifo.h" +#include "qemu/fifo8.h" #include "ssi.h" diff --git a/hw/xilinx_spips.c b/hw/xilinx_spips.c index 42e019d..915eb96 100644 --- a/hw/xilinx_spips.c +++ b/hw/xilinx_spips.c @@ -26,7 +26,7 @@ #include "sysemu/sysemu.h" #include "ptimer.h" #include "qemu/log.h" -#include "fifo.h" +#include "qemu/fifo8.h" #include "ssi.h" #include "qemu/bitops.h" diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index f27276c..94a409b 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -26,6 +26,8 @@ #ifndef QEMU_VMSTATE_H #define QEMU_VMSTATE_H 1 +#include + typedef void SaveStateHandler(QEMUFile *f, void *opaque); typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id); diff --git a/hw/fifo.h b/include/qemu/fifo8.h similarity index 98% rename from hw/fifo.h rename to include/qemu/fifo8.h index f23890a..d318f71 100644 --- a/hw/fifo.h +++ b/include/qemu/fifo8.h @@ -1,7 +1,7 @@ #ifndef FIFO_H #define FIFO_H -#include "hw.h" +#include "migration/vmstate.h" typedef struct { /* All fields are private */ diff --git a/util/Makefile.objs b/util/Makefile.objs index 495a178..cad5ce8 100644 --- a/util/Makefile.objs +++ b/util/Makefile.objs @@ -3,6 +3,7 @@ util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o event_notifier-win util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o event_notifier-posix.o util-obj-y += envlist.o path.o host-utils.o cache-utils.o module.o util-obj-y += bitmap.o bitops.o hbitmap.o +util-obj-y += fifo8.o util-obj-y += acl.o util-obj-y += error.o qemu-error.o util-obj-$(CONFIG_POSIX) += compatfd.o diff --git a/hw/fifo.c b/util/fifo8.c similarity index 97% rename from hw/fifo.c rename to util/fifo8.c index 68a955a..013e903 100644 --- a/hw/fifo.c +++ b/util/fifo8.c @@ -12,7 +12,8 @@ * with this program; if not, see . */ -#include "fifo.h" +#include "qemu-common.h" +#include "qemu/fifo8.h" void fifo8_create(Fifo8 *fifo, uint32_t capacity) {