summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/PlatformDxe/PlatformConfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/PlatformDxe/PlatformConfig.c')
-rw-r--r--OvmfPkg/PlatformDxe/PlatformConfig.c45
1 files changed, 27 insertions, 18 deletions
diff --git a/OvmfPkg/PlatformDxe/PlatformConfig.c b/OvmfPkg/PlatformDxe/PlatformConfig.c
index f3f0b54d6c..e202ac5b47 100644
--- a/OvmfPkg/PlatformDxe/PlatformConfig.c
+++ b/OvmfPkg/PlatformDxe/PlatformConfig.c
@@ -21,8 +21,7 @@
//
// Name of the UEFI variable that we use for persistent storage.
//
-STATIC CHAR16 mVariableName[] = L"PlatformConfig";
-
+STATIC CHAR16 mVariableName[] = L"PlatformConfig";
/**
Serialize and persistently save platform configuration.
@@ -34,10 +33,10 @@ STATIC CHAR16 mVariableName[] = L"PlatformConfig";
EFI_STATUS
EFIAPI
PlatformConfigSave (
- IN PLATFORM_CONFIG *PlatformConfig
+ IN PLATFORM_CONFIG *PlatformConfig
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
//
// We could implement any kind of translation here, as part of serialization.
@@ -45,14 +44,17 @@ PlatformConfigSave (
// variables with human-readable contents, allowing other tools to access
// them more easily. For now, just save a binary dump.
//
- Status = gRT->SetVariable (mVariableName, &gOvmfPlatformConfigGuid,
+ Status = gRT->SetVariable (
+ mVariableName,
+ &gOvmfPlatformConfigGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS |
- EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof *PlatformConfig, PlatformConfig);
+ EFI_VARIABLE_RUNTIME_ACCESS,
+ sizeof *PlatformConfig,
+ PlatformConfig
+ );
return Status;
}
-
/**
Load and deserialize platform configuration.
@@ -73,13 +75,13 @@ PlatformConfigSave (
EFI_STATUS
EFIAPI
PlatformConfigLoad (
- OUT PLATFORM_CONFIG *PlatformConfig,
- OUT UINT64 *OptionalElements
+ OUT PLATFORM_CONFIG *PlatformConfig,
+ OUT UINT64 *OptionalElements
)
{
- VOID *Data;
- UINTN DataSize;
- EFI_STATUS Status;
+ VOID *Data;
+ UINTN DataSize;
+ EFI_STATUS Status;
//
// Any translation done in PlatformConfigSave() would have to be mirrored
@@ -89,8 +91,12 @@ PlatformConfigLoad (
// (only incremental changes, ie. new fields), and on GUID.
// (Incompatible changes require a GUID change.)
//
- Status = GetVariable2 (mVariableName, &gOvmfPlatformConfigGuid, &Data,
- &DataSize);
+ Status = GetVariable2 (
+ mVariableName,
+ &gOvmfPlatformConfigGuid,
+ &Data,
+ &DataSize
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -108,15 +114,18 @@ PlatformConfigLoad (
//
// Handle firmware upgrade -- zero out missing fields.
//
- ZeroMem ((UINT8 *)PlatformConfig + DataSize,
- sizeof *PlatformConfig - DataSize);
+ ZeroMem (
+ (UINT8 *)PlatformConfig + DataSize,
+ sizeof *PlatformConfig - DataSize
+ );
}
//
// Based on DataSize, report the optional features that we recognize.
//
if (DataSize >= (OFFSET_OF (PLATFORM_CONFIG, VerticalResolution) +
- sizeof PlatformConfig->VerticalResolution)) {
+ sizeof PlatformConfig->VerticalResolution))
+ {
*OptionalElements |= PLATFORM_CONFIG_F_GRAPHICS_RESOLUTION;
}