summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/VariablePei
diff options
context:
space:
mode:
authorAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>2007-07-03 18:34:24 +0000
committerAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>2007-07-03 18:34:24 +0000
commitba2377328775b10caa4c2091a8997eb8685c39b8 (patch)
tree25dcb7bffc70961027119f8a9deebcac101eaf21 /MdeModulePkg/Universal/VariablePei
parentc1f23d63363d36947e76df61320bdd2e5e233946 (diff)
downloadedk2-platforms-ba2377328775b10caa4c2091a8997eb8685c39b8.tar.xz
Removed IntelframeworkPkg contamination from MdeModulePkg modules.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3019 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/VariablePei')
-rw-r--r--MdeModulePkg/Universal/VariablePei/Ipf/VariableWorker.c17
-rw-r--r--MdeModulePkg/Universal/VariablePei/Variable.c72
-rw-r--r--MdeModulePkg/Universal/VariablePei/Variable.h30
-rw-r--r--MdeModulePkg/Universal/VariablePei/Variable.inf53
-rw-r--r--MdeModulePkg/Universal/VariablePei/VariableWorker.c18
5 files changed, 50 insertions, 140 deletions
diff --git a/MdeModulePkg/Universal/VariablePei/Ipf/VariableWorker.c b/MdeModulePkg/Universal/VariablePei/Ipf/VariableWorker.c
index 912aab1182..0a4ee95774 100644
--- a/MdeModulePkg/Universal/VariablePei/Ipf/VariableWorker.c
+++ b/MdeModulePkg/Universal/VariablePei/Ipf/VariableWorker.c
@@ -11,23 +11,6 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-//
-// The package level header files this module uses
-//
-#include <PiPei.h>
-
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include <Ppi/ReadOnlyVariable.h>
-//
-// The Library classes this module consumes
-//
-#include <Library/DebugLib.h>
-#include <Library/PeimEntryPoint.h>
-#include <Library/HobLib.h>
-#include <Library/PcdLib.h>
-#include <Library/BaseMemoryLib.h>
#include <Variable.h>
diff --git a/MdeModulePkg/Universal/VariablePei/Variable.c b/MdeModulePkg/Universal/VariablePei/Variable.c
index b56e315e69..ba8a23d67a 100644
--- a/MdeModulePkg/Universal/VariablePei/Variable.c
+++ b/MdeModulePkg/Universal/VariablePei/Variable.c
@@ -18,38 +18,20 @@ Abstract:
--*/
-//
-// The package level header files this module uses
-//
-#include <PiPei.h>
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include <Ppi/ReadOnlyVariable.h>
-//
-// The Library classes this module consumes
-//
-#include <Library/DebugLib.h>
-#include <Library/PeimEntryPoint.h>
-#include <Library/HobLib.h>
-#include <Library/PcdLib.h>
-#include <Library/BaseMemoryLib.h>
-
-
-#include <Variable.h>
+#include "Variable.h"
//
// Module globals
//
-static EFI_PEI_READ_ONLY_VARIABLE_PPI mVariablePpi = {
+static EFI_PEI_READ_ONLY_VARIABLE2_PPI mVariablePpi = {
PeiGetVariable,
PeiGetNextVariableName
};
static EFI_PEI_PPI_DESCRIPTOR mPpiListVariable = {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
- &gEfiPeiReadOnlyVariablePpiGuid,
+ &gEfiPeiReadOnlyVariable2PpiGuid,
&mVariablePpi
};
@@ -187,10 +169,10 @@ Returns:
STATIC
EFI_STATUS
CompareWithValidVariable (
- IN VARIABLE_HEADER *Variable,
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- OUT VARIABLE_POINTER_TRACK *PtrTrack
+ IN VARIABLE_HEADER *Variable,
+ IN CONST CHAR16 *VariableName,
+ IN CONST EFI_GUID *VendorGuid,
+ OUT VARIABLE_POINTER_TRACK *PtrTrack
)
/*++
@@ -242,8 +224,8 @@ EFI_STATUS
EFIAPI
FindVariable (
IN EFI_PEI_SERVICES **PeiServices,
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
+ IN CONST CHAR16 *VariableName,
+ IN CONST EFI_GUID *VendorGuid,
OUT VARIABLE_POINTER_TRACK *PtrTrack
)
/*++
@@ -380,12 +362,12 @@ Returns:
EFI_STATUS
EFIAPI
PeiGetVariable (
- IN EFI_PEI_SERVICES **PeiServices,
- IN CHAR16 *VariableName,
- IN EFI_GUID * VendorGuid,
- OUT UINT32 *Attributes OPTIONAL,
- IN OUT UINTN *DataSize,
- OUT VOID *Data
+ 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
)
/*++
@@ -420,15 +402,16 @@ Returns:
VARIABLE_POINTER_TRACK Variable;
UINTN VarDataSize;
EFI_STATUS Status;
+ EFI_PEI_SERVICES **PeiServices;
- if (VariableName == NULL || VendorGuid == NULL) {
+ PeiServices = GetPeiServicesTablePointer ();
+ if (VariableName == NULL || VariableGuid == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Find existing variable
//
- Status = FindVariable (PeiServices, VariableName, VendorGuid, &Variable);
-
+ Status = FindVariable (PeiServices, VariableName, VariableGuid, &Variable);
if (Variable.CurrPtr == NULL || Status != EFI_SUCCESS) {
return Status;
}
@@ -454,10 +437,10 @@ Returns:
EFI_STATUS
EFIAPI
PeiGetNextVariableName (
- IN EFI_PEI_SERVICES **PeiServices,
- IN OUT UINTN *VariableNameSize,
- IN OUT CHAR16 *VariableName,
- IN OUT EFI_GUID *VendorGuid
+ IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
+ IN OUT UINTN *VariableNameSize,
+ IN OUT CHAR16 *VariableName,
+ IN OUT EFI_GUID *VariableGuid
)
/*++
@@ -470,7 +453,7 @@ Arguments:
PeiServices - General purpose services available to every PEIM.
VariabvleNameSize - The variable name's size.
VariableName - A pointer to the variable's name.
- VendorGuid - A pointer to the EFI_GUID structure.
+ VariableGuid - A pointer to the EFI_GUID structure.
VariableNameSize - Size of the variable name
@@ -489,13 +472,14 @@ Returns:
VARIABLE_POINTER_TRACK Variable;
UINTN VarNameSize;
EFI_STATUS Status;
+ EFI_PEI_SERVICES **PeiServices;
+ PeiServices = GetPeiServicesTablePointer ();
if (VariableName == NULL) {
return EFI_INVALID_PARAMETER;
}
- Status = FindVariable (PeiServices, VariableName, VendorGuid, &Variable);
-
+ Status = FindVariable (PeiServices, VariableName, VariableGuid, &Variable);
if (Variable.CurrPtr == NULL || Status != EFI_SUCCESS) {
return Status;
}
@@ -514,7 +498,7 @@ Returns:
if (VarNameSize <= *VariableNameSize) {
(*PeiServices)->CopyMem (VariableName, GET_VARIABLE_NAME_PTR (Variable.CurrPtr), VarNameSize);
- (*PeiServices)->CopyMem (VendorGuid, &Variable.CurrPtr->VendorGuid, sizeof (EFI_GUID));
+ (*PeiServices)->CopyMem (VariableGuid, &Variable.CurrPtr->VendorGuid, sizeof (EFI_GUID));
Status = EFI_SUCCESS;
} else {
diff --git a/MdeModulePkg/Universal/VariablePei/Variable.h b/MdeModulePkg/Universal/VariablePei/Variable.h
index 187edbaf7d..9747a8d426 100644
--- a/MdeModulePkg/Universal/VariablePei/Variable.h
+++ b/MdeModulePkg/Universal/VariablePei/Variable.h
@@ -22,6 +22,16 @@ Abstract:
#ifndef _PEI_VARIABLE_H
#define _PEI_VARIABLE_H
+#include <PiPei.h>
+#include <Ppi/ReadOnlyVariable2.h>
+#include <Library/DebugLib.h>
+#include <Library/PeimEntryPoint.h>
+#include <Library/HobLib.h>
+#include <Library/PcdLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/PeiServicesTablePointerLib.h>
+
+
//
// BugBug: We need relcate the head file.
//
@@ -91,12 +101,12 @@ Returns:
EFI_STATUS
EFIAPI
PeiGetVariable (
- IN EFI_PEI_SERVICES **PeiServices,
- IN CHAR16 *VariableName,
- IN EFI_GUID * VendorGuid,
- OUT UINT32 *Attributes OPTIONAL,
- IN OUT UINTN *DataSize,
- OUT VOID *Data
+ 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
)
/*++
@@ -123,10 +133,10 @@ Returns:
EFI_STATUS
EFIAPI
PeiGetNextVariableName (
- IN EFI_PEI_SERVICES **PeiServices,
- IN OUT UINTN *VariableNameSize,
- IN OUT CHAR16 *VariableName,
- IN OUT EFI_GUID *VendorGuid
+ IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
+ IN OUT UINTN *VariableNameSize,
+ IN OUT CHAR16 *VariableName,
+ IN OUT EFI_GUID *VariableGuid
)
/*++
diff --git a/MdeModulePkg/Universal/VariablePei/Variable.inf b/MdeModulePkg/Universal/VariablePei/Variable.inf
index 5151c4bf4b..434c2991c8 100644
--- a/MdeModulePkg/Universal/VariablePei/Variable.inf
+++ b/MdeModulePkg/Universal/VariablePei/Variable.inf
@@ -14,11 +14,6 @@
#
#**/
-################################################################################
-#
-# Defines Section - statements that will be processed to create a Makefile.
-#
-################################################################################
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = PeiVariable
@@ -36,12 +31,6 @@
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
-################################################################################
-#
-# Sources Section - list of files that are required for the build to succeed.
-#
-################################################################################
-
[Sources.common]
Variable.c
Variable.h
@@ -58,26 +47,9 @@
[Sources.EBC]
VariableWorker.c
-
-################################################################################
-#
-# Package Dependency Section - list of Package files that are required for
-# this module.
-#
-################################################################################
-
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- IntelFrameworkPkg/IntelFrameworkPkg.dec
-
-
-################################################################################
-#
-# Library Class Section - list of Library Classes that are required for
-# this module.
-#
-################################################################################
[LibraryClasses]
BaseMemoryLib
@@ -85,34 +57,13 @@
HobLib
PeimEntryPoint
DebugLib
-
-
-################################################################################
-#
-# PPI C Name Section - list of PPI and PPI Notify C Names that this module
-# uses or produces.
-#
-################################################################################
+ PeiServiceTablePointerLib
[Ppis]
- gEfiPeiReadOnlyVariablePpiGuid # PPI ALWAYS_CONSUMED
-
-
-################################################################################
-#
-# Pcd DYNAMIC - list of PCDs that this module is coded for.
-#
-################################################################################
+ gEfiPeiReadOnlyVariable2PpiGuid # PPI ALWAYS_CONSUMED
[PcdsDynamic.common]
PcdFlashNvStorageVariableBase|gEfiGenericPlatformTokenSpaceGuid
-################################################################################
-#
-# Dependency Expression Section - list of Dependency expressions that are required for
-# this module.
-#
-################################################################################
-
[Depex]
TRUE
diff --git a/MdeModulePkg/Universal/VariablePei/VariableWorker.c b/MdeModulePkg/Universal/VariablePei/VariableWorker.c
index 5cb75d03ef..1a49ee8c98 100644
--- a/MdeModulePkg/Universal/VariablePei/VariableWorker.c
+++ b/MdeModulePkg/Universal/VariablePei/VariableWorker.c
@@ -18,24 +18,6 @@ Abstract:
Framework PEIM to provide the Variable functionality
--*/
-//
-// The package level header files this module uses
-//
-#include <PiPei.h>
-
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include <Ppi/ReadOnlyVariable.h>
-//
-// The Library classes this module consumes
-//
-#include <Library/DebugLib.h>
-#include <Library/PeimEntryPoint.h>
-#include <Library/HobLib.h>
-#include <Library/PcdLib.h>
-#include <Library/BaseMemoryLib.h>
-
#include <Variable.h>