TianoCore EDK2 master
Loading...
Searching...
No Matches
AcpiSdt.c File Reference
#include "AcpiTable.h"

Go to the source code of this file.

Functions

EFI_ACPI_TABLE_INSTANCESdtGetAcpiTableInstance (VOID)
 
EFI_ACPI_TABLE_LISTFindTableByBuffer (IN VOID *Buffer)
 
EFI_STATUS SdtUpdateAmlChecksum (IN VOID *Buffer)
 
EFI_STATUS SdtGetMaxAmlBufferSize (IN VOID *Buffer, OUT UINTN *MaxSize)
 
VOID SdtNotifyAcpiList (IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance, IN EFI_ACPI_TABLE_VERSION Version, IN UINTN Handle)
 
EFI_STATUS SdtGetAcpiTable (IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance, IN UINTN Index, OUT EFI_ACPI_SDT_HEADER **Table, OUT EFI_ACPI_TABLE_VERSION *Version, OUT UINTN *TableKey)
 
EFI_STATUS EFIAPI GetAcpiTable2 (IN UINTN Index, OUT EFI_ACPI_SDT_HEADER **Table, OUT EFI_ACPI_TABLE_VERSION *Version, OUT UINTN *TableKey)
 
VOID SdtRegisterNotify (IN EFI_ACPI_NOTIFICATION_FN Notification)
 
EFI_STATUS SdtUnregisterNotify (IN EFI_ACPI_NOTIFICATION_FN Notification)
 
EFI_STATUS EFIAPI RegisterNotify (IN BOOLEAN Register, IN EFI_ACPI_NOTIFICATION_FN Notification)
 
EFI_STATUS SdtOpenSdtTable (IN UINTN TableKey, OUT EFI_ACPI_HANDLE *Handle)
 
EFI_STATUS EFIAPI OpenSdt (IN UINTN TableKey, OUT EFI_ACPI_HANDLE *Handle)
 
EFI_STATUS SdtOpenEx (IN VOID *Buffer, IN UINTN BufferSize, OUT EFI_ACPI_HANDLE *Handle)
 
EFI_STATUS EFIAPI Open (IN VOID *Buffer, OUT EFI_ACPI_HANDLE *Handle)
 
EFI_STATUS EFIAPI Close (IN EFI_ACPI_HANDLE Handle)
 
EFI_STATUS EFIAPI GetOption (IN EFI_ACPI_HANDLE Handle, IN UINTN Index, OUT EFI_ACPI_DATA_TYPE *DataType, OUT CONST VOID **Data, OUT UINTN *DataSize)
 
EFI_STATUS EFIAPI SetOption (IN EFI_ACPI_HANDLE Handle, IN UINTN Index, IN CONST VOID *Data, IN UINTN DataSize)
 
EFI_STATUS EFIAPI GetChild (IN EFI_ACPI_HANDLE ParentHandle, IN OUT EFI_ACPI_HANDLE *Handle)
 
EFI_STATUS SdtFindPathFromNonRoot (IN EFI_ACPI_HANDLE HandleIn, IN UINT8 *AmlPath, OUT EFI_ACPI_HANDLE *HandleOut)
 
EFI_AML_HANDLESdtDuplicateHandle (IN EFI_AML_HANDLE *AmlHandle)
 
EFI_STATUS SdtFindPathFromRoot (IN EFI_ACPI_HANDLE HandleIn, IN UINT8 *AmlPath, OUT EFI_ACPI_HANDLE *HandleOut)
 
EFI_STATUS EFIAPI FindPath (IN EFI_ACPI_HANDLE HandleIn, IN VOID *AcpiPath, OUT EFI_ACPI_HANDLE *HandleOut)
 
VOID SdtAcpiTableAcpiSdtConstructor (IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance)
 

Variables

GLOBAL_REMOVE_IF_UNREFERENCED EFI_ACPI_SDT_PROTOCOL mAcpiSdtProtocolTemplate
 

Detailed Description

ACPI Sdt Protocol Driver

Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file AcpiSdt.c.

Function Documentation

◆ Close()

