OvmfPkg[all]  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
QemuFwCfgSimpleParserLib.h File Reference

Functions

RETURN_STATUS EFIAPI QemuFwCfgParseBool (IN CONST CHAR8 *FileName, OUT BOOLEAN *Value)
 
RETURN_STATUS EFIAPI QemuFwCfgParseUint8 (IN CONST CHAR8 *FileName, IN BOOLEAN ParseAsHex, OUT UINT8 *Value)
 
RETURN_STATUS EFIAPI QemuFwCfgParseUint16 (IN CONST CHAR8 *FileName, IN BOOLEAN ParseAsHex, OUT UINT16 *Value)
 
RETURN_STATUS EFIAPI QemuFwCfgParseUint32 (IN CONST CHAR8 *FileName, IN BOOLEAN ParseAsHex, OUT UINT32 *Value)
 
RETURN_STATUS EFIAPI QemuFwCfgParseUint64 (IN CONST CHAR8 *FileName, IN BOOLEAN ParseAsHex, OUT UINT64 *Value)
 
RETURN_STATUS EFIAPI QemuFwCfgParseUintn (IN CONST CHAR8 *FileName, IN BOOLEAN ParseAsHex, OUT UINTN *Value)
 

Detailed Description

Parse the contents of named fw_cfg files as simple (scalar) data types.

Copyright (C) 2020, Red Hat, Inc.

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

Function Documentation

RETURN_STATUS EFIAPI QemuFwCfgParseBool ( IN CONST CHAR8 *  FileName,
OUT BOOLEAN *  Value 
)

Look up FileName with QemuFwCfgFindFile() from QemuFwCfgLib. Read the fw_cfg file into a small array with automatic storage duration. Parse the array as the textual representation of a BOOLEAN.

Parameters
[in]FileNameThe name of the fw_cfg file to look up and parse.
[out]ValueOn success, Value is TRUE if the contents of the fw_cfg file case-insensitively match "true", "yes", "y", "enable", "enabled", "1".

On success, Value is FALSE if the contents of the fw_cfg file case-insensitively match "false", "no", "n", "disable", "disabled", "0".

On failure, Value is not changed.

Return values
RETURN_SUCCESSParsing successful. Value has been set.
RETURN_UNSUPPORTEDFirmware configuration is unavailable.
RETURN_PROTOCOL_ERRORParsing failed. Value has not been changed.
Returns
Error codes propagated from QemuFwCfgFindFile(). Value has not been changed.
RETURN_STATUS EFIAPI QemuFwCfgParseUint16 ( IN CONST CHAR8 *  FileName,
IN BOOLEAN  ParseAsHex,
OUT UINT16 *  Value 
)
RETURN_STATUS EFIAPI QemuFwCfgParseUint32 ( IN CONST CHAR8 *  FileName,
IN BOOLEAN  ParseAsHex,
OUT UINT32 Value 
)
RETURN_STATUS EFIAPI QemuFwCfgParseUint64 ( IN CONST CHAR8 *  FileName,
IN BOOLEAN  ParseAsHex,
OUT UINT64 *  Value 
)
RETURN_STATUS EFIAPI QemuFwCfgParseUint8 ( IN CONST CHAR8 *  FileName,
IN BOOLEAN  ParseAsHex,
OUT UINT8 *  Value 
)

Look up FileName with QemuFwCfgFindFile() from QemuFwCfgLib. Read the fw_cfg file into a small array with automatic storage duration. Parse the array as the textual representation of a UINT8.

Parameters
[in]FileNameThe name of the fw_cfg file to look up and parse.
[in]ParseAsHexIf TRUE, call BaseLib's AsciiStrHexToUint64S() for parsing the fw_cfg file.

If FALSE, call BaseLib's AsciiStrDecimalToUint64S() for parsing the fw_cfg file.

Parameters
[out]ValueOn success, Value has been parsed with the BaseLib function determined by ParseAsHex, and also range-checked for [0, MAX_UINT8].

On failure, Value is not changed.

Return values
RETURN_SUCCESSParsing successful. Value has been set.
RETURN_UNSUPPORTEDFirmware configuration is unavailable.
RETURN_PROTOCOL_ERRORParsing failed. Value has not been changed.
RETURN_PROTOCOL_ERRORParsing succeeded, but the result does not fit in the [0, MAX_UINT8] range. Value has not been changed.
Returns
Error codes propagated from QemuFwCfgFindFile() and from the BaseLib function selected by ParseAsHex. Value has not been changed.
RETURN_STATUS EFIAPI QemuFwCfgParseUintn ( IN CONST CHAR8 *  FileName,
IN BOOLEAN  ParseAsHex,
OUT UINTN *  Value 
)