153 return EFI_INVALID_PARAMETER;
156 switch (ExpectedFormat) {
171 return EFI_INVALID_PARAMETER;
180 if (EFI_ERROR (Status)) {
189 if (EFI_ERROR (Status)) {
240 return EFI_INVALID_PARAMETER;
245 if ((ByteEncoding ==
NULL) ||
249 return EFI_INVALID_PARAMETER;
254 if ((EFI_ERROR (Status)) ||
258 return EFI_INVALID_PARAMETER;
267 if (EFI_ERROR (Status)) {
276 if (EFI_ERROR (Status)) {
326 return EFI_INVALID_PARAMETER;
335 if (EFI_ERROR (Status)) {
341 }
while (Byte !=
'\0');
343 AMLDBG_DUMP_RAW (Buffer,
StrSize);
405 return EFI_INVALID_PARAMETER;
412 if (AmlByteEncoding ==
NULL) {
414 return EFI_INVALID_PARAMETER;
430 if (EFI_ERROR (Status)) {
439 if (*Buffer == AML_EXT_OP) {
446 if (EFI_ERROR (Status)) {
452 AMLDBG_DUMP_RAW (Buffer, OpCodeSize);
459 if (PkgOffset == 0) {
461 return EFI_INVALID_PARAMETER;
465 AMLDBG_DUMP_RAW (Buffer, PkgOffset);
469 if (FreeSpace > PkgLength) {
472 }
else if (FreeSpace != PkgLength) {
474 return EFI_INVALID_PARAMETER;
478 if (EFI_ERROR (Status)) {
486 return EFI_INVALID_PARAMETER;
547 return EFI_INVALID_PARAMETER;
553 if (PkgOffset == 0) {
555 return EFI_INVALID_PARAMETER;
566 if (EFI_ERROR (Status)) {
571 AMLDBG_DUMP_RAW (Buffer, PkgOffset);
574 if (EFI_ERROR (Status)) {
638 (NameSpaceRefList ==
NULL) ||
642 return EFI_INVALID_PARAMETER;
652 if (EFI_ERROR (Status)) {
658 NameSpaceRefNode =
NULL;
665 if (EFI_ERROR (Status)) {
670 MethodInvocationNode =
NULL;
671 if (NameSpaceRefNode !=
NULL) {
677 &MethodInvocationNode
679 if (EFI_ERROR (Status)) {
685 *OutNode = MethodInvocationNode;
732 (NameSpaceRefList ==
NULL) ||
736 return EFI_INVALID_PARAMETER;
740 if (ParsingFunction ==
NULL) {
742 return EFI_INVALID_PARAMETER;
747 Status = ParsingFunction (
753 if (EFI_ERROR (Status)) {
769 &MethodInvocationNode
771 if (EFI_ERROR (Status)) {
779 if (MethodInvocationNode !=
NULL) {
821 return EFI_INVALID_PARAMETER;
829 if (EFI_ERROR (Status)) {
846 if (EFI_ERROR (Status)) {
855 if (EFI_ERROR (Status)) {
861 AMLDBG_DUMP_RAW (Buffer, BufferSize);
865 if (EFI_ERROR (Status)) {
914 (NameSpaceRefList ==
NULL))
917 return EFI_INVALID_PARAMETER;
924 if ((ObjectNode->AmlByteEncoding !=
NULL) &&
925 (ObjectNode->AmlByteEncoding->Format !=
NULL))
927 Format = ObjectNode->AmlByteEncoding->Format;
930 return EFI_INVALID_PARAMETER;
934 while ((TermIndex < MaxIndex) &&
940 if (EFI_ERROR (Status)) {
953 if (EFI_ERROR (Status)) {
965 if (EFI_ERROR (Status)) {
979 Status = AmlParseStream (
984 if (EFI_ERROR (Status)) {
995 if (EFI_ERROR (Status)) {
1039 BOOLEAN IsMethodInvocation;
1040 UINT8 MethodInvocationArgCount;
1053 (NameSpaceRefList ==
NULL))
1056 return EFI_INVALID_PARAMETER;
1061 &IsMethodInvocation,
1062 &MethodInvocationArgCount
1064 if (EFI_ERROR (Status)) {
1072 if ((IsMethodInvocation) && (MethodInvocationArgCount-- == 0)) {
1078 if (EFI_ERROR (Status)) {
1091 if (EFI_ERROR (Status)) {
1102 if (EFI_ERROR (Status)) {
1116 Status = AmlParseStream (VarArgNode, &VarArgFStream, NameSpaceRefList);
1117 if (EFI_ERROR (Status)) {
1128 if (EFI_ERROR (Status)) {
1136 if (IsMethodInvocation && (MethodInvocationArgCount != 0)) {
1138 return EFI_INVALID_PARAMETER;
1173 (NameSpaceRefList ==
NULL))
1176 return EFI_INVALID_PARAMETER;
1219 (NameSpaceRefList ==
NULL))
1222 return EFI_INVALID_PARAMETER;
1245 if (EFI_ERROR (Status)) {
1263 if (EFI_ERROR (Status)) {
1293 if (EFI_ERROR (Status)) {
1332 if (EFI_ERROR (Status)) {
1341 if (EFI_ERROR (Status)) {
1347 Status = EFI_INVALID_PARAMETER;
1383 UINT32 MaxBufferSize;
1385 if ((DefinitionBlock ==
NULL) ||
1389 return EFI_INVALID_PARAMETER;
1395 return EFI_INVALID_PARAMETER;
1398 MaxBufferSize = DefinitionBlock->Length -
1406 if (EFI_ERROR (Status)) {
1413 if (MaxBufferSize == 0) {
1424 if (EFI_ERROR (Status)) {
1434 Status = AmlParseStream (
1439 if (EFI_ERROR (Status)) {
1447 Status = EFI_INVALID_PARAMETER;
1464 if (EFI_ERROR (Status1)) {
1466 if (!EFI_ERROR (Status)) {
#define AML_IS_FIELD_ELEMENT
enum EAmlParseFormat AML_PARSE_FORMAT
#define AML_HAS_CHILD_OBJ
#define AML_HAS_PKG_LENGTH
#define AML_HAS_BYTE_LIST
#define AML_HAS_FIELD_LIST
@ EAmlParseFormatMax
Max enum.
@ EAmlUInt64
Eight byte value evaluated as a UINT64.
@ EAmlUInt8
One byte value evaluated as a UINT8.
@ EAmlString
NULL terminated string.
@ EAmlNone
No data expected.
@ EAmlUInt16
Two byte value evaluated as a UINT16.
@ EAmlUInt32
Four byte value evaluated as a UINT32.
EFI_STATUS EFIAPI AmlParseFieldList(IN AML_OBJECT_NODE *FieldNode, IN AML_STREAM *FStream, IN LIST_ENTRY *NameSpaceRefList)
EFI_STATUS EFIAPI AmlCreateMethodInvocationNode(IN CONST AML_NAMESPACE_REF_NODE *NameSpaceRefNode, IN AML_DATA_NODE *MethodInvocationName, OUT AML_OBJECT_NODE **MethodInvocationNodePtr)
EFI_STATUS EFIAPI AmlGetMethodInvocationArgCount(IN CONST AML_OBJECT_NODE *MethodInvocationNode, OUT BOOLEAN *IsMethodInvocation, OUT UINT8 *ArgCount)
EFI_STATUS EFIAPI AmlAddNameSpaceReference(IN CONST AML_OBJECT_NODE *Node, IN OUT LIST_ENTRY *NameSpaceRefList)
EFI_STATUS EFIAPI AmlIsMethodInvocation(IN CONST AML_NODE_HEADER *ParentNode, IN CONST AML_STREAM *FStream, IN CONST LIST_ENTRY *NameSpaceRefList, OUT AML_NAMESPACE_REF_NODE **OutNameSpaceRefNode)
EFI_STATUS EFIAPI AmlDeleteNameSpaceRefList(IN LIST_ENTRY *NameSpaceRefList)
BOOLEAN EFIAPI AmlNodeCompareOpCode(IN CONST AML_OBJECT_NODE *ObjectNode, IN UINT8 OpCode, IN UINT8 SubOpCode)
EFI_STATUS EFIAPI AmlCreateObjectNode(IN CONST AML_BYTE_ENCODING *AmlByteEncoding, IN UINT32 PkgLength, OUT AML_OBJECT_NODE **NewObjectNodePtr)
EFI_STATUS EFIAPI AmlDeleteNode(IN AML_NODE_HEADER *Node)
BOOLEAN EFIAPI AmlNodeHasAttribute(IN CONST AML_OBJECT_NODE *ObjectNode, IN AML_OP_ATTRIBUTE Attribute)
EFI_STATUS EFIAPI AmlCreateRootNode(IN CONST EFI_ACPI_DESCRIPTION_HEADER *SdtHeader, OUT AML_ROOT_NODE **NewRootNodePtr)
EFI_STATUS EFIAPI AmlCreateDataNode(IN EAML_NODE_DATA_TYPE DataType, IN CONST UINT8 *Data, IN UINT32 DataSize, OUT AML_DATA_NODE **NewDataNodePtr)
#define IS_AML_ROOT_NODE(Node)
#define IS_AML_OBJECT_NODE(Node)
#define IS_AML_DATA_NODE(Node)
STATIC EFI_STATUS EFIAPI AmlPopulateObjectNode(IN AML_OBJECT_NODE *ObjectNode, IN OUT AML_STREAM *FStream, IN OUT LIST_ENTRY *NameSpaceRefList)
STATIC EFI_STATUS EFIAPI AmlParseString(IN CONST AML_NODE_HEADER *ParentNode, IN AML_PARSE_FORMAT ExpectedFormat, IN OUT AML_STREAM *FStream, OUT AML_NODE_HEADER **OutNode)
STATIC EFI_STATUS EFIAPI AmlParseNameString(IN CONST AML_NODE_HEADER *ParentNode, IN AML_PARSE_FORMAT ExpectedFormat, IN OUT AML_STREAM *FStream, OUT AML_NODE_HEADER **OutNode)
STATIC EFI_STATUS EFIAPI AmlParseByteList(IN AML_OBJECT_NODE *BufferNode, IN OUT AML_STREAM *FStream)
EFI_STATUS EFIAPI AmlParseFixedArguments(IN AML_OBJECT_NODE *ObjectNode, IN AML_STREAM *FStream, IN LIST_ENTRY *NameSpaceRefList)
EFI_STATUS EFIAPI AmlParseVariableArguments(IN AML_NODE_HEADER *Node, IN AML_STREAM *FStream, IN LIST_ENTRY *NameSpaceRefList)
STATIC EFI_STATUS EFIAPI AmlPopulateRootNode(IN AML_ROOT_NODE *RootNode, IN OUT AML_STREAM *FStream, IN OUT LIST_ENTRY *NameSpaceRefList)
AML_PARSE_FUNCTION mParseType[EAmlParseFormatMax]
STATIC EFI_STATUS EFIAPI AmlParseUIntX(IN CONST AML_NODE_HEADER *ParentNode, IN AML_PARSE_FORMAT ExpectedFormat, IN OUT AML_STREAM *FStream, OUT AML_NODE_HEADER **OutNode)
STATIC EFI_STATUS EFIAPI AmlParseObject(IN CONST AML_NODE_HEADER *ParentNode, IN AML_PARSE_FORMAT ExpectedFormat, IN OUT AML_STREAM *FStream, OUT AML_NODE_HEADER **OutNode)
EFI_STATUS(EFIAPI * AML_PARSE_FUNCTION)(IN CONST AML_NODE_HEADER *Node, IN AML_PARSE_FORMAT ExpectedFormat, IN OUT AML_STREAM *FStream, OUT AML_NODE_HEADER **OutNode)
STATIC EFI_STATUS EFIAPI AmlParseArgument(IN CONST AML_NODE_HEADER *ParentNode, IN AML_PARSE_FORMAT ExpectedFormat, IN OUT AML_STREAM *FStream, IN OUT LIST_ENTRY *NameSpaceRefList, OUT AML_NODE_HEADER **OutNode)
EFI_STATUS EFIAPI AmlParseDefinitionBlock(IN CONST EFI_ACPI_DESCRIPTION_HEADER *DefinitionBlock, OUT AML_ROOT_NODE **RootPtr)
STATIC EFI_STATUS EFIAPI AmlParseFieldPkgLen(IN CONST AML_NODE_HEADER *ParentNode, IN AML_PARSE_FORMAT ExpectedFormat, IN OUT AML_STREAM *FStream, OUT AML_NODE_HEADER **OutNode)
STATIC EFI_STATUS EFIAPI AmlCheckAndParseMethodInvoc(IN CONST AML_NODE_HEADER *ParentNode, IN AML_DATA_NODE *DataNode, IN OUT LIST_ENTRY *NameSpaceRefList, OUT AML_OBJECT_NODE **OutNode)
EFI_STATUS EFIAPI AmlParseResourceData(IN AML_OBJECT_NODE *BufferNode, IN AML_STREAM *FStream)
BOOLEAN EFIAPI AmlRdIsResourceDataBuffer(IN CONST AML_STREAM *FStream)
UINT32 EFIAPI AmlStreamGetIndex(IN CONST AML_STREAM *Stream)
EFI_STATUS EFIAPI AmlStreamReadByte(IN AML_STREAM *Stream, OUT UINT8 *OutByte)
UINT32 EFIAPI AmlStreamGetFreeSpace(IN CONST AML_STREAM *Stream)
EFI_STATUS EFIAPI AmlStreamProgress(IN AML_STREAM *Stream, IN UINT32 Offset)
UINT8 *EFIAPI AmlStreamGetCurrPos(IN CONST AML_STREAM *Stream)
EFI_STATUS EFIAPI AmlStreamReduceMaxBufferSize(IN AML_STREAM *Stream, IN UINT32 Diff)
EFI_STATUS EFIAPI AmlStreamInitSubStream(IN CONST AML_STREAM *Stream, OUT AML_STREAM *SubStream)
EFI_STATUS EFIAPI AmlStreamInit(IN OUT AML_STREAM *Stream, IN UINT8 *Buffer, IN UINT32 MaxBufferSize, IN EAML_STREAM_DIRECTION Direction)
#define IS_STREAM_FORWARD(Stream)
@ EAmlStreamDirectionForward
#define IS_STREAM(Stream)
#define IS_END_OF_STREAM(Stream)
EFI_STATUS EFIAPI AmlSetFixedArgument(IN AML_OBJECT_NODE *ObjectNode, IN EAML_PARSE_INDEX Index, IN AML_NODE_HEADER *NewNode)
EFI_STATUS EFIAPI AmlVarListAddTailInternal(IN AML_NODE_HEADER *ParentNode, IN AML_NODE_HEADER *NewNode)
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
EAML_NODE_DATA_TYPE EFIAPI AmlTypeToNodeDataType(IN AML_PARSE_FORMAT AmlType)
UINT32 EFIAPI AmlGetPkgLength(IN CONST UINT8 *Buffer, OUT UINT32 *PkgLength)
CONST AML_BYTE_ENCODING *EFIAPI AmlGetByteEncoding(IN CONST UINT8 *Buffer)
EFI_STATUS EFIAPI AmlGetNameStringSize(IN CONST CHAR8 *AmlPath, OUT UINT32 *AmlPathSizePtr)
#define ASSERT_EFI_ERROR(StatusParameter)
UINT8 AmlGetFixedArgumentCount(IN AML_OBJECT_NODE_HANDLE Node)
#define AML_METHOD_INVOC_OP
enum EAmlParseIndex EAML_PARSE_INDEX
@ EAmlParseIndexTerm0
First fixed argument index.
@ EAmlNodeDataTypeRaw
Raw bytes contained in a buffer.
@ EAmlNodeDataTypeNameString
EFI_STATUS EFIAPI AmlDeleteTree(IN AML_NODE_HANDLE Node)
EAML_NODE_DATA_TYPE DataType
UINT8 * Buffer
Pointer to a buffer.