TianoCore EDK2 master
|
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/HiiLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiHiiServicesLib.h>
#include <Protocol/DevicePath.h>
#include <Protocol/GraphicsOutput.h>
#include <Protocol/HiiConfigAccess.h>
#include <Guid/MdeModuleHii.h>
#include <Guid/OvmfPlatformConfig.h>
#include "Platform.h"
#include "PlatformConfig.h"
Go to the source code of this file.
Data Structures | |
struct | PKG_DEVICE_PATH |
struct | GOP_MODE |
Variables | |
STATIC PKG_DEVICE_PATH | mPkgDevicePath |
STATIC EFI_HII_CONFIG_ACCESS_PROTOCOL | mConfigAccess |
STATIC EFI_HII_HANDLE | mInstalledPackages |
UINT8 | PlatformDxeStrings [] |
UINT8 | PlatformFormsBin [] |
STATIC EFI_EVENT | mGopEvent |
STATIC VOID * | mGopTracker |
STATIC EFI_HANDLE | mImageHandle |
STATIC UINTN | mNumGopModes |
STATIC GOP_MODE * | mGopModes |
This driver effectuates OVMF's platform configuration settings and exposes them via HII.
Copyright (C) 2014, Red Hat, Inc. Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Platform.c.
STATIC EFI_STATUS EFIAPI Callback | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN EFI_BROWSER_ACTION | Action, | ||
IN EFI_QUESTION_ID | QuestionId, | ||
IN UINT8 | Type, | ||
IN OUT EFI_IFR_TYPE_VALUE * | Value, | ||
OUT EFI_BROWSER_ACTION_REQUEST * | ActionRequest | ||
) |
Definition at line 505 of file Platform.c.
STATIC EFI_STATUS EFIAPI CreateResolutionOptions | ( | IN EFI_HII_HANDLE | PackageList, |
OUT VOID ** | OpCodeBuffer, | ||
IN UINTN | NumGopModes, | ||
IN GOP_MODE * | GopModes | ||
) |
Create a set of "one-of-many" (ie. "drop down list") option IFR opcodes, based on available GOP resolutions, to be placed under a "one-of-many" (ie. "drop down list") opcode.
[in] | PackageList | The package list with the formset and form for which the drop down options are produced. Option names are added as new strings to PackageList. |
[out] | OpCodeBuffer | On output, a dynamically allocated opcode buffer with drop down list options corresponding to GOP resolutions. The caller is responsible for freeing OpCodeBuffer with HiiFreeOpCodeHandle() after use. |
[in] | NumGopModes | Number of entries in GopModes. |
[in] | GopModes | Array of resolutions retrieved from the GOP. |
EFI_SUCESS | Opcodes have been successfully produced. |
Definition at line 632 of file Platform.c.
STATIC EFI_STATUS EFIAPI ExecutePlatformConfig | ( | VOID | ) |
Load and execute the platform configuration.
EFI_SUCCESS | Configuration loaded and executed. |
Definition at line 824 of file Platform.c.
STATIC EFI_STATUS EFIAPI ExtractConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Request, | ||
OUT EFI_STRING * | Progress, | ||
OUT EFI_STRING * | Results | ||
) |
This function is called by the HII machinery when it fetches the form state.
See the precise documentation in the UEFI spec.
[in] | This | The Config Access Protocol instance. |
[in] | Request | A <ConfigRequest> format UCS-2 string describing the query. |
[out] | Progress | A pointer into Request on output, identifying the query element where processing failed. |
[out] | Results | A <MultiConfigAltResp> format UCS-2 string that has all values filled in for the names in the Request string. |
EFI_SUCCESS | Extraction of form state in <MultiConfigAltResp> encoding successful. |
Definition at line 228 of file Platform.c.
STATIC EFI_STATUS EFIAPI FormStateToPlatformConfig | ( | IN CONST MAIN_FORM_STATE * | MainFormState | ) |
Interpret the binary form state and save it as persistent platform configuration.
[in] | MainFormState | Binary form/widget state to verify and save. |
EFI_SUCCESS | Platform configuration saved. |
Definition at line 374 of file Platform.c.
Notification callback for GOP interface installation.
[in] | Event | Event whose notification function is being invoked. |
[in] | Context | The pointer to the notification function's context, which is implementation-dependent. |
Definition at line 878 of file Platform.c.
STATIC EFI_STATUS EFIAPI PlatformConfigToFormState | ( | OUT MAIN_FORM_STATE * | MainFormState | ) |
Load the persistent platform configuration and translate it to binary form state.
If the platform configuration is missing, then the function fills in a default state.
[out] | MainFormState | Binary form/widget state after translation. |
EFI_SUCCESS | Form/widget state ready. |
Definition at line 142 of file Platform.c.
EFI_STATUS EFIAPI PlatformInit | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Entry point for this driver.
[in] | ImageHandle | Image handle of this driver. |
[in] | SystemTable | Pointer to SystemTable. |
EFI_SUCESS | Driver has loaded successfully. |
EFI_OUT_OF_RESOURCES | Failed to install HII packages. |
Definition at line 947 of file Platform.c.
EFI_STATUS EFIAPI PlatformUnload | ( | IN EFI_HANDLE | ImageHandle | ) |
Unload the driver.
[in] | ImageHandle | Handle that identifies the image to evict. |
EFI_SUCCESS | The image has been unloaded. |
Definition at line 1050 of file Platform.c.
STATIC EFI_STATUS EFIAPI PopulateForm | ( | IN EFI_HII_HANDLE | PackageList, |
IN EFI_GUID * | FormSetGuid, | ||
IN EFI_FORM_ID | FormId, | ||
IN UINTN | NumGopModes, | ||
IN GOP_MODE * | GopModes | ||
) |
Populate the form identified by the (PackageList, FormSetGuid, FormId) triplet.
The drop down list of video resolutions is generated from (NumGopModes, GopModes).
EFI_SUCESS | Form successfully updated. |
Definition at line 707 of file Platform.c.
STATIC EFI_STATUS EFIAPI QueryGopModes | ( | IN EFI_GRAPHICS_OUTPUT_PROTOCOL * | Gop, |
OUT UINTN * | NumGopModes, | ||
OUT GOP_MODE ** | GopModes | ||
) |
Query and save all resolutions supported by the GOP.
[in] | Gop | The Graphics Output Protocol instance to query. |
[out] | NumGopModes | The number of modes supported by the GOP. On output, this parameter will be positive. |
[out] | GopModes | On output, a dynamically allocated array containing the resolutions returned by the GOP. The caller is responsible for freeing the array after use. |
EFI_UNSUPPORTED | No modes found. |
EFI_OUT_OF_RESOURCES | Failed to allocate GopModes. |
Definition at line 563 of file Platform.c.
STATIC EFI_STATUS EFIAPI RouteConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Configuration, | ||
OUT EFI_STRING * | Progress | ||
) |
This function is called by the HII machinery when it wants the driver to interpret and persist the form state.
See the precise documentation in the UEFI spec.
[in] | This | The Config Access Protocol instance. |
[in] | Configuration | A <ConfigResp> format UCS-2 string describing the form state. |
[out] | Progress | A pointer into Configuration on output, identifying the element where processing failed. |
EFI_SUCCESS | Configuration verified, state permanent. |
Definition at line 421 of file Platform.c.
STATIC EFI_HII_CONFIG_ACCESS_PROTOCOL mConfigAccess |
Definition at line 78 of file Platform.c.
Definition at line 103 of file Platform.c.
Definition at line 125 of file Platform.c.
STATIC VOID* mGopTracker |
Definition at line 109 of file Platform.c.
STATIC EFI_HANDLE mImageHandle |
Definition at line 114 of file Platform.c.
STATIC EFI_HII_HANDLE mInstalledPackages |
Definition at line 83 of file Platform.c.
Definition at line 124 of file Platform.c.
STATIC PKG_DEVICE_PATH mPkgDevicePath |
Definition at line 52 of file Platform.c.