tpm_ppi.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * TPM Physical Presence Interface
  3. *
  4. * Copyright (C) 2018 IBM Corporation
  5. *
  6. * Authors:
  7. * Stefan Berger <stefanb@us.ibm.com>
  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. #ifndef TPM_TPM_PPI_H
  13. #define TPM_TPM_PPI_H
  14. #include "hw/acpi/tpm.h"
  15. #include "exec/address-spaces.h"
  16. typedef struct TPMPPI {
  17. MemoryRegion ram;
  18. uint8_t *buf;
  19. } TPMPPI;
  20. /**
  21. * tpm_ppi_init:
  22. * @tpmppi: a TPMPPI
  23. * @m: the address-space / MemoryRegion to use
  24. * @addr: the address of the PPI region
  25. * @obj: the owner object
  26. *
  27. * Register the TPM PPI memory region at @addr on the given address
  28. * space for the object @obj.
  29. **/
  30. void tpm_ppi_init(TPMPPI *tpmppi, struct MemoryRegion *m,
  31. hwaddr addr, Object *obj);
  32. /**
  33. * tpm_ppi_reset:
  34. * @tpmppi: a TPMPPI
  35. *
  36. * Function to call on machine reset. It will check if the "Memory
  37. * overwrite" variable is set, and perform a memory clear on volatile
  38. * memory if requested.
  39. **/
  40. void tpm_ppi_reset(TPMPPI *tpmppi);
  41. #endif /* TPM_TPM_PPI_H */