EFI_STATUS EFIAPI Close ( IN EFI_ACPI_HANDLE  Handle)

Close an ACPI handle.

Parameters
[in]HandleReturns the handle.
Return values
EFI_SUCCESSSuccess
EFI_INVALID_PARAMETERHandle is NULL or does not refer to a valid ACPI object.

Definition at line 628 of file AcpiSdt.c.

◆ FindPath()

EFI_STATUS EFIAPI FindPath ( IN EFI_ACPI_HANDLE  HandleIn,
IN VOID *  AcpiPath,
OUT EFI_ACPI_HANDLE *  HandleOut 
)

Returns the handle of the ACPI object representing the specified ACPI path

Parameters
[in]HandleInPoints to the handle of the object representing the starting point for the path search.
[in]AcpiPathPoints to the ACPI path, which conforms to the ACPI encoded path format.
[out]HandleOutOn return, points to the ACPI object which represents AcpiPath, relative to HandleIn.
Return values
EFI_SUCCESSSuccess
EFI_INVALID_PARAMETERHandleIn is NULL or does not refer to a valid ACPI object.

Definition at line 1033 of file AcpiSdt.c.

◆ FindTableByBuffer()

EFI_ACPI_TABLE_LIST * FindTableByBuffer ( IN VOID *  Buffer)

This function finds the table specified by the buffer.

Parameters
[in]BufferTable buffer to find.
Returns
ACPI table list.

Definition at line 49 of file AcpiSdt.c.

◆ GetAcpiTable2()

EFI_STATUS EFIAPI GetAcpiTable2 ( IN UINTN  Index,
OUT EFI_ACPI_SDT_HEADER **  Table,
OUT EFI_ACPI_TABLE_VERSION *  Version,
OUT UINTN TableKey 
)

Returns a requested ACPI table.

The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated with the Index that was input. The following structures are not considered elements in the list of ACPI tables:

  • Root System Description Pointer (RSD_PTR)
  • Root System Description Table (RSDT)
  • Extended System Description Table (XSDT) Version is updated with a bit map containing all the versions of ACPI of which the table is a member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface, the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.
Parameters
[in]IndexThe zero-based index of the table to retrieve.
[out]TablePointer for returning the table buffer.
[out]VersionOn return, updated with the ACPI versions to which this table belongs. Type EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the EFI_ACPI_SDT_PROTOCOL.
[out]TableKeyOn return, points to the table key for the specified ACPI system definition table. This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL. The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable() to uninstall the table.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_NOT_FOUNDThe requested index is too large and a table was not found.

Definition at line 292 of file AcpiSdt.c.

◆ GetChild()

EFI_STATUS EFIAPI GetChild ( IN EFI_ACPI_HANDLE  ParentHandle,
IN OUT EFI_ACPI_HANDLE *  Handle 
)

Return the child ACPI objects.

Parameters
[in]ParentHandleParent handle.
[in,out]HandleOn entry, points to the previously returned handle or NULL to start with the first handle. On return, points to the next returned ACPI handle or NULL if there are no child objects.
Return values
EFI_SUCCESSSuccess
EFI_INVALID_PARAMETERParentHandle is NULL or does not refer to a valid ACPI object.

Definition at line 820 of file AcpiSdt.c.

◆ GetOption()

EFI_STATUS EFIAPI GetOption ( IN EFI_ACPI_HANDLE  Handle,
IN UINTN  Index,
OUT EFI_ACPI_DATA_TYPE *  DataType,
OUT CONST VOID **  Data,
OUT UINTN DataSize 
)

Retrieve information about an ACPI object.

Parameters
[in]HandleACPI object handle.
[in]IndexIndex of the data to retrieve from the object. In general, indexes read from left-to-right in the ACPI encoding, with index 0 always being the ACPI opcode.
[out]DataTypePoints to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists for the specified index.
[out]DataUpon return, points to the pointer to the data.
[out]DataSizeUpon return, points to the size of Data.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERHandle is NULL or does not refer to a valid ACPI object.

Definition at line 680 of file AcpiSdt.c.

◆ Open()

EFI_STATUS EFIAPI Open ( IN VOID *  Buffer,
OUT EFI_ACPI_HANDLE *  Handle 
)

