xref: /freebsd/sys/contrib/edk2/Include/Protocol/Variable.h (revision f439973d6726c3be929c8fb3b1545b8b1744abc3)
1*f439973dSWarner Losh /** @file
2*f439973dSWarner Losh   Variable Architectural Protocol as defined in PI Specification VOLUME 2 DXE
3*f439973dSWarner Losh 
4*f439973dSWarner Losh   This provides the services required to get and set environment variables. This
5*f439973dSWarner Losh   protocol must be produced by a runtime DXE driver and may be consumed only by
6*f439973dSWarner Losh   the DXE Foundation. The DXE driver that produces this protocol must be a runtime
7*f439973dSWarner Losh   driver. This driver is responsible for initializing the GetVariable(),
8*f439973dSWarner Losh   GetNextVariableName(), and SetVariable() fields of the UEFI Runtime Services Table.
9*f439973dSWarner Losh 
10*f439973dSWarner Losh   After the three fields of the UEFI Runtime Services Table have been initialized,
11*f439973dSWarner Losh   the driver must install the EFI_VARIABLE_ARCH_PROTOCOL_GUID on a new handle with
12*f439973dSWarner Losh   a NULL interface pointer. The installation of this protocol informs the DXE Foundation
13*f439973dSWarner Losh   that the read-only and the volatile environment variable related services are
14*f439973dSWarner Losh   now available and that the DXE Foundation must update the 32-bit CRC of the UEFI
15*f439973dSWarner Losh   Runtime Services Table. The full complement of environment variable services are
16*f439973dSWarner Losh   not available until both this protocol and EFI_VARIABLE_WRITE_ARCH_PROTOCOL are
17*f439973dSWarner Losh   installed. DXE drivers that require read-only access or read/write access to volatile
18*f439973dSWarner Losh   environment variables must have this architectural protocol in their dependency
19*f439973dSWarner Losh   expressions. DXE drivers that require write access to nonvolatile environment
20*f439973dSWarner Losh   variables must have the EFI_VARIABLE_WRITE_ARCH_PROTOCOL in their dependency
21*f439973dSWarner Losh   expressions.
22*f439973dSWarner Losh 
23*f439973dSWarner Losh   Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
24*f439973dSWarner Losh   SPDX-License-Identifier: BSD-2-Clause-Patent
25*f439973dSWarner Losh 
26*f439973dSWarner Losh **/
27*f439973dSWarner Losh 
28*f439973dSWarner Losh #ifndef __ARCH_PROTOCOL_VARIABLE_ARCH_H__
29*f439973dSWarner Losh #define __ARCH_PROTOCOL_VARIABLE_ARCH_H__
30*f439973dSWarner Losh 
31*f439973dSWarner Losh ///
32*f439973dSWarner Losh /// Global ID for the Variable Architectural Protocol
33*f439973dSWarner Losh ///
34*f439973dSWarner Losh #define EFI_VARIABLE_ARCH_PROTOCOL_GUID \
35*f439973dSWarner Losh   { 0x1e5668e2, 0x8481, 0x11d4, {0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
36*f439973dSWarner Losh 
37*f439973dSWarner Losh extern EFI_GUID  gEfiVariableArchProtocolGuid;
38*f439973dSWarner Losh 
39*f439973dSWarner Losh #endif
40