tpm_eventlog.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef __TPM_EVENTLOG_H__
  2. #define __TPM_EVENTLOG_H__
  3. #define TCG_EVENT_NAME_LEN_MAX 255
  4. #define MAX_TEXT_EVENT 1000 /* Max event string length */
  5. #define ACPI_TCPA_SIG "TCPA" /* 0x41504354 /'TCPA' */
  6. #ifdef CONFIG_PPC64
  7. #define do_endian_conversion(x) be32_to_cpu(x)
  8. #else
  9. #define do_endian_conversion(x) x
  10. #endif
  11. enum bios_platform_class {
  12. BIOS_CLIENT = 0x00,
  13. BIOS_SERVER = 0x01,
  14. };
  15. struct tpm_bios_log {
  16. void *bios_event_log;
  17. void *bios_event_log_end;
  18. };
  19. struct tcpa_event {
  20. u32 pcr_index;
  21. u32 event_type;
  22. u8 pcr_value[20]; /* SHA1 */
  23. u32 event_size;
  24. u8 event_data[0];
  25. };
  26. enum tcpa_event_types {
  27. PREBOOT = 0,
  28. POST_CODE,
  29. UNUSED,
  30. NO_ACTION,
  31. SEPARATOR,
  32. ACTION,
  33. EVENT_TAG,
  34. SCRTM_CONTENTS,
  35. SCRTM_VERSION,
  36. CPU_MICROCODE,
  37. PLATFORM_CONFIG_FLAGS,
  38. TABLE_OF_DEVICES,
  39. COMPACT_HASH,
  40. IPL,
  41. IPL_PARTITION_DATA,
  42. NONHOST_CODE,
  43. NONHOST_CONFIG,
  44. NONHOST_INFO,
  45. };
  46. struct tcpa_pc_event {
  47. u32 event_id;
  48. u32 event_size;
  49. u8 event_data[0];
  50. };
  51. enum tcpa_pc_event_ids {
  52. SMBIOS = 1,
  53. BIS_CERT,
  54. POST_BIOS_ROM,
  55. ESCD,
  56. CMOS,
  57. NVRAM,
  58. OPTION_ROM_EXEC,
  59. OPTION_ROM_CONFIG,
  60. OPTION_ROM_MICROCODE = 10,
  61. S_CRTM_VERSION,
  62. S_CRTM_CONTENTS,
  63. POST_CONTENTS,
  64. HOST_TABLE_OF_DEVICES,
  65. };
  66. int read_log(struct tpm_bios_log *log);
  67. #if defined(CONFIG_TCG_IBMVTPM) || defined(CONFIG_TCG_IBMVTPM_MODULE) || \
  68. defined(CONFIG_ACPI)
  69. extern struct dentry **tpm_bios_log_setup(char *);
  70. extern void tpm_bios_log_teardown(struct dentry **);
  71. #else
  72. static inline struct dentry **tpm_bios_log_setup(char *name)
  73. {
  74. return NULL;
  75. }
  76. static inline void tpm_bios_log_teardown(struct dentry **dir)
  77. {
  78. }
  79. #endif
  80. #endif