]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / Ia32 / DxeLoadFunc.c
index d28baa3615988ef43632ec67c566c9e21d8014b2..172d7cd1c60ccfebd3b7c48796078c9be9b94fa4 100644 (file)
@@ -4,13 +4,7 @@
 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>\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
@@ -186,37 +180,6 @@ IsIa32PaeSupport (
   return Ia32PaeSupport;\r
 }\r
 \r
-/**\r
-  The function will check if Execute Disable Bit is available.\r
-\r
-  @retval TRUE      Execute Disable Bit is available.\r
-  @retval FALSE     Execute Disable Bit is not available.\r
-\r
-**/\r
-BOOLEAN\r
-IsExecuteDisableBitAvailable (\r
-  VOID\r
-  )\r
-{\r
-  UINT32            RegEax;\r
-  UINT32            RegEdx;\r
-  BOOLEAN           Available;\r
-\r
-  Available = FALSE;\r
-  AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);\r
-  if (RegEax >= 0x80000001) {\r
-    AsmCpuid (0x80000001, NULL, NULL, NULL, &RegEdx);\r
-    if ((RegEdx & BIT20) != 0) {\r
-      //\r
-      // Bit 20: Execute Disable Bit available.\r
-      //\r
-      Available = TRUE;\r
-    }\r
-  }\r
-\r
-  return Available;\r
-}\r
-\r
 /**\r
   The function will check if page table should be setup or not.\r
 \r
@@ -245,7 +208,7 @@ ToBuildPageTable (
     return TRUE;\r
   }\r
 \r
-  if (PcdGetBool (PcdSetNxForStack) && IsExecuteDisableBitAvailable ()) {\r
+  if (IsEnableNonExecNeeded ()) {\r
     return TRUE;\r
   }\r
 \r
@@ -436,7 +399,7 @@ HandOffToDxeCore (
     BuildPageTablesIa32Pae = ToBuildPageTable ();\r
     if (BuildPageTablesIa32Pae) {\r
       PageTables = Create4GPageTablesIa32Pae (BaseOfStack, STACK_SIZE);\r
-      if (IsExecuteDisableBitAvailable ()) {\r
+      if (IsEnableNonExecNeeded ()) {\r
         EnableExecuteDisableBit();\r
       }\r
     }\r