2 * Minimal TPM emulator for TPM test cases
4 * Copyright (c) 2018 Red Hat, Inc.
7 * Marc-André Lureau <marcandre.lureau@redhat.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
13 #ifndef TESTS_TPM_EMU_H
14 #define TESTS_TPM_EMU_H
16 #define TPM_RC_FAILURE 0x101
17 #define TPM2_ST_NO_SESSIONS 0x8001
19 #include "qemu/sockets.h"
20 #include "io/channel.h"
25 uint32_t code
; /*ordinal/error */
29 typedef struct TestState
{
32 bool data_cond_signal
;
35 GThread
*emu_tpm_thread
;
36 struct tpm_hdr
*tpm_msg
;
39 void tpm_emu_test_wait_cond(TestState
*s
);
40 void *tpm_emu_ctrl_thread(void *data
);
42 #endif /* TESTS_TPM_EMU_H */