Create a handle from an ACPI opcode

Parameters
[in]BufferPoints to the ACPI opcode.
[out]HandleUpon return, holds the handle.
Return values
EFI_SUCCESSSuccess
EFI_INVALID_PARAMETERBuffer is NULL or Handle is NULL or Buffer points to an invalid opcode.

Definition at line 593 of file AcpiSdt.c.

◆ OpenSdt()

EFI_STATUS EFIAPI OpenSdt ( IN UINTN  TableKey,
OUT EFI_ACPI_HANDLE *  Handle 
)

Create a handle for the first ACPI opcode in an ACPI system description table.

Parameters
[in]TableKeyThe table key for the ACPI table, as returned by GetTable().
[out]HandleOn return, points to the newly created ACPI handle.
Return values
EFI_SUCCESSHandle created successfully.
EFI_NOT_FOUNDTableKey does not refer to a valid ACPI table.

Definition at line 512 of file AcpiSdt.c.

◆ RegisterNotify()

EFI_STATUS EFIAPI RegisterNotify ( IN BOOLEAN  Register,
IN EFI_ACPI_NOTIFICATION_FN  Notification 
)

Register or unregister a callback when an ACPI table is installed.

This function registers or unregisters a function which will be called whenever a new ACPI table is installed.

Parameters
[in]RegisterIf TRUE, then the specified function will be registered. If FALSE, then the specified function will be unregistered.
[in]NotificationPoints to the callback function to be registered or unregistered.
Return values
EFI_SUCCESSCallback successfully registered or unregistered.
EFI_INVALID_PARAMETERNotification is NULL
EFI_INVALID_PARAMETERRegister is FALSE and Notification does not match a known registration function.

Definition at line 422 of file AcpiSdt.c.

◆ SdtAcpiTableAcpiSdtConstructor()

VOID SdtAcpiTableAcpiSdtConstructor ( IN EFI_ACPI_TABLE_INSTANCE AcpiTableInstance)

This function initializes AcpiSdt protocol in ACPI table instance.

Parameters
[in]AcpiTableInstanceInstance to construct

Definition at line 1091 of file AcpiSdt.c.

◆ SdtDuplicateHandle()

EFI_AML_HANDLE * SdtDuplicateHandle ( IN EFI_AML_HANDLE AmlHandle)

Duplicate AML handle.

Parameters
[in]AmlHandleHandle to be duplicated.
Returns
Duplicated AML handle.

Definition at line 923 of file AcpiSdt.c.

◆ SdtFindPathFromNonRoot()

EFI_STATUS SdtFindPathFromNonRoot ( IN EFI_ACPI_HANDLE  HandleIn,
IN UINT8 *  AmlPath,
OUT EFI_ACPI_HANDLE *  HandleOut 
)

Returns the handle of the ACPI object representing the specified ACPI path

Parameters
[in]HandleInPoints to the handle of the object representing the starting point for the path search.
[in]AmlPathPoints to the AML path.
[out]HandleOutOn return, points to the ACPI object which represents AcpiPath, relative to HandleIn.
Return values
EFI_SUCCESSSuccess
EFI_INVALID_PARAMETERHandleIn is NULL or does not refer to a valid ACPI object.

Definition at line 886 of file AcpiSdt.c.

◆ SdtFindPathFromRoot()

EFI_STATUS SdtFindPathFromRoot ( IN EFI_ACPI_HANDLE  HandleIn,
IN UINT8 *  AmlPath,
OUT EFI_ACPI_HANDLE *  HandleOut 
)

Returns the handle of the ACPI object representing the specified ACPI path

Parameters
[in]HandleInPoints to the handle of the object representing the starting point for the path search.
[in]AmlPathPoints to the AML path.
[out]HandleOutOn return, points to the ACPI object which represents AcpiPath, relative to HandleIn.
Return values
EFI_SUCCESSSuccess
EFI_INVALID_PARAMETERHandleIn is NULL or does not refer to a valid ACPI object.

Definition at line 948 of file AcpiSdt.c.

◆ SdtGetAcpiTable()

