33 return EFI_INVALID_PARAMETER;
39 Node->NodeType = NodeType;
63 return EFI_INVALID_PARAMETER;
66 if ((RootNode->SdtHeader !=
NULL)) {
70 return EFI_INVALID_PARAMETER;
100 if ((SdtHeader ==
NULL) ||
101 (NewRootNodePtr ==
NULL))
104 return EFI_INVALID_PARAMETER;
107 *NewRootNodePtr =
NULL;
110 if (RootNode ==
NULL) {
112 return EFI_OUT_OF_RESOURCES;
116 if (EFI_ERROR (Status)) {
131 return EFI_OUT_OF_RESOURCES;
134 *NewRootNodePtr = RootNode;
158 return EFI_INVALID_PARAMETER;
190 if ((AmlByteEncoding ==
NULL) ||
191 (NewObjectNodePtr ==
NULL))
194 return EFI_INVALID_PARAMETER;
197 *NewObjectNodePtr =
NULL;
200 if (ObjectNode ==
NULL) {
202 return EFI_OUT_OF_RESOURCES;
206 if (EFI_ERROR (Status)) {
217 ObjectNode->
PkgLen = PkgLength;
219 *NewObjectNodePtr = ObjectNode;
244 return EFI_INVALID_PARAMETER;
247 if (DataNode->Buffer !=
NULL) {
251 return EFI_INVALID_PARAMETER;
294 (NewDataNodePtr ==
NULL))
297 return EFI_INVALID_PARAMETER;
300 *NewDataNodePtr =
NULL;
303 if (DataNode ==
NULL) {
305 return EFI_OUT_OF_RESOURCES;
309 if (EFI_ERROR (Status)) {
319 return EFI_OUT_OF_RESOURCES;
323 DataNode->
Size = DataSize;
325 *NewDataNodePtr = DataNode;
353 return EFI_INVALID_PARAMETER;
356 switch (Node->NodeType) {
362 return EFI_INVALID_PARAMETER;
366 if (EFI_ERROR (Status)) {
378 return EFI_INVALID_PARAMETER;
385 return EFI_INVALID_PARAMETER;
390 if (EFI_ERROR (Status)) {
400 if (EFI_ERROR (Status)) {
410 Status = EFI_INVALID_PARAMETER;
436 (ObjectNode->AmlByteEncoding ==
NULL))
441 return ((ObjectNode->AmlByteEncoding->Attribute &
464 (ObjectNode->AmlByteEncoding ==
NULL))
471 return ((ObjectNode->AmlByteEncoding->OpCode == OpCode) &&
472 (ObjectNode->AmlByteEncoding->SubOpCode == SubOpCode)) ?
498 (Node->AmlByteEncoding ==
NULL))
504 OpCode = Node->AmlByteEncoding->OpCode;
505 if ((OpCode != AML_BYTE_PREFIX) &&
506 (OpCode != AML_WORD_PREFIX) &&
507 (OpCode != AML_DWORD_PREFIX) &&
508 (OpCode != AML_QWORD_PREFIX))
535 (Node->AmlByteEncoding ==
NULL))
540 OpCode = Node->AmlByteEncoding->OpCode;
542 if ((OpCode != AML_ZERO_OP) &&
543 (OpCode != AML_ONE_OP) &&
544 (OpCode != AML_ONES_OP))
591 ((ObjectType->
Size == 1)))
593 if (*((UINT8 *)ObjectType->
Buffer) == (UINT8)EAmlObjTypeMethodObj) {
629 (ObjectNode->AmlByteEncoding ==
NULL) ||
633 return EFI_INVALID_PARAMETER;
636 NameIndex = ObjectNode->AmlByteEncoding->NameIndex;
638 if ((NameIndex > ObjectNode->AmlByteEncoding->MaxIndex) ||
639 (ObjectNode->AmlByteEncoding->Format[NameIndex] !=
EAmlName))
642 return EFI_INVALID_PARAMETER;
678 if (EFI_ERROR (Status)) {
684 DataNode = (
AML_DATA_NODE *)ObjectNode->FixedArgs[NameIndex];
688 return (CHAR8 *)DataNode->
Buffer;
BOOLEAN EFIAPI IsIntegerNode(IN AML_OBJECT_NODE *Node)
BOOLEAN EFIAPI AmlIsMethodDefinitionNode(IN CONST AML_OBJECT_NODE *Node)
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)
STATIC EFI_STATUS EFIAPI AmlDeleteRootNode(IN AML_ROOT_NODE *RootNode)
BOOLEAN EFIAPI AmlNodeHasAttribute(IN CONST AML_OBJECT_NODE *ObjectNode, IN AML_OP_ATTRIBUTE Attribute)
CHAR8 *EFIAPI AmlNodeGetName(IN CONST AML_OBJECT_NODE *ObjectNode)
STATIC EFI_STATUS EFIAPI AmlDeleteObjectNode(IN AML_OBJECT_NODE *ObjectNode)
STATIC EFI_STATUS EFIAPI AmlDeleteDataNode(IN AML_DATA_NODE *DataNode)
EFI_STATUS EFIAPI AmlCreateRootNode(IN CONST EFI_ACPI_DESCRIPTION_HEADER *SdtHeader, OUT AML_ROOT_NODE **NewRootNodePtr)
STATIC EFI_STATUS EFIAPI AmlInitializeNodeHeader(IN AML_NODE_HEADER *Node, IN EAML_NODE_TYPE NodeType)
BOOLEAN EFIAPI IsSpecialIntegerNode(IN AML_OBJECT_NODE *Node)
EFI_STATUS EFIAPI AmlCreateDataNode(IN EAML_NODE_DATA_TYPE DataType, IN CONST UINT8 *Data, IN UINT32 DataSize, OUT AML_DATA_NODE **NewDataNodePtr)
EFI_STATUS AmlNodeGetNameIndex(IN CONST AML_OBJECT_NODE *ObjectNode, OUT EAML_PARSE_INDEX *Index)
#define IS_AML_ROOT_NODE(Node)
#define IS_AML_OBJECT_NODE(Node)
#define IS_AML_DATA_NODE(Node)
#define IS_AML_NODE_VALID(Node)
#define AML_NODE_IS_DETACHED(Node)
LIST_ENTRY *EFIAPI AmlNodeGetVariableArgList(IN CONST AML_NODE_HEADER *Node)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
BOOLEAN EFIAPI AmlIsOpCodeValid(IN UINT8 OpCode, IN UINT8 SubOpCode)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
AML_NODE_HANDLE EFIAPI AmlGetFixedArgument(IN AML_OBJECT_NODE_HANDLE ObjectNode, IN EAML_PARSE_INDEX Index)
enum EAmlParseIndex EAML_PARSE_INDEX
enum EAmlNodeType EAML_NODE_TYPE
enum EAmlNodeDataType EAML_NODE_DATA_TYPE
@ EAmlParseIndexMax
Maximum fixed argument index (=6).
@ EAmlParseIndexTerm1
Second fixed argument index.
@ EAmlParseIndexTerm0
First fixed argument index.
@ EAmlNodeRoot
AML Root Node, typically represents a DefinitionBlock.
@ EAmlNodeDataTypeReserved4
EAmlUInt64, converted to the UInt type.
@ EAmlNodeDataTypeReserved1
EAmlUInt8, converted to the UInt type.
@ EAmlNodeDataTypeNone
EAmlNone, not accessible.
@ EAmlNodeDataTypeReserved5
EAmlObject, not accessible.
@ EAmlNodeDataTypeReserved3
EAmlUInt32, converted to the UInt type.
@ EAmlNodeDataTypeReserved2
EAmlUInt16, converted to the UInt type.
@ EAmlNodeDataTypeNameString
AML_NODE_HEADER NodeHeader
Header information. Must be the first field of the struct.
EAML_NODE_DATA_TYPE DataType
UINT8 * Buffer
Buffer containing the data stored by this node.
UINT32 Size
Size of the Buffer.
CONST AML_BYTE_ENCODING * AmlByteEncoding
AML_NODE_HEADER NodeHeader
Header information. Must be the first field of the struct.
AML_NODE_HEADER NodeHeader
Header information. Must be the first field of the struct.
EFI_ACPI_DESCRIPTION_HEADER * SdtHeader
ACPI DSDT/SSDT header.