]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/DebugSupport/Dxe/x64/plDebugSupport.c
1. Added PcdNtEmulator and Removed MACRO EFI_NT_EMULATOR
[mirror_edk2.git] / EdkModulePkg / Universal / DebugSupport / Dxe / x64 / plDebugSupport.c
index b3580a42fa18f884b3f5085a60d30edbdf9884e7..3f12a76d6ceaa4002533030b5c4456f6d5d2a7d6 100644 (file)
@@ -1,14 +1,14 @@
 /**@file\r
   X64 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
+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
@@ -44,16 +44,15 @@ Returns:
 \r
 --*/\r
 {\r
-  EFI_STATUS  Status;\r
   UINT8       *StubCopy;\r
 \r
   //\r
   // First, allocate a new buffer and copy the stub code into it\r
   //\r
-  Status = gBS->AllocatePool (EfiBootServicesData, StubSize, Stub);\r
-  if (Status == EFI_SUCCESS) {\r
+  *Stub = AllocatePool (StubSize);\r
+  if (*Stub != NULL) {\r
     StubCopy = *Stub;\r
-    gBS->CopyMem (StubCopy, InterruptEntryStub, StubSize);\r
+    CopyMem (StubCopy, InterruptEntryStub, StubSize);\r
 \r
     //\r
     // Next fixup the stub code for this vector\r
@@ -75,9 +74,11 @@ Returns:
     // fixup the jump target to point to the common entry\r
     //\r
     *(UINT32 *) &StubCopy[0x3] = (UINT32)((UINTN) CommonIdtEntry - (UINTN) &StubCopy[StubSize]);\r
+\r
+    return EFI_SUCCESS;\r
   }\r
 \r
-  return Status;\r
+  return EFI_OUT_OF_RESOURCES;\r
 }\r
 \r
 STATIC\r
@@ -142,20 +143,18 @@ Arguments:
 \r
 Returns:\r
   EFI_SUCCESS\r
-  Other values are passed through from FreePool\r
 \r
 --*/\r
 {\r
   BOOLEAN     OldIntFlagState;\r
-  EFI_STATUS  Status;\r
 \r
   OldIntFlagState = WriteInterruptFlag (0);\r
   WriteIdt (ExceptionType, &(IdtEntryTable[ExceptionType].OrigDesc));\r
-  Status = gBS->FreePool ((VOID *) (UINTN) IdtEntryTable[ExceptionType].StubEntry);\r
+  FreePool ((VOID *) (UINTN) IdtEntryTable[ExceptionType].StubEntry);\r
   ZeroMem (&IdtEntryTable[ExceptionType], sizeof (IDT_ENTRY));\r
   WriteInterruptFlag (OldIntFlagState);\r
 \r
-  return (Status);\r
+  return EFI_SUCCESS;\r
 }\r
 \r
 EFI_STATUS\r
@@ -401,7 +400,7 @@ Returns:
     ManageIdtEntryTable (NULL, ExceptionType);\r
   }\r
 \r
-  gBS->FreePool (IdtEntryTable);\r
+  FreePool (IdtEntryTable);\r
   return EFI_SUCCESS;\r
 }\r
 \r