tpm_eventlog.h 1.5 KB

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