summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-04-15 17:06:04 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-15 17:06:04 -0500
commit4ceb193d30fe9b1cda0dc73bddb8051659926fb9 (patch)
treea9ffbe92293ba9b0cc3298591e7564aae19a0ef1 /include
parenta907cf59d8a41ecb909ad4367cd016c7d71f8546 (diff)
parentc72dd2d04bd28f7ec6b073316270258684ba5fc3 (diff)
downloadqemu-4ceb193d30fe9b1cda0dc73bddb8051659926fb9.tar.gz
Merge remote-tracking branch 'bonzini/hw-dirs' into staging
* bonzini/hw-dirs: exec: remove useless declarations from memory-internal.h memory: move core typedefs to qemu/typedefs.h include: avoid useless includes of exec/ headers sysemu: avoid proliferation of include/ subdirectories tpm: reorganize headers and split hardware part configure: fix TPM logic acpi.h: make it self contained acpi: move declarations from pc.h to acpi.h hw: Add lost ARM core again Fix failure to create q35 machine Add linux-headers to QEMU_INCLUDES arm: fix location of some include files Conflicts: configure aliguori: trivial conflict in configure output Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include')
-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.h45
15 files changed, 98 insertions, 24 deletions
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/include/sysemu/tpm_backend_int.h b/include/sysemu/tpm_backend_int.h
new file mode 100644
index 0000000000..05d94d0f5b
--- /dev/null
+++ b/include/sysemu/tpm_backend_int.h
@@ -0,0 +1,45 @@
+/*
+ * 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/>
+ */
+
+#ifndef TPM_TPM_BACKEND_H
+#define TPM_TPM_BACKEND_H
+
+#include <glib.h>
+
+typedef struct TPMBackendThread {
+ GThreadPool *pool;
+} TPMBackendThread;
+
+void tpm_backend_thread_deliver_request(TPMBackendThread *tbt);
+void tpm_backend_thread_create(TPMBackendThread *tbt,
+ GFunc func, gpointer user_data);
+void tpm_backend_thread_end(TPMBackendThread *tbt);
+void tpm_backend_thread_tpm_reset(TPMBackendThread *tbt,
+ GFunc func, gpointer user_data);
+
+typedef enum TPMBackendCmd {
+ TPM_BACKEND_CMD_INIT = 1,
+ TPM_BACKEND_CMD_PROCESS_CMD,
+ TPM_BACKEND_CMD_END,
+ TPM_BACKEND_CMD_TPM_RESET,
+} TPMBackendCmd;
+
+#endif /* TPM_TPM_BACKEND_H */