]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PCD/Pei/Pcd.c
MdeModulePkg/BdsDxe: Avoid overwriting PlatformRecovery####
[mirror_edk2.git] / MdeModulePkg / Universal / PCD / Pei / Pcd.c
index 4d0caed5a94ef218f5afc6d8622917efbda0b982..668860b61c6ccb3590a51002e578451731c76779 100644 (file)
@@ -2,13 +2,14 @@
   All Pcd Ppi services are implemented here.\r
   \r
 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 **/\r
 \r
@@ -226,7 +227,7 @@ PeiGetPcdInfoGetSku (
   VOID\r
   )\r
 {\r
-  return GetPcdDatabase()->SystemSkuId;\r
+  return (UINTN) GetPcdDatabase()->SystemSkuId;\r
 }\r
 \r
 /**\r
@@ -1116,13 +1117,17 @@ PeiPcdGetNextToken (
     }\r
 \r
     if (Found) {\r
+      //\r
+      // If given token number is PCD_INVALID_TOKEN_NUMBER, then return the first\r
+      // token number in found token space.\r
+      //\r
       if (*TokenNumber == PCD_INVALID_TOKEN_NUMBER) {\r
         *TokenNumber = ExMapTable[Index].ExTokenNumber;\r
          return EFI_SUCCESS;\r
       }\r
 \r
       for ( ; Index < PeiPcdDb->ExTokenCount; Index++) {\r
-        if (ExMapTable[Index].ExTokenNumber == *TokenNumber) {\r
+        if ((ExMapTable[Index].ExTokenNumber == *TokenNumber) && (ExMapTable[Index].ExGuidIndex == GuidTableIdx)) {\r
           break;\r
         }\r
       }\r