2008-04-09 09:07:50 +02:00
|
|
|
/** @file
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-04-09 09:07:50 +02:00
|
|
|
The internal header file includes the common header files, defines
|
|
|
|
internal structure and functions used by PeiVariable module.
|
|
|
|
|
2011-03-14 06:53:05 +01:00
|
|
|
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
2010-04-24 11:33:45 +02:00
|
|
|
This program and the accompanying materials
|
2007-07-19 12:09:07 +02:00
|
|
|
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
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
2008-04-09 09:07:50 +02:00
|
|
|
**/
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-11-12 11:30:50 +01:00
|
|
|
#ifndef _PEI_VARIABLE_H_
|
|
|
|
#define _PEI_VARIABLE_H_
|
2007-07-19 12:09:07 +02:00
|
|
|
|
|
|
|
#include <PiPei.h>
|
|
|
|
#include <Ppi/ReadOnlyVariable2.h>
|
2008-11-12 11:30:50 +01:00
|
|
|
|
2007-07-19 12:09:07 +02:00
|
|
|
#include <Library/DebugLib.h>
|
|
|
|
#include <Library/PeimEntryPoint.h>
|
|
|
|
#include <Library/HobLib.h>
|
|
|
|
#include <Library/PcdLib.h>
|
|
|
|
#include <Library/BaseMemoryLib.h>
|
|
|
|
#include <Library/PeiServicesTablePointerLib.h>
|
2008-11-12 11:30:50 +01:00
|
|
|
#include <Library/PeiServicesLib.h>
|
|
|
|
|
2009-02-27 06:35:08 +01:00
|
|
|
#include <Guid/VariableFormat.h>
|
2011-06-07 06:49:10 +02:00
|
|
|
#include <Guid/VariableIndexTable.h>
|
2007-07-19 12:09:07 +02:00
|
|
|
//
|
|
|
|
// Functions
|
|
|
|
//
|
2008-11-12 11:30:50 +01:00
|
|
|
/**
|
|
|
|
Provide the functionality of the variable services.
|
|
|
|
|
|
|
|
@param FileHandle Handle of the file being invoked.
|
|
|
|
Type EFI_PEI_FILE_HANDLE is defined in FfsFindNextFile().
|
|
|
|
@param PeiServices General purpose services available to every PEIM.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS If the interface could be successfully installed
|
|
|
|
@retval Others Returned from PeiServicesInstallPpi()
|
|
|
|
|
|
|
|
**/
|
2007-07-19 12:09:07 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
PeimInitializeVariableServices (
|
2008-11-12 11:30:50 +01:00
|
|
|
IN EFI_PEI_FILE_HANDLE FileHandle,
|
|
|
|
IN CONST EFI_PEI_SERVICES **PeiServices
|
|
|
|
);
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-11-12 11:30:50 +01:00
|
|
|
/**
|
|
|
|
This service retrieves a variable's value using its name and GUID.
|
|
|
|
|
|
|
|
Read the specified variable from the UEFI variable store. If the Data
|
|
|
|
buffer is too small to hold the contents of the variable, the error
|
|
|
|
EFI_BUFFER_TOO_SMALL is returned and DataSize is set to the required buffer
|
|
|
|
size to obtain the data.
|
|
|
|
|
|
|
|
@param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI.
|
|
|
|
@param VariableName A pointer to a null-terminated string that is the variable's name.
|
|
|
|
@param VariableGuid A pointer to an EFI_GUID that is the variable's GUID. The combination of
|
|
|
|
VariableGuid and VariableName must be unique.
|
|
|
|
@param Attributes If non-NULL, on return, points to the variable's attributes.
|
|
|
|
@param DataSize On entry, points to the size in bytes of the Data buffer.
|
|
|
|
On return, points to the size of the data returned in Data.
|
|
|
|
@param Data Points to the buffer which will hold the returned variable value.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The variable was read successfully.
|
|
|
|
@retval EFI_NOT_FOUND The variable could not be found.
|
|
|
|
@retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the resulting data.
|
|
|
|
DataSize is updated with the size required for
|
|
|
|
the specified variable.
|
|
|
|
@retval EFI_INVALID_PARAMETER VariableName, VariableGuid, DataSize or Data is NULL.
|
|
|
|
@retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-11-12 11:30:50 +01:00
|
|
|
**/
|
2007-07-19 12:09:07 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
PeiGetVariable (
|
|
|
|
IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
|
|
|
|
IN CONST CHAR16 *VariableName,
|
|
|
|
IN CONST EFI_GUID *VariableGuid,
|
|
|
|
OUT UINT32 *Attributes,
|
|
|
|
IN OUT UINTN *DataSize,
|
|
|
|
OUT VOID *Data
|
2008-11-12 11:30:50 +01:00
|
|
|
);
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-11-12 11:30:50 +01:00
|
|
|
/**
|
|
|
|
Return the next variable name and GUID.
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-11-12 11:30:50 +01:00
|
|
|
This function is called multiple times to retrieve the VariableName
|
|
|
|
and VariableGuid of all variables currently available in the system.
|
|
|
|
On each call, the previous results are passed into the interface,
|
|
|
|
and, on return, the interface returns the data for the next
|
|
|
|
interface. When the entire variable list has been returned,
|
|
|
|
EFI_NOT_FOUND is returned.
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-11-12 11:30:50 +01:00
|
|
|
@param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI.
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-11-12 11:30:50 +01:00
|
|
|
@param VariableNameSize On entry, points to the size of the buffer pointed to by VariableName.
|
|
|
|
@param VariableName On entry, a pointer to a null-terminated string that is the variable's name.
|
|
|
|
On return, points to the next variable's null-terminated name string.
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-11-12 11:30:50 +01:00
|
|
|
@param VariableGuid On entry, a pointer to an UEFI _GUID that is the variable's GUID.
|
|
|
|
On return, a pointer to the next variable's GUID.
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-11-12 11:30:50 +01:00
|
|
|
@retval EFI_SUCCESS The variable was read successfully.
|
|
|
|
@retval EFI_NOT_FOUND The variable could not be found.
|
|
|
|
@retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the resulting
|
|
|
|
data. VariableNameSize is updated with the size
|
|
|
|
required for the specified variable.
|
|
|
|
@retval EFI_INVALID_PARAMETER VariableName, VariableGuid or
|
|
|
|
VariableNameSize is NULL.
|
|
|
|
@retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-11-12 11:30:50 +01:00
|
|
|
**/
|
2007-07-19 12:09:07 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
PeiGetNextVariableName (
|
|
|
|
IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
|
|
|
|
IN OUT UINTN *VariableNameSize,
|
|
|
|
IN OUT CHAR16 *VariableName,
|
|
|
|
IN OUT EFI_GUID *VariableGuid
|
2008-11-12 11:30:50 +01:00
|
|
|
);
|
2007-07-19 12:09:07 +02:00
|
|
|
|
2008-11-12 11:30:50 +01:00
|
|
|
#endif
|