qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 02/18] hw: move fifo.[ch] to libqemuutil
Date: Tue,  5 Mar 2013 18:17:29 +0100	[thread overview]
Message-ID: <1362503865-27292-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1362503865-27292-1-git-send-email-pbonzini@redhat.com>

fifo.c is generic code that can be easily unit tested.  So it
belongs in libqemuutil.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 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 <migration/qemu-file.h>
+
 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 <http://www.gnu.org/licenses/>.
  */
 
-#include "fifo.h"
+#include "qemu-common.h"
+#include "qemu/fifo8.h"
 
 void fifo8_create(Fifo8 *fifo, uint32_t capacity)
 {
-- 
1.8.1.2

  parent reply	other threads:[~2013-03-05 17:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05 17:17 [Qemu-devel] [PULL 00/18] hw/ reorganization, part 1 Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 01/18] hw: move char backends to backends/ Paolo Bonzini
2013-03-05 17:17 ` Paolo Bonzini [this message]
2013-03-05 17:17 ` [Qemu-devel] [PATCH 03/18] hw: move qdev-monitor.o to toplevel directory Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 04/18] hw: move device-hotplug.o to toplevel, compile it once Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 05/18] virtio-9p: use CONFIG_VIRTFS, not CONFIG_LINUX Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 06/18] virtio-9p: remove PCI dependencies from hw/9pfs/ Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 07/18] vt82c686: vt82c686 is not a PCI host bridge Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 08/18] ppc: do not use ../ in include files Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 09/18] hw: include hw header files with full paths Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 10/18] build: always link device_tree.o into emulators if libfdt available Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 11/18] ppc: express FDT dependency of pSeries and e500 boards via default-configs/ Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 12/18] hw: move boards and other isolated files to hw/ARCH Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 13/18] arm: move files referencing CPU to hw/arm/ Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 14/18] i386: move files referencing CPU to hw/i386/ Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 15/18] m68k: move files referencing CPU to hw/m68k/ Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 16/18] ppc: move files referencing CPU to hw/ppc/ Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 17/18] ppc: move more files to hw/ppc Paolo Bonzini
2013-03-05 17:17 ` [Qemu-devel] [PATCH 18/18] sh: move files referencing CPU to hw/sh4/ Paolo Bonzini
2013-03-09 11:07 ` [Qemu-devel] [PULL 00/18] hw/ reorganization, part 1 Paolo Bonzini
2013-03-11  0:49   ` Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2013-03-01 13:33 [Qemu-devel] [PATCH 00/18] hw/ reorganization, part 1: out of hw/ + into hw/ARCH Paolo Bonzini
2013-03-01 13:33 ` [Qemu-devel] [PATCH 02/18] hw: move fifo.[ch] to libqemuutil Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362503865-27292-3-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).