]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformMemory.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / IntelFsp2Pkg / Library / BaseFspPlatformLib / FspPlatformMemory.c
index edb8d67223824fbcee1b43bf4225ade643a7772e..2573e4e4218219c367f31ac7d94e43bbcce9b48c 100644 (file)
@@ -1,13 +1,7 @@
 /** @file\r
 \r
-  Copyright (c) 2014 - 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
+  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 EFI_HOB_RESOURCE_DESCRIPTOR *\r
 EFIAPI\r
 FspGetResourceDescriptorByOwner (\r
-  IN EFI_GUID   *OwnerGuid\r
+  IN EFI_GUID  *OwnerGuid\r
   )\r
 {\r
-  EFI_PEI_HOB_POINTERS    Hob;\r
+  EFI_PEI_HOB_POINTERS  Hob;\r
 \r
   //\r
   // Get the HOB list for processing\r
@@ -47,13 +41,15 @@ FspGetResourceDescriptorByOwner (
   while (!END_OF_HOB_LIST (Hob)) {\r
     if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {\r
       if ((Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) && \\r
-          (CompareGuid (&Hob.ResourceDescriptor->Owner, OwnerGuid))) {\r
-        return  Hob.ResourceDescriptor;                     \r
+          (CompareGuid (&Hob.ResourceDescriptor->Owner, OwnerGuid)))\r
+      {\r
+        return Hob.ResourceDescriptor;\r
       }\r
     }\r
+\r
     Hob.Raw = GET_NEXT_HOB (Hob);\r
   }\r
-  \r
+\r
   return NULL;\r
 }\r
 \r
@@ -66,14 +62,14 @@ FspGetResourceDescriptorByOwner (
 VOID\r
 EFIAPI\r
 FspGetSystemMemorySize (\r
-  IN OUT UINT64              *LowMemoryLength,\r
-  IN OUT UINT64              *HighMemoryLength\r
+  IN OUT UINT64  *LowMemoryLength,\r
+  IN OUT UINT64  *HighMemoryLength\r
   )\r
 {\r
-  EFI_STATUS                  Status;\r
-  EFI_BOOT_MODE               BootMode;\r
-  EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute;\r
-  EFI_PEI_HOB_POINTERS        Hob;\r
+  EFI_STATUS                   Status;\r
+  EFI_BOOT_MODE                BootMode;\r
+  EFI_RESOURCE_ATTRIBUTE_TYPE  ResourceAttribute;\r
+  EFI_PEI_HOB_POINTERS         Hob;\r
 \r
   ResourceAttribute = (\r
                        EFI_RESOURCE_ATTRIBUTE_PRESENT |\r
@@ -105,18 +101,21 @@ FspGetSystemMemorySize (
     if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {\r
       if ((Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) ||\r
           ((Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) &&\r
-           (Hob.ResourceDescriptor->ResourceAttribute == ResourceAttribute))) {\r
+           (Hob.ResourceDescriptor->ResourceAttribute == ResourceAttribute)))\r
+      {\r
         //\r
         // Need memory above 1MB to be collected here\r
         //\r
-        if (Hob.ResourceDescriptor->PhysicalStart >= BASE_1MB &&\r
-            Hob.ResourceDescriptor->PhysicalStart < (EFI_PHYSICAL_ADDRESS) BASE_4GB) {\r
-          *LowMemoryLength += (UINT64) (Hob.ResourceDescriptor->ResourceLength);\r
-        } else if (Hob.ResourceDescriptor->PhysicalStart >= (EFI_PHYSICAL_ADDRESS) BASE_4GB) {\r
-          *HighMemoryLength += (UINT64) (Hob.ResourceDescriptor->ResourceLength);\r
+        if ((Hob.ResourceDescriptor->PhysicalStart >= BASE_1MB) &&\r
+            (Hob.ResourceDescriptor->PhysicalStart < (EFI_PHYSICAL_ADDRESS)BASE_4GB))\r
+        {\r
+          *LowMemoryLength += (UINT64)(Hob.ResourceDescriptor->ResourceLength);\r
+        } else if (Hob.ResourceDescriptor->PhysicalStart >= (EFI_PHYSICAL_ADDRESS)BASE_4GB) {\r
+          *HighMemoryLength += (UINT64)(Hob.ResourceDescriptor->ResourceLength);\r
         }\r
       }\r
     }\r
+\r
     Hob.Raw = GET_NEXT_HOB (Hob);\r
   }\r
 }\r