X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkModulePkg%2FUniversal%2FDebugSupport%2FDxe%2Fx64%2FplDebugSupport.c;h=6fb4cdb542157091ba1c9dd63f50c319730519eb;hp=b3580a42fa18f884b3f5085a60d30edbdf9884e7;hb=2c3b5ec562c7b43a73424e1be25e2053d1edfe4f;hpb=9db9711c414fe3207ffae81b3c1627554c428308 diff --git a/EdkModulePkg/Universal/DebugSupport/Dxe/x64/plDebugSupport.c b/EdkModulePkg/Universal/DebugSupport/Dxe/x64/plDebugSupport.c index b3580a42fa..6fb4cdb542 100644 --- a/EdkModulePkg/Universal/DebugSupport/Dxe/x64/plDebugSupport.c +++ b/EdkModulePkg/Universal/DebugSupport/Dxe/x64/plDebugSupport.c @@ -44,16 +44,15 @@ Returns: --*/ { - EFI_STATUS Status; UINT8 *StubCopy; // // First, allocate a new buffer and copy the stub code into it // - Status = gBS->AllocatePool (EfiBootServicesData, StubSize, Stub); - if (Status == EFI_SUCCESS) { + *Stub = AllocatePool (StubSize); + if (*Stub != NULL) { StubCopy = *Stub; - gBS->CopyMem (StubCopy, InterruptEntryStub, StubSize); + CopyMem (StubCopy, InterruptEntryStub, StubSize); // // Next fixup the stub code for this vector @@ -75,9 +74,11 @@ Returns: // fixup the jump target to point to the common entry // *(UINT32 *) &StubCopy[0x3] = (UINT32)((UINTN) CommonIdtEntry - (UINTN) &StubCopy[StubSize]); + + return EFI_SUCCESS; } - return Status; + return EFI_OUT_OF_RESOURCES; } STATIC @@ -142,20 +143,18 @@ Arguments: Returns: EFI_SUCCESS - Other values are passed through from FreePool --*/ { BOOLEAN OldIntFlagState; - EFI_STATUS Status; - + OldIntFlagState = WriteInterruptFlag (0); WriteIdt (ExceptionType, &(IdtEntryTable[ExceptionType].OrigDesc)); - Status = gBS->FreePool ((VOID *) (UINTN) IdtEntryTable[ExceptionType].StubEntry); + FreePool ((VOID *) (UINTN) IdtEntryTable[ExceptionType].StubEntry); ZeroMem (&IdtEntryTable[ExceptionType], sizeof (IDT_ENTRY)); WriteInterruptFlag (OldIntFlagState); - return (Status); + return EFI_SUCCESS; } EFI_STATUS @@ -401,7 +400,7 @@ Returns: ManageIdtEntryTable (NULL, ExceptionType); } - gBS->FreePool (IdtEntryTable); + FreePool (IdtEntryTable); return EFI_SUCCESS; }