TianoCore EDK2 master
Loading...
Searching...
No Matches
HwInfoParserLib.h File Reference

Go to the source code of this file.

Typedefs

typedef VOID * HW_INFO_PARSER_HANDLE
 
typedef EFI_STATUS(EFIAPI * HW_INFO_ADD_OBJECT) (IN HW_INFO_PARSER_HANDLE ParserHandle, IN VOID *Context, IN CONST CM_OBJ_DESCRIPTOR *CmObjDesc, OUT CM_OBJECT_TOKEN *Token OPTIONAL)
 

Functions

EFI_STATUS EFIAPI HwInfoParserInit (IN VOID *HwDataSource, IN VOID *Context, IN HW_INFO_ADD_OBJECT HwInfoAdd, OUT HW_INFO_PARSER_HANDLE *ParserHandle)
 
EFI_STATUS EFIAPI HwInfoParse (IN HW_INFO_PARSER_HANDLE ParserHandle)
 
EFI_STATUS EFIAPI HwInfoParserShutdown (IN HW_INFO_PARSER_HANDLE ParserHandle)
 

Detailed Description

Hardware information parser library.

Copyright (c) 2021, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HwInfoParserLib.h.

Typedef Documentation

◆ HW_INFO_ADD_OBJECT

typedef EFI_STATUS(EFIAPI * HW_INFO_ADD_OBJECT) (IN HW_INFO_PARSER_HANDLE ParserHandle, IN VOID *Context, IN CONST CM_OBJ_DESCRIPTOR *CmObjDesc, OUT CM_OBJECT_TOKEN *Token OPTIONAL)

Function pointer called by the parser to add information.

Callback function that the parser can use to add new CmObj. This function must copy the CmObj data and not rely on the parser preserving the CmObj memory. This function is responsible of the Token allocation.

Parameters
[in]ParserHandleA handle to the parser instance.
[in]ContextA pointer to the caller's context provided in HwInfoParserInit ().
[in]CmObjDescCM_OBJ_DESCRIPTOR containing the CmObj(s) to add.
[out]TokenIf provided and success, contain the token generated for the CmObj.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 35 of file HwInfoParserLib.h.

◆ HW_INFO_PARSER_HANDLE

typedef VOID* HW_INFO_PARSER_HANDLE

A handle to the HwInfoParser instance.

Definition at line 15 of file HwInfoParserLib.h.

Function Documentation

◆ HwInfoParse()

EFI_STATUS EFIAPI HwInfoParse ( IN HW_INFO_PARSER_HANDLE  ParserHandle)

Parse the data provided by the HwDataSource.

Parameters
[in]ParserHandleA handle to the parser instance.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESAn allocation has failed.

Definition at line 74 of file FdtHwInfoParser.c.

◆ HwInfoParserInit()

EFI_STATUS EFIAPI HwInfoParserInit ( IN VOID *  HwDataSource,
IN VOID *  Context,
IN HW_INFO_ADD_OBJECT  HwInfoAdd,
OUT HW_INFO_PARSER_HANDLE ParserHandle 
)

Initialise the HwInfoParser.

The HwInfoParser shall use the information provided by the HwDataSource to initialise the internal state of the parser or to index the data. This internal state shall be linked to the ParserHandle using an implementation defined mechanism.

Parameters
[in]HwDataSourcePointer to the blob containing the hardware information. It can be a pointer to a Device Tree, an XML file, etc. or any other data structure defined by the HwInfoParser.
[in]ContextA pointer to the caller's context.
[in]HwInfoAddFunction pointer called by the parser when adding information.
[out]ParserHandleA handle to the parser instance.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 31 of file FdtHwInfoParser.c.

◆ HwInfoParserShutdown()

EFI_STATUS EFIAPI HwInfoParserShutdown ( IN HW_INFO_PARSER_HANDLE  ParserHandle)

Cleanup any internal state and resources that were allocated by the HwInfoParser.

Parameters
[in]ParserHandleA handle to the parser instance.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 104 of file FdtHwInfoParser.c.