]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspPkg/FspSecCore/SecFsp.c
IntelFspPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFspPkg / FspSecCore / SecFsp.c
index b4566045f9ba828b77fb480ce3db34a0642b6c1b..94b908e2e09100d2d1553f215402641ba6f2e72f 100644 (file)
@@ -1,13 +1,7 @@
 /** @file\r
 \r
   Copyright (c) 2014 - 2015, 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
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -32,7 +26,7 @@ FspGetExceptionHandler(
   IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor;\r
   FSP_INFO_HEADER          *FspInfoHeader;\r
 \r
-  FspInfoHeader     = (FSP_INFO_HEADER *)(GetFspBaseAddress() + FSP_INFO_HEADER_OFF);\r
+  FspInfoHeader     = (FSP_INFO_HEADER *)AsmGetFspInfoHeader();\r
   ExceptionHandler  = IdtEntryTemplate;\r
   IdtGateDescriptor = (IA32_IDT_GATE_DESCRIPTOR *)&ExceptionHandler;\r
   Entry = (IdtGateDescriptor->Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow;\r
@@ -171,7 +165,7 @@ FspGlobalDataInit (
   // Get FSP Header offset\r
   // It may have multiple FVs, so look into the last one for FSP header\r
   //\r
-  PeiFspData->FspInfoHeader      = (FSP_INFO_HEADER *)(GetFspBaseAddress() + FSP_INFO_HEADER_OFF);\r
+  PeiFspData->FspInfoHeader      = (FSP_INFO_HEADER *)AsmGetFspInfoHeader();\r
   SecGetPlatformData (PeiFspData);\r
 \r
   //\r
@@ -265,7 +259,7 @@ FspApiCallingCheck (
     //\r
     if ((UINT32)FspData != 0xFFFFFFFF) {\r
       Status = EFI_UNSUPPORTED;\r
-    } else if ((FspRtBuffer == NULL) || ((FspRtBuffer->BootLoaderTolumSize % EFI_PAGE_SIZE) != 0)) {\r
+    } else if ((FspRtBuffer == NULL) || ((FspRtBuffer->BootLoaderTolumSize % EFI_PAGE_SIZE) != 0) || (EFI_ERROR(FspUpdSignatureCheck(ApiIdx, ApiParam)))) {\r
       Status = EFI_INVALID_PARAMETER;\r
     }\r
   } else if (ApiIdx == 2) {\r
@@ -285,7 +279,7 @@ FspApiCallingCheck (
     //\r
     if ((UINT32)FspData != 0xFFFFFFFF) {\r
       Status = EFI_UNSUPPORTED;\r
-    } else if ((FspRtBuffer == NULL) || ((FspRtBuffer->BootLoaderTolumSize % EFI_PAGE_SIZE) != 0)) {\r
+    } else if ((FspRtBuffer == NULL) || ((FspRtBuffer->BootLoaderTolumSize % EFI_PAGE_SIZE) != 0) || (EFI_ERROR(FspUpdSignatureCheck(ApiIdx, ApiParam)))) {\r
       Status = EFI_INVALID_PARAMETER;\r
     }\r
   } else if (ApiIdx == 4) {\r
@@ -308,6 +302,8 @@ FspApiCallingCheck (
     } else {\r
       if (FspData->Signature != FSP_GLOBAL_DATA_SIGNATURE) {\r
         Status = EFI_UNSUPPORTED;\r
+      } else if (EFI_ERROR(FspUpdSignatureCheck(ApiIdx, ApiParam))) {\r
+        Status = EFI_INVALID_PARAMETER;\r
       }\r
     }\r
   } else {\r