Files
slimbootloader/BootloaderCommonPkg/Library/LoaderPerformanceLib/ExtendedFirmwarePerformance.h
Mike Crowe 990e3e81e6 Use LF line endings in the repository
Convert the line endings stored for all text files in the repository to
LF. The majority previously used DOS-style CRLF line endings. Add a
.gitattributes file to enforce this and treat certain extensions as
never being text files.

Update PatchCheck.py to insist on LF line endings rather than CRLF.
However, its other checks fail on this commit due to lots of
pre-existing complaints that it only notices because the line endings
have changed.

Silicon/QemuSocPkg/FspBin/Patches/0001-Build-QEMU-FSP-2.0-binaries.patch
needs to be treated as binary since it contains a mixture of line
endings.

This change has implications depending on the client platform you are
using the repository from:

* Windows

The usual configuration for Git on Windows means that text files will
be checked out to the work tree with DOS-style CRLF line endings. If
that's not the case then you can configure Git to do so for the entire
machine with:

 git config --global core.autocrlf true

or for just the repository with:

 git config core.autocrlf true

Line endings will be normalised to LF when they are committed to the
repository. If you commit a text file with only LF line endings then it
will be converted to CRLF line endings in your work tree.

* Linux, MacOS and other Unices

The usual configuration for Git on such platforms is to check files out
of the repository with LF line endings. This is probably the right thing
for you. In the unlikely even that you are using Git on Unix but editing
or compiling on Windows for some reason then you may need to tweak your
configuration to force the use of CRLF line endings as described above.

* General

For more information see
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings .

Fixes: https://github.com/slimbootloader/slimbootloader/issues/1400
Signed-off-by: Mike Crowe <mac@mcrowe.com>
2021-11-10 12:46:42 -08:00

264 lines
9.7 KiB
C

