TianoCore EDK2 master
|
#include <Parser/AmlResourceDataParser.h>
#include <AmlCoreInterface.h>
#include <AmlDbgPrint/AmlDbgPrint.h>
#include <Tree/AmlNode.h>
#include <Tree/AmlTree.h>
Go to the source code of this file.
Functions | |
UINT32 EFIAPI | AmlRdStreamGetRdSize (IN CONST AML_STREAM *FStream) |
STATIC BOOLEAN EFIAPI | AmlRdCheckFunctionDescNesting (IN CONST AML_STREAM *FStream, IN OUT BOOLEAN *InFunctionDesc) |
BOOLEAN EFIAPI | AmlRdIsResourceDataBuffer (IN CONST AML_STREAM *FStream) |
EFI_STATUS EFIAPI | AmlParseResourceData (IN AML_OBJECT_NODE *BufferNode, IN AML_STREAM *FStream) |
AML Resource Data Parser.
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file AmlResourceDataParser.c.
EFI_STATUS EFIAPI AmlParseResourceData | ( | IN AML_OBJECT_NODE * | BufferNode, |
IN AML_STREAM * | FStream | ||
) |
Parse a ResourceDataBuffer.
For each resource data element, create a data node and add them to the variable list of arguments of the BufferNode.
The input stream is expected to point to a valid list of resource data elements. A function is available to check it for the caller.
[in] | BufferNode | Buffer node. |
[in] | FStream | Forward stream pointing to a resource data element. The stream must not be at its end. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_OUT_OF_RESOURCES | Could not allocate memory. |
Definition at line 269 of file AmlResourceDataParser.c.
STATIC BOOLEAN EFIAPI AmlRdCheckFunctionDescNesting | ( | IN CONST AML_STREAM * | FStream, |
IN OUT BOOLEAN * | InFunctionDesc | ||
) |
Check the nesting of resource data elements that are dependent function descriptors.
[in] | FStream | Forward stream pointing to a resource data element. The stream is not modified/progressing. The stream must not be at its end. |
[in,out] | InFunctionDesc | Pointer holding the nesting of the resource data buffer. InFunctionDesc holds TRUE if the resource data at the address of Buffer is currently in a dependent function descriptor list. |
FALSE | The Header being parsed is ending a function descriptor list when none started. This should not be possible for a resource data buffer. |
TRUE | Otherwise. |
Definition at line 90 of file AmlResourceDataParser.c.
BOOLEAN EFIAPI AmlRdIsResourceDataBuffer | ( | IN CONST AML_STREAM * | FStream | ) |
Check whether the input stream is pointing to a valid list of resource data elements.
The check is based on the size of resource data elements. This means that a buffer can pass this check with non-existing descriptor Ids that have a correct size.
A list of resource data elements can contain one unique resource data element, without an end tag resource data. This is the case for a FieldList.
[in] | FStream | Forward stream ideally pointing to a resource data element. The stream is not modified/progressing. The stream must not be at its end. |
TRUE | The buffer is holding a valid list of resource data elements. |
FALSE | Otherwise. |
Definition at line 166 of file AmlResourceDataParser.c.
UINT32 EFIAPI AmlRdStreamGetRdSize | ( | IN CONST AML_STREAM * | FStream | ) |
Get the size of a resource data element using a stream.
If the resource data element is of the large type, the Header is expected to be at least 3 bytes long.
The use of a stream makes this function safer than the version without stream.
[in] | FStream | Forward stream pointing to a resource data element. The stream must not be at its end. |
Definition at line 38 of file AmlResourceDataParser.c.