-#define FF_FXSR (1 << 24)\r
-\r
-typedef UINT64 DESCRIPTOR;\r
-\r
-typedef\r
-VOID\r
-(*DEBUG_PROC) (\r
- VOID\r
- );\r
-\r
-typedef struct {\r
- DESCRIPTOR OrigDesc;\r
- DEBUG_PROC OrigVector;\r
- DESCRIPTOR NewDesc;\r
- DEBUG_PROC StubEntry;\r
- VOID (*RegisteredCallback) ();\r
-} IDT_ENTRY;\r
-\r
-extern EFI_SYSTEM_CONTEXT SystemContext;\r
-extern UINT8 InterruptEntryStub[];\r
-extern UINT32 StubSize;\r
-extern VOID (*OrigVector) (VOID);\r
-\r
-VOID\r
-CommonIdtEntry (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Generic IDT entry\r
-\r
-Arguments:\r
-\r
- None\r
-\r
-Returns:\r
-\r
- None\r
-\r
---*/\r
-;\r
-\r
-\r
-BOOLEAN\r
-FxStorSupport (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Check whether FXSTOR is supported\r
-\r
-Arguments:\r
-\r
- None\r
-\r
-Returns:\r
-\r
- TRUE - supported\r
- FALSE - not supported\r
-\r
---*/\r
-;\r
-\r
-DESCRIPTOR *\r
-GetIdtr (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Return the physical address of IDTR\r
-\r
-Arguments:\r
-\r
- None\r
-\r
-Returns:\r
-\r
- The physical address of IDTR\r
-\r
---*/\r
-;\r
-\r
-VOID\r
-Vect2Desc (\r
- DESCRIPTOR * DestDesc,\r
- VOID (*Vector) (VOID)\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Encodes an IDT descriptor with the given physical address\r
-\r
-Arguments:\r
-\r
- DestDesc - The IDT descriptor address\r
- Vector - The interrupt vector entry\r
-\r
-Returns:\r
-\r
- None\r
-\r
---*/\r
-;\r
-\r
-BOOLEAN\r
-WriteInterruptFlag (\r
- BOOLEAN NewState\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Programs interrupt flag to the requested state and returns previous\r
- state.\r
-\r
-Arguments:\r
-\r
- NewState - New interrupt status\r
-\r
-Returns:\r
-\r
- Old interrupt status\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-plInitializeDebugSupportDriver (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Initializes driver's handler registration database.\r
-\r
- This code executes in boot services context.\r
-\r
-Arguments:\r
- None\r
-\r
-Returns:\r
- EFI_SUCCESS\r
- EFI_UNSUPPORTED - if IA32 processor does not support FXSTOR/FXRSTOR instructions,\r
- the context save will fail, so these processor's are not supported.\r
- EFI_OUT_OF_RESOURCES - not resource to finish initialization\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-plUnloadDebugSupportDriver (\r
- IN EFI_HANDLE ImageHandle\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- This is the callback that is written to the LoadedImage protocol instance\r
- on the image handle. It uninstalls all registered handlers and frees all entry\r
- stub memory.\r
-\r
- This code executes in boot services context.\r
-\r
-Arguments:\r
- ImageHandle - The image handle of the unload handler\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - always return success\r
-\r
---*/\r
-;\r
-\r
-//\r
-// DebugSupport protocol member functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-GetMaximumProcessorIndex (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- OUT UINTN *MaxProcessorIndex\r
- )\r
-/*++\r
-\r
-Routine Description: This is a DebugSupport protocol member function.\r
-\r
-Arguments:\r
- This - The DebugSupport instance\r
- MaxProcessorIndex - The maximuim supported processor index\r
-\r
-Returns:\r
- Always returns EFI_SUCCESS with *MaxProcessorIndex set to 0\r
-\r
---*/\r
-;\r
-\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
- )\r
-/*++\r
-\r
-Routine Description: This is a DebugSupport protocol member function.\r
-\r
-Arguments:\r
- This - The DebugSupport instance\r
- ProcessorIndex - Which processor the callback applies to.\r
- PeriodicCallback - Callback function\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS\r
- EFI_INVALID_PARAMETER - requested uninstalling a handler from a vector that has\r
- no handler registered for it\r
- EFI_ALREADY_STARTED - requested install to a vector that already has a handler registered.\r
-\r
- Other possible return values are passed through from UnHookEntry and HookEntry.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-RegisterExceptionCallback (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- IN UINTN ProcessorIndex,\r
- IN EFI_EXCEPTION_CALLBACK NewCallback,\r
- IN EFI_EXCEPTION_TYPE ExceptionType\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- This is a DebugSupport protocol member function.\r
-\r
- This code executes in boot services context.\r
-\r
-Arguments:\r
- This - The DebugSupport instance\r
- ProcessorIndex - Which processor the callback applies to.\r
- NewCallback - Callback function\r
- ExceptionType - Which exception to hook\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS\r
- EFI_INVALID_PARAMETER - requested uninstalling a handler from a vector that has\r
- no handler registered for it\r
- EFI_ALREADY_STARTED - requested install to a vector that already has a handler registered.\r
-\r
- Other possible return values are passed through from UnHookEntry and HookEntry.\r
-\r
---*/\r
-;\r
-\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
- )\r
-/*++\r
-\r
-Routine Description:\r
- This is a DebugSupport protocol member function.\r
- Calls assembly routine to flush cache.\r
-\r
-Arguments:\r
- This - The DebugSupport instance\r
- ProcessorIndex - Which processor the callback applies to.\r
- Start - Physical base of the memory range to be invalidated\r
- Length - mininum number of bytes in instruction cache to invalidate\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - always return success\r
-\r
---*/\r
-;\r