Re: [edk2-devel] [PATCH V1] IntelFsp2Pkg: Add Definition of EDKII_PEI_VARIABLE_PPI

2022-07-18 Thread Nate DeSimone
Pushed: https://github.com/tianocore/edk2/commit/c966204

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Nate DeSimone
Sent: Monday, July 18, 2022 1:17 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel 
Subject: [edk2-devel] [PATCH V1] IntelFsp2Pkg: Add Definition of 
EDKII_PEI_VARIABLE_PPI

Adds definition of EDKII_PEI_VARIABLE_PPI.

Cc: Chasel Chiu 
Signed-off-by: Nate DeSimone 
---
 IntelFsp2Pkg/Include/Ppi/Variable.h | 195 
 IntelFsp2Pkg/IntelFsp2Pkg.dec   |   8 +-
 2 files changed, 202 insertions(+), 1 deletion(-)  create mode 100644 
IntelFsp2Pkg/Include/Ppi/Variable.h

diff --git a/IntelFsp2Pkg/Include/Ppi/Variable.h 
b/IntelFsp2Pkg/Include/Ppi/Variable.h
new file mode 100644
index 00..3e1f4b98a9
--- /dev/null
+++ b/IntelFsp2Pkg/Include/Ppi/Variable.h
@@ -0,0 +1,195 @@
+/** @file
+  EDKII PEI Variable PPI provides an implementation of variables
+  intended for use as a means to store data in the PEI environment.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_PEI_VARIABLE_PPI_H_
+#define EDKII_PEI_VARIABLE_PPI_H_
+
+#define EDKII_PEI_VARIABLE_PPI_GUID \
+  { \
+0xe7b2cd04, 0x4b14, 0x44c2, { 0xb7, 0x48, 0xce, 0xaf, 0x2b, 0x66, 
+0x4a, 0xb0 } \
+  }
+
+typedef struct _EDKII_PEI_VARIABLE_PPI EDKII_PEI_VARIABLE_PPI;
+
+/**
+  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[in]This  A pointer to this instance of the 
EDKII_PEI_VARIABLE_PPI.
+  @param[in]VariableName  A pointer to a null-terminated string 
that is the variable's name.
+  @param[in]VariableGuid  A pointer to an EFI_GUID that is the 
variable's GUID. The combination of
+  VariableGuid and VariableName must be 
unique.
+  @param[out]   AttributesIf non-NULL, on return, points to the 
variable's attributes.
+  @param[in, out]   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[out]   Data  Points to the buffer which will hold the 
returned variable value.
+  May be NULL with a zero DataSize in 
order to determine the size of the
+  buffer needed.
+
+  @retval EFI_SUCCESS The variable was read successfully.
+  @retval EFI_NOT_FOUND   The variable was not found.
+  @retval EFI_BUFFER_TOO_SMALLThe 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_ERRORThe variable could not be retrieved 
because of a device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_PEI_GET_VARIABLE)(
+  IN CONST  EDKII_PEI_VARIABLE_PPI*This,
+  IN CONST  CHAR16*VariableName,
+  IN CONST  EFI_GUID  *VariableGuid,
+  OUT   UINT32*Attributes   OPTIONAL,
+  IN OUTUINTN *DataSize,
+  OUT   VOID  *Data OPTIONAL
+  );
+
+/**
+  Return the next variable name and GUID.
+
+  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  variable. 
+ To get started, VariableName should initially contain L"\0"
+  and VariableNameSize should be sizeof(CHAR16). When the entire  
+ variable list has been returned, EFI_NOT_FOUND is returned.
+
+  @param[in]This  A pointer to this instance of the 
EDKII_PEI_VARIABLE_PPI.
+  @param[in, out]   VariableNameSize  On entry, points to the size of the 
buffer pointed to by VariableName.
+  On return, the size of the variable name 
buffer.
+  @param[in, out]   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.
+  @param[in, out]   VariableGuid  On entry, a pointer to an EFI_GUID that 
is the variable's GUID.
+  On return, a pointer to the next 
variable's GUID.
+
+  @retval EFI_SUCCESS The next var

Re: [edk2-devel] [PATCH V1] IntelFsp2Pkg: Add Definition of EDKII_PEI_VARIABLE_PPI

2022-07-18 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

Thanks,
Chasel


> -Original Message-
> From: Desimone, Nathaniel L 
> Sent: Monday, July 18, 2022 1:17 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel 
> Subject: [PATCH V1] IntelFsp2Pkg: Add Definition of EDKII_PEI_VARIABLE_PPI
> 
> Adds definition of EDKII_PEI_VARIABLE_PPI.
> 
> Cc: Chasel Chiu 
> Signed-off-by: Nate DeSimone 
> ---
>  IntelFsp2Pkg/Include/Ppi/Variable.h | 195 
>  IntelFsp2Pkg/IntelFsp2Pkg.dec   |   8 +-
>  2 files changed, 202 insertions(+), 1 deletion(-)  create mode 100644
> IntelFsp2Pkg/Include/Ppi/Variable.h
> 
> diff --git a/IntelFsp2Pkg/Include/Ppi/Variable.h
> b/IntelFsp2Pkg/Include/Ppi/Variable.h
> new file mode 100644
> index 00..3e1f4b98a9
> --- /dev/null
> +++ b/IntelFsp2Pkg/Include/Ppi/Variable.h
> @@ -0,0 +1,195 @@
> +/** @file
> +  EDKII PEI Variable PPI provides an implementation of variables
> +  intended for use as a means to store data in the PEI environment.
> +
> +  Copyright (c) 2022, Intel Corporation. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef EDKII_PEI_VARIABLE_PPI_H_
> +#define EDKII_PEI_VARIABLE_PPI_H_
> +
> +#define EDKII_PEI_VARIABLE_PPI_GUID \
> +  { \
> +0xe7b2cd04, 0x4b14, 0x44c2, { 0xb7, 0x48, 0xce, 0xaf, 0x2b, 0x66,
> +0x4a, 0xb0 } \
> +  }
> +
> +typedef struct _EDKII_PEI_VARIABLE_PPI EDKII_PEI_VARIABLE_PPI;
> +
> +/**
> +  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[in]This  A pointer to this instance of the
> EDKII_PEI_VARIABLE_PPI.
> +  @param[in]VariableName  A pointer to a null-terminated string 
> that is
> the variable's name.
> +  @param[in]VariableGuid  A pointer to an EFI_GUID that is the 
> variable's
> GUID. The combination of
> +  VariableGuid and VariableName must be 
> unique.
> +  @param[out]   AttributesIf non-NULL, on return, points to the
> variable's attributes.
> +  @param[in, out]   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[out]   Data  Points to the buffer which will hold 
> the returned
> variable value.
> +  May be NULL with a zero DataSize in 
> order to determine
> the size of the
> +  buffer needed.
> +
> +  @retval EFI_SUCCESS The variable was read successfully.
> +  @retval EFI_NOT_FOUND   The variable was not found.
> +  @retval EFI_BUFFER_TOO_SMALLThe 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_ERRORThe variable could not be retrieved
> because of a device error.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EDKII_PEI_GET_VARIABLE)(
> +  IN CONST  EDKII_PEI_VARIABLE_PPI*This,
> +  IN CONST  CHAR16*VariableName,
> +  IN CONST  EFI_GUID  *VariableGuid,
> +  OUT   UINT32*Attributes   OPTIONAL,
> +  IN OUTUINTN *DataSize,
> +  OUT   VOID  *Data OPTIONAL
> +  );
> +
> +/**
> +  Return the next variable name and GUID.
> +
> +  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  variable.
> + To get started, VariableName should initially contain L"\0"
> +  and VariableNameSize should be sizeof(CHAR16). When the entire
> + variable list has been returned, EFI_NOT_FOUND is returned.
> +
> +  @param[in]This  A pointer to this instance of the
> EDKII_PEI_VARIABLE_PPI.
> +  @param[in, out]   VariableNameSize  On entry, points to the size of the 
> buffer
> pointed to by VariableName.
> +  On return, the size of the variable 
> name buffer.
> +  @param[in, out]   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.
> +  @param[in, out]   VariableGuid  On entry, a pointer to an EFI_GUID 
> that 

[edk2-devel] [PATCH V1] IntelFsp2Pkg: Add Definition of EDKII_PEI_VARIABLE_PPI

2022-07-18 Thread Nate DeSimone
Adds definition of EDKII_PEI_VARIABLE_PPI.

Cc: Chasel Chiu 
Signed-off-by: Nate DeSimone 
---
 IntelFsp2Pkg/Include/Ppi/Variable.h | 195 
 IntelFsp2Pkg/IntelFsp2Pkg.dec   |   8 +-
 2 files changed, 202 insertions(+), 1 deletion(-)
 create mode 100644 IntelFsp2Pkg/Include/Ppi/Variable.h

diff --git a/IntelFsp2Pkg/Include/Ppi/Variable.h 
b/IntelFsp2Pkg/Include/Ppi/Variable.h
new file mode 100644
index 00..3e1f4b98a9
--- /dev/null
+++ b/IntelFsp2Pkg/Include/Ppi/Variable.h
@@ -0,0 +1,195 @@
+/** @file
+  EDKII PEI Variable PPI provides an implementation of variables
+  intended for use as a means to store data in the PEI environment.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_PEI_VARIABLE_PPI_H_
+#define EDKII_PEI_VARIABLE_PPI_H_
+
+#define EDKII_PEI_VARIABLE_PPI_GUID \
+  { \
+0xe7b2cd04, 0x4b14, 0x44c2, { 0xb7, 0x48, 0xce, 0xaf, 0x2b, 0x66, 0x4a, 
0xb0 } \
+  }
+
+typedef struct _EDKII_PEI_VARIABLE_PPI EDKII_PEI_VARIABLE_PPI;
+
+/**
+  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[in]This  A pointer to this instance of the 
EDKII_PEI_VARIABLE_PPI.
+  @param[in]VariableName  A pointer to a null-terminated string 
that is the variable's name.
+  @param[in]VariableGuid  A pointer to an EFI_GUID that is the 
variable's GUID. The combination of
+  VariableGuid and VariableName must be 
unique.
+  @param[out]   AttributesIf non-NULL, on return, points to the 
variable's attributes.
+  @param[in, out]   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[out]   Data  Points to the buffer which will hold the 
returned variable value.
+  May be NULL with a zero DataSize in 
order to determine the size of the
+  buffer needed.
+
+  @retval EFI_SUCCESS The variable was read successfully.
+  @retval EFI_NOT_FOUND   The variable was not found.
+  @retval EFI_BUFFER_TOO_SMALLThe 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_ERRORThe variable could not be retrieved 
because of a device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_PEI_GET_VARIABLE)(
+  IN CONST  EDKII_PEI_VARIABLE_PPI*This,
+  IN CONST  CHAR16*VariableName,
+  IN CONST  EFI_GUID  *VariableGuid,
+  OUT   UINT32*Attributes   OPTIONAL,
+  IN OUTUINTN *DataSize,
+  OUT   VOID  *Data OPTIONAL
+  );
+
+/**
+  Return the next variable name and GUID.
+
+  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
+  variable. To get started, VariableName should initially contain L"\0"
+  and VariableNameSize should be sizeof(CHAR16). When the entire
+  variable list has been returned, EFI_NOT_FOUND is returned.
+
+  @param[in]This  A pointer to this instance of the 
EDKII_PEI_VARIABLE_PPI.
+  @param[in, out]   VariableNameSize  On entry, points to the size of the 
buffer pointed to by VariableName.
+  On return, the size of the variable name 
buffer.
+  @param[in, out]   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.
+  @param[in, out]   VariableGuid  On entry, a pointer to an EFI_GUID that 
is the variable's GUID.
+  On return, a pointer to the next 
variable's GUID.
+
+  @retval EFI_SUCCESS The next variable name was read 
successfully.
+  @retval EFI_NOT_FOUND   All variables have been enumerated.
+  @retval EFI_BUFFER_TOO_SMALLThe VariableNameSize is too small for 
the resulting
+  data. VariableNameSize is updated with 
the size
+