Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / char / tpm / tpm_eventlog.h
1
2 #ifndef __TPM_EVENTLOG_H__
3 #define __TPM_EVENTLOG_H__
4
5 #define TCG_EVENT_NAME_LEN_MAX  255
6 #define MAX_TEXT_EVENT          1000    /* Max event string length */
7 #define ACPI_TCPA_SIG           "TCPA"  /* 0x41504354 /'TCPA' */
8
9 enum bios_platform_class {
10         BIOS_CLIENT = 0x00,
11         BIOS_SERVER = 0x01,
12 };
13
14 struct tpm_bios_log {
15         void *bios_event_log;
16         void *bios_event_log_end;
17 };
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
27 enum tcpa_event_types {
28         PREBOOT = 0,
29         POST_CODE,
30         UNUSED,
31         NO_ACTION,
32         SEPARATOR,
33         ACTION,
34         EVENT_TAG,
35         SCRTM_CONTENTS,
36         SCRTM_VERSION,
37         CPU_MICROCODE,
38         PLATFORM_CONFIG_FLAGS,
39         TABLE_OF_DEVICES,
40         COMPACT_HASH,
41         IPL,
42         IPL_PARTITION_DATA,
43         NONHOST_CODE,
44         NONHOST_CONFIG,
45         NONHOST_INFO,
46 };
47
48 struct tcpa_pc_event {
49         u32 event_id;
50         u32 event_size;
51         u8 event_data[0];
52 };
53
54 enum tcpa_pc_event_ids {
55         SMBIOS = 1,
56         BIS_CERT,
57         POST_BIOS_ROM,
58         ESCD,
59         CMOS,
60         NVRAM,
61         OPTION_ROM_EXEC,
62         OPTION_ROM_CONFIG,
63         OPTION_ROM_MICROCODE = 10,
64         S_CRTM_VERSION,
65         S_CRTM_CONTENTS,
66         POST_CONTENTS,
67         HOST_TABLE_OF_DEVICES,
68 };
69
70 int read_log(struct tpm_bios_log *log);
71
72 #if defined(CONFIG_TCG_IBMVTPM) || defined(CONFIG_TCG_IBMVTPM_MODULE) || \
73         defined(CONFIG_ACPI)
74 extern struct dentry **tpm_bios_log_setup(char *);
75 extern void tpm_bios_log_teardown(struct dentry **);
76 #else
77 static inline struct dentry **tpm_bios_log_setup(char *name)
78 {
79         return NULL;
80 }
81 static inline void tpm_bios_log_teardown(struct dentry **dir)
82 {
83 }
84 #endif
85
86 #endif