TianoCore EDK2 master
|
#include <Parser/AmlFieldListParser.h>
#include <AmlCoreInterface.h>
#include <AmlDbgPrint/AmlDbgPrint.h>
#include <Parser/AmlMethodParser.h>
#include <Parser/AmlParser.h>
#include <Tree/AmlNode.h>
#include <Tree/AmlTree.h>
Go to the source code of this file.
Functions | |
STATIC EFI_STATUS EFIAPI | AmlParseFieldElement (IN CONST AML_BYTE_ENCODING *FieldByteEncoding, IN OUT AML_OBJECT_NODE *FieldNode, IN OUT AML_STREAM *FStream, IN OUT LIST_ENTRY *NameSpaceRefList) |
STATIC EFI_STATUS EFIAPI | AmlParseNamedFieldElement (IN CONST AML_BYTE_ENCODING *NamedFieldByteEncoding, IN OUT AML_OBJECT_NODE *FieldNode, IN OUT AML_STREAM *FStream, IN OUT LIST_ENTRY *NameSpaceRefList) |
EFI_STATUS EFIAPI | AmlParseFieldList (IN AML_OBJECT_NODE *FieldNode, IN AML_STREAM *FStream, IN LIST_ENTRY *NameSpaceRefList) |
AML Field List Parser.
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file AmlFieldListParser.c.
STATIC EFI_STATUS EFIAPI AmlParseFieldElement | ( | IN CONST AML_BYTE_ENCODING * | FieldByteEncoding, |
IN OUT AML_OBJECT_NODE * | FieldNode, | ||
IN OUT AML_STREAM * | FStream, | ||
IN OUT LIST_ENTRY * | NameSpaceRefList | ||
) |
Parse a field element.
The field elements this function can parse are one of:
[in] | FieldByteEncoding | Field byte encoding to parse. |
[in,out] | FieldNode | Field node to attach the field element to. Must have the AML_HAS_FIELD_LIST attribute. |
[in,out] | FStream | Forward stream pointing to a field element not being a named field. The stream must not be at its end. |
[in,out] | NameSpaceRefList | List of namespace reference nodes, allowing to associate an absolute path to a node in the tree. |
EFI_SUCCESS | The function completed successfully. |
EFI_BUFFER_TOO_SMALL | No space left in the buffer. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_OUT_OF_RESOURCES | Could not allocate memory. |
Definition at line 48 of file AmlFieldListParser.c.
EFI_STATUS EFIAPI AmlParseFieldList | ( | IN AML_OBJECT_NODE * | FieldNode, |
IN AML_STREAM * | FStream, | ||
IN LIST_ENTRY * | NameSpaceRefList | ||
) |
Parse the FieldList contained in the stream.
Create an object node for each field element parsed in the field list available in the Stream, and add them to the variable list of arguments of the FieldNode.
Nodes that can have a field list are referred as field nodes. They have the AML_HAS_FIELD_LIST attribute.
According to the ACPI 6.3 specification, s20.2.5.2 "Named Objects Encoding", field elements can be:
A small set of opcodes describes the field elements. They are referred as field opcodes. An AML_BYTE_ENCODING table has been created for field OpCodes. Field elements:
ConnectField's BufferData is a buffer node containing a single resource data element. NamedField field elements don't have an AML OpCode. NameSeg starts with a Char type and can thus be differentiated from the Opcodes for other fields. A pseudo OpCode has been created to simplify the parser.
The branch created from parsing a field node is as: (FieldNode) \ |- [FixedArg[0]][FixedArg[1]] # Fixed Arguments |- {(FieldElement[0])->(FieldElement[1])->...)} # Variable Arguments
With FieldElement[n] being one of NamedField, ReservedField, AccessField, ConnectField, ExtendedAccessField.
[in] | FieldNode | Field node. Must have the AML_HAS_FIELD_LIST attribute. |
[in] | FStream | Forward stream pointing to a field list. The stream must not be at its end. |
[in] | NameSpaceRefList | List of namespace reference nodes, allowing to associate an absolute path to a node in the tree. |
EFI_SUCCESS | The function completed successfully. |
EFI_BUFFER_TOO_SMALL | No space left in the buffer. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_OUT_OF_RESOURCES | Could not allocate memory. |
Definition at line 311 of file AmlFieldListParser.c.
STATIC EFI_STATUS EFIAPI AmlParseNamedFieldElement | ( | IN CONST AML_BYTE_ENCODING * | NamedFieldByteEncoding, |
IN OUT AML_OBJECT_NODE * | FieldNode, | ||
IN OUT AML_STREAM * | FStream, | ||
IN OUT LIST_ENTRY * | NameSpaceRefList | ||
) |
Parse a named field element.
Indeed, the NamedField field element doesn't have an OpCode. Thus it needs to be parsed differently. NamedField field element start with a char.
[in] | NamedFieldByteEncoding | Field byte encoding to parse. |
[in,out] | FieldNode | Field node to attach the field element to. Must have the AML_HAS_FIELD_LIST attribute. |
[in,out] | FStream | Forward stream pointing to a named field element. The stream must not be at its end. |
[in,out] | NameSpaceRefList | List of namespace reference nodes, allowing to associate an absolute path to a node in the tree. |
EFI_SUCCESS | The function completed successfully. |
EFI_BUFFER_TOO_SMALL | No space left in the buffer. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_OUT_OF_RESOURCES | Could not allocate memory. |
Definition at line 186 of file AmlFieldListParser.c.