Per the UEFI specification, if the Request argument in EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig() is NULL or does not contain any request elements, the implementation should return all of the settings being abstracted for the particular ConfigHdr reference. The current implementation returns EFI_INVALID_PARAMETER if Request is NULL or does not contain any request elements. Instead, construct a new ConfigRequest to handle these cases per the specification. In addition, per the UEFI specification, if the Configuration argument in EFI_HII_CONFIG_ACCESS_PROTOCOL.RouteConfig() has a ConfigHdr that specifies a non-existing target, the implementation should return EFI_NOT_FOUND. The current implementation returns EFI_INVALID_PARAMETER if Configuration has a non-existing target in ConfigHdr. Instead, perform a check and return EFI_NOT_FOUND in this case. Signed-off-by: Dimitrije Pavlov <Dimitrije.Pavlov@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
56 lines
1.2 KiB
C
56 lines
1.2 KiB
C
/** @file
|
|
|
|
Utility functions for serializing (persistently storing) and deserializing
|
|
OVMF's platform configuration.
|
|
|
|
Copyright (C) 2014, Red Hat, Inc.
|
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
#ifndef _PLATFORM_CONFIG_H_
|
|
#define _PLATFORM_CONFIG_H_
|
|
|
|
#include <Base.h>
|
|
|
|
//
|
|
// This structure participates in driver configuration. It does not
|
|
// (necessarily) reflect the wire format in the persistent store.
|
|
//
|
|
#pragma pack(1)
|
|
typedef struct {
|
|
//
|
|
// preferred graphics console resolution when booting
|
|
//
|
|
UINT32 HorizontalResolution;
|
|
UINT32 VerticalResolution;
|
|
} PLATFORM_CONFIG;
|
|
#pragma pack()
|
|
|
|
//
|
|
// Please see the API documentation near the function definitions.
|
|
//
|
|
EFI_STATUS
|
|
EFIAPI
|
|
PlatformConfigSave (
|
|
IN PLATFORM_CONFIG *PlatformConfig
|
|
);
|
|
|
|
EFI_STATUS
|
|
EFIAPI
|
|
PlatformConfigLoad (
|
|
OUT PLATFORM_CONFIG *PlatformConfig,
|
|
OUT UINT64 *OptionalElements
|
|
);
|
|
|
|
//
|
|
// Feature flags for OptionalElements.
|
|
//
|
|
#define PLATFORM_CONFIG_F_GRAPHICS_RESOLUTION BIT0
|
|
#define PLATFORM_CONFIG_F_DOWNGRADE BIT63
|
|
|
|
extern CHAR16 mVariableName[];
|
|
|
|
#endif // _PLATFORM_CONFIG_H_
|