MdeModulePkg-FPDT(1): Add SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET definition.
[mirror_edk2.git] / MdeModulePkg / Include / Guid / FirmwarePerformance.h
CommitLineData
0284e90c
LG
1/** @file\r
2 ACPI Firmware Performance Data Table (FPDT) implementation specific definitions.\r
3\r
7110e306 4 Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
0284e90c
LG
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _FIRMWARE_PERFORMANCE_GUID_H_\r
16#define _FIRMWARE_PERFORMANCE_GUID_H_\r
17\r
0284e90c 18#include <PiPei.h>\r
96f0d1ca 19#include <IndustryStandard/Acpi.h>\r
0284e90c
LG
20#include <Ppi/SecPerformance.h>\r
21\r
22///\r
23/// This GUID is used for FPDT implementation specific EFI Variable, LockBox and Hob.\r
24///\r
25/// EFI Variable:\r
26/// GUID - gEfiFirmwarePerformanceGuid\r
27/// Name - EFI_FIRMWARE_PERFORMANCE_VARIABLE_NAME\r
28/// Data - FIRMWARE_PERFORMANCE_VARIABLE\r
29///\r
30/// LockBox:\r
31/// GUID - gEfiFirmwarePerformanceGuid\r
32/// Data - EFI_ACPI_BASIC_S3_SUSPEND_PERFORMANCE_RECORD\r
33///\r
34/// Hob:\r
35/// GUID - gEfiFirmwarePerformanceGuid\r
36/// Data - FIRMWARE_SEC_PERFORMANCE (defined in <Ppi/SecPerformance.h>)\r
37///\r
1c0cc375
LG
38/// SMI:\r
39/// GUID - gEfiFirmwarePerformanceGuid\r
40/// Data - SMM_BOOT_RECORD_COMMUNICATE\r
41///\r
42/// StatusCodeData:\r
43/// Type - gEfiFirmwarePerformanceGuid\r
44/// Data - One or more boot record\r
45///\r
0284e90c
LG
46#define EFI_FIRMWARE_PERFORMANCE_GUID \\r
47 { \\r
48 0xc095791a, 0x3001, 0x47b2, {0x80, 0xc9, 0xea, 0xc7, 0x31, 0x9f, 0x2f, 0xa4 } \\r
49 }\r
50\r
51#define EFI_FIRMWARE_PERFORMANCE_VARIABLE_NAME L"FirmwarePerformance"\r
52\r
db91c620
SZ
53/// LockBox:\r
54/// GUID - gFirmwarePerformanceS3PointerGuid\r
55/// Data - S3 performance table pointer\r
56///\r
57#define FIRMWARE_PERFORMANCE_S3_POINTER_GUID \\r
58 { \\r
59 0xdc65adc, 0xa973, 0x4130, { 0x8d, 0xf0, 0x2a, 0xdb, 0xeb, 0x9e, 0x4a, 0x31 } \\r
60 }\r
61\r
0284e90c
LG
62#pragma pack(1)\r
63\r
64///\r
65/// Firmware Performance Data Table.\r
66/// This structure will be installed into ACPI table as FPDT in normal boot path.\r
67///\r
68typedef struct {\r
69 EFI_ACPI_DESCRIPTION_HEADER Header; ///< Common ACPI description table header.\r
70 EFI_ACPI_5_0_FPDT_BOOT_PERFORMANCE_TABLE_POINTER_RECORD BootPointerRecord; ///< Basic Boot Performance Table Pointer record.\r
71 EFI_ACPI_5_0_FPDT_S3_PERFORMANCE_TABLE_POINTER_RECORD S3PointerRecord; ///< S3 Performance Table Pointer record.\r
72} FIRMWARE_PERFORMANCE_TABLE;\r
73\r
74///\r
75/// S3 Performance Data Table.\r
76/// This structure contains S3 performance records which will be updated in S3\r
77/// suspend and S3 resume boot path.\r
78///\r
79typedef struct {\r
80 EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER Header; ///< Common ACPI table header.\r
81 EFI_ACPI_5_0_FPDT_S3_RESUME_RECORD S3Resume; ///< Basic S3 Resume performance record.\r
82 EFI_ACPI_5_0_FPDT_S3_SUSPEND_RECORD S3Suspend; ///< Basic S3 Suspend performance record.\r
83} S3_PERFORMANCE_TABLE;\r
84\r
85///\r
86/// Basic Boot Performance Data Table.\r
87/// This structure contains BasicBoot performance record.\r
88///\r
89typedef struct {\r
90 EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER Header; ///< Common ACPI table header.\r
91 EFI_ACPI_5_0_FPDT_FIRMWARE_BASIC_BOOT_RECORD BasicBoot; ///< Basic Boot Resume performance record.\r
1c0cc375
LG
92 //\r
93 // one or more boot performance records.\r
94 //\r
0284e90c
LG
95} BOOT_PERFORMANCE_TABLE;\r
96\r
97///\r
98/// Performance data pointed by Performance Pointer Record.\r
99///\r
100typedef struct {\r
101 BOOT_PERFORMANCE_TABLE BootPerformance; ///< Basic Boot Performance.\r
102 S3_PERFORMANCE_TABLE S3Performance; ///< S3 performance.\r
103} FIRMWARE_PERFORMANCE_RUNTIME_DATA;\r
104\r
105///\r
106/// Variable defined for FPDT implementation.\r
db91c620 107/// This Variable is produced by FPDT DXE module.\r
0284e90c
LG
108///\r
109typedef struct {\r
110 EFI_PHYSICAL_ADDRESS BootPerformanceTablePointer; ///< Pointer to Boot Performance Table.\r
111 EFI_PHYSICAL_ADDRESS S3PerformanceTablePointer; ///< Pointer to S3 Performance Table.\r
112} FIRMWARE_PERFORMANCE_VARIABLE;\r
113\r
114#pragma pack()\r
115\r
1c0cc375
LG
116//\r
117// Log BOOT RECORD from SMM driver on boot time.\r
118//\r
7110e306
LG
119#define SMM_FPDT_FUNCTION_GET_BOOT_RECORD_SIZE 1\r
120#define SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA 2\r
121#define SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET 3\r
1c0cc375
LG
122\r
123typedef struct {\r
124 UINTN Function;\r
125 EFI_STATUS ReturnStatus;\r
126 UINTN BootRecordSize;\r
127 VOID *BootRecordData;\r
7110e306 128 UINTN BootRecordOffset;\r
1c0cc375
LG
129} SMM_BOOT_RECORD_COMMUNICATE;\r
130\r
0284e90c 131extern EFI_GUID gEfiFirmwarePerformanceGuid;\r
db91c620 132extern EFI_GUID gFirmwarePerformanceS3PointerGuid;\r
0284e90c
LG
133\r
134#endif\r