]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/PlatformPei/Xen.c
OvmfPkg/Csm/LegacyBiosDxe: Fix Legacy16GetTableAddress call for E820 data
[mirror_edk2.git] / OvmfPkg / PlatformPei / Xen.c
index 1886326f20c66ed30f5c4263e435b2ce05dea3bd..89dc4143b23b6fa060ca216ca8211b2b73d65a2c 100644 (file)
@@ -1,16 +1,10 @@
 /**@file\r
   Xen Platform PEI support\r
 \r
-  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
   Copyright (c) 2011, Andrei Warkentin <andreiw@motorola.com>\r
 \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
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -171,6 +165,7 @@ XenPublishRamRegions (
   //\r
   // Parse RAM in E820 map\r
   //\r
+  E820EntriesCount = 0;\r
   Status = XenGetE820Map (&E820Map, &E820EntriesCount);\r
 \r
   ASSERT_EFI_ERROR (Status);\r
@@ -189,11 +184,7 @@ XenPublishRamRegions (
         continue;\r
       }\r
 \r
-      if (Entry->BaseAddr >= BASE_4GB) {\r
-        AddUntestedMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length);\r
-      } else {\r
-        AddMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length);\r
-      }\r
+      AddMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length);\r
 \r
       MtrrSetMemoryAttribute (Entry->BaseAddr, Entry->Length, CacheWriteBack);\r
     }\r
@@ -213,6 +204,8 @@ InitializeXen (
   VOID\r
   )\r
 {\r
+  RETURN_STATUS PcdStatus;\r
+\r
   if (mXenLeaf == 0) {\r
     return EFI_NOT_FOUND;\r
   }\r
@@ -223,9 +216,10 @@ InitializeXen (
   // Reserve away HVMLOADER reserved memory [0xFC000000,0xFD000000).\r
   // This needs to match HVMLOADER RESERVED_MEMBASE/RESERVED_MEMSIZE.\r
   //\r
-  AddReservedMemoryBaseSizeHob (0xFC000000, 0x1000000);\r
+  AddReservedMemoryBaseSizeHob (0xFC000000, 0x1000000, FALSE);\r
 \r
-  PcdSetBool (PcdPciDisableBusEnumeration, TRUE);\r
+  PcdStatus = PcdSetBoolS (PcdPciDisableBusEnumeration, TRUE);\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
 \r
   return EFI_SUCCESS;\r
 }\r