EFI_STATUS SdtGetAcpiTable ( IN EFI_ACPI_TABLE_INSTANCE AcpiTableInstance,
IN UINTN  Index,
OUT EFI_ACPI_SDT_HEADER **  Table,
OUT EFI_ACPI_TABLE_VERSION *  Version,
OUT UINTN TableKey 
)

Returns a requested ACPI table.

The following structures are not considered elements in the list of ACPI tables:

  • Root System Description Pointer (RSD_PTR)
  • Root System Description Table (RSDT)
  • Extended System Description Table (XSDT) Version is updated with a bit map containing all the versions of ACPI of which the table is a member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface, the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.
Parameters
[in]AcpiTableInstanceACPI table Instance.
[in]IndexThe zero-based index of the table to retrieve.
[out]TablePointer for returning the table buffer.
[out]VersionOn return, updated with the ACPI versions to which this table belongs. Type EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the EFI_ACPI_SDT_PROTOCOL.
[out]TableKeyOn return, points to the table key for the specified ACPI system definition table. This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL. The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable() to uninstall the table.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_NOT_FOUNDThe requested index is too large and a table was not found.

Definition at line 218 of file AcpiSdt.c.

◆ SdtGetAcpiTableInstance()

EFI_ACPI_TABLE_INSTANCE * SdtGetAcpiTableInstance ( VOID  )

This function returns ACPI Table instance.

Returns
AcpiTableInstance

Definition at line 34 of file AcpiSdt.c.

◆ SdtGetMaxAmlBufferSize()

EFI_STATUS SdtGetMaxAmlBufferSize ( IN VOID *  Buffer,
OUT UINTN MaxSize 
)

This function finds MAX AML buffer size. It will search the ACPI table installed by ACPI_TABLE protocol.

Parameters
[in]BufferA piece of AML code buffer pointer.
[out]MaxSizeOn return it holds the MAX size of buffer.
Return values
EFI_SUCCESSThe table holds the AML buffer is found, and MAX size if returned.
EFI_NOT_FOUNDThe table holds the AML buffer is not found.

Definition at line 126 of file AcpiSdt.c.

◆ SdtNotifyAcpiList()

VOID SdtNotifyAcpiList ( IN EFI_ACPI_TABLE_INSTANCE AcpiTableInstance,
IN EFI_ACPI_TABLE_VERSION  Version,
IN UINTN  Handle 
)

This function invokes ACPI notification.

Parameters
[in]AcpiTableInstanceInstance to AcpiTable
[in]VersionVersion(s) to set.
[in]HandleHandle of the table.

Definition at line 150 of file AcpiSdt.c.

◆ SdtOpenEx()

EFI_STATUS SdtOpenEx ( IN VOID *  Buffer,
IN UINTN  BufferSize,
OUT EFI_ACPI_HANDLE *  Handle 
)

Create a handle from an ACPI opcode

Parameters
[in]BufferPoints to the ACPI opcode.
[in]BufferSizeMax buffer size.
[out]HandleUpon return, holds the handle.
Return values
EFI_SUCCESSSuccess
EFI_INVALID_PARAMETERBuffer is NULL or Handle is NULL or Buffer points to an invalid opcode.

Definition at line 537 of file AcpiSdt.c.

◆ SdtOpenSdtTable()

EFI_STATUS SdtOpenSdtTable ( IN UINTN  TableKey,
OUT EFI_ACPI_HANDLE *  Handle 
)

Create a handle for the first ACPI opcode in an ACPI system description table.

Parameters
[in]TableKeyThe table key for the ACPI table, as returned by GetTable().
[out]HandleOn return, points to the newly created ACPI handle.
Return values
EFI_SUCCESSHandle created successfully.
EFI_NOT_FOUNDTableKey does not refer to a valid ACPI table.

Definition at line 458 of file AcpiSdt.c.

◆ SdtRegisterNotify()

VOID SdtRegisterNotify ( IN EFI_ACPI_NOTIFICATION_FN  Notification)

Register a callback when an ACPI table is installed.

This function registers a function which will be called whenever a new ACPI table is installed.

