tpm_int.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * TPM configuration
  3. *
  4. * Copyright (C) 2011-2013 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_INT_H
  13. #define TPM_TPM_INT_H
  14. #include "exec/memory.h"
  15. #include "tpm_tis.h"
  16. /* overall state of the TPM interface */
  17. struct TPMState {
  18. ISADevice busdev;
  19. MemoryRegion mmio;
  20. union {
  21. TPMTISEmuState tis;
  22. } s;
  23. uint8_t locty_number;
  24. TPMLocality *locty_data;
  25. char *backend;
  26. TPMBackend *be_driver;
  27. };
  28. #define TPM(obj) OBJECT_CHECK(TPMState, (obj), TYPE_TPM_TIS)
  29. #define TPM_STANDARD_CMDLINE_OPTS \
  30. { \
  31. .name = "type", \
  32. .type = QEMU_OPT_STRING, \
  33. .help = "Type of TPM backend", \
  34. }
  35. struct tpm_req_hdr {
  36. uint16_t tag;
  37. uint32_t len;
  38. uint32_t ordinal;
  39. } QEMU_PACKED;
  40. struct tpm_resp_hdr {
  41. uint16_t tag;
  42. uint32_t len;
  43. uint32_t errcode;
  44. } QEMU_PACKED;
  45. #define TPM_TAG_RQU_COMMAND 0xc1
  46. #define TPM_TAG_RQU_AUTH1_COMMAND 0xc2
  47. #define TPM_TAG_RQU_AUTH2_COMMAND 0xc3
  48. #define TPM_TAG_RSP_COMMAND 0xc4
  49. #define TPM_TAG_RSP_AUTH1_COMMAND 0xc5
  50. #define TPM_TAG_RSP_AUTH2_COMMAND 0xc6
  51. #define TPM_FAIL 9
  52. #define TPM_ORD_GetTicks 0xf1
  53. #endif /* TPM_TPM_INT_H */