]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/DebugSupport/Dxe/Ia32/plDebugSupport.c
1. Added PcdNtEmulator and Removed MACRO EFI_NT_EMULATOR
[mirror_edk2.git] / EdkModulePkg / Universal / DebugSupport / Dxe / Ia32 / plDebugSupport.c
index 270a158b7972e221e63723ecc67128a6e16c38ed..88b8c5a14acaae74879afaa7074057ff5c564b4f 100644 (file)
@@ -1,14 +1,14 @@
 /**@file\r
   IA32 specific debug support functions\r
-  \r
-Copyright (c) 2006 Intel Corporation                                                         \r
-All rights reserved. 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
+\r
+Copyright (c) 2006 - 2007, Intel Corporation\r
+All rights reserved. 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
 \r
 **/\r
 \r
@@ -23,7 +23,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 IDT_ENTRY   *IdtEntryTable  = NULL;\r
 DESCRIPTOR  NullDesc        = 0;\r
 \r
-#ifndef EFI_NT_EMULATOR\r
 STATIC\r
 EFI_STATUS\r
 CreateEntryStub (\r
@@ -77,7 +76,7 @@ Returns:
     // fixup the jump target to point to the common entry\r
     //\r
     *(UINT32 *) &StubCopy[0x0e] = (UINT32) CommonIdtEntry - (UINT32) &StubCopy[StubSize];\r
-    \r
+\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -158,7 +157,6 @@ Returns:
 \r
   return EFI_SUCCESS;\r
 }\r
-#endif\r
 \r
 EFI_STATUS\r
 ManageIdtEntryTable (\r
@@ -193,33 +191,34 @@ Returns:
 \r
   Status = EFI_SUCCESS;\r
 \r
-#ifndef EFI_NT_EMULATOR\r
-  if (CompareDescriptor (&IdtEntryTable[ExceptionType].NewDesc, &NullDesc)) {\r
-    //\r
-    // we've already installed to this vector\r
-    //\r
-    if (NewCallback != NULL) {\r
+  if (FeaturePcdGet (PcdNtEmulatorEnable)) {\r
+    if (CompareDescriptor (&IdtEntryTable[ExceptionType].NewDesc, &NullDesc)) {\r
       //\r
-      // if the input handler is non-null, error\r
+      // we've already installed to this vector\r
       //\r
-      Status = EFI_ALREADY_STARTED;\r
+      if (NewCallback != NULL) {\r
+        //\r
+        // if the input handler is non-null, error\r
+        //\r
+        Status = EFI_ALREADY_STARTED;\r
+      } else {\r
+        Status = UnhookEntry (ExceptionType);\r
+      }\r
     } else {\r
-      Status = UnhookEntry (ExceptionType);\r
-    }\r
-  } else {\r
-    //\r
-    // no user handler installed on this vector\r
-    //\r
-    if (NewCallback == NULL) {\r
       //\r
-      // if the input handler is null, error\r
+      // no user handler installed on this vector\r
       //\r
-      Status = EFI_INVALID_PARAMETER;\r
-    } else {\r
-      Status = HookEntry (ExceptionType, NewCallback);\r
+      if (NewCallback == NULL) {\r
+        //\r
+        // if the input handler is null, error\r
+        //\r
+        Status = EFI_INVALID_PARAMETER;\r
+      } else {\r
+        Status = HookEntry (ExceptionType, NewCallback);\r
+      }\r
     }\r
   }\r
-#endif\r
+\r
   return Status;\r
 }\r
 \r