code scrub for DebugSpport Module.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6997 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2008-12-11 08:38:20 +00:00
parent 89df7f9df7
commit c84507ab52
12 changed files with 369 additions and 456 deletions

View File

@@ -30,14 +30,6 @@ _StubSize: .long _InterruptEntryStubEnd - _InterruptEntryStub
_FxStorSupport:
ret
.globl _GetIdtr
_GetIdtr:
ret
.globl _WriteInterruptFlag
_WriteInterruptFlag:
ret
.globl _Vect2Desc
_Vect2Desc:
ret

View File

@@ -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 (

View File

@@ -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);
}
}