16 EFI_ACPI_TABLE_VERSION_NONE,
66 StartLink = &AcpiTableInstance->TableList;
67 CurrentLink = StartLink->ForwardLink;
69 while (CurrentLink != StartLink) {
70 CurrentTableList = EFI_ACPI_TABLE_LIST_FROM_LINK (CurrentLink);
71 if (((
UINTN)CurrentTableList->Table <= (
UINTN)Buffer) &&
72 ((
UINTN)CurrentTableList->Table + CurrentTableList->TableSize > (
UINTN)Buffer))
77 return CurrentTableList;
80 CurrentLink = CurrentLink->ForwardLink;
103 if (CurrentTableList ==
NULL) {
104 return EFI_NOT_FOUND;
108 (VOID *)CurrentTableList->Table,
109 CurrentTableList->Table->Length,
134 if (CurrentTableList ==
NULL) {
135 return EFI_NOT_FOUND;
138 *MaxSize = (
UINTN)CurrentTableList->Table + CurrentTableList->Table->Length - (
UINTN)Buffer;
152 IN EFI_ACPI_TABLE_VERSION Version,
167 &AcpiTableInstance->TableList,
175 StartLink = &AcpiTableInstance->NotifyList;
176 CurrentLink = StartLink->ForwardLink;
178 while (CurrentLink != StartLink) {
179 CurrentNotifyList = EFI_ACPI_NOTIFY_LIST_FROM_LINK (CurrentLink);
186 CurrentLink = CurrentLink->ForwardLink;
222 OUT EFI_ACPI_TABLE_VERSION *Version,
234 StartLink = &AcpiTableInstance->TableList;
235 CurrentLink = StartLink->ForwardLink;
238 while (CurrentLink != StartLink) {
239 if (TableIndex == Index) {
246 CurrentLink = CurrentLink->ForwardLink;
250 if ((TableIndex != Index) || (CurrentLink == StartLink)) {
251 return EFI_NOT_FOUND;
257 CurrentTable = EFI_ACPI_TABLE_LIST_FROM_LINK (CurrentLink);
258 *TableKey = CurrentTable->Handle;
259 *Version = CurrentTable->Version;
295 OUT EFI_ACPI_TABLE_VERSION *Version,
301 ASSERT (Table !=
NULL);
302 ASSERT (Version !=
NULL);
303 ASSERT (TableKey !=
NULL);
310 return SdtGetAcpiTable (AcpiTableInstance, Index, Table, Version, TableKey);
337 ASSERT (CurrentNotifyList !=
NULL);
342 CurrentNotifyList->Signature = EFI_ACPI_NOTIFY_LIST_SIGNATURE;
343 CurrentNotifyList->Notification = Notification;
348 InsertTailList (&AcpiTableInstance->NotifyList, &CurrentNotifyList->Link);
381 StartLink = &AcpiTableInstance->NotifyList;
382 CurrentLink = StartLink->ForwardLink;
384 while (CurrentLink != StartLink) {
385 CurrentNotifyList = EFI_ACPI_NOTIFY_LIST_FROM_LINK (CurrentLink);
386 if (CurrentNotifyList->Notification == Notification) {
397 CurrentLink = CurrentLink->ForwardLink;
403 return EFI_INVALID_PARAMETER;
430 if (Notification ==
NULL) {
431 return EFI_INVALID_PARAMETER;
460 OUT EFI_ACPI_HANDLE *Handle
478 &AcpiTableInstance->TableList,
481 if (EFI_ERROR (Status)) {
482 return EFI_NOT_FOUND;
486 ASSERT (AmlHandle !=
NULL);
487 AmlHandle->Signature = EFI_AML_ROOT_HANDLE_SIGNATURE;
490 AmlHandle->AmlByteEncoding =
NULL;
491 AmlHandle->Modified =
FALSE;
496 *Handle = (EFI_ACPI_HANDLE)AmlHandle;
514 OUT EFI_ACPI_HANDLE *Handle
517 if (Handle ==
NULL) {
518 return EFI_INVALID_PARAMETER;
540 OUT EFI_ACPI_HANDLE *Handle
547 if (AmlByteEncoding ==
NULL) {
548 return EFI_INVALID_PARAMETER;
555 return EFI_INVALID_PARAMETER;
562 ASSERT (AmlHandle !=
NULL);
564 AmlHandle->Signature = EFI_AML_HANDLE_SIGNATURE;
565 AmlHandle->Buffer = Buffer;
566 AmlHandle->AmlByteEncoding = AmlByteEncoding;
567 AmlHandle->Modified =
FALSE;
570 if (AmlHandle->Size == 0) {
572 return EFI_INVALID_PARAMETER;
575 *Handle = (EFI_ACPI_HANDLE)AmlHandle;
595 OUT EFI_ACPI_HANDLE *Handle
606 if ((Buffer ==
NULL) || (Handle ==
NULL)) {
607 return EFI_INVALID_PARAMETER;
611 if (EFI_ERROR (Status)) {
612 return EFI_INVALID_PARAMETER;
615 return SdtOpenEx (Buffer, MaxSize, Handle);
629 IN EFI_ACPI_HANDLE Handle
638 if (Handle ==
NULL) {
639 return EFI_INVALID_PARAMETER;
643 if ((AmlHandle->Signature != EFI_AML_ROOT_HANDLE_SIGNATURE) &&
644 (AmlHandle->Signature != EFI_AML_HANDLE_SIGNATURE))
646 return EFI_INVALID_PARAMETER;
652 if (AmlHandle->Modified) {
654 if (EFI_ERROR (Status)) {
655 return EFI_INVALID_PARAMETER;
681 IN EFI_ACPI_HANDLE Handle,
683 OUT EFI_ACPI_DATA_TYPE *DataType,
692 ASSERT (DataType !=
NULL);
693 ASSERT (Data !=
NULL);
694 ASSERT (DataSize !=
NULL);
699 if (Handle ==
NULL) {
700 return EFI_INVALID_PARAMETER;
707 if (AmlHandle->Signature != EFI_AML_HANDLE_SIGNATURE) {
708 return EFI_INVALID_PARAMETER;
711 AmlByteEncoding = AmlHandle->AmlByteEncoding;
712 if (Index > AmlByteEncoding->
MaxIndex) {
713 *DataType = EFI_ACPI_DATA_TYPE_NONE;
721 if (EFI_ERROR (Status)) {
722 return EFI_INVALID_PARAMETER;
746 IN EFI_ACPI_HANDLE Handle,
755 EFI_ACPI_DATA_TYPE DataType;
759 ASSERT (Data !=
NULL);
764 if (Handle ==
NULL) {
765 return EFI_INVALID_PARAMETER;
772 if (AmlHandle->Signature != EFI_AML_HANDLE_SIGNATURE) {
773 return EFI_INVALID_PARAMETER;
776 AmlByteEncoding = AmlHandle->AmlByteEncoding;
778 if (Index > AmlByteEncoding->
MaxIndex) {
779 return EFI_INVALID_PARAMETER;
786 if (EFI_ERROR (Status)) {
787 return EFI_INVALID_PARAMETER;
790 if (DataType == EFI_ACPI_DATA_TYPE_NONE) {
791 return EFI_INVALID_PARAMETER;
794 if (DataSize > OrgDataSize) {
795 return EFI_BAD_BUFFER_SIZE;
801 CopyMem (OrgData, Data, DataSize);
802 AmlHandle->Modified =
TRUE;
821 IN EFI_ACPI_HANDLE ParentHandle,
822 IN OUT EFI_ACPI_HANDLE *Handle
830 ASSERT (Handle !=
NULL);
835 if (ParentHandle ==
NULL) {
836 return EFI_INVALID_PARAMETER;
840 if ((AmlHandle !=
NULL) && (AmlHandle->Signature != EFI_AML_HANDLE_SIGNATURE)) {
841 return EFI_INVALID_PARAMETER;
845 if (AmlParentHandle->Signature == EFI_AML_ROOT_HANDLE_SIGNATURE) {
850 }
else if (AmlParentHandle->Signature == EFI_AML_HANDLE_SIGNATURE) {
859 return EFI_INVALID_PARAMETER;
862 if (EFI_ERROR (Status)) {
863 return EFI_INVALID_PARAMETER;
866 if (Buffer ==
NULL) {
871 return SdtOpenEx (Buffer, (
UINTN)AmlParentHandle->Buffer + AmlParentHandle->Size - (
UINTN)Buffer, Handle);
887 IN EFI_ACPI_HANDLE HandleIn,
889 OUT EFI_ACPI_HANDLE *HandleOut
903 if (EFI_ERROR (Status)) {
904 return EFI_INVALID_PARAMETER;
907 if (Buffer ==
NULL) {
912 return SdtOpenEx (Buffer, (
UINTN)AmlHandle->Buffer + AmlHandle->Size - (
UINTN)Buffer, HandleOut);
930 ASSERT (DstAmlHandle !=
NULL);
931 CopyMem (DstAmlHandle, (VOID *)AmlHandle,
sizeof (*DstAmlHandle));
949 IN EFI_ACPI_HANDLE HandleIn,
951 OUT EFI_ACPI_HANDLE *HandleOut
954 EFI_ACPI_HANDLE ChildHandle;
978 Status =
GetChild (HandleIn, &ChildHandle);
979 if (EFI_ERROR (Status)) {
980 return EFI_INVALID_PARAMETER;
983 if (ChildHandle ==
NULL) {
996 if (EFI_ERROR (Status)) {
997 return EFI_INVALID_PARAMETER;
1000 if (Buffer !=
NULL) {
1004 Status =
SdtOpenEx (Buffer, (
UINTN)AmlHandle->Buffer + AmlHandle->Size - (
UINTN)Buffer, HandleOut);
1005 if (!EFI_ERROR (Status)) {
1034 IN EFI_ACPI_HANDLE HandleIn,
1036 OUT EFI_ACPI_HANDLE *HandleOut
1046 if (HandleIn ==
NULL) {
1047 return EFI_INVALID_PARAMETER;
1056 if (AmlPath ==
NULL) {
1057 return EFI_INVALID_PARAMETER;
1061 DEBUG ((DEBUG_ERROR,
"AcpiSdt: FindPath - "));
1063 DEBUG ((DEBUG_ERROR,
"\n"));
1066 if (AmlHandle->Signature == EFI_AML_ROOT_HANDLE_SIGNATURE) {
1071 }
else if (AmlHandle->Signature == EFI_AML_HANDLE_SIGNATURE) {
1077 Status = EFI_INVALID_PARAMETER;
1096 CopyMem (&AcpiTableInstance->AcpiSdtProtocol, &mAcpiSdtProtocolTemplate, sizeof (mAcpiSdtProtocolTemplate));
1097 AcpiTableInstance->AcpiSdtProtocol.AcpiVersion = (EFI_ACPI_TABLE_VERSION)
PcdGet32 (PcdAcpiExposedTableVersions);
EFI_STATUS SdtUnregisterNotify(IN EFI_ACPI_NOTIFICATION_FN Notification)
EFI_STATUS SdtUpdateAmlChecksum(IN VOID *Buffer)
VOID SdtAcpiTableAcpiSdtConstructor(IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance)
EFI_STATUS EFIAPI OpenSdt(IN UINTN TableKey, OUT EFI_ACPI_HANDLE *Handle)
EFI_STATUS SdtGetMaxAmlBufferSize(IN VOID *Buffer, OUT UINTN *MaxSize)
EFI_STATUS EFIAPI GetAcpiTable2(IN UINTN Index, OUT EFI_ACPI_SDT_HEADER **Table, OUT EFI_ACPI_TABLE_VERSION *Version, OUT UINTN *TableKey)
EFI_STATUS EFIAPI RegisterNotify(IN BOOLEAN Register, IN EFI_ACPI_NOTIFICATION_FN Notification)
EFI_STATUS EFIAPI Open(IN VOID *Buffer, OUT EFI_ACPI_HANDLE *Handle)
EFI_STATUS EFIAPI FindPath(IN EFI_ACPI_HANDLE HandleIn, IN VOID *AcpiPath, OUT EFI_ACPI_HANDLE *HandleOut)
VOID SdtRegisterNotify(IN EFI_ACPI_NOTIFICATION_FN Notification)
EFI_ACPI_TABLE_INSTANCE * SdtGetAcpiTableInstance(VOID)
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 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 SdtOpenEx(IN VOID *Buffer, IN UINTN BufferSize, OUT EFI_ACPI_HANDLE *Handle)
VOID SdtNotifyAcpiList(IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance, IN EFI_ACPI_TABLE_VERSION Version, IN UINTN Handle)
EFI_STATUS SdtFindPathFromNonRoot(IN EFI_ACPI_HANDLE HandleIn, IN UINT8 *AmlPath, OUT EFI_ACPI_HANDLE *HandleOut)
EFI_AML_HANDLE * SdtDuplicateHandle(IN EFI_AML_HANDLE *AmlHandle)
EFI_STATUS SdtOpenSdtTable(IN UINTN TableKey, OUT EFI_ACPI_HANDLE *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_ACPI_TABLE_LIST * FindTableByBuffer(IN VOID *Buffer)
EFI_STATUS SdtFindPathFromRoot(IN EFI_ACPI_HANDLE HandleIn, IN UINT8 *AmlPath, OUT EFI_ACPI_HANDLE *HandleOut)
EFI_STATUS EFIAPI Close(IN EFI_ACPI_HANDLE Handle)
EFI_STATUS AmlFindPath(IN EFI_AML_HANDLE *AmlHandle, IN UINT8 *AmlPath, OUT VOID **Buffer, IN BOOLEAN FromRoot)
UINTN AmlGetObjectSize(IN AML_BYTE_ENCODING *AmlByteEncoding, IN UINT8 *Buffer, IN UINTN MaxBufferSize)
VOID AmlPrintNameString(IN UINT8 *Buffer)
EFI_STATUS AmlGetChildFromRoot(IN EFI_AML_HANDLE *AmlParentHandle, IN EFI_AML_HANDLE *AmlHandle, OUT VOID **Buffer)
EFI_STATUS AmlParseOptionHandleCommon(IN EFI_AML_HANDLE *AmlHandle, IN AML_OP_PARSE_INDEX Index, OUT EFI_ACPI_DATA_TYPE *DataType, OUT VOID **Data, OUT UINTN *DataSize)
UINT8 * AmlNameFromAslName(IN UINT8 *AslPath)
AML_BYTE_ENCODING * AmlSearchByOpByte(IN UINT8 *OpByteBuffer)
EFI_STATUS AmlGetChildFromNonRoot(IN EFI_AML_HANDLE *AmlParentHandle, IN EFI_AML_HANDLE *AmlHandle, OUT VOID **Buffer)
EFI_STATUS(EFIAPI * EFI_ACPI_NOTIFICATION_FN)(IN EFI_ACPI_SDT_HEADER *Table, IN EFI_ACPI_TABLE_VERSION Version, IN UINTN TableKey)
EFI_STATUS EFIAPI AcpiPlatformChecksum(IN EFI_ACPI_DESCRIPTION_HEADER *AcpiTable)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI AmlIsRootPath(IN CONST CHAR8 *Buffer)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS FindTableByHandle(IN UINTN Handle, IN LIST_ENTRY *TableList, OUT EFI_ACPI_TABLE_LIST **Table)
#define OFFSET_OF(TYPE, Field)
#define GLOBAL_REMOVE_IF_UNREFERENCED
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG_CODE_BEGIN()
#define DEBUG(Expression)
#define PcdGet32(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_STATUS EFIAPI Register(IN EFI_PEI_RSC_HANDLER_CALLBACK Callback)
AML_OP_ATTRIBUTE Attribute
Additional information on the AML object.
EAML_PARSE_INDEX MaxIndex