1
0
mirror of https://github.com/projectacrn/acrn-hypervisor.git synced 2025-05-07 07:56:56 +00:00
acrn-hypervisor/devicemodel/hw/platform/tpm/tpm_internal.h
Ziheng Li eb8bcb06b3 Update copyright year range in code headers
Modified the copyright year range in code, and corrected "int32_tel"
into "Intel" in two "hypervisor/include/debug/profiling.h" and
"hypervisor/include/debug/profiling_internal.h".

Tracked-On: 
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-07-15 11:48:35 +08:00

55 lines
1.4 KiB
C

/*
* Copyright (C) 2018-2022 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _TPM_INTERNAL_H_
#define _TPM_INTERNAL_H_
/* TPMCommBuffer will package TPM2 command and
* response which are handled by TPM emulator
*
* locty: the locality TPM emulator used
* in & in_len: To indicate the buffer and the
* size for TPM command
* out & out_len: To indicate the buffer and
* the size for TPM response
*/
typedef struct TPMCommBuffer {
uint8_t locty;
const uint8_t *in;
uint32_t in_len;
uint8_t *out;
uint32_t out_len;
bool selftest_done;
} TPMCommBuffer;
/* APIs by tpm_emulator.c */
/* Create Ctrl channel and Cmd channel so as to communicate with SWTPM */
int init_tpm_emulator(const char *sock_path);
/* Shutdown of SWTPM and close Ctrl channel and Cmd channel */
void deinit_tpm_emulator(void);
/* Send Ctrl channel command CMD_GET_TPMESTABLISHED to SWTPM */
bool swtpm_get_tpm_established_flag(void);
/* Send TPM2 command request to SWTPM by using Cmd channel */
int swtpm_handle_request(TPMCommBuffer *cmd);
/* Initialization for SWTPM */
int swtpm_startup(size_t buffersize);
/* Cancellation of the current TPM2 command */
void swtpm_cancel_cmd(void);
/* APIs by tpm_crb.c */
/* Initialize TPM CRB Virtual Device */
int init_tpm_crb(struct vmctx *ctx);
/* Deinitialize TPM CRB Virtual Device */
void deinit_tpm_crb(struct vmctx *ctx);
#endif