2007-06-27 07:49:17 +02:00
|
|
|
/** @file
|
2009-07-28 15:25:37 +02:00
|
|
|
This file declares the Read-only Variable Service PPI, which is required by the framework spec.
|
2009-07-07 09:04:59 +02:00
|
|
|
|
2008-04-08 08:29:25 +02:00
|
|
|
These services provide a lightweight, read-only variant of the full EFI variable services. The
|
|
|
|
reason that these services are read-only is to reduce the complexity of flash management. Also,
|
|
|
|
some implementation of the PEI may use the same physical flash part for variable and PEIM
|
|
|
|
storage; as such, a write command to certain technologies would alter the contents of the entire part,
|
|
|
|
thus making the in situ PEIM execution not follow the required flow.
|
2007-06-27 07:49:17 +02:00
|
|
|
|
2009-07-02 09:40:24 +02:00
|
|
|
Copyright (c) 2006 - 2009, Intel Corporation
|
2007-06-28 14:23:11 +02:00
|
|
|
All rights reserved. This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
2007-06-27 07:49:17 +02:00
|
|
|
|
2007-06-28 14:23:11 +02:00
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-06-27 07:49:17 +02:00
|
|
|
|
2009-07-10 14:17:41 +02:00
|
|
|
@par Revision Reference:
|
|
|
|
This PPI is defined in PEI CIS
|
|
|
|
Version 0.91.
|
2007-06-27 07:49:17 +02:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __PEI_READ_ONLY_VARIABLE_PPI_H__
|
|
|
|
#define __PEI_READ_ONLY_VARIABLE_PPI_H__
|
|
|
|
|
|
|
|
#define EFI_PEI_READ_ONLY_VARIABLE_ACCESS_PPI_GUID \
|
|
|
|
{ \
|
|
|
|
0x3cdc90c6, 0x13fb, 0x4a75, {0x9e, 0x79, 0x59, 0xe9, 0xdd, 0x78, 0xb9, 0xfa } \
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct _EFI_PEI_READ_ONLY_VARIABLE_PPI EFI_PEI_READ_ONLY_VARIABLE_PPI;
|
|
|
|
|
2009-07-11 00:09:04 +02:00
|
|
|
///
|
|
|
|
/// Variable attributes
|
|
|
|
///@{
|
2007-06-27 07:49:17 +02:00
|
|
|
#define EFI_VARIABLE_NON_VOLATILE 0x00000001
|
|
|
|
#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
|
|
|
|
#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
|
2009-08-18 08:21:10 +02:00
|
|
|
///
|
|
|
|
/// Inconsistent with specification here:
|
|
|
|
/// In Framework Spec, PeiCis0.91, neither the macro or its value is defined.
|
|
|
|
/// Keeping this inconsistancy for backward compatibility.
|
|
|
|
///
|
2009-07-10 12:19:26 +02:00
|
|
|
#define EFI_VARIABLE_READ_ONLY 0x00000008
|
2009-07-11 00:09:04 +02:00
|
|
|
///@}
|
2009-07-08 11:38:08 +02:00
|
|
|
|
2007-06-27 07:49:17 +02:00
|
|
|
/**
|
|
|
|
Get Variable value by Name and GUID pair
|
|
|
|
|
2009-07-11 00:09:04 +02:00
|
|
|
@param[in] PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
|
|
|
|
@param[in] VariableName A NULL-terminated Unicode string that is the name of the vendor's variable.
|
|
|
|
@param[in] VendorGuid A unique identifier for the vendor.
|
|
|
|
@param[out] Attributes This OPTIONAL parameter may be either NULL or
|
|
|
|
a pointer to the location in which to return
|
|
|
|
the attributes bitmask for the variable.
|
|
|
|
@param[in,out] DataSize On input, the size in bytes of the return Data buffer.
|
|
|
|
On output, the size of data returned in Data.
|
|
|
|
@param[out] Data The buffer to return the contents of the variable.
|
2007-06-27 07:49:17 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The function completed successfully.
|
|
|
|
@retval EFI_NOT_FOUND The variable was not found.
|
|
|
|
@retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.
|
|
|
|
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
|
|
|
|
@retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_PEI_GET_VARIABLE)(
|
2009-07-11 00:09:04 +02:00
|
|
|
IN EFI_PEI_SERVICES **PeiServices,
|
|
|
|
IN CHAR16 *VariableName,
|
|
|
|
IN EFI_GUID *VendorGuid,
|
|
|
|
OUT UINT32 *Attributes OPTIONAL,
|
|
|
|
IN OUT UINTN *DataSize,
|
|
|
|
OUT VOID *Data
|
2007-06-27 07:49:17 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2007-06-28 14:23:11 +02:00
|
|
|
This function can be called multiple times to retrieve the VariableName
|
|
|
|
and VendorGuid of all variables currently available in the system. On each call
|
2009-07-28 15:25:37 +02:00
|
|
|
to GetNextVariableName(), the previous results are passed into the interface,
|
2007-06-28 14:23:11 +02:00
|
|
|
and on output the interface returns the next variable name data. When the
|
2007-06-27 07:49:17 +02:00
|
|
|
entire variable list has been returned, the error EFI_NOT_FOUND is returned.
|
|
|
|
|
2009-07-11 00:09:04 +02:00
|
|
|
@param[in] PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
|
|
|
|
@param[in] VariableNameSize The size of the VariableName buffer.
|
|
|
|
@param[in] VariableName On input, supplies the last VariableName that was
|
|
|
|
returned by GetNextVariableName(). On output, returns the Null-terminated
|
|
|
|
Unicode string of the current variable.
|
|
|
|
@param[in] VendorGuid On input, supplies the last VendorGuid that was
|
|
|
|
returned by GetNextVariableName(). On output, returns the VendorGuid
|
|
|
|
of the current variable.
|
2007-06-27 07:49:17 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The function completed successfully.
|
|
|
|
@retval EFI_NOT_FOUND The next variable was not found.
|
|
|
|
@retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.
|
|
|
|
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
|
|
|
|
@retval EFI_DEVICE_ERROR The variable name could not be retrieved due to a hardware error.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_PEI_GET_NEXT_VARIABLE_NAME)(
|
2007-06-27 07:49:17 +02:00
|
|
|
IN EFI_PEI_SERVICES **PeiServices,
|
|
|
|
IN OUT UINTN *VariableNameSize,
|
|
|
|
IN OUT CHAR16 *VariableName,
|
|
|
|
IN OUT EFI_GUID *VendorGuid
|
|
|
|
);
|
|
|
|
|
2009-07-07 09:04:59 +02:00
|
|
|
///
|
|
|
|
/// This PPI provides a lightweight, read-only variant of the full EFI
|
|
|
|
/// variable services.
|
|
|
|
///
|
2007-06-27 07:49:17 +02:00
|
|
|
struct _EFI_PEI_READ_ONLY_VARIABLE_PPI {
|
2009-07-10 12:19:26 +02:00
|
|
|
///
|
|
|
|
/// Inconsistent with specification here:
|
|
|
|
/// In Framework Spec, PeiCis0.91, the field is named as GetVariable and GetNextVariableName.
|
|
|
|
/// Keeping this inconsistance is for backward compatibility.
|
|
|
|
///
|
|
|
|
EFI_PEI_GET_VARIABLE PeiGetVariable; ///< A service to ascertain a given variable name.
|
|
|
|
EFI_PEI_GET_NEXT_VARIABLE_NAME PeiGetNextVariableName; ///< A service to ascertain a variable based upon a given, known variable
|
2007-06-27 07:49:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiPeiReadOnlyVariablePpiGuid;
|
|
|
|
|
2009-07-11 00:09:04 +02:00
|
|
|
#endif /* __PEI_READ_ONLY_VARIABLE_PPI_H__ */
|
|
|
|
|