TianoCore EDK2 master
Loading...
Searching...
No Matches
FadtParser.c File Reference
#include <IndustryStandard/Acpi.h>
#include <Library/UefiLib.h>
#include "AcpiParser.h"
#include "AcpiTableParser.h"
#include "AcpiView.h"

Go to the source code of this file.

Macros

#define HW_REDUCED_ACPI   BIT20
 
#define FACS_SIGNATURE_OFFSET   0
 
#define FACS_VERSION_OFFSET   32
 
#define FACS_LENGTH_OFFSET   4
 

Functions

CONST ACPI_DESCRIPTION_HEADER_INFO *EFIAPI GetAcpiXsdtHeaderInfo (VOID)
 
STATIC VOID EFIAPI ValidateFirmwareCtrl (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidateXFirmwareCtrl (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidateFlags (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
VOID EFIAPI DumpFadtFlags (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
 
VOID EFIAPI ParseAcpiFadt (IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
 

Variables

STATIC CONST UINT32 * DsdtAddress
 
STATIC CONST UINT64 * X_DsdtAddress
 
STATIC CONST UINT32 * Flags
 
STATIC CONST UINT32 * FirmwareCtrl
 
STATIC CONST UINT64 * X_FirmwareCtrl
 
STATIC CONST UINT8 * FadtMinorRevision
 
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo
 
STATIC CONST ACPI_PARSER FadtFlagParser []
 
STATIC CONST ACPI_PARSER FadtParser []
 

Detailed Description

FADT table parser

Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Reference(s):
  • ACPI 6.3 Specification - January 2019

Definition in file FadtParser.c.

Macro Definition Documentation

◆ FACS_LENGTH_OFFSET

#define FACS_LENGTH_OFFSET   4

Offset to the FACS length from the start of the FACS.

Definition at line 45 of file FadtParser.c.

◆ FACS_SIGNATURE_OFFSET

#define FACS_SIGNATURE_OFFSET   0

Offset to the FACS signature from the start of the FACS.

Definition at line 35 of file FadtParser.c.

◆ FACS_VERSION_OFFSET

#define FACS_VERSION_OFFSET   32

Offset to the FACS revision from the start of the FACS.

Definition at line 40 of file FadtParser.c.

◆ HW_REDUCED_ACPI

#define HW_REDUCED_ACPI   BIT20

A macro defining the Hardware reduced ACPI flag

Definition at line 30 of file FadtParser.c.

Function Documentation

◆ DumpFadtFlags()

VOID EFIAPI DumpFadtFlags ( IN CONST CHAR16 *Format  OPTIONAL,
IN UINT8 *  Ptr,
IN UINT32  Length 
)

This function traces FADT Flags fields. If no format string is specified the Format must be NULL.

Parameters
[in]FormatOptional format string for tracing the data.
[in]PtrPointer to the start of the buffer.
[in]LengthLength of the field.

Definition at line 176 of file FadtParser.c.

◆ GetAcpiXsdtHeaderInfo()

CONST ACPI_DESCRIPTION_HEADER_INFO *EFIAPI GetAcpiXsdtHeaderInfo ( VOID  )

Get the ACPI XSDT header info.

Definition at line 31 of file XsdtParser.c.

◆ ParseAcpiFadt()

VOID EFIAPI ParseAcpiFadt ( IN BOOLEAN  Trace,
IN UINT8 *  Ptr,
IN UINT32  AcpiTableLength,
IN UINT8  AcpiTableRevision 
)

This function parses the ACPI FADT table. This function parses the FADT table and optionally traces the ACPI table fields.

This function also performs validation of the ACPI table fields.

Parameters
[in]TraceIf TRUE, trace the ACPI fields.
[in]PtrPointer to the start of the buffer.
[in]AcpiTableLengthLength of the ACPI table.
[in]AcpiTableRevisionRevision of the ACPI table.

Definition at line 276 of file FadtParser.c.

◆ ValidateFirmwareCtrl()

STATIC VOID EFIAPI ValidateFirmwareCtrl ( IN UINT8 *  Ptr,
IN UINT32  Length,
IN VOID *  Context 
)

This function validates the Firmware Control Field.

Parameters
[in]PtrPointer to the start of the field data.
[in]LengthLength of the field.
[in]ContextPointer to context specific information e.g. this could be a pointer to the ACPI table header.

Definition at line 67 of file FadtParser.c.

◆ ValidateFlags()

STATIC VOID EFIAPI ValidateFlags ( IN UINT8 *  Ptr,
IN UINT32  Length,
IN VOID *  Context 
)

This function validates the flags.

Parameters
[in]PtrPointer to the start of the field data.
[in]LengthLength of the field.
[in]ContextPointer to context specific information e.g. this could be a pointer to the ACPI table header.

Definition at line 123 of file FadtParser.c.

◆ ValidateXFirmwareCtrl()

STATIC VOID EFIAPI ValidateXFirmwareCtrl ( IN UINT8 *  Ptr,
IN UINT32  Length,
IN VOID *  Context 
)

This function validates the X_Firmware Control Field.

Parameters
[in]PtrPointer to the start of the field data.
[in]LengthLength of the field.
[in]ContextPointer to context specific information e.g. this could be a pointer to the ACPI table header.

Definition at line 95 of file FadtParser.c.

Variable Documentation

◆ AcpiHdrInfo

Definition at line 25 of file FadtParser.c.

◆ DsdtAddress

STATIC CONST UINT32* DsdtAddress

Definition at line 19 of file FadtParser.c.

◆ FadtFlagParser

STATIC CONST ACPI_PARSER FadtFlagParser[]
Initial value:
= {
{ L"WBINVD", 1, 0, L"%d", NULL, NULL, NULL, NULL },
{ L"WBINVD_FLUSH", 1, 1, L"%d", NULL, NULL, NULL, NULL },
{ L"PROC_C1", 1, 2, L"%d", NULL, NULL, NULL, NULL },
{ L"P_LVL2_UP", 1, 3, L"%d", NULL, NULL, NULL, NULL },
{ L"PWR_BUTTON", 1, 4, L"%d", NULL, NULL, NULL, NULL },
{ L"SLP_BUTTON", 1, 5, L"%d", NULL, NULL, NULL, NULL },
{ L"FIX_RTC", 1, 6, L"%d", NULL, NULL, NULL, NULL },
{ L"RTC_S4", 1, 7, L"%d", NULL, NULL, NULL, NULL },
{ L"TMR_VAL_EXT", 1, 8, L"%d", NULL, NULL, NULL, NULL },
{ L"DCK_CAP", 1, 9, L"%d", NULL, NULL, NULL, NULL },
{ L"RESET_REG_SUP", 1, 10, L"%d", NULL, NULL, NULL, NULL },
{ L"SEALED_CASE", 1, 11, L"%d", NULL, NULL, NULL, NULL },
{ L"HEADLESS", 1, 12, L"%d", NULL, NULL, NULL, NULL },
{ L"CPU_SW_SLP", 1, 13, L"%d", NULL, NULL, NULL, NULL },
{ L"PCI_EXP_WAK", 1, 14, L"%d", NULL, NULL, NULL, NULL },
{ L"USE_PLATFORM_CLOCK", 1, 15, L"%d", NULL, NULL, NULL, NULL },
{ L"S4_RTC_STS_VALID", 1, 16, L"%d", NULL, NULL, NULL, NULL },
{ L"REMOTE_POWER_ON_CAPABLE", 1, 17, L"%d", NULL, NULL, NULL, NULL },
{ L"FORCE_APIC_CLUSTER_MODEL", 1, 18, L"%d", NULL, NULL, NULL, NULL },
{ L"FORCE_APIC_PHYSICAL_DESTINATION_MODE", 1, 19, L"%d", NULL, NULL, NULL, NULL },
{ L"HW_REDUCED_ACPI", 1, 20, L"%d", NULL, NULL, NULL, NULL },
{ L"LOW_POWER_S0_IDLE_CAPABLE", 1, 21, L"%d", NULL, NULL, NULL, NULL },
{ L"Reserved", 10, 22, L"%d", NULL, NULL, NULL, NULL }
}
#define NULL
Definition: Base.h:319

Definition at line 140 of file FadtParser.c.

◆ FadtMinorRevision

STATIC CONST UINT8* FadtMinorRevision

Definition at line 24 of file FadtParser.c.

◆ FadtParser

STATIC CONST ACPI_PARSER FadtParser[]

An ACPI_PARSER array describing the ACPI FADT Table.

Definition at line 201 of file FadtParser.c.

◆ FirmwareCtrl

STATIC CONST UINT32* FirmwareCtrl

Definition at line 22 of file FadtParser.c.

◆ Flags

STATIC CONST UINT32* Flags

Definition at line 21 of file FadtParser.c.

◆ X_DsdtAddress

STATIC CONST UINT64* X_DsdtAddress

Definition at line 20 of file FadtParser.c.

◆ X_FirmwareCtrl

STATIC CONST UINT64* X_FirmwareCtrl

Definition at line 23 of file FadtParser.c.