From c84507ab5229c462806187b090ba6249540c9070 Mon Sep 17 00:00:00 2001 From: vanjeff Date: Thu, 11 Dec 2008 08:38:20 +0000 Subject: code scrub for DebugSpport Module. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6997 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/DebugSupportDxe/X64/AsmFuncs.S | 8 ------ .../Universal/DebugSupportDxe/X64/AsmFuncs.asm | 30 ---------------------- .../DebugSupportDxe/X64/PlDebugSupportX64.c | 30 ++++++++++------------ 3 files changed, 13 insertions(+), 55 deletions(-) (limited to 'MdeModulePkg/Universal/DebugSupportDxe/X64') diff --git a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S index 087e5490bb..693d26e6e4 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S +++ b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S @@ -30,14 +30,6 @@ _StubSize: .long _InterruptEntryStubEnd - _InterruptEntryStub _FxStorSupport: ret -.globl _GetIdtr -_GetIdtr: - ret - -.globl _WriteInterruptFlag -_WriteInterruptFlag: - ret - .globl _Vect2Desc _Vect2Desc: ret diff --git a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm index f486bd32b5..d9ba0be191 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm +++ b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm @@ -131,36 +131,6 @@ FxStorSupport PROC PUBLIC ret FxStorSupport ENDP - - - -;------------------------------------------------------------------------------ -; BOOLEAN -; WriteInterruptFlag ( -; BOOLEAN NewState // rcx -; ) -; -; Abstract: Programs interrupt flag to the requested state and returns previous -; state. -; -WriteInterruptFlag PROC PUBLIC - - pushfq - pop rax - and rax, 200h - shr rax, 9 - cmp rcx, 0 - jnz EnableIF - cli - ret -EnableIF: - sti - ret - -WriteInterruptFlag ENDP - - - ;------------------------------------------------------------------------------ ; void ; Vect2Desc ( diff --git a/MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupportX64.c b/MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupportX64.c index 943d2c6911..e898d82271 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupportX64.c +++ b/MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupportX64.c @@ -12,30 +12,28 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -// -// private header files -// #include "DebugSupport.h" /** - Get Procedure Entry Point from IDT Gate Descriptor. + Get Interrupt Handle from IDT Gate Descriptor. @param IdtGateDecriptor IDT Gate Descriptor. - @return Procedure Entry Point located in IDT Gate Descriptor. + @return Interrupt Handle stored in IDT Gate Descriptor. **/ -UINTN GetProcedureEntryPoint ( +UINTN +GetInterruptHandleFromIdt ( IN IA32_IDT_GATE_DESCRIPTOR *IdtGateDecriptor ) { - UINTN ProcedureEntryPoint; + UINTN InterruptHandle; - ((UINT16 *) &ProcedureEntryPoint)[0] = (UINT16) IdtGateDecriptor->Bits.OffsetLow; - ((UINT16 *) &ProcedureEntryPoint)[1] = (UINT16) IdtGateDecriptor->Bits.OffsetHigh; - ((UINT32 *) &ProcedureEntryPoint)[1] = (UINT32) IdtGateDecriptor->Bits.OffsetUpper; + ((UINT16 *) &InterruptHandle)[0] = (UINT16) IdtGateDecriptor->Bits.OffsetLow; + ((UINT16 *) &InterruptHandle)[1] = (UINT16) IdtGateDecriptor->Bits.OffsetHigh; + ((UINT32 *) &InterruptHandle)[1] = (UINT32) IdtGateDecriptor->Bits.OffsetUpper; - return ProcedureEntryPoint; + return InterruptHandle; } /** @@ -48,10 +46,8 @@ UINTN GetProcedureEntryPoint ( for. @param Stub On successful exit, *Stub contains the newly allocated entry stub. - @retval EFI_SUCCESS Always. - **/ -EFI_STATUS +VOID CreateEntryStub ( IN EFI_EXCEPTION_TYPE ExceptionType, OUT VOID **Stub @@ -82,7 +78,7 @@ CreateEntryStub ( // *(UINT32 *) &StubCopy[0x3] = (UINT32)((UINTN) CommonIdtEntry - (UINTN) &StubCopy[StubSize]); - return EFI_SUCCESS; + return; } /** @@ -123,7 +119,7 @@ ManageIdtEntryTable ( // Status = EFI_ALREADY_STARTED; } else { - Status = UnhookEntry (ExceptionType); + UnhookEntry (ExceptionType); } } else { // @@ -135,7 +131,7 @@ ManageIdtEntryTable ( // Status = EFI_INVALID_PARAMETER; } else { - Status = HookEntry (ExceptionType, NewCallback); + HookEntry (ExceptionType, NewCallback); } } -- cgit v1.2.3