]> Git Repo - qemu.git/blame - tests/qtest/tpm-emu.h
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
[qemu.git] / tests / qtest / tpm-emu.h
CommitLineData
0e6ca954
SB
1/*
2 * Minimal TPM emulator for TPM test cases
3 *
4 * Copyright (c) 2018 Red Hat, Inc.
5 *
6 * Authors:
7 * Marc-AndrĂ© Lureau <[email protected]>
8 *
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.
11 */
12
13#ifndef TESTS_TPM_EMU_H
14#define TESTS_TPM_EMU_H
15
16#define TPM_RC_FAILURE 0x101
17#define TPM2_ST_NO_SESSIONS 0x8001
18
266345a8
EA
19#include "qemu/sockets.h"
20#include "io/channel.h"
21
0e6ca954
SB
22struct tpm_hdr {
23 uint16_t tag;
24 uint32_t len;
25 uint32_t code; /*ordinal/error */
26 char buffer[];
27} QEMU_PACKED;
28
29typedef struct TestState {
e7b3af81
DB
30 GMutex data_mutex;
31 GCond data_cond;
2271b75f 32 bool data_cond_signal;
0e6ca954
SB
33 SocketAddress *addr;
34 QIOChannel *tpm_ioc;
35 GThread *emu_tpm_thread;
36 struct tpm_hdr *tpm_msg;
37} TestState;
38
39void tpm_emu_test_wait_cond(TestState *s);
40void *tpm_emu_ctrl_thread(void *data);
41
6834c3f4 42#endif /* TESTS_TPM_EMU_H */
This page took 0.180944 seconds and 4 git commands to generate.