//\r
// This the global main table to keep track of the interrupts\r
//\r
-IDT_ENTRY *IdtEntryTable = NULL;\r
+IDT_ENTRY *IdtEntryTable = NULL;\r
\r
/**\r
Read IDT Gate Descriptor from IDT Table.\r
OUT IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor\r
)\r
{\r
- IA32_DESCRIPTOR IdtrValue;\r
- IA32_IDT_GATE_DESCRIPTOR *IdtTable;\r
+ IA32_DESCRIPTOR IdtrValue;\r
+ IA32_IDT_GATE_DESCRIPTOR *IdtTable;\r
\r
- AsmReadIdtr (&IdtrValue);\r
- IdtTable = (IA32_IDT_GATE_DESCRIPTOR *) IdtrValue.Base;\r
+ AsmReadIdtr (&IdtrValue);\r
+ IdtTable = (IA32_IDT_GATE_DESCRIPTOR *)IdtrValue.Base;\r
\r
- CopyMem ((VOID *) IdtGateDescriptor, (VOID *) &(IdtTable)[Vector], sizeof (IA32_IDT_GATE_DESCRIPTOR));\r
+ CopyMem ((VOID *)IdtGateDescriptor, (VOID *)&(IdtTable)[Vector], sizeof (IA32_IDT_GATE_DESCRIPTOR));\r
}\r
\r
/**\r
IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor\r
)\r
{\r
- IA32_DESCRIPTOR IdtrValue;\r
- IA32_IDT_GATE_DESCRIPTOR *IdtTable;\r
+ IA32_DESCRIPTOR IdtrValue;\r
+ IA32_IDT_GATE_DESCRIPTOR *IdtTable;\r
\r
- AsmReadIdtr (&IdtrValue);\r
- IdtTable = (IA32_IDT_GATE_DESCRIPTOR *) IdtrValue.Base;\r
+ AsmReadIdtr (&IdtrValue);\r
+ IdtTable = (IA32_IDT_GATE_DESCRIPTOR *)IdtrValue.Base;\r
\r
- CopyMem ((VOID *) &(IdtTable)[Vector], (VOID *) IdtGateDescriptor, sizeof (IA32_IDT_GATE_DESCRIPTOR));\r
+ CopyMem ((VOID *)&(IdtTable)[Vector], (VOID *)IdtGateDescriptor, sizeof (IA32_IDT_GATE_DESCRIPTOR));\r
}\r
\r
/**\r
**/\r
VOID\r
HookEntry (\r
- IN EFI_EXCEPTION_TYPE ExceptionType,\r
- IN CALLBACK_FUNC NewCallback\r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN CALLBACK_FUNC NewCallback\r
)\r
{\r
- BOOLEAN OldIntFlagState;\r
+ BOOLEAN OldIntFlagState;\r
\r
- CreateEntryStub (ExceptionType, (VOID **) &IdtEntryTable[ExceptionType].StubEntry);\r
+ CreateEntryStub (ExceptionType, (VOID **)&IdtEntryTable[ExceptionType].StubEntry);\r
\r
//\r
// Disables CPU interrupts and returns the previous interrupt state\r
//\r
// stores orignal interrupt handle\r
//\r
- IdtEntryTable[ExceptionType].OrigVector = (DEBUG_PROC) GetInterruptHandleFromIdt (&(IdtEntryTable[ExceptionType].OrigDesc));\r
+ IdtEntryTable[ExceptionType].OrigVector = (DEBUG_PROC)GetInterruptHandleFromIdt (&(IdtEntryTable[ExceptionType].OrigDesc));\r
\r
//\r
// encodes new IDT Gate descriptor by stub entry\r
//\r
SetInterruptState (OldIntFlagState);\r
\r
- return ;\r
+ return;\r
}\r
\r
/**\r
**/\r
VOID\r
UnhookEntry (\r
- IN EFI_EXCEPTION_TYPE ExceptionType\r
+ IN EFI_EXCEPTION_TYPE ExceptionType\r
)\r
{\r
- BOOLEAN OldIntFlagState;\r
+ BOOLEAN OldIntFlagState;\r
\r
//\r
// Disables CPU interrupts and returns the previous interrupt state\r
//\r
SetInterruptState (OldIntFlagState);\r
\r
- return ;\r
+ return;\r
}\r
\r
/**\r
EFI_STATUS\r
EFIAPI\r
GetMaximumProcessorIndex (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- OUT UINTN *MaxProcessorIndex\r
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
+ OUT UINTN *MaxProcessorIndex\r
)\r
{\r
*MaxProcessorIndex = 0;\r
EFI_STATUS\r
EFIAPI\r
RegisterPeriodicCallback (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- IN UINTN ProcessorIndex,\r
- IN EFI_PERIODIC_CALLBACK PeriodicCallback\r
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
+ IN UINTN ProcessorIndex,\r
+ IN EFI_PERIODIC_CALLBACK PeriodicCallback\r
)\r
{\r
return ManageIdtEntryTable (PeriodicCallback, SYSTEM_TIMER_VECTOR);\r
EFI_STATUS\r
EFIAPI\r
RegisterExceptionCallback (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- IN UINTN ProcessorIndex,\r
- IN EFI_EXCEPTION_CALLBACK ExceptionCallback,\r
- IN EFI_EXCEPTION_TYPE ExceptionType\r
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
+ IN UINTN ProcessorIndex,\r
+ IN EFI_EXCEPTION_CALLBACK ExceptionCallback,\r
+ IN EFI_EXCEPTION_TYPE ExceptionType\r
)\r
{\r
return ManageIdtEntryTable (ExceptionCallback, ExceptionType);\r
}\r
\r
-\r
/**\r
Invalidates processor instruction cache for a memory range. Subsequent execution in this range\r
causes a fresh memory fetch to retrieve code to be executed.\r
EFI_STATUS\r
EFIAPI\r
InvalidateInstructionCache (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- IN UINTN ProcessorIndex,\r
- IN VOID *Start,\r
- IN UINT64 Length\r
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
+ IN UINTN ProcessorIndex,\r
+ IN VOID *Start,\r
+ IN UINT64 Length\r
)\r
{\r
AsmWbinvd ();\r
**/\r
VOID\r
InterruptDistrubutionHub (\r
- EFI_EXCEPTION_TYPE ExceptionType,\r
- EFI_SYSTEM_CONTEXT_IA32 *ContextRecord\r
+ EFI_EXCEPTION_TYPE ExceptionType,\r
+ EFI_SYSTEM_CONTEXT_IA32 *ContextRecord\r
)\r
{\r
if (IdtEntryTable[ExceptionType].RegisteredCallback != NULL) {\r
EFI_STATUS\r
EFIAPI\r
PlUnloadDebugSupportDriver (\r
- IN EFI_HANDLE ImageHandle\r
+ IN EFI_HANDLE ImageHandle\r
)\r
{\r
EFI_EXCEPTION_TYPE ExceptionType;\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
- for (ExceptionType = 0; ExceptionType < NUM_IDT_ENTRIES; ExceptionType ++) {\r
- IdtEntryTable[ExceptionType].StubEntry = (DEBUG_PROC) (UINTN) AllocatePool (StubSize);\r
+ for (ExceptionType = 0; ExceptionType < NUM_IDT_ENTRIES; ExceptionType++) {\r
+ IdtEntryTable[ExceptionType].StubEntry = (DEBUG_PROC)(UINTN)AllocatePool (StubSize);\r
if (IdtEntryTable[ExceptionType].StubEntry == NULL) {\r
goto ErrorCleanup;\r
}\r
//\r
CopyMem ((VOID *)(UINTN)IdtEntryTable[ExceptionType].StubEntry, InterruptEntryStub, StubSize);\r
}\r
+\r
return EFI_SUCCESS;\r
\r
ErrorCleanup:\r
FreePool ((VOID *)(UINTN)IdtEntryTable[ExceptionType].StubEntry);\r
}\r
}\r
+\r
FreePool (IdtEntryTable);\r
\r
return EFI_OUT_OF_RESOURCES;\r