/** @file
This file defines edk2 extended firmware performance records.
These records will be added into ACPI FPDT Firmware Basic Boot Performance Table.
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __EXTENDED_FIRMWARE_PERFORMANCE_H__
#define __EXTENDED_FIRMWARE_PERFORMANCE_H__
#include <IndustryStandard/Acpi.h>
//
// Known performance tokens
//
#define SEC_TOK "SEC" ///< SEC Phase
#define DXE_TOK "DXE" ///< DXE Phase
#define PEI_TOK "PEI" ///< PEI Phase
#define BDS_TOK "BDS" ///< BDS Phase
#define DRIVERBINDING_START_TOK "DB:Start:" ///< Driver Binding Start() function call
#define DRIVERBINDING_SUPPORT_TOK "DB:Support:" ///< Driver Binding Support() function call
#define DRIVERBINDING_STOP_TOK "DB:Stop:" ///< Driver Binding Stop() function call
#define LOAD_IMAGE_TOK "LoadImage:" ///< Load a dispatched module
#define START_IMAGE_TOK "StartImage:" ///< Dispatched Modules Entry Point execution
#define PEIM_TOK "PEIM" ///< PEIM Modules Entry Point execution
//
// Misc defines
//
#define FPDT_RECORD_REVISION_1 (0x01)
//
// Length field in EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER is a UINT8, thus:
//
#define FPDT_MAX_PERF_RECORD_SIZE (MAX_UINT8)
//
// FPDT Record Types
//
#define FPDT_GUID_EVENT_TYPE 0x1010
#define FPDT_DYNAMIC_STRING_EVENT_TYPE 0x1011
#define FPDT_DUAL_GUID_STRING_EVENT_TYPE 0x1012
#define FPDT_GUID_QWORD_EVENT_TYPE 0x1013
#define FPDT_GUID_QWORD_STRING_EVENT_TYPE 0x1014
//
// EDKII extended Fpdt record structures
//
#define FPDT_STRING_EVENT_RECORD_NAME_LENGTH 24
#pragma pack(1)
//
// FPDT Boot Performance Guid Event Record Structure
//
typedef struct {
EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;
///
/// ProgressID < 0x10 are reserved for core performance entries.
/// Start measurement point shall have lowered one nibble set to zero and
/// corresponding end points shall have lowered one nibble set to non-zero value;
/// keeping other nibbles same as start point.
///
UINT16 ProgressID;
///
/// APIC ID for the processor in the system used as a timestamp clock source.
/// If only one timestamp clock source is used, this field is Reserved and populated as 0.
///
UINT32 ApicID;
///
/// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
///
UINT64 Timestamp;
///
/// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.
///
EFI_GUID Guid;
} FPDT_GUID_EVENT_RECORD;
//
// FPDT Boot Performance Dynamic String Event Record Structure
//
typedef struct {
EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;
///
/// ProgressID < 0x10 are reserved for core performance entries.
/// Start measurement point shall have lowered one nibble set to zero and
/// corresponding end points shall have lowered one nibble set to non-zero value;
/// keeping other nibbles same as start point.
///
UINT16 ProgressID;
///
/// APIC ID for the processor in the system used as a timestamp clock source.
/// If only one timestamp clock source is used, this field is Reserved and populated as 0.
///
UINT32 ApicID;
///
/// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
///
UINT64 Timestamp;
///
/// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.
///
EFI_GUID Guid;
///
/// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
/// It may be module name, function name, or token name.
///
CHAR8 String[0];
} FPDT_DYNAMIC_STRING_EVENT_RECORD;
//
// FPDT Boot Performance Dual GUID String Event Record Structure
//
typedef struct {
EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;
///
/// ProgressID < 0x10 are reserved for core performance entries.
/// Start measurement point shall have lowered one nibble set to zero and
/// corresponding end points shall have lowered one nibble set to non-zero value;
/// keeping other nibbles same as start point.
///
UINT16 ProgressID;
///
/// APIC ID for the processor in the system used as a timestamp clock source.
/// If only one timestamp clock source is used, this field is Reserved and populated as 0.
///
UINT32 ApicID;
///
/// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
///
UINT64 Timestamp;
///
/// GUID of the module logging the event.
///
EFI_GUID Guid1;
///
/// Event or Ppi or Protocol GUID for Callback.
///
EFI_GUID Guid2;
///
/// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
/// It is the function name.
///
CHAR8 String[0];
} FPDT_DUAL_GUID_STRING_EVENT_RECORD;
//
// FPDT Boot Performance GUID Qword Event Record Structure
//
typedef struct {
EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;
///
/// ProgressID < 0x10 are reserved for core performance entries.
/// Start measurement point shall have lowered one nibble set to zero and
/// corresponding end points shall have lowered one nibble set to non-zero value;
/// keeping other nibbles same as start point.
///
UINT16 ProgressID;
///
/// APIC ID for the processor in the system used as a timestamp clock source.
/// If only one timestamp clock source is used, this field is Reserved and populated as 0.
///
UINT32 ApicID;
///
/// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
///
UINT64 Timestamp;
///
/// GUID of the module logging the event
///
EFI_GUID Guid;
///
/// Qword of misc data, meaning depends on the ProgressId
///
UINT64 Qword;
} FPDT_GUID_QWORD_EVENT_RECORD;
//
// FPDT Boot Performance GUID Qword String Event Record Structure
//
typedef struct {
EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;
///
/// ProgressID < 0x10 are reserved for core performance entries.
/// Start measurement point shall have lowered one nibble set to zero and
/// corresponding end points shall have lowered one nibble set to non-zero value;
/// keeping other nibbles same as start point.
///
UINT16 ProgressID;
///
/// APIC ID for the processor in the system used as a timestamp clock source.
/// If only one timestamp clock source is used, this field is Reserved and populated as 0.
///
UINT32 ApicID;
///
/// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
///
UINT64 Timestamp;
///
/// GUID of the module logging the event
///
EFI_GUID Guid;
///
/// Qword of misc data, meaning depends on the ProgressId
///
UINT64 Qword;
///
/// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
///
CHAR8 String[0];
} FPDT_GUID_QWORD_STRING_EVENT_RECORD;
#pragma pack()
//
// Union of all FPDT records
//
typedef union {
EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER RecordHeader;
FPDT_GUID_EVENT_RECORD GuidEvent;
FPDT_DYNAMIC_STRING_EVENT_RECORD DynamicStringEvent;
FPDT_DUAL_GUID_STRING_EVENT_RECORD DualGuidStringEvent;
FPDT_GUID_QWORD_EVENT_RECORD GuidQwordEvent;
FPDT_GUID_QWORD_STRING_EVENT_RECORD GuidQwordStringEvent;
} FPDT_RECORD;
//
// Union of all pointers to FPDT records
//
typedef union {
EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER *RecordHeader;
FPDT_GUID_EVENT_RECORD *GuidEvent;
FPDT_DYNAMIC_STRING_EVENT_RECORD *DynamicStringEvent;
FPDT_DUAL_GUID_STRING_EVENT_RECORD *DualGuidStringEvent;
FPDT_GUID_QWORD_EVENT_RECORD *GuidQwordEvent;
FPDT_GUID_QWORD_STRING_EVENT_RECORD *GuidQwordStringEvent;
} FPDT_RECORD_PTR;
///
/// Hob:
/// GUID - gEdkiiFpdtExtendedFirmwarePerformanceGuid;
/// Data - FPDT_PEI_EXT_PERF_HEADER + one or more FPDT records
///
typedef struct {
UINT32 SizeOfAllEntries;
UINT32 LoadImageCount;
UINT32 HobIsFull;
} FPDT_PEI_EXT_PERF_HEADER;
typedef struct {
CONST CHAR8 *Token; ///< Measured token string name.
CONST CHAR8 *Module; ///< Module string name.
UINT64 StartTimeStamp; ///< Start time point.
UINT32 Type; ///< Rec type.
UINT32 Identifier; ///< Identifier.
EFI_GUID ModuleGuid;
} MEASUREMENT_RECORD;
extern EFI_GUID gEdkiiFpdtExtendedFirmwarePerformanceGuid;
#endif