TianoCore EDK2 master
Loading...
Searching...
No Matches
AmlResourceDataParser.c File Reference

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)
 

Detailed Description

AML Resource Data Parser.

Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Glossary:
  • Rd or RD - Resource Data
  • Rds or RDS - Resource Data Small
  • Rdl or RDL - Resource Data Large

Definition in file AmlResourceDataParser.c.

Function Documentation

◆ AmlParseResourceData()

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.

Parameters
[in]BufferNodeBuffer node.
[in]FStreamForward stream pointing to a resource data element. The stream must not be at its end.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 269 of file AmlResourceDataParser.c.

◆ AmlRdCheckFunctionDescNesting()

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.

Parameters
[in]FStreamForward stream pointing to a resource data element. The stream is not modified/progressing. The stream must not be at its end.
[in,out]InFunctionDescPointer 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.
Return values
FALSEThe Header being parsed is ending a function descriptor list when none started. This should not be possible for a resource data buffer.
TRUEOtherwise.

Definition at line 90 of file AmlResourceDataParser.c.

◆ AmlRdIsResourceDataBuffer()

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.

Parameters
[in]FStreamForward stream ideally pointing to a resource data element. The stream is not modified/progressing. The stream must not be at its end.
Return values
TRUEThe buffer is holding a valid list of resource data elements.
FALSEOtherwise.

Definition at line 166 of file AmlResourceDataParser.c.

◆ AmlRdStreamGetRdSize()

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.

Parameters
[in]FStreamForward stream pointing to a resource data element. The stream must not be at its end.
Returns
The size of the resource data element. Zero if error.

Definition at line 38 of file AmlResourceDataParser.c.