SetVariable()services to read and write UEFI variables. UEFI Drivers for add-in adapters, such as PCI adapters, should not use these services to access configuration information for the adapter. Instead, the add-in adapter should provide its own local storage for configuration information. UEFI Drivers provided with UEFI system firmware use UEFI variables to store configuration information. Examples found in the EDK II of UEFI Drivers use UEFI variables to store configuration information include the IPv4 and IPv6 network stacks in the
gEfiGlobalVariableGuidin the EDK II, that is reserved for UEFI variables defined by the _UEFI Specification. UEFI Drivers must never use this GUID to store their configuration information.
ExitBootServices()is called. The variable is not available after
BOOTSERVICE_ACCESS | RUNTIME_ACCESS
NON_VOLATILE | BOOTSERVICE_ACCESS
ExitBootServices()is called and the contents are persistent across
NON_VOLATILE | BOOTSERVICE_ACCESS | RUNTIME_ACCESS
EFI_HII_CONFIG_ACCESS_PROTOCOLprotocol instance. The services
SetVariable()are used to get and set configuration information associated with HII setup screens provided by the UEFI Driver using the UEFI HII infrastructure that is described in more detail in Chapter 12.
BOOTSERVICE_ACCESSshould be used with a UEFI variable used as a mailbox to store state information that is required by multiple HII forms or multiple HII callbacks.
GetVariable()service to read the configuration structure from the UEFI variable written in the previous example.
GetVariable()function from the EDK II library
UefiLibto read the configuration structure from the UEFI variable. The UEFI variable contents are allocated from pool, so the variable contents must be freed after they are used. The
GetVariable()supports reading both fixed size UEFI variables such as an
EXAMPLE_CONFIGURATIONstructure and UEFI variables whose size may vary.