summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.objs2
-rw-r--r--arch_init.c2
-rw-r--r--backends/baum.c2
-rw-r--r--backends/msmouse.c2
-rw-r--r--backends/rng-egd.c4
-rw-r--r--backends/rng-random.c4
-rw-r--r--backends/rng.c2
-rw-r--r--backends/tpm.c40
-rw-r--r--bt-host.c2
-rw-r--r--bt-vhci.c2
-rwxr-xr-xconfigure29
-rw-r--r--default-configs/arm-softmmu.mak2
-rw-r--r--default-configs/i386-softmmu.mak5
-rw-r--r--default-configs/x86_64-softmmu.mak5
-rw-r--r--dump.c6
-rw-r--r--gdbstub.c2
-rw-r--r--hmp.c2
-rw-r--r--hw/Makefile.objs1
-rw-r--r--hw/alpha/typhoon.c3
-rw-r--r--hw/arm/armv7m.c2
-rw-r--r--hw/arm/boot.c2
-rw-r--r--hw/arm/collie.c4
-rw-r--r--hw/arm/exynos4210.c2
-rw-r--r--hw/arm/exynos4_boards.c2
-rw-r--r--hw/arm/gumstix.c2
-rw-r--r--hw/arm/highbank.c4
-rw-r--r--hw/arm/integratorcp.c4
-rw-r--r--hw/arm/kzm.c4
-rw-r--r--hw/arm/mainstone.c4
-rw-r--r--hw/arm/musicpal.c4
-rw-r--r--hw/arm/nseries.c4
-rw-r--r--hw/arm/omap1.c2
-rw-r--r--hw/arm/omap2.c4
-rw-r--r--hw/arm/omap_sx1.c2
-rw-r--r--hw/arm/palm.c4
-rw-r--r--hw/arm/pic_cpu.c2
-rw-r--r--hw/arm/pxa2xx.c2
-rw-r--r--hw/arm/realview.c4
-rw-r--r--hw/arm/spitz.c4
-rw-r--r--hw/arm/stellaris.c4
-rw-r--r--hw/arm/strongarm.c4
-rw-r--r--hw/arm/tosa.c4
-rw-r--r--hw/arm/versatilepb.c4
-rw-r--r--hw/arm/vexpress.c4
-rw-r--r--hw/arm/xilinx_zynq.c2
-rw-r--r--hw/arm/z2.c4
-rw-r--r--hw/block/m25p80.c2
-rw-r--r--hw/bt/core.c2
-rw-r--r--hw/bt/hci-csr.c4
-rw-r--r--hw/bt/hci.c2
-rw-r--r--hw/char/cadence_uart.c2
-rw-r--r--hw/char/debugcon.c2
-rw-r--r--hw/char/escc.c2
-rw-r--r--hw/char/etraxfs_ser.c2
-rw-r--r--hw/char/exynos4210_uart.c2
-rw-r--r--hw/char/grlib_apbuart.c2
-rw-r--r--hw/char/imx_serial.c2
-rw-r--r--hw/char/ipoctal232.c2
-rw-r--r--hw/char/lm32_juart.c2
-rw-r--r--hw/char/lm32_uart.c2
-rw-r--r--hw/char/mcf_uart.c2
-rw-r--r--hw/char/milkymist-uart.c2
-rw-r--r--hw/char/omap_uart.c2
-rw-r--r--hw/char/parallel.c2
-rw-r--r--hw/char/pl011.c2
-rw-r--r--hw/char/sclpconsole.c2
-rw-r--r--hw/char/serial.c2
-rw-r--r--hw/char/sh_serial.c2
-rw-r--r--hw/char/spapr_vty.c2
-rw-r--r--hw/char/virtio-console.c2
-rw-r--r--hw/char/xen_console.c2
-rw-r--r--hw/char/xilinx_uartlite.c2
-rw-r--r--hw/core/qdev-properties-system.c2
-rw-r--r--hw/core/qdev-properties.c2
-rw-r--r--hw/display/blizzard.c2
-rw-r--r--hw/display/sm501.c2
-rw-r--r--hw/display/tc6393xb.c2
-rw-r--r--hw/display/xenfb.c2
-rw-r--r--hw/i386/pc.c1
-rw-r--r--hw/i386/pc_piix.c1
-rw-r--r--hw/ide/ahci.c1
-rw-r--r--hw/ide/internal.h1
-rw-r--r--hw/input/stellaris_input.c2
-rw-r--r--hw/input/tsc2005.c2
-rw-r--r--hw/input/tsc210x.c2
-rw-r--r--hw/intc/armv7m_nvic.c2
-rw-r--r--hw/isa/pc87312.c2
-rw-r--r--hw/lm32/lm32_boards.c2
-rw-r--r--hw/lm32/milkymist.c2
-rw-r--r--hw/microblaze/petalogix_ml605_mmu.c2
-rw-r--r--hw/microblaze/petalogix_s3adsp1800_mmu.c2
-rw-r--r--hw/mips/mips_fulong2e.c2
-rw-r--r--hw/mips/mips_malta.c2
-rw-r--r--hw/misc/cbus.c2
-rw-r--r--hw/misc/ivshmem.c2
-rw-r--r--hw/net/lan9118.c2
-rw-r--r--hw/net/smc91c111.c2
-rw-r--r--hw/net/vmxnet_tx_pkt.c2
-rw-r--r--hw/net/xgmac.c2
-rw-r--r--hw/ppc/spapr_events.c2
-rw-r--r--hw/ppc/spapr_rtas.c2
-rw-r--r--hw/ppc/virtex_ml507.c2
-rw-r--r--hw/sh4/r2d.c2
-rw-r--r--hw/sparc/leon3.c2
-rw-r--r--hw/timer/tusb6010.c2
-rw-r--r--hw/tpm/Makefile.objs (renamed from tpm/Makefile.objs)4
-rw-r--r--hw/tpm/tpm_int.h (renamed from tpm/tpm_int.h)37
-rw-r--r--hw/tpm/tpm_passthrough.c (renamed from tpm/tpm_passthrough.c)22
-rw-r--r--hw/tpm/tpm_tis.c (renamed from tpm/tpm_tis.c)4
-rw-r--r--hw/tpm/tpm_tis.h (renamed from tpm/tpm_tis.h)5
-rw-r--r--hw/usb/ccid-card-emulated.c2
-rw-r--r--hw/usb/ccid-card-passthru.c2
-rw-r--r--hw/usb/dev-bluetooth.c2
-rw-r--r--hw/usb/dev-serial.c2
-rw-r--r--hw/usb/libhw.c2
-rw-r--r--hw/usb/redirect.c2
-rw-r--r--hw/virtio/virtio-rng.c2
-rw-r--r--hw/xen/xen_backend.c2
-rw-r--r--hw/xtensa/xtensa_lx60.c2
-rw-r--r--include/exec/memory-internal.h6
-rw-r--r--include/exec/memory.h5
-rw-r--r--include/hw/acpi/acpi.h7
-rw-r--r--include/hw/arm/arm.h (renamed from include/hw/arm.h)0
-rw-r--r--include/hw/devices.h (renamed from include/hw/arm/devices.h)0
-rw-r--r--include/hw/i386/pc.h8
-rw-r--r--include/hw/virtio/virtio-rng.h4
-rw-r--r--include/qemu/typedefs.h4
-rw-r--r--include/sysemu/bt.h (renamed from include/bt/bt.h)0
-rw-r--r--include/sysemu/char.h (renamed from include/char/char.h)0
-rw-r--r--include/sysemu/rng-random.h (renamed from include/qemu/rng-random.h)0
-rw-r--r--include/sysemu/rng.h (renamed from include/qemu/rng.h)0
-rw-r--r--include/sysemu/tpm.h (renamed from include/tpm/tpm.h)2
-rw-r--r--include/sysemu/tpm_backend.h (renamed from include/backends/tpm.h)41
-rw-r--r--include/sysemu/tpm_backend_int.h (renamed from tpm/tpm_backend.h)0
-rw-r--r--kvm-stub.c1
-rw-r--r--monitor.c4
-rw-r--r--net/slirp.c2
-rw-r--r--qemu-char.c2
-rw-r--r--qmp.c2
-rw-r--r--qtest.c2
-rw-r--r--slirp/slirp.c2
-rw-r--r--spice-qemu-char.c2
-rw-r--r--target-arm/arm-semi.c2
-rw-r--r--target-arm/kvm.c2
-rw-r--r--target-ppc/kvm_ppc.h2
-rw-r--r--tpm.c (renamed from tpm/tpm.c)21
-rw-r--r--tpm/tpm_backend.c58
-rw-r--r--translate-all.c5
-rw-r--r--ui/console.c2
-rw-r--r--ui/gtk.c2
-rw-r--r--util/event_notifier-posix.c2
-rw-r--r--vl.c6
-rw-r--r--xen-all.c2
153 files changed, 290 insertions, 319 deletions
diff --git a/Makefile.objs b/Makefile.objs
index e568c018b3..a473348dc2 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -65,7 +65,7 @@ common-obj-y += bt-host.o bt-vhci.o
common-obj-y += dma-helpers.o
common-obj-y += vl.o
-common-obj-y += tpm/
+common-obj-y += tpm.o
common-obj-$(CONFIG_SLIRP) += slirp/
diff --git a/arch_init.c b/arch_init.c
index 769ce77e61..92de1bde49 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -40,7 +40,6 @@
#include "hw/audio/audio.h"
#include "sysemu/kvm.h"
#include "migration/migration.h"
-#include "exec/gdbstub.h"
#include "hw/i386/smbios.h"
#include "exec/address-spaces.h"
#include "hw/audio/pcspk.h"
@@ -49,6 +48,7 @@
#include "qmp-commands.h"
#include "trace.h"
#include "exec/cpu-all.h"
+#include "hw/acpi/acpi.h"
#ifdef DEBUG_ARCH_INIT
#define DPRINTF(fmt, ...) \
diff --git a/backends/baum.c b/backends/baum.c
index ea9ffe88fb..4cba79fc7d 100644
--- a/backends/baum.c
+++ b/backends/baum.c
@@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
#include "qemu-common.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/timer.h"
#include "hw/usb.h"
#include <brlapi.h>
diff --git a/backends/msmouse.c b/backends/msmouse.c
index 61052fe783..0ac05a0d10 100644
--- a/backends/msmouse.c
+++ b/backends/msmouse.c
@@ -23,7 +23,7 @@
*/
#include <stdlib.h>
#include "qemu-common.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "ui/console.h"
#define MSMOUSE_LO6(n) ((n) & 0x3f)
diff --git a/backends/rng-egd.c b/backends/rng-egd.c
index cc6f5ee28e..9e5a5366f7 100644
--- a/backends/rng-egd.c
+++ b/backends/rng-egd.c
@@ -10,8 +10,8 @@
* See the COPYING file in the top-level directory.
*/
-#include "qemu/rng.h"
-#include "char/char.h"
+#include "sysemu/rng.h"
+#include "sysemu/char.h"
#include "qapi/qmp/qerror.h"
#include "hw/qdev.h" /* just for DEFINE_PROP_CHR */
diff --git a/backends/rng-random.c b/backends/rng-random.c
index acd20afad2..d5761f2cce 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -10,8 +10,8 @@
* See the COPYING file in the top-level directory.
*/
-#include "qemu/rng-random.h"
-#include "qemu/rng.h"
+#include "sysemu/rng-random.h"
+#include "sysemu/rng.h"
#include "qapi/qmp/qerror.h"
#include "qemu/main-loop.h"
diff --git a/backends/rng.c b/backends/rng.c
index 3d3389802e..85cb83f5e1 100644
--- a/backends/rng.c
+++ b/backends/rng.c
@@ -10,7 +10,7 @@
* See the COPYING file in the top-level directory.
*/
-#include "qemu/rng.h"
+#include "sysemu/rng.h"
#include "qapi/qmp/qerror.h"
void rng_backend_request_entropy(RngBackend *s, size_t size,
diff --git a/backends/tpm.c b/backends/tpm.c
index 28148c23cf..b73580134c 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -12,9 +12,11 @@
* Based on backends/rng.c by Anthony Liguori
*/
-#include "backends/tpm.h"
-#include "tpm/tpm_int.h"
+#include "sysemu/tpm_backend.h"
#include "qapi/qmp/qerror.h"
+#include "sysemu/tpm.h"
+#include "qemu/thread.h"
+#include "sysemu/tpm_backend_int.h"
enum TpmType tpm_backend_get_type(TPMBackend *s)
{
@@ -137,6 +139,40 @@ static void tpm_backend_instance_init(Object *obj)
NULL);
}
+void tpm_backend_thread_deliver_request(TPMBackendThread *tbt)
+{
+ g_thread_pool_push(tbt->pool, (gpointer)TPM_BACKEND_CMD_PROCESS_CMD, NULL);
+}
+
+void tpm_backend_thread_create(TPMBackendThread *tbt,
+ GFunc func, gpointer user_data)
+{
+ if (!tbt->pool) {
+ tbt->pool = g_thread_pool_new(func, user_data, 1, TRUE, NULL);
+ g_thread_pool_push(tbt->pool, (gpointer)TPM_BACKEND_CMD_INIT, NULL);
+ }
+}
+
+void tpm_backend_thread_end(TPMBackendThread *tbt)
+{
+ if (tbt->pool) {
+ g_thread_pool_push(tbt->pool, (gpointer)TPM_BACKEND_CMD_END, NULL);
+ g_thread_pool_free(tbt->pool, FALSE, TRUE);
+ tbt->pool = NULL;
+ }
+}
+
+void tpm_backend_thread_tpm_reset(TPMBackendThread *tbt,
+ GFunc func, gpointer user_data)
+{
+ if (!tbt->pool) {
+ tpm_backend_thread_create(tbt, func, user_data);
+ } else {
+ g_thread_pool_push(tbt->pool, (gpointer)TPM_BACKEND_CMD_TPM_RESET,
+ NULL);
+ }
+}
+
static const TypeInfo tpm_backend_info = {
.name = TYPE_TPM_BACKEND,
.parent = TYPE_OBJECT,
diff --git a/bt-host.c b/bt-host.c
index 2da3c32204..49205bf288 100644
--- a/bt-host.c
+++ b/bt-host.c
@@ -18,7 +18,7 @@
*/
#include "qemu-common.h"
-#include "bt/bt.h"
+#include "sysemu/bt.h"
#include "qemu/main-loop.h"
#ifndef _WIN32
diff --git a/bt-vhci.c b/bt-vhci.c
index a6a7ab0329..e267c8ad15 100644
--- a/bt-vhci.c
+++ b/bt-vhci.c
@@ -18,7 +18,7 @@
*/
#include "qemu-common.h"
-#include "bt/bt.h"
+#include "sysemu/bt.h"
#include "hw/bt.h"
#include "qemu/main-loop.h"
diff --git a/configure b/configure
index c5fa609efb..0788e27951 100755
--- a/configure
+++ b/configure
@@ -545,6 +545,7 @@ Haiku)
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
audio_possible_drivers="$audio_possible_drivers fmod"
fi
+ QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers $QEMU_INCLUDES"
;;
esac
@@ -2404,6 +2405,15 @@ EOF
fi
##########################################
+# TPM passthrough is only on x86 Linux
+
+if test "$targetos" = Linux && test "$cpu" = i386 -o "$cpu" = x86_64; then
+ tpm_passthrough=$tpm
+else
+ tpm_passthrough=no
+fi
+
+##########################################
# adjust virtio-blk-data-plane based on linux-aio
if test "$virtio_blk_data_plane" = "yes" -a \
@@ -3518,6 +3528,7 @@ echo "gcov $gcov_tool"
echo "gcov enabled $gcov"
echo "TPM support $tpm"
echo "libssh2 support $libssh2"
+echo "TPM passthrough $tpm_passthrough"
if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -3901,6 +3912,14 @@ bsd)
;;
esac
+# TPM passthrough support?
+if test "$tpm" = "yes"; then
+ echo 'CONFIG_TPM=$(CONFIG_SOFTMMU)' >> $config_host_mak
+ if test "$tpm_passthrough" = "yes"; then
+ echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak
+ fi
+fi
+
# use default implementation for tracing backend-specific routines
trace_default=yes
echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak
@@ -4318,10 +4337,6 @@ else
fi
includes="-I\$(SRC_PATH)/tcg $includes"
-if test "$linux" = "yes" ; then
- includes="-I\$(SRC_PATH)/linux-headers $includes"
-fi
-
for i in $ARCH $TARGET_BASE_ARCH ; do
case "$i" in
alpha)
@@ -4432,12 +4447,6 @@ if test "$gprof" = "yes" ; then
fi
fi
-if test "$tpm" = "yes"; then
- if test "$target_softmmu" = "yes" ; then
- echo "CONFIG_TPM=y" >> $config_host_mak
- fi
-fi
-
if test "$ARCH" = "tci"; then
linker_script=""
else
diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 31725a97f9..27cbe3d088 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -34,8 +34,8 @@ CONFIG_PFLASH_CFI02=y
CONFIG_MICRODRIVE=y
CONFIG_USB_MUSB=y
-CONFIG_ARM5MPCORE=y
CONFIG_ARM9MPCORE=y
+CONFIG_ARM11MPCORE=y
CONFIG_ARM15MPCORE=y
CONFIG_ARM_GIC=y
diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 4ac0694470..368a776166 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -27,8 +27,7 @@ CONFIG_HPET=y
CONFIG_APPLESMC=y
CONFIG_I8259=y
CONFIG_PFLASH_CFI01=y
-CONFIG_TPM_TIS=y
-CONFIG_TPM_PASSTHROUGH=y
+CONFIG_TPM_TIS=$(CONFIG_TPM)
CONFIG_PCI_HOTPLUG=y
CONFIG_MC146818RTC=y
CONFIG_PAM=y
@@ -42,6 +41,6 @@ CONFIG_ISA_TESTDEV=y
CONFIG_VMPORT=y
CONFIG_SGA=y
CONFIG_LPC_ICH9=y
-CONFIG_Q35=y
+CONFIG_PCI_Q35=y
CONFIG_APIC=y
CONFIG_IOAPIC=y
diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
index bf4091c4dd..2711b83bf0 100644
--- a/default-configs/x86_64-softmmu.mak
+++ b/default-configs/x86_64-softmmu.mak
@@ -27,8 +27,7 @@ CONFIG_HPET=y
CONFIG_APPLESMC=y
CONFIG_I8259=y
CONFIG_PFLASH_CFI01=y
-CONFIG_TPM_TIS=y
-CONFIG_TPM_PASSTHROUGH=y
+CONFIG_TPM_TIS=$(CONFIG_TPM)
CONFIG_PCI_HOTPLUG=y
CONFIG_MC146818RTC=y
CONFIG_PAM=y
@@ -42,6 +41,6 @@ CONFIG_ISA_TESTDEV=y
CONFIG_VMPORT=y
CONFIG_SGA=y
CONFIG_LPC_ICH9=y
-CONFIG_Q35=y
+CONFIG_PCI_Q35=y
CONFIG_APIC=y
CONFIG_IOAPIC=y
diff --git a/dump.c b/dump.c
index a25f5096eb..b34f143c42 100644
--- a/dump.c
+++ b/dump.c
@@ -23,7 +23,6 @@
#include "sysemu/memory_mapping.h"
#include "qapi/error.h"
#include "qmp-commands.h"
-#include "exec/gdbstub.h"
static uint16_t cpu_convert_to_target16(uint16_t val, int endian)
{
@@ -268,6 +267,11 @@ static int write_elf64_note(DumpState *s)
return 0;
}
+static inline int cpu_index(CPUState *cpu)
+{
+ return cpu->cpu_index + 1;
+}
+
static int write_elf64_notes(DumpState *s)
{
CPUArchState *env;
diff --git a/gdbstub.c b/gdbstub.c
index 22ab12c68c..e80e1d32b1 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -30,7 +30,7 @@
#include "qemu.h"
#else
#include "monitor/monitor.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "sysemu/sysemu.h"
#include "exec/gdbstub.h"
#endif
diff --git a/hmp.c b/hmp.c
index 2e35b3da4e..4fb76ec7a7 100644
--- a/hmp.c
+++ b/hmp.c
@@ -15,7 +15,7 @@
#include "hmp.h"
#include "net/net.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/option.h"
#include "qemu/timer.h"
#include "qmp-commands.h"
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 1cb86fa323..b7a1613612 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -22,6 +22,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += scsi/
devices-dirs-$(CONFIG_SOFTMMU) += sd/
devices-dirs-$(CONFIG_SOFTMMU) += ssi/
devices-dirs-$(CONFIG_SOFTMMU) += timer/
+devices-dirs-$(CONFIG_TPM) += tpm/
devices-dirs-$(CONFIG_SOFTMMU) += usb/
devices-dirs-$(CONFIG_SOFTMMU) += virtio/
devices-dirs-$(CONFIG_SOFTMMU) += watchdog/
diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c
index faec8dcebd..1ead1877c7 100644
--- a/hw/alpha/typhoon.c
+++ b/hw/alpha/typhoon.c
@@ -7,9 +7,8 @@
*/
#include "cpu.h"
-#include "exec/exec-all.h"
#include "hw/hw.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "sysemu/sysemu.h"
#include "alpha_sys.h"
#include "exec/address-spaces.h"
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index a4bdd5f30f..2ae3576760 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -8,7 +8,7 @@
*/
#include "hw/sysbus.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "hw/loader.h"
#include "elf.h"
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index c79c590171..e9c09454ac 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -9,7 +9,7 @@
#include "config.h"
#include "hw/hw.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"
#include "hw/loader.h"
diff --git a/hw/arm/collie.c b/hw/arm/collie.c
index 5420bb4ba8..a19857aaaf 100644
--- a/hw/arm/collie.c
+++ b/hw/arm/collie.c
@@ -11,9 +11,9 @@
#include "hw/hw.h"
#include "hw/sysbus.h"
#include "hw/boards.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "strongarm.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "hw/block/flash.h"
#include "sysemu/blockdev.h"
#include "exec/address-spaces.h"
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c
index 78b8b7407a..c8101d3e84 100644
--- a/hw/arm/exynos4210.c
+++ b/hw/arm/exynos4210.c
@@ -24,7 +24,7 @@
#include "hw/boards.h"
#include "sysemu/sysemu.h"
#include "hw/sysbus.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "hw/loader.h"
#include "hw/arm/exynos4210.h"
#include "hw/usb/hcd-ehci.h"
diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c
index ba14a1fd09..74f110ba61 100644
--- a/hw/arm/exynos4_boards.c
+++ b/hw/arm/exynos4_boards.c
@@ -24,7 +24,7 @@
#include "sysemu/sysemu.h"
#include "hw/sysbus.h"
#include "net/net.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "exec/address-spaces.h"
#include "hw/arm/exynos4210.h"
#include "hw/boards.h"
diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c
index 4d800c9547..b8cab10ba6 100644
--- a/hw/arm/gumstix.c
+++ b/hw/arm/gumstix.c
@@ -38,7 +38,7 @@
#include "hw/arm/pxa.h"
#include "net/net.h"
#include "hw/block/flash.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/boards.h"
#include "sysemu/blockdev.h"
#include "exec/address-spaces.h"
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index 58f73c1bd3..0fd9465cfa 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -18,8 +18,8 @@
*/
#include "hw/sysbus.h"
-#include "hw/arm.h"
-#include "hw/arm/devices.h"
+#include "hw/arm/arm.h"
+#include "hw/devices.h"
#include "hw/loader.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index 8d0fb7584a..cca29719ec 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -8,9 +8,9 @@
*/
#include "hw/sysbus.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/boards.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "net/net.h"
#include "exec/address-spaces.h"
#include "sysemu/sysemu.h"
diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c
index 46264cdeac..cf90f5dc71 100644
--- a/hw/arm/kzm.c
+++ b/hw/arm/kzm.c
@@ -16,8 +16,8 @@
#include "hw/sysbus.h"
#include "exec/address-spaces.h"
#include "hw/hw.h"
-#include "hw/arm.h"
-#include "hw/arm/devices.h"
+#include "hw/arm/arm.h"
+#include "hw/devices.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"
diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c
index b78e6f00d3..260e31481d 100644
--- a/hw/arm/mainstone.c
+++ b/hw/arm/mainstone.c
@@ -13,9 +13,9 @@
*/
#include "hw/hw.h"
#include "hw/arm/pxa.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "net/net.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/block/flash.h"
#include "sysemu/blockdev.h"
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index 97b13405e6..d2247fa1b9 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -10,8 +10,8 @@
*/
#include "hw/sysbus.h"
-#include "hw/arm.h"
-#include "hw/arm/devices.h"
+#include "hw/arm/arm.h"
+#include "hw/devices.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index ba8dc3e01a..4976438ae6 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -21,12 +21,12 @@
#include "qemu-common.h"
#include "sysemu/sysemu.h"
#include "hw/arm/omap.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "hw/irq.h"
#include "ui/console.h"
#include "hw/boards.h"
#include "hw/i2c/i2c.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/block/flash.h"
#include "hw/hw.h"
#include "hw/bt.h"
diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index 17caa61822..f59f0f291a 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -17,7 +17,7 @@
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw/hw.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "hw/arm/omap.h"
#include "sysemu/sysemu.h"
#include "hw/arm/soc_dma.h"
diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c
index 010c483e8c..2ff43710e4 100644
--- a/hw/arm/omap2.c
+++ b/hw/arm/omap2.c
@@ -20,11 +20,11 @@
#include "sysemu/blockdev.h"
#include "hw/hw.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "hw/arm/omap.h"
#include "sysemu/sysemu.h"
#include "qemu/timer.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/block/flash.h"
#include "hw/arm/soc_dma.h"
#include "hw/sysbus.h"
diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
index aa85602aa6..e421ece026 100644
--- a/hw/arm/omap_sx1.c
+++ b/hw/arm/omap_sx1.c
@@ -29,7 +29,7 @@
#include "ui/console.h"
#include "hw/arm/omap.h"
#include "hw/boards.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "hw/block/flash.h"
#include "sysemu/blockdev.h"
#include "exec/address-spaces.h"
diff --git a/hw/arm/palm.c b/hw/arm/palm.c
index 0bc11aed2b..b13d8108a4 100644
--- a/hw/arm/palm.c
+++ b/hw/arm/palm.c
@@ -22,8 +22,8 @@
#include "ui/console.h"
#include "hw/arm/omap.h"
#include "hw/boards.h"
-#include "hw/arm.h"
-#include "hw/arm/devices.h"
+#include "hw/arm/arm.h"
+#include "hw/devices.h"
#include "hw/loader.h"
#include "exec/address-spaces.h"
diff --git a/hw/arm/pic_cpu.c b/hw/arm/pic_cpu.c
index 787767f51f..875280aa97 100644
--- a/hw/arm/pic_cpu.c
+++ b/hw/arm/pic_cpu.c
@@ -8,7 +8,7 @@
*/
#include "hw/hw.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "sysemu/kvm.h"
/* Input 0 is IRQ and input 1 is FIQ. */
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index bbecc770ed..24b03a0d29 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -13,7 +13,7 @@
#include "hw/char/serial.h"
#include "hw/i2c/i2c.h"
#include "hw/ssi.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "sysemu/blockdev.h"
static struct {
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index afd52d31be..feabfc58d4 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -8,9 +8,9 @@
*/
#include "hw/sysbus.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "hw/arm/primecell.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/pci/pci.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index fa434dc68e..c42668ae49 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -12,14 +12,14 @@
#include "hw/hw.h"
#include "hw/arm/pxa.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "sysemu/sysemu.h"
#include "hw/pcmcia.h"
#include "hw/i2c/i2c.h"
#include "hw/ssi.h"
#include "hw/block/flash.h"
#include "qemu/timer.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/arm/sharpsl.h"
#include "ui/console.h"
#include "block/block.h"
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index 952087ce2d..2b61e3c7f8 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -9,8 +9,8 @@
#include "hw/sysbus.h"
#include "hw/ssi.h"
-#include "hw/arm.h"
-#include "hw/arm/devices.h"
+#include "hw/arm/arm.h"
+#include "hw/devices.h"
#include "qemu/timer.h"
#include "hw/i2c/i2c.h"
#include "net/net.h"
diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c
index 5873a3c956..4d49306dd0 100644
--- a/hw/arm/strongarm.c
+++ b/hw/arm/strongarm.c
@@ -29,8 +29,8 @@
#include "hw/sysbus.h"
#include "strongarm.h"
#include "qemu/error-report.h"
-#include "hw/arm.h"
-#include "char/char.h"
+#include "hw/arm/arm.h"
+#include "sysemu/char.h"
#include "sysemu/sysemu.h"
#include "hw/ssi.h"
diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
index c4362d4313..47818a5d01 100644
--- a/hw/arm/tosa.c
+++ b/hw/arm/tosa.c
@@ -13,8 +13,8 @@
#include "hw/hw.h"
#include "hw/arm/pxa.h"
-#include "hw/arm.h"
-#include "hw/arm/devices.h"
+#include "hw/arm/arm.h"
+#include "hw/devices.h"
#include "hw/arm/sharpsl.h"
#include "hw/pcmcia.h"
#include "block/block.h"
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index d9be604481..25c665ab27 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -8,8 +8,8 @@
*/
#include "hw/sysbus.h"
-#include "hw/arm.h"
-#include "hw/arm/devices.h"
+#include "hw/arm/arm.h"
+#include "hw/devices.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
#include "hw/pci/pci.h"
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 96e098579f..a077c62744 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -22,9 +22,9 @@
*/
#include "hw/sysbus.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "hw/arm/primecell.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index 8d65f796f9..41505c32ba 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -16,7 +16,7 @@
*/
#include "hw/sysbus.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "net/net.h"
#include "exec/address-spaces.h"
#include "sysemu/sysemu.h"
diff --git a/hw/arm/z2.c b/hw/arm/z2.c
index 3e272088f5..07a127b498 100644
--- a/hw/arm/z2.c
+++ b/hw/arm/z2.c
@@ -13,8 +13,8 @@
#include "hw/hw.h"
#include "hw/arm/pxa.h"
-#include "hw/arm.h"
-#include "hw/arm/devices.h"
+#include "hw/arm/arm.h"
+#include "hw/devices.h"
#include "hw/i2c/i2c.h"
#include "hw/ssi.h"
#include "hw/boards.h"
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index cd560e3747..55e9d0d37a 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -24,7 +24,7 @@
#include "hw/hw.h"
#include "sysemu/blockdev.h"
#include "hw/ssi.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#ifdef M25P80_ERR_DEBUG
#define DB_PRINT(...) do { \
diff --git a/hw/bt/core.c b/hw/bt/core.c
index 24ef4de49d..49012e028c 100644
--- a/hw/bt/core.c
+++ b/hw/bt/core.c
@@ -18,7 +18,7 @@
*/
#include "qemu-common.h"
-#include "bt/bt.h"
+#include "sysemu/bt.h"
#include "hw/bt.h"
/* Slave implementations can ignore this */
diff --git a/hw/bt/hci-csr.c b/hw/bt/hci-csr.c
index 55c819b085..16a25cb349 100644
--- a/hw/bt/hci-csr.c
+++ b/hw/bt/hci-csr.c
@@ -19,10 +19,10 @@
*/
#include "qemu-common.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/timer.h"
#include "hw/irq.h"
-#include "bt/bt.h"
+#include "sysemu/bt.h"
#include "hw/bt.h"
struct csrhci_s {
diff --git a/hw/bt/hci.c b/hw/bt/hci.c
index a76edea2c9..b53cd5dea2 100644
--- a/hw/bt/hci.c
+++ b/hw/bt/hci.c
@@ -21,7 +21,7 @@
#include "qemu-common.h"
#include "qemu/timer.h"
#include "hw/usb.h"
-#include "bt/bt.h"
+#include "sysemu/bt.h"
#include "hw/bt.h"
struct bt_hci_s {
diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index 421ec998d6..c2a783430b 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -17,7 +17,7 @@
*/
#include "hw/sysbus.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/timer.h"
#ifdef CADENCE_UART_ERR_DEBUG
diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c
index 0588eebb77..02c9577024 100644
--- a/hw/char/debugcon.c
+++ b/hw/char/debugcon.c
@@ -25,7 +25,7 @@
*/
#include "hw/hw.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/isa/isa.h"
#include "hw/i386/pc.h"
diff --git a/hw/char/escc.c b/hw/char/escc.c
index 067b055fee..c2cb07f3bd 100644
--- a/hw/char/escc.c
+++ b/hw/char/escc.c
@@ -25,7 +25,7 @@
#include "hw/hw.h"
#include "hw/sysbus.h"
#include "hw/char/escc.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "ui/console.h"
#include "trace.h"
diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c
index b7499d775b..11820f5864 100644
--- a/hw/char/etraxfs_ser.c
+++ b/hw/char/etraxfs_ser.c
@@ -23,7 +23,7 @@
*/
#include "hw/sysbus.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/log.h"
#define D(x)
diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
index 8b4e72ca11..5751816c62 100644
--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -21,7 +21,7 @@
#include "hw/sysbus.h"
#include "sysemu/sysemu.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/arm/exynos4210.h"
diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c
index 62f799083c..a64453fb18 100644
--- a/hw/char/grlib_apbuart.c
+++ b/hw/char/grlib_apbuart.c
@@ -23,7 +23,7 @@
*/
#include "hw/sysbus.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "trace.h"
diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
index d7ec2090fd..2a2c230c55 100644
--- a/hw/char/imx_serial.c
+++ b/hw/char/imx_serial.c
@@ -20,7 +20,7 @@
#include "hw/hw.h"
#include "hw/sysbus.h"
#include "sysemu/sysemu.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/arm/imx.h"
//#define DEBUG_SERIAL 1
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index fcd0af31b4..c9698a6bc4 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -10,7 +10,7 @@
#include "ipack.h"
#include "qemu/bitops.h"
-#include "char/char.h"
+#include "sysemu/char.h"
/* #define DEBUG_IPOCTAL */
diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c
index 93f0d1534e..839f3ebfe7 100644
--- a/hw/char/lm32_juart.c
+++ b/hw/char/lm32_juart.c
@@ -20,7 +20,7 @@
#include "hw/hw.h"
#include "hw/sysbus.h"
#include "trace.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/lm32/lm32_juart.h"
diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c
index 32bc37ac96..99721ab78d 100644
--- a/hw/char/lm32_uart.c
+++ b/hw/char/lm32_uart.c
@@ -25,7 +25,7 @@
#include "hw/hw.h"
#include "hw/sysbus.h"
#include "trace.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/error-report.h"
enum {
diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c
index 6724b1b718..3ec4705867 100644
--- a/hw/char/mcf_uart.c
+++ b/hw/char/mcf_uart.c
@@ -7,7 +7,7 @@
*/
#include "hw/hw.h"
#include "hw/m68k/mcf.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "exec/address-spaces.h"
typedef struct {
diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
index f3bdf6991a..cbc7d73a6e 100644
--- a/hw/char/milkymist-uart.c
+++ b/hw/char/milkymist-uart.c
@@ -24,7 +24,7 @@
#include "hw/hw.h"
#include "hw/sysbus.h"
#include "trace.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/error-report.h"
enum {
diff --git a/hw/char/omap_uart.c b/hw/char/omap_uart.c
index 26c14266fc..5bb36ed2c1 100644
--- a/hw/char/omap_uart.c
+++ b/hw/char/omap_uart.c
@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/hw.h"
#include "hw/arm/omap.h"
#include "hw/char/serial.h"
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 863a6fb4a9..b5e867f21c 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
#include "hw/hw.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/isa/isa.h"
#include "hw/i386/pc.h"
#include "sysemu/sysemu.h"
diff --git a/hw/char/pl011.c b/hw/char/pl011.c
index 332d5b970c..7079ef6be1 100644
--- a/hw/char/pl011.c
+++ b/hw/char/pl011.c
@@ -8,7 +8,7 @@
*/
#include "hw/sysbus.h"
-#include "char/char.h"
+#include "sysemu/char.h"
typedef struct {
SysBusDevice busdev;
diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c
index 42ed54c9ab..bcc7893230 100644
--- a/hw/char/sclpconsole.c
+++ b/hw/char/sclpconsole.c
@@ -18,7 +18,7 @@
#include "hw/s390x/sclp.h"
#include "hw/s390x/event-facility.h"
-#include "char/char.h"
+#include "sysemu/char.h"
typedef struct ASCIIConsoleData {
EventBufferHeader ebh;
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 1151bf1bab..66b6348867 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -24,7 +24,7 @@
*/
#include "hw/char/serial.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/timer.h"
#include "exec/address-spaces.h"
diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c
index 450c7d8551..b3286438ca 100644
--- a/hw/char/sh_serial.c
+++ b/hw/char/sh_serial.c
@@ -26,7 +26,7 @@
*/
#include "hw/hw.h"
#include "hw/sh4/sh.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "exec/address-spaces.h"
//#define DEBUG_SERIAL
diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c
index 9df018a230..afcec1f182 100644
--- a/hw/char/spapr_vty.c
+++ b/hw/char/spapr_vty.c
@@ -1,5 +1,5 @@
#include "hw/qdev.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/ppc/spapr.h"
#include "hw/ppc/spapr_vio.h"
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 31f672c9a3..50350303cd 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -10,7 +10,7 @@
* the COPYING file in the top-level directory.
*/
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/error-report.h"
#include "trace.h"
#include "hw/virtio/virtio-serial.h"
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index efc32320fa..eb7f450aba 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -30,7 +30,7 @@
#include <sys/mman.h>
#include "hw/hw.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/xen/xen_backend.h"
#include <xen/io/console.h>
diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c
index 079f4d4e1a..3f7e989f35 100644
--- a/hw/char/xilinx_uartlite.c
+++ b/hw/char/xilinx_uartlite.c
@@ -23,7 +23,7 @@
*/
#include "hw/sysbus.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#define DUART(x)
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 8c2e15205c..0eada32dcf 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -17,7 +17,7 @@
#include "hw/block/block.h"
#include "net/hub.h"
#include "qapi/visitor.h"
-#include "char/char.h"
+#include "sysemu/char.h"
static void get_pointer(Object *obj, Visitor *v, Property *prop,
const char *(*print)(void *ptr),
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 9a0872d3b9..ddde18e6b4 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -5,7 +5,7 @@
#include "hw/block/block.h"
#include "net/hub.h"
#include "qapi/visitor.h"
-#include "char/char.h"
+#include "sysemu/char.h"
void qdev_prop_set_after_realize(DeviceState *dev, const char *name,
Error **errp)
diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c
index 175c5cdd00..de7ccf87dc 100644
--- a/hw/display/blizzard.c
+++ b/hw/display/blizzard.c
@@ -20,7 +20,7 @@
#include "qemu-common.h"
#include "ui/console.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "vga_int.h"
#include "ui/pixel_ops.h"
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 6b660ac1c0..9878df4af6 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -26,7 +26,7 @@
#include "hw/hw.h"
#include "hw/char/serial.h"
#include "ui/console.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/sysbus.h"
#include "hw/qdev-addr.h"
#include "qemu/range.h"
diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c
index e252ce945f..178a21fd8d 100644
--- a/hw/display/tc6393xb.c
+++ b/hw/display/tc6393xb.c
@@ -11,7 +11,7 @@
* GNU GPL, version 2 or (at your option) any later version.
*/
#include "hw/hw.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/block/flash.h"
#include "ui/console.h"
#include "ui/pixel_ops.h"
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 8e4266142d..e371569585 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -37,7 +37,7 @@
#include "hw/hw.h"
#include "ui/console.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/xen/xen_backend.h"
#include <xen/event_channel.h>
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 8d75b34218..0d6e72b209 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -52,6 +52,7 @@
#include "sysemu/arch_init.h"
#include "qemu/bitmap.h"
#include "qemu/config-file.h"
+#include "hw/acpi/acpi.h"
/* debug PC/ISA interrupts */
//#define DEBUG_IRQ
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index cff8013b83..943758ad30 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -43,6 +43,7 @@
#include "hw/xen/xen.h"
#include "exec/memory.h"
#include "exec/address-spaces.h"
+#include "hw/acpi/acpi.h"
#include "cpu.h"
#ifdef CONFIG_XEN
# include <xen/hvm/hvm_info_table.h>
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index d0ae8afba2..3405583f59 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -29,7 +29,6 @@
#include "monitor/monitor.h"
#include "sysemu/dma.h"
-#include "exec/cpu-common.h"
#include "internal.h"
#include <hw/ide/pci.h>
#include <hw/ide/ahci.h>
diff --git a/hw/ide/internal.h b/hw/ide/internal.h
index 2c89b50c5e..0efb2da19b 100644
--- a/hw/ide/internal.h
+++ b/hw/ide/internal.h
@@ -8,7 +8,6 @@
*/
#include <hw/ide.h>
#include <hw/isa/isa.h>
-#include "exec/iorange.h"
#include "sysemu/dma.h"
#include "sysemu/sysemu.h"
#include "hw/block/block.h"
diff --git a/hw/input/stellaris_input.c b/hw/input/stellaris_input.c
index f83fc3f288..4e407922a0 100644
--- a/hw/input/stellaris_input.c
+++ b/hw/input/stellaris_input.c
@@ -7,7 +7,7 @@
* This code is licensed under the GPL.
*/
#include "hw/hw.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "ui/console.h"
typedef struct {
diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c
index 34ee1fb3cf..a771cd5e52 100644
--- a/hw/input/tsc2005.c
+++ b/hw/input/tsc2005.c
@@ -21,7 +21,7 @@
#include "hw/hw.h"
#include "qemu/timer.h"
#include "ui/console.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#define TSC_CUT_RESOLUTION(value, p) ((value) >> (16 - (p ? 12 : 10)))
diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c
index e6c217c8db..9b854e77dd 100644
--- a/hw/input/tsc210x.c
+++ b/hw/input/tsc210x.c
@@ -24,7 +24,7 @@
#include "qemu/timer.h"
#include "ui/console.h"
#include "hw/arm/omap.h" /* For I2SCodec and uWireSlave */
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#define TSC_DATA_REGISTERS_PAGE 0x0
#define TSC_CONTROL_REGISTERS_PAGE 0x1
diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
index 67dbe68cdc..25fa43cb2d 100644
--- a/hw/intc/armv7m_nvic.c
+++ b/hw/intc/armv7m_nvic.c
@@ -12,7 +12,7 @@
#include "hw/sysbus.h"
#include "qemu/timer.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#include "exec/address-spaces.h"
#include "gic_internal.h"
diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index 9f5e185685..82f7c80f9c 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -27,7 +27,7 @@
#include "qemu/error-report.h"
#include "sysemu/blockdev.h"
#include "sysemu/sysemu.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "trace.h"
diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c
index 6555a97e2e..1ca94980fb 100644
--- a/hw/lm32/lm32_boards.c
+++ b/hw/lm32/lm32_boards.c
@@ -20,7 +20,7 @@
#include "hw/sysbus.h"
#include "hw/hw.h"
#include "hw/block/flash.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/loader.h"
#include "sysemu/blockdev.h"
diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
index d02ca0cc04..cca93748aa 100644
--- a/hw/lm32/milkymist.c
+++ b/hw/lm32/milkymist.c
@@ -21,7 +21,7 @@
#include "hw/hw.h"
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/loader.h"
#include "elf.h"
diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c
index f61818b42b..ae7ff44423 100644
--- a/hw/microblaze/petalogix_ml605_mmu.c
+++ b/hw/microblaze/petalogix_ml605_mmu.c
@@ -30,7 +30,7 @@
#include "net/net.h"
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/xilinx.h"
#include "sysemu/blockdev.h"
diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c
index eedd60e38c..7c258f03af 100644
--- a/hw/microblaze/petalogix_s3adsp1800_mmu.c
+++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c
@@ -28,7 +28,7 @@
#include "net/net.h"
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/xilinx.h"
#include "sysemu/blockdev.h"
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 3cf27fa822..1aac93a414 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -30,7 +30,7 @@
#include "hw/mips/mips.h"
#include "hw/mips/cpudevs.h"
#include "hw/pci/pci.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "sysemu/sysemu.h"
#include "audio/audio.h"
#include "qemu/log.h"
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index a3e936b77f..86f42b2ede 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -34,7 +34,7 @@
#include "hw/mips/mips.h"
#include "hw/mips/cpudevs.h"
#include "hw/pci/pci.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "sysemu/sysemu.h"
#include "sysemu/arch_init.h"
#include "hw/boards.h"
diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c
index 3d9027f692..29b467b61f 100644
--- a/hw/misc/cbus.c
+++ b/hw/misc/cbus.c
@@ -22,7 +22,7 @@
#include "qemu-common.h"
#include "hw/irq.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "sysemu/sysemu.h"
//#define DEBUG
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index f92ce19dde..a19a6d6d8c 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -24,7 +24,7 @@
#include "migration/migration.h"
#include "qapi/qmp/qerror.h"
#include "qemu/event_notifier.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include <sys/mman.h>
#include <sys/types.h>
diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c
index 04cf267f13..403fb868ae 100644
--- a/hw/net/lan9118.c
+++ b/hw/net/lan9118.c
@@ -12,7 +12,7 @@
#include "hw/sysbus.h"
#include "net/net.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "sysemu/sysemu.h"
#include "hw/ptimer.h"
/* For crc32 */
diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c
index f659256d6e..c2feae6eb8 100644
--- a/hw/net/smc91c111.c
+++ b/hw/net/smc91c111.c
@@ -9,7 +9,7 @@
#include "hw/sysbus.h"
#include "net/net.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
/* For crc32 */
#include <zlib.h>
diff --git a/hw/net/vmxnet_tx_pkt.c b/hw/net/vmxnet_tx_pkt.c
index b1e795b3b2..fc01e4da3c 100644
--- a/hw/net/vmxnet_tx_pkt.c
+++ b/hw/net/vmxnet_tx_pkt.c
@@ -15,6 +15,7 @@
*
*/
+#include "hw/hw.h"
#include "vmxnet_tx_pkt.h"
#include "net/eth.h"
#include "qemu-common.h"
@@ -22,7 +23,6 @@
#include "net/checksum.h"
#include "net/tap.h"
#include "net/net.h"
-#include "exec/cpu-common.h"
enum {
VMXNET_TX_PKT_VHDR_FRAG = 0,
diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c
index 5275f4810d..1d9074a1d0 100644
--- a/hw/net/xgmac.c
+++ b/hw/net/xgmac.c
@@ -25,7 +25,7 @@
*/
#include "hw/sysbus.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/log.h"
#include "net/net.h"
#include "net/checksum.h"
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index ff87ac31d1..c0d7e62f32 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -26,7 +26,7 @@
*/
#include "cpu.h"
#include "sysemu/sysemu.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/qdev.h"
#include "sysemu/device_tree.h"
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index b71b59c5cf..8ecaa5f8ec 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -26,7 +26,7 @@
*/
#include "cpu.h"
#include "sysemu/sysemu.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/qdev.h"
#include "sysemu/device_tree.h"
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index 92b43947f7..6728ba7ea0 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -27,7 +27,7 @@
#include "hw/char/serial.h"
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/boards.h"
#include "sysemu/device_tree.h"
#include "hw/loader.h"
diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index fe82bd62fe..3e4818e170 100644
--- a/hw/sh4/r2d.c
+++ b/hw/sh4/r2d.c
@@ -26,7 +26,7 @@
#include "hw/sysbus.h"
#include "hw/hw.h"
#include "hw/sh4/sh.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"
#include "hw/pci/pci.h"
diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index 3b27d4019a..78c77eff46 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -24,7 +24,7 @@
#include "hw/hw.h"
#include "qemu/timer.h"
#include "hw/ptimer.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"
#include "hw/loader.h"
diff --git a/hw/timer/tusb6010.c b/hw/timer/tusb6010.c
index 533938a9b4..50edc063d1 100644
--- a/hw/timer/tusb6010.c
+++ b/hw/timer/tusb6010.c
@@ -23,7 +23,7 @@
#include "hw/usb.h"
#include "hw/arm/omap.h"
#include "hw/irq.h"
-#include "hw/arm/devices.h"
+#include "hw/devices.h"
#include "hw/sysbus.h"
typedef struct TUSBState {
diff --git a/tpm/Makefile.objs b/hw/tpm/Makefile.objs
index 86768244e4..99f5983143 100644
--- a/tpm/Makefile.objs
+++ b/hw/tpm/Makefile.objs
@@ -1,6 +1,2 @@
-common-obj-y = tpm.o
-ifeq ($(CONFIG_TPM),y)
-common-obj-y += tpm_backend.o
common-obj-$(CONFIG_TPM_TIS) += tpm_tis.o
common-obj-$(CONFIG_TPM_PASSTHROUGH) += tpm_passthrough.o
-endif
diff --git a/tpm/tpm_int.h b/hw/tpm/tpm_int.h
index 340bfd52f1..08f87cb9a8 100644
--- a/tpm/tpm_int.h
+++ b/hw/tpm/tpm_int.h
@@ -13,7 +13,7 @@
#define TPM_TPM_INT_H
#include "exec/memory.h"
-#include "tpm/tpm_tis.h"
+#include "tpm_tis.h"
/* overall state of the TPM interface */
struct TPMState {
@@ -33,32 +33,6 @@ struct TPMState {
#define TPM(obj) OBJECT_CHECK(TPMState, (obj), TYPE_TPM_TIS)
-struct TPMDriverOps {
- enum TpmType type;
- /* get a descriptive text of the backend to display to the user */
- const char *(*desc)(void);
-
- TPMBackend *(*create)(QemuOpts *opts, const char *id);
- void (*destroy)(TPMBackend *t);
-
- /* initialize the backend */
- int (*init)(TPMBackend *t, TPMState *s, TPMRecvDataCB *datacb);
- /* start up the TPM on the backend */
- int (*startup_tpm)(TPMBackend *t);
- /* returns true if nothing will ever answer TPM requests */
- bool (*had_startup_error)(TPMBackend *t);
-
- size_t (*realloc_buffer)(TPMSizedBuffer *sb);
-
- void (*deliver_request)(TPMBackend *t);
-
- void (*reset)(TPMBackend *t);
-
- void (*cancel_cmd)(TPMBackend *t);
-
- bool (*get_tpm_established_flag)(TPMBackend *t);
-};
-
struct tpm_req_hdr {
uint16_t tag;
uint32_t len;
@@ -83,13 +57,4 @@ struct tpm_resp_hdr {
#define TPM_ORD_GetTicks 0xf1
-TPMBackend *qemu_find_tpm(const char *id);
-int tpm_register_model(enum TpmModel model);
-int tpm_register_driver(const TPMDriverOps *tdo);
-void tpm_display_backend_drivers(void);
-const TPMDriverOps *tpm_get_backend_driver(const char *type);
-void tpm_write_fatal_error_response(uint8_t *out, uint32_t out_len);
-
-extern const TPMDriverOps tpm_passthrough_driver;
-
#endif /* TPM_TPM_INT_H */
diff --git a/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index 1fdd66d356..416b9b65c7 100644
--- a/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -27,12 +27,12 @@
#include "qemu-common.h"
#include "qapi/error.h"
#include "qemu/sockets.h"
-#include "backends/tpm.h"
+#include "sysemu/tpm_backend.h"
#include "tpm_int.h"
#include "hw/hw.h"
#include "hw/i386/pc.h"
+#include "sysemu/tpm_backend_int.h"
#include "tpm_tis.h"
-#include "tpm_backend.h"
/* #define DEBUG_TPM */
@@ -48,6 +48,8 @@
#define TPM_PASSTHROUGH(obj) \
OBJECT_CHECK(TPMPassthruState, (obj), TYPE_TPM_PASSTHROUGH)
+static const TPMDriverOps tpm_passthrough_driver;
+
/* data structures */
typedef struct TPMPassthruThreadParams {
TPMState *tpm_state;
@@ -96,6 +98,20 @@ static uint32_t tpm_passthrough_get_size_from_buffer(const uint8_t *buf)
return be32_to_cpu(resp->len);
}
+/*
+ * Write an error message in the given output buffer.
+ */
+static void tpm_write_fatal_error_response(uint8_t *out, uint32_t out_len)
+{
+ if (out_len >= sizeof(struct tpm_resp_hdr)) {
+ struct tpm_resp_hdr *resp = (struct tpm_resp_hdr *)out;
+
+ resp->tag = cpu_to_be16(TPM_TAG_RSP_COMMAND);
+ resp->len = cpu_to_be32(sizeof(struct tpm_resp_hdr));
+ resp->errcode = cpu_to_be32(TPM_FAIL);
+ }
+}
+
static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
const uint8_t *in, uint32_t in_len,
uint8_t *out, uint32_t out_len)
@@ -512,7 +528,7 @@ static void tpm_passthrough_destroy(TPMBackend *tb)
g_free(tpm_pt->tpm_dev);
}
-const TPMDriverOps tpm_passthrough_driver = {
+static const TPMDriverOps tpm_passthrough_driver = {
.type = TPM_TYPE_PASSTHROUGH,
.desc = tpm_passthrough_create_desc,
.create = tpm_passthrough_create,
diff --git a/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index f0a4584607..d4d8152875 100644
--- a/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -19,14 +19,14 @@
* specification.
*/
-#include "backends/tpm.h"
+#include "sysemu/tpm_backend.h"
#include "tpm_int.h"
#include "block/block.h"
#include "exec/address-spaces.h"
#include "hw/hw.h"
#include "hw/i386/pc.h"
#include "hw/pci/pci_ids.h"
-#include "tpm/tpm_tis.h"
+#include "tpm_tis.h"
#include "qemu-common.h"
/*#define DEBUG_TIS */
diff --git a/tpm/tpm_tis.h b/hw/tpm/tpm_tis.h
index 1be4ddc8a1..916152ae3e 100644
--- a/tpm/tpm_tis.h
+++ b/hw/tpm/tpm_tis.h
@@ -35,11 +35,6 @@
#define TYPE_TPM_TIS "tpm-tis"
-struct TPMSizedBuffer {
- uint32_t size;
- uint8_t *buffer;
-};
-
typedef enum {
TPM_TIS_STATE_IDLE = 0,
TPM_TIS_STATE_READY,
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index 29dcd7acbf..d534c94c1a 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -32,7 +32,7 @@
#include <vcard_emul.h>
#include "qemu/thread.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "monitor/monitor.h"
#include "ccid.h"
diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
index 5e017ae0ca..71a45f674f 100644
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -8,7 +8,7 @@
* See the COPYING file in the top-level directory.
*/
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/sockets.h"
#include "monitor/monitor.h"
#include "ccid.h"
diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c
index 0f8aa48c85..68cc1d4fab 100644
--- a/hw/usb/dev-bluetooth.c
+++ b/hw/usb/dev-bluetooth.c
@@ -21,7 +21,7 @@
#include "qemu-common.h"
#include "hw/usb.h"
#include "hw/usb/desc.h"
-#include "bt/bt.h"
+#include "sysemu/bt.h"
#include "hw/bt.h"
struct USBBtState {
diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c
index 7c314dc59d..dd0a608bff 100644
--- a/hw/usb/dev-serial.c
+++ b/hw/usb/dev-serial.c
@@ -12,7 +12,7 @@
#include "qemu/error-report.h"
#include "hw/usb.h"
#include "hw/usb/desc.h"
-#include "char/char.h"
+#include "sysemu/char.h"
//#define DEBUG_Serial
diff --git a/hw/usb/libhw.c b/hw/usb/libhw.c
index 75f022f4ec..d2d4b51b94 100644
--- a/hw/usb/libhw.c
+++ b/hw/usb/libhw.c
@@ -20,7 +20,7 @@
* THE SOFTWARE.
*/
#include "qemu-common.h"
-#include "exec/cpu-common.h"
+#include "hw/hw.h"
#include "hw/usb.h"
#include "sysemu/dma.h"
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 0ddb0818d8..a594e954e4 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -30,7 +30,7 @@
#include "monitor/monitor.h"
#include "sysemu/sysemu.h"
#include "qemu/iov.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include <dirent.h>
#include <sys/ioctl.h>
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index 6079b2a3a9..fcc223af06 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -14,7 +14,7 @@
#include "qapi/qmp/qerror.h"
#include "hw/virtio/virtio.h"
#include "hw/virtio/virtio-rng.h"
-#include "qemu/rng.h"
+#include "sysemu/rng.h"
static bool is_guest_ready(VirtIORNG *vrng)
{
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 2a8c9f5d1a..d82ce5d8a6 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -35,7 +35,7 @@
#include <sys/signal.h>
#include "hw/hw.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/log.h"
#include "hw/xen/xen_backend.h"
diff --git a/hw/xtensa/xtensa_lx60.c b/hw/xtensa/xtensa_lx60.c
index 2682eda2ad..650dd31c98 100644
--- a/hw/xtensa/xtensa_lx60.c
+++ b/hw/xtensa/xtensa_lx60.c
@@ -36,7 +36,7 @@
#include "hw/sysbus.h"
#include "hw/block/flash.h"
#include "sysemu/blockdev.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "xtensa_bootparam.h"
typedef struct LxBoardDesc {
diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
index 977467bb57..1b156fd58f 100644
--- a/include/exec/memory-internal.h
+++ b/include/exec/memory-internal.h
@@ -49,12 +49,6 @@ ram_addr_t qemu_ram_alloc(ram_addr_t size, MemoryRegion *mr);
void qemu_ram_free(ram_addr_t addr);
void qemu_ram_free_from_ptr(ram_addr_t addr);
-struct MemoryRegion;
-struct MemoryRegionSection;
-
-void qemu_register_coalesced_mmio(hwaddr addr, ram_addr_t size);
-void qemu_unregister_coalesced_mmio(hwaddr addr, ram_addr_t size);
-
#define VGA_DIRTY_FLAG 0x01
#define CODE_DIRTY_FLAG 0x02
#define MIGRATION_DIRTY_FLAG 0x08
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 2322732dce..9e88320113 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -27,7 +27,6 @@
#include "qemu/int128.h"
typedef struct MemoryRegionOps MemoryRegionOps;
-typedef struct MemoryRegion MemoryRegion;
typedef struct MemoryRegionPortio MemoryRegionPortio;
typedef struct MemoryRegionMmio MemoryRegionMmio;
@@ -157,8 +156,6 @@ struct MemoryRegionPortio {
#define PORTIO_END_OF_LIST() { }
-typedef struct AddressSpace AddressSpace;
-
/**
* AddressSpace: describes a mapping of addresses to #MemoryRegion objects
*/
@@ -173,8 +170,6 @@ struct AddressSpace {
QTAILQ_ENTRY(AddressSpace) address_spaces_link;
};
-typedef struct MemoryRegionSection MemoryRegionSection;
-
/**
* MemoryRegionSection: describes a fragment of a #MemoryRegion
*
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index de7fb3c0a4..635be7be10 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -160,4 +160,11 @@ void acpi_gpe_reset(ACPIREGS *ar);
void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val);
uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr);
+/* acpi.c */
+extern int acpi_enabled;
+extern char unsigned *acpi_tables;
+extern size_t acpi_tables_len;
+
+void acpi_table_add(const QemuOpts *opts, Error **errp);
+
#endif /* !QEMU_HW_ACPI_H */
diff --git a/include/hw/arm.h b/include/hw/arm/arm.h
index 7b2b02daaf..7b2b02daaf 100644
--- a/include/hw/arm.h
+++ b/include/hw/arm/arm.h
diff --git a/include/hw/arm/devices.h b/include/hw/devices.h
index c60bcabae3..c60bcabae3 100644
--- a/include/hw/arm/devices.h
+++ b/include/hw/devices.h
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 5d40914f49..9bcc8193b7 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -107,14 +107,6 @@ void cpu_smm_register(cpu_set_smm_t callback, void *arg);
void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name);
-/* acpi.c */
-extern int acpi_enabled;
-extern char unsigned *acpi_tables;
-extern size_t acpi_tables_len;
-
-void acpi_bios_init(void);
-void acpi_table_add(const QemuOpts *opts, Error **errp);
-
/* acpi_piix.c */
i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
diff --git a/include/hw/virtio/virtio-rng.h b/include/hw/virtio/virtio-rng.h
index 3711c97a70..c9cadc24b6 100644
--- a/include/hw/virtio/virtio-rng.h
+++ b/include/hw/virtio/virtio-rng.h
@@ -12,8 +12,8 @@
#ifndef _QEMU_VIRTIO_RNG_H
#define _QEMU_VIRTIO_RNG_H
-#include "qemu/rng.h"
-#include "qemu/rng-random.h"
+#include "sysemu/rng.h"
+#include "sysemu/rng-random.h"
/* The Virtio ID for the virtio rng device */
#define VIRTIO_ID_RNG 4
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index fd532a268d..93aae81a82 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -18,6 +18,10 @@ typedef struct DeviceState DeviceState;
typedef struct BusState BusState;
typedef struct BusClass BusClass;
+typedef struct AddressSpace AddressSpace;
+typedef struct MemoryRegion MemoryRegion;
+typedef struct MemoryRegionSection MemoryRegionSection;
+
typedef struct NICInfo NICInfo;
typedef struct HCIInfo HCIInfo;
typedef struct AudioState AudioState;
diff --git a/include/bt/bt.h b/include/sysemu/bt.h
index 2bc6d53cca..2bc6d53cca 100644
--- a/include/bt/bt.h
+++ b/include/sysemu/bt.h
diff --git a/include/char/char.h b/include/sysemu/char.h
index 9d1ea46117..9d1ea46117 100644
--- a/include/char/char.h
+++ b/include/sysemu/char.h
diff --git a/include/qemu/rng-random.h b/include/sysemu/rng-random.h
index 4332772a24..4332772a24 100644
--- a/include/qemu/rng-random.h
+++ b/include/sysemu/rng-random.h
diff --git a/include/qemu/rng.h b/include/sysemu/rng.h
index 509abd023d..509abd023d 100644
--- a/include/qemu/rng.h
+++ b/include/sysemu/rng.h
diff --git a/include/tpm/tpm.h b/include/sysemu/tpm.h
index 2d457c4439..13febddbee 100644
--- a/include/tpm/tpm.h
+++ b/include/sysemu/tpm.h
@@ -15,8 +15,6 @@
#include "qemu/option.h"
typedef struct TPMState TPMState;
-typedef struct TPMSizedBuffer TPMSizedBuffer;
-typedef void (TPMRecvDataCB)(TPMState *, uint8_t locty);
int tpm_config_parse(QemuOptsList *opts_list, const char *optarg);
int tpm_init(void);
diff --git a/include/backends/tpm.h b/include/sysemu/tpm_backend.h
index 9e93cc5060..466787453d 100644
--- a/include/backends/tpm.h
+++ b/include/sysemu/tpm_backend.h
@@ -18,7 +18,7 @@
#include "qapi/error.h"
#include "qapi-types.h"
#include "qemu/option.h"
-#include "tpm/tpm.h"
+#include "sysemu/tpm.h"
#define TYPE_TPM_BACKEND "tpm-backend"
#define TPM_BACKEND(obj) \
@@ -56,6 +56,39 @@ struct TPMBackend {
QLIST_ENTRY(TPMBackend) list;
};
+typedef void (TPMRecvDataCB)(TPMState *, uint8_t locty);
+
+typedef struct TPMSizedBuffer {
+ uint32_t size;
+ uint8_t *buffer;
+} TPMSizedBuffer;
+
+struct TPMDriverOps {
+ enum TpmType type;
+ /* get a descriptive text of the backend to display to the user */
+ const char *(*desc)(void);
+
+ TPMBackend *(*create)(QemuOpts *opts, const char *id);
+ void (*destroy)(TPMBackend *t);
+
+ /* initialize the backend */
+ int (*init)(TPMBackend *t, TPMState *s, TPMRecvDataCB *datacb);
+ /* start up the TPM on the backend */
+ int (*startup_tpm)(TPMBackend *t);
+ /* returns true if nothing will ever answer TPM requests */
+ bool (*had_startup_error)(TPMBackend *t);
+
+ size_t (*realloc_buffer)(TPMSizedBuffer *sb);
+
+ void (*deliver_request)(TPMBackend *t);
+
+ void (*reset)(TPMBackend *t);
+
+ void (*cancel_cmd)(TPMBackend *t);
+
+ bool (*get_tpm_established_flag)(TPMBackend *t);
+};
+
/**
* tpm_backend_get_type:
@@ -167,4 +200,10 @@ bool tpm_backend_get_tpm_established_flag(TPMBackend *s);
*/
void tpm_backend_open(TPMBackend *s, Error **errp);
+TPMBackend *qemu_find_tpm(const char *id);
+
+const TPMDriverOps *tpm_get_backend_driver(const char *type);
+int tpm_register_model(enum TpmModel model);
+int tpm_register_driver(const TPMDriverOps *tdo);
+
#endif
diff --git a/tpm/tpm_backend.h b/include/sysemu/tpm_backend_int.h
index 05d94d0f5b..05d94d0f5b 100644
--- a/tpm/tpm_backend.h
+++ b/include/sysemu/tpm_backend_int.h
diff --git a/kvm-stub.c b/kvm-stub.c
index 760aadc874..f6137d343a 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -14,7 +14,6 @@
#include "hw/hw.h"
#include "hw/pci/msi.h"
#include "cpu.h"
-#include "exec/gdbstub.h"
#include "sysemu/kvm.h"
KVMState *kvm_state;
diff --git a/monitor.c b/monitor.c
index 0f7d52c543..332abe76f3 100644
--- a/monitor.c
+++ b/monitor.c
@@ -33,7 +33,7 @@
#include "exec/gdbstub.h"
#include "net/net.h"
#include "net/slirp.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "ui/qemu-spice.h"
#include "sysemu/sysemu.h"
#include "monitor/monitor.h"
@@ -47,7 +47,7 @@
#include "migration/migration.h"
#include "sysemu/kvm.h"
#include "qemu/acl.h"
-#include "tpm/tpm.h"
+#include "sysemu/tpm.h"
#include "qapi/qmp/qint.h"
#include "qapi/qmp/qfloat.h"
#include "qapi/qmp/qlist.h"
diff --git a/net/slirp.c b/net/slirp.c
index eabfee6d4f..b3f35d5861 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -35,7 +35,7 @@
#include "monitor/monitor.h"
#include "qemu/sockets.h"
#include "slirp/libslirp.h"
-#include "char/char.h"
+#include "sysemu/char.h"
static int get_str_sep(char *buf, int buf_size, const char **pp, int sep)
{
diff --git a/qemu-char.c b/qemu-char.c
index 90cc1d6fbe..728ed9b477 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -26,7 +26,7 @@
#include "ui/console.h"
#include "sysemu/sysemu.h"
#include "qemu/timer.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "hw/usb.h"
#include "qmp-commands.h"
diff --git a/qmp.c b/qmp.c
index 55b056b558..ed6c7ef3ae 100644
--- a/qmp.c
+++ b/qmp.c
@@ -16,7 +16,7 @@
#include "qemu-common.h"
#include "sysemu/sysemu.h"
#include "qmp-commands.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "ui/qemu-spice.h"
#include "ui/vnc.h"
#include "sysemu/kvm.h"
diff --git a/qtest.c b/qtest.c
index b03b68adb3..3bba3e5751 100644
--- a/qtest.c
+++ b/qtest.c
@@ -13,7 +13,7 @@
#include "sysemu/qtest.h"
#include "hw/qdev.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "exec/ioport.h"
#include "exec/memory.h"
#include "hw/irq.h"
diff --git a/slirp/slirp.c b/slirp/slirp.c
index bd9b7cb644..80b28ea89e 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -23,7 +23,7 @@
*/
#include "qemu-common.h"
#include "qemu/timer.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "slirp.h"
#include "hw/hw.h"
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index 535f955ca8..c9403de8af 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -1,7 +1,7 @@
#include "config-host.h"
#include "trace.h"
#include "ui/qemu-spice.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include <spice.h>
#include <spice-experimental.h>
#include <spice/protocol.h>
diff --git a/target-arm/arm-semi.c b/target-arm/arm-semi.c
index 77718c4caa..f0637a43f2 100644
--- a/target-arm/arm-semi.c
+++ b/target-arm/arm-semi.c
@@ -34,7 +34,7 @@
#else
#include "qemu-common.h"
#include "exec/gdbstub.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
#endif
#define TARGET_SYS_OPEN 0x01
diff --git a/target-arm/kvm.c b/target-arm/kvm.c
index 6bfb10350b..d8acace9b7 100644
--- a/target-arm/kvm.c
+++ b/target-arm/kvm.c
@@ -21,7 +21,7 @@
#include "sysemu/kvm.h"
#include "kvm_arm.h"
#include "cpu.h"
-#include "hw/arm.h"
+#include "hw/arm/arm.h"
const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
KVM_CAP_LAST_INFO
diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h
index c30b006674..6bcc5cc36c 100644
--- a/target-ppc/kvm_ppc.h
+++ b/target-ppc/kvm_ppc.h
@@ -9,8 +9,6 @@
#ifndef __KVM_PPC_H__
#define __KVM_PPC_H__
-#include "exec/memory.h"
-
#define TYPE_HOST_POWERPC_CPU "host-" TYPE_POWERPC_CPU
void kvmppc_init(void);
diff --git a/tpm/tpm.c b/tpm.c
index 1f4ac8da00..c91da43cf1 100644
--- a/tpm/tpm.c
+++ b/tpm.c
@@ -15,9 +15,8 @@
#include "monitor/monitor.h"
#include "qapi/qmp/qerror.h"
-#include "backends/tpm.h"
-#include "tpm_int.h"
-#include "tpm/tpm.h"
+#include "sysemu/tpm_backend.h"
+#include "sysemu/tpm.h"
#include "qemu/config-file.h"
#include "qmp-commands.h"
@@ -62,20 +61,6 @@ static bool tpm_model_is_registered(enum TpmModel model)
return false;
}
-/*
- * Write an error message in the given output buffer.
- */
-void tpm_write_fatal_error_response(uint8_t *out, uint32_t out_len)
-{
- if (out_len >= sizeof(struct tpm_resp_hdr)) {
- struct tpm_resp_hdr *resp = (struct tpm_resp_hdr *)out;
-
- resp->tag = cpu_to_be16(TPM_TAG_RSP_COMMAND);
- resp->len = cpu_to_be32(sizeof(struct tpm_resp_hdr));
- resp->errcode = cpu_to_be32(TPM_FAIL);
- }
-}
-
const TPMDriverOps *tpm_get_backend_driver(const char *type)
{
int i;
@@ -109,7 +94,7 @@ int tpm_register_driver(const TPMDriverOps *tdo)
* Walk the list of available TPM backend drivers and display them on the
* screen.
*/
-void tpm_display_backend_drivers(void)
+static void tpm_display_backend_drivers(void)
{
int i;
diff --git a/tpm/tpm_backend.c b/tpm/tpm_backend.c
deleted file mode 100644
index 4144ef7d76..0000000000
--- a/tpm/tpm_backend.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * common TPM backend driver functions
- *
- * Copyright (c) 2012-2013 IBM Corporation
- * Authors:
- * Stefan Berger <stefanb@us.ibm.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, see <http://www.gnu.org/licenses/>
- */
-
-#include "tpm/tpm.h"
-#include "qemu/thread.h"
-#include "tpm_backend.h"
-
-void tpm_backend_thread_deliver_request(TPMBackendThread *tbt)
-{
- g_thread_pool_push(tbt->pool, (gpointer)TPM_BACKEND_CMD_PROCESS_CMD, NULL);
-}
-
-void tpm_backend_thread_create(TPMBackendThread *tbt,
- GFunc func, gpointer user_data)
-{
- if (!tbt->pool) {
- tbt->pool = g_thread_pool_new(func, user_data, 1, TRUE, NULL);
- g_thread_pool_push(tbt->pool, (gpointer)TPM_BACKEND_CMD_INIT, NULL);
- }
-}
-
-void tpm_backend_thread_end(TPMBackendThread *tbt)
-{
- if (tbt->pool) {
- g_thread_pool_push(tbt->pool, (gpointer)TPM_BACKEND_CMD_END, NULL);
- g_thread_pool_free(tbt->pool, FALSE, TRUE);
- tbt->pool = NULL;
- }
-}
-
-void tpm_backend_thread_tpm_reset(TPMBackendThread *tbt,
- GFunc func, gpointer user_data)
-{
- if (!tbt->pool) {
- tpm_backend_thread_create(tbt, func, user_data);
- } else {
- g_thread_pool_push(tbt->pool, (gpointer)TPM_BACKEND_CMD_TPM_RESET,
- NULL);
- }
-}
diff --git a/translate-all.c b/translate-all.c
index a98c646d92..08dd038816 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -35,9 +35,6 @@
#include "cpu.h"
#include "disas/disas.h"
#include "tcg.h"
-#include "qemu/timer.h"
-#include "exec/memory.h"
-#include "exec/address-spaces.h"
#if defined(CONFIG_USER_ONLY)
#include "qemu.h"
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
@@ -55,6 +52,8 @@
#include <libutil.h>
#endif
#endif
+#else
+#include "exec/address-spaces.h"
#endif
#include "exec/cputlb.h"
diff --git a/ui/console.c b/ui/console.c
index e84ba8b40a..0ed4211986 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -25,7 +25,7 @@
#include "ui/console.h"
#include "qemu/timer.h"
#include "qmp-commands.h"
-#include "char/char.h"
+#include "sysemu/char.h"
//#define DEBUG_CONSOLE
#define DEFAULT_BACKSCROLL 512
diff --git a/ui/gtk.c b/ui/gtk.c
index 1a6bee616a..1e105e2fc7 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -62,7 +62,7 @@
#include "qmp-commands.h"
#include "x_keymap.h"
#include "keymaps.h"
-#include "char/char.h"
+#include "sysemu/char.h"
//#define DEBUG_GTK
diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c
index 713d7560d0..8442c6e63c 100644
--- a/util/event_notifier-posix.c
+++ b/util/event_notifier-posix.c
@@ -12,7 +12,7 @@
#include "qemu-common.h"
#include "qemu/event_notifier.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/main-loop.h"
#ifdef CONFIG_EVENTFD
diff --git a/vl.c b/vl.c
index a1093c52c4..05989986f3 100644
--- a/vl.c
+++ b/vl.c
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
#include "hw/qdev.h"
#include "hw/loader.h"
#include "monitor/qdev.h"
-#include "bt/bt.h"
+#include "sysemu/bt.h"
#include "net/net.h"
#include "net/slirp.h"
#include "monitor/monitor.h"
@@ -134,12 +134,12 @@ int main(int argc, char **argv)
#include "sysemu/sysemu.h"
#include "exec/gdbstub.h"
#include "qemu/timer.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/cache-utils.h"
#include "sysemu/blockdev.h"
#include "hw/block/block.h"
#include "migration/block.h"
-#include "tpm/tpm.h"
+#include "sysemu/tpm.h"
#include "sysemu/dma.h"
#include "audio/audio.h"
#include "migration/migration.h"
diff --git a/xen-all.c b/xen-all.c
index 31f28fc1ae..539a1549a5 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -16,7 +16,7 @@
#include "hw/xen/xen_backend.h"
#include "qmp-commands.h"
-#include "char/char.h"
+#include "sysemu/char.h"
#include "qemu/range.h"
#include "sysemu/xen-mapcache.h"
#include "trace.h"