tpm: move TpmIf in include/sysemu/tpm.h

This is a better location than hw/tpm, since we are going to use the
interface from outside hw/tpm.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
Marc-André Lureau 2017-11-06 19:38:59 +01:00 committed by Stefan Berger
parent 8a37fc44c6
commit 67af320cd6
3 changed files with 20 additions and 22 deletions

View File

@ -17,7 +17,6 @@
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "sysemu/tpm.h"
#include "hw/tpm/tpm_int.h"
#include "qemu/thread.h"
static void tpm_backend_worker_thread(gpointer data, gpointer user_data)

View File

@ -13,28 +13,8 @@
#define TPM_TPM_INT_H
#include "qemu/osdep.h"
#include "qom/object.h"
#define TYPE_TPM_IF "tpm-if"
#define TPM_IF_CLASS(klass) \
OBJECT_CLASS_CHECK(TPMIfClass, (klass), TYPE_TPM_IF)
#define TPM_IF_GET_CLASS(obj) \
OBJECT_GET_CLASS(TPMIfClass, (obj), TYPE_TPM_IF)
#define TPM_IF(obj) \
INTERFACE_CHECK(TPMIf, (obj), TYPE_TPM_IF)
typedef struct TPMIf {
Object parent_obj;
} TPMIf;
typedef struct TPMIfClass {
InterfaceClass parent_class;
/* run in thread pool by backend */
void (*request_completed)(TPMIf *obj);
} TPMIfClass;
#define TPM_STANDARD_CMDLINE_OPTS \
#define TPM_STANDARD_CMDLINE_OPTS \
{ \
.name = "type", \
.type = QEMU_OPT_STRING, \

View File

@ -27,6 +27,25 @@ typedef enum TPMVersion {
TPM_VERSION_2_0 = 2,
} TPMVersion;
#define TYPE_TPM_IF "tpm-if"
#define TPM_IF_CLASS(klass) \
OBJECT_CLASS_CHECK(TPMIfClass, (klass), TYPE_TPM_IF)
#define TPM_IF_GET_CLASS(obj) \
OBJECT_GET_CLASS(TPMIfClass, (obj), TYPE_TPM_IF)
#define TPM_IF(obj) \
INTERFACE_CHECK(TPMIf, (obj), TYPE_TPM_IF)
typedef struct TPMIf {
Object parent_obj;
} TPMIf;
typedef struct TPMIfClass {
InterfaceClass parent_class;
/* run in thread pool by backend */
void (*request_completed)(TPMIf *obj);
} TPMIfClass;
TPMVersion tpm_tis_get_tpm_version(Object *obj);
#define TYPE_TPM_TIS "tpm-tis"