Parameters
[in]NotificationPoints to the callback function to be registered

Definition at line 321 of file AcpiSdt.c.

◆ SdtUnregisterNotify()

EFI_STATUS SdtUnregisterNotify ( IN EFI_ACPI_NOTIFICATION_FN  Notification)

Unregister a callback when an ACPI table is installed.

This function unregisters a function which will be called whenever a new ACPI table is installed.

Parameters
[in]NotificationPoints to the callback function to be unregistered.
Return values
EFI_SUCCESSCallback successfully unregistered.
EFI_INVALID_PARAMETERNotification does not match a known registration function.

Definition at line 364 of file AcpiSdt.c.

◆ SdtUpdateAmlChecksum()

EFI_STATUS SdtUpdateAmlChecksum ( IN VOID *  Buffer)

This function updates AML table checksum. It will search the ACPI table installed by ACPI_TABLE protocol.

Parameters
[in]BufferA piece of AML code buffer pointer.
Return values
EFI_SUCCESSThe table holds the AML buffer is found, and checksum is updated.
EFI_NOT_FOUNDThe table holds the AML buffer is not found.

Definition at line 96 of file AcpiSdt.c.

◆ SetOption()

EFI_STATUS EFIAPI SetOption ( IN EFI_ACPI_HANDLE  Handle,
IN UINTN  Index,
IN CONST VOID *  Data,
IN UINTN  DataSize 
)

Change information about an ACPI object.

Parameters
[in]HandleACPI object handle.
[in]IndexIndex of the data to retrieve from the object. In general, indexes read from left-to-right in the ACPI encoding, with index 0 always being the ACPI opcode.
[in]DataPoints to the data.
[in]DataSizeThe size of the Data.
Return values
EFI_SUCCESSSuccess
EFI_INVALID_PARAMETERHandle is NULL or does not refer to a valid ACPI object.
EFI_BAD_BUFFER_SIZEData cannot be accommodated in the space occupied by the option.

Definition at line 745 of file AcpiSdt.c.

Variable Documentation

◆ mAcpiSdtProtocolTemplate

Initial value:
= {
EFI_ACPI_TABLE_VERSION_NONE,
}
EFI_STATUS EFIAPI OpenSdt(IN UINTN TableKey, OUT EFI_ACPI_HANDLE *Handle)
Definition: AcpiSdt.c:512
EFI_STATUS EFIAPI GetAcpiTable2(IN UINTN Index, OUT EFI_ACPI_SDT_HEADER **Table, OUT EFI_ACPI_TABLE_VERSION *Version, OUT UINTN *TableKey)
Definition: AcpiSdt.c:292
EFI_STATUS EFIAPI RegisterNotify(IN BOOLEAN Register, IN EFI_ACPI_NOTIFICATION_FN Notification)
Definition: AcpiSdt.c:422
EFI_STATUS EFIAPI Open(IN VOID *Buffer, OUT EFI_ACPI_HANDLE *Handle)
Definition: AcpiSdt.c:593
EFI_STATUS EFIAPI FindPath(IN EFI_ACPI_HANDLE HandleIn, IN VOID *AcpiPath, OUT EFI_ACPI_HANDLE *HandleOut)
Definition: AcpiSdt.c:1033
EFI_STATUS EFIAPI SetOption(IN EFI_ACPI_HANDLE Handle, IN UINTN Index, IN CONST VOID *Data, IN UINTN DataSize)
Definition: AcpiSdt.c:745
EFI_STATUS EFIAPI GetChild(IN EFI_ACPI_HANDLE ParentHandle, IN OUT EFI_ACPI_HANDLE *Handle)
Definition: AcpiSdt.c:820
EFI_STATUS EFIAPI GetOption(IN EFI_ACPI_HANDLE Handle, IN UINTN Index, OUT EFI_ACPI_DATA_TYPE *DataType, OUT CONST VOID **Data, OUT UINTN *DataSize)
Definition: AcpiSdt.c:680
EFI_STATUS EFIAPI Close(IN EFI_ACPI_HANDLE Handle)
Definition: AcpiSdt.c:628

Definition at line 15 of file AcpiSdt.c.