summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-04 12:43:59 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-04 12:43:59 +0000
commit1eb73ab57aa6d49cd82eb2b3305ec39bba591d1f (patch)
tree19c89a20bac24b562c2b8b139d8889694647a1fa /MdePkg
parent0d2001d31d1adf5d6abbff41c3eda82a2bd208cc (diff)
downloadedk2-platforms-1eb73ab57aa6d49cd82eb2b3305ec39bba591d1f.tar.xz
Added LibPatchPcdSetPtr.
Cleaup Pcd Database code generation routine. Fixed a few bugs. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@745 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Library/PcdLib.h32
-rw-r--r--MdePkg/Library/BasePcdLibNull/BasePcdLibNull.msa15
-rw-r--r--MdePkg/Library/BasePcdLibNull/PcdLib.c49
-rw-r--r--MdePkg/Library/DxePcdLib/DxePcdLib.c49
-rw-r--r--MdePkg/Library/DxePcdLib/DxePcdLib.msa15
-rw-r--r--MdePkg/Library/PeiPcdLib/PeiPcdLib.c49
-rw-r--r--MdePkg/Library/PeiPcdLib/PeiPcdLib.msa22
7 files changed, 210 insertions, 21 deletions
diff --git a/MdePkg/Include/Library/PcdLib.h b/MdePkg/Include/Library/PcdLib.h
index fe8a1e6939..37d435596e 100644
--- a/MdePkg/Include/Library/PcdLib.h
+++ b/MdePkg/Include/Library/PcdLib.h
@@ -725,17 +725,45 @@ LibPcdGetNextToken (
- @param[in] Pointer to a 128-bit unique value that designates from which namespace
+ @param[in] Guid Pointer to a 128-bit unique value that designates from which namespace
to start the search.
@retval CONST GUID * The next valid token namespace.
**/
-
GUID *
EFIAPI
LibPcdGetNextTokenSpace (
IN CONST GUID *Guid
);
+
+/**
+ Sets the PCD entry specified by PatchVariable to the value specified by Buffer
+ and SizeOfValue. Buffer is returned. If SizeOfValue is greater than
+ MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return
+ NULL to indicate that the set operation was not actually performed.
+ If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to
+ MaximumDatumSize and NULL must be returned.
+
+ If PatchVariable is NULL, then ASSERT().
+ If SizeOfValue is NULL, then ASSERT().
+ If SizeOfValue > 0 and Buffer is NULL, then ASSERT().
+
+ @param[in] PatchVariable A pointer to the global variable in a module that is
+ the target of the set operation.
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.
+
+**/
+VOID *
+EFIAPI
+LibPatchPcdSetPtr (
+ IN VOID *PatchVariable,
+ IN UINTN MaximumDatumSize,
+ IN OUT UINTN *SizeOfBuffer,
+ IN CONST VOID *Buffer
+ );
+
#endif
diff --git a/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.msa b/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.msa
index 26d6609b51..564ccc1e28 100644
--- a/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.msa
+++ b/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.msa
@@ -8,11 +8,11 @@
<Abstract>NULL PCD Library</Abstract>
<Description>FIX ME!</Description>
<Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
- <License>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
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ <License>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
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
@@ -28,6 +28,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>DebugLib</Keyword>
</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>BaseMemoryLib</Keyword>
+ </LibraryClass>
</LibraryClassDefinitions>
<SourceFiles>
<Filename>PcdLib.c</Filename>
@@ -39,4 +42,4 @@
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
<Specification>EDK_RELEASE_VERSION 0x00090000</Specification>
</Externs>
-</ModuleSurfaceArea> \ No newline at end of file
+</ModuleSurfaceArea>
diff --git a/MdePkg/Library/BasePcdLibNull/PcdLib.c b/MdePkg/Library/BasePcdLibNull/PcdLib.c
index a2e46b05b2..e58965cc68 100644
--- a/MdePkg/Library/BasePcdLibNull/PcdLib.c
+++ b/MdePkg/Library/BasePcdLibNull/PcdLib.c
@@ -780,3 +780,52 @@ LibPcdGetNextTokenSpace (
{
return NULL;
}
+
+
+
+/**
+ Sets the PCD entry specified by PatchVariable to the value specified by Buffer
+ and SizeOfValue. Buffer is returned. If SizeOfValue is greater than
+ MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return
+ NULL to indicate that the set operation was not actually performed.
+ If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to
+ MaximumDatumSize and NULL must be returned.
+
+ If PatchVariable is NULL, then ASSERT().
+ If SizeOfValue is NULL, then ASSERT().
+ If SizeOfValue > 0 and Buffer is NULL, then ASSERT().
+
+ @param[in] PatchVariable A pointer to the global variable in a module that is
+ the target of the set operation.
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.
+
+**/
+VOID *
+EFIAPI
+LibPatchPcdSetPtr (
+ IN VOID *PatchVariable,
+ IN UINTN MaximumDatumSize,
+ IN OUT UINTN *SizeOfBuffer,
+ IN CONST VOID *Buffer
+ )
+{
+ ASSERT (PatchVariable != NULL);
+ ASSERT (SizeOfBuffer != NULL);
+
+ if (*SizeOfBuffer > 0) {
+ ASSERT (Buffer != NULL);
+ }
+
+ if ((*SizeOfBuffer > MaximumDatumSize) ||
+ (*SizeOfBuffer == MAX_ADDRESS)) {
+ *SizeOfBuffer = MaximumDatumSize;
+ return NULL;
+ }
+
+ CopyMem (PatchVariable, Buffer, *SizeOfBuffer);
+
+ return (VOID *) Buffer;
+}
+
diff --git a/MdePkg/Library/DxePcdLib/DxePcdLib.c b/MdePkg/Library/DxePcdLib/DxePcdLib.c
index b746614d5b..f0b0cbd8f6 100644
--- a/MdePkg/Library/DxePcdLib/DxePcdLib.c
+++ b/MdePkg/Library/DxePcdLib/DxePcdLib.c
@@ -923,3 +923,52 @@ LibPcdGetNextTokenSpace (
return (GUID *) Guid;
}
+
+/**
+ Sets the PCD entry specified by PatchVariable to the value specified by Buffer
+ and SizeOfValue. Buffer is returned. If SizeOfValue is greater than
+ MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return
+ NULL to indicate that the set operation was not actually performed.
+ If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to
+ MaximumDatumSize and NULL must be returned.
+
+ If PatchVariable is NULL, then ASSERT().
+ If SizeOfValue is NULL, then ASSERT().
+ If SizeOfValue > 0 and Buffer is NULL, then ASSERT().
+
+ @param[in] PatchVariable A pointer to the global variable in a module that is
+ the target of the set operation.
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.
+
+**/
+VOID *
+EFIAPI
+LibPatchPcdSetPtr (
+ IN VOID *PatchVariable,
+ IN UINTN MaximumDatumSize,
+ IN OUT UINTN *SizeOfBuffer,
+ IN CONST VOID *Buffer
+ )
+{
+ ASSERT (PatchVariable != NULL);
+ ASSERT (SizeOfBuffer != NULL);
+
+ if (*SizeOfBuffer > 0) {
+ ASSERT (Buffer != NULL);
+ }
+
+ if ((*SizeOfBuffer > MaximumDatumSize) ||
+ (*SizeOfBuffer == MAX_ADDRESS)) {
+ *SizeOfBuffer = MaximumDatumSize;
+ return NULL;
+ }
+
+ CopyMem (PatchVariable, Buffer, *SizeOfBuffer);
+
+ return (VOID *) Buffer;
+}
+
+
+
diff --git a/MdePkg/Library/DxePcdLib/DxePcdLib.msa b/MdePkg/Library/DxePcdLib/DxePcdLib.msa
index c250fbeb3a..c50ac45220 100644
--- a/MdePkg/Library/DxePcdLib/DxePcdLib.msa
+++ b/MdePkg/Library/DxePcdLib/DxePcdLib.msa
@@ -8,11 +8,11 @@
<Abstract>IO Library implemented with Framework CPU IO Protocol</Abstract>
<Description>FIX ME!</Description>
<Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
- <License>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
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ <License>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
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
@@ -31,6 +31,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>BaseMemoryLib</Keyword>
+ </LibraryClass>
</LibraryClassDefinitions>
<SourceFiles>
<Filename>DxePcdLib.c</Filename>
@@ -50,4 +53,4 @@
<Constructor>PcdLibConstructor</Constructor>
</Extern>
</Externs>
-</ModuleSurfaceArea> \ No newline at end of file
+</ModuleSurfaceArea>
diff --git a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
index 57fa821156..bee5386097 100644
--- a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
+++ b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
@@ -1022,3 +1022,52 @@ LibPcdGetNextTokenSpace (
return (GUID *)Guid;
}
+
+
+/**
+ Sets the PCD entry specified by PatchVariable to the value specified by Buffer
+ and SizeOfValue. Buffer is returned. If SizeOfValue is greater than
+ MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return
+ NULL to indicate that the set operation was not actually performed.
+ If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to
+ MaximumDatumSize and NULL must be returned.
+
+ If PatchVariable is NULL, then ASSERT().
+ If SizeOfValue is NULL, then ASSERT().
+ If SizeOfValue > 0 and Buffer is NULL, then ASSERT().
+
+ @param[in] PatchVariable A pointer to the global variable in a module that is
+ the target of the set operation.
+ @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
+ @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
+ @param[in] Buffer A pointer to the buffer to used to set the target variable.
+
+**/
+VOID *
+EFIAPI
+LibPatchPcdSetPtr (
+ IN VOID *PatchVariable,
+ IN UINTN MaximumDatumSize,
+ IN OUT UINTN *SizeOfBuffer,
+ IN CONST VOID *Buffer
+ )
+{
+ ASSERT (PatchVariable != NULL);
+ ASSERT (SizeOfBuffer != NULL);
+
+ if (*SizeOfBuffer > 0) {
+ ASSERT (Buffer != NULL);
+ }
+
+ if ((*SizeOfBuffer > MaximumDatumSize) ||
+ (*SizeOfBuffer == MAX_ADDRESS)) {
+ *SizeOfBuffer = MaximumDatumSize;
+ return NULL;
+ }
+
+ CopyMem (PatchVariable, Buffer, *SizeOfBuffer);
+
+ return (VOID *) Buffer;
+}
+
+
diff --git a/MdePkg/Library/PeiPcdLib/PeiPcdLib.msa b/MdePkg/Library/PeiPcdLib/PeiPcdLib.msa
index 8c3c1e73f8..e4923679c8 100644
--- a/MdePkg/Library/PeiPcdLib/PeiPcdLib.msa
+++ b/MdePkg/Library/PeiPcdLib/PeiPcdLib.msa
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">
<MsaHeader>
<ModuleName>PeiPcdLib</ModuleName>
@@ -8,11 +8,11 @@
<Abstract>PCD Library Instance implemented with PCD PPI.</Abstract>
<Description>FIX ME!</Description>
<Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
- <License>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
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ <License>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
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
@@ -34,6 +34,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>PeiServicesTablePointerLib</Keyword>
</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>BaseMemoryLib</Keyword>
+ </LibraryClass>
</LibraryClassDefinitions>
<SourceFiles>
<Filename>PeiPcdLib.c</Filename>
@@ -41,8 +44,13 @@
<PackageDependencies>
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
</PackageDependencies>
+ <PPIs>
+ <Ppi Usage="ALWAYS_CONSUMED">
+ <PpiCName>PcdPpi</PpiCName>
+ </Ppi>
+ </PPIs>
<Externs>
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
<Specification>EDK_RELEASE_VERSION 0x00090000</Specification>
</Externs>
-</ModuleSurfaceArea> \ No newline at end of file
+</ModuleSurfaceArea>