/** @file\r
- IA32 specific debug support functions\r
+ IA32 specific functions to support Debug Support protocol.\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation\r
+Copyright (c) 2008, 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
\r
**/\r
\r
-#include "DebugSupport.h"\r
+#include "PlDebugSupport.h"\r
+\r
+IA32_IDT_GATE_DESCRIPTOR NullDesc = {{0}};\r
\r
/**\r
- Get Procedure Entry Point from IDT Gate Descriptor.\r
+ Get Interrupt Handle from IDT Gate Descriptor.\r
\r
- @param IdtGateDecriptor IDT Gate Descriptor.\r
+ @param IdtGateDescriptor IDT Gate Descriptor.\r
\r
- @return Procedure Entry Point located in IDT Gate Descriptor.\r
+ @return Interrupt Handle stored in IDT Gate Descriptor.\r
\r
**/\r
-UINTN GetProcedureEntryPoint (\r
- IN IA32_IDT_GATE_DESCRIPTOR *IdtGateDecriptor\r
+UINTN\r
+GetInterruptHandleFromIdt (\r
+ IN IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor\r
)\r
{\r
- UINTN ProcedureEntryPoint;\r
- \r
- ((UINT16 *) &ProcedureEntryPoint)[0] = (UINT16) IdtGateDecriptor->Bits.OffsetLow;\r
- ((UINT16 *) &ProcedureEntryPoint)[1] = (UINT16) IdtGateDecriptor->Bits.OffsetHigh;\r
+ UINTN InterruptHandle;\r
+\r
+ //\r
+ // InterruptHandle 0-15 : OffsetLow\r
+ // InterruptHandle 16-31 : OffsetHigh\r
+ //\r
+ ((UINT16 *) &InterruptHandle)[0] = (UINT16) IdtGateDescriptor->Bits.OffsetLow;\r
+ ((UINT16 *) &InterruptHandle)[1] = (UINT16) IdtGateDescriptor->Bits.OffsetHigh;\r
\r
- return ProcedureEntryPoint;\r
+ return InterruptHandle;\r
}\r
\r
/**\r
for.\r
@param Stub On successful exit, *Stub contains the newly allocated entry stub.\r
\r
- @retval EFI_SUCCESS Always.\r
-\r
**/\r
-EFI_STATUS\r
+VOID\r
CreateEntryStub (\r
IN EFI_EXCEPTION_TYPE ExceptionType,\r
OUT VOID **Stub\r
//\r
*(UINT32 *) &StubCopy[0x0e] = (UINT32) CommonIdtEntry - (UINT32) &StubCopy[StubSize];\r
\r
- return EFI_SUCCESS;\r
+ return ;\r
}\r
\r
/**\r
be uninstalled.\r
@param ExceptionType Indicates which entry to manage.\r
\r
- @retval EFI_SUCCESS Process is ok.\r
+ @retval EFI_SUCCESS Installing or Uninstalling operation is ok.\r
@retval EFI_INVALID_PARAMETER Requested uninstalling a handler from a vector that has\r
no handler registered for it\r
@retval EFI_ALREADY_STARTED Requested install to a vector that already has a handler registered.\r
- @retval others Possible return values are passed through from UnHookEntry and HookEntry.\r
\r
**/\r
EFI_STATUS\r
ManageIdtEntryTable (\r
- VOID (*NewCallback)(),\r
+ VOID (*NewCallback)(),\r
EFI_EXCEPTION_TYPE ExceptionType\r
)\r
{\r
//\r
Status = EFI_ALREADY_STARTED;\r
} else {\r
- Status = UnhookEntry (ExceptionType);\r
+ UnhookEntry (ExceptionType);\r
}\r
} else {\r
//\r
//\r
Status = EFI_INVALID_PARAMETER;\r
} else {\r
- Status = HookEntry (ExceptionType, NewCallback);\r
+ HookEntry (ExceptionType, NewCallback);\r
}\r
}\r
}\r