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
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
return TRUE;\r
}\r
\r
- if (PcdGetBool (PcdSetNxForStack) && IsExecuteDisableBitAvailable ()) {\r
+ if (IsEnableNonExecNeeded ()) {\r
return TRUE;\r
}\r
\r
BuildPageTablesIa32Pae = ToBuildPageTable ();\r
if (BuildPageTablesIa32Pae) {\r
PageTables = Create4GPageTablesIa32Pae (BaseOfStack, STACK_SIZE);\r
- if (IsExecuteDisableBitAvailable ()) {\r
+ if (IsEnableNonExecNeeded ()) {\r
EnableExecuteDisableBit();\r
}\r
}\r