]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
DxeMain: Fix the bug that StackGuard is not enabled
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain / DxeMain.c
index 83f49d7c0071b34b90722db2abff04b9b686823c..0a1f3d79e2420eb1e7a224efdbceaddf5224e740 100644 (file)
@@ -256,6 +256,14 @@ DxeMain (
   Status = InitializeCpuExceptionHandlers (VectorInfoList);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
+  //\r
+  // Setup Stack Guard\r
+  //\r
+  if (PcdGetBool (PcdCpuStackGuard)) {\r
+    Status = InitializeSeparateExceptionStacks (NULL);\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
+\r
   //\r
   // Initialize Debug Agent to support source level debug in DXE phase\r
   //\r