]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.h
202033 make .h more clear, seperate ComponentName.h IScsiInitiatorName.h from IScsiDr...
[mirror_edk2.git] / MdeModulePkg / Universal / DebugSupportDxe / Ipf / PlDebugSupport.h
index f8f5532de7c663272172043133e4691b5b0377fa..e1e34a449caac6e47615b955d31fa1a64d1f72c6 100644 (file)
@@ -15,7 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _PLDEBUG_SUPPORT_H_\r
 #define _PLDEBUG_SUPPORT_H_\r
 \r
-\r
 #include <Uefi.h>\r
 \r
 #include <Protocol/DebugSupport.h>\r
@@ -29,11 +28,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #define DISABLE_INTERRUPTS  0UL\r
 \r
-//\r
-// The remaining definitions comprise the protocol members.\r
-//\r
 #define EFI_ISA IsaIpf\r
 \r
+typedef struct {\r
+  UINT64  low;\r
+  UINT64  high;\r
+} BUNDLE;\r
+\r
 /**\r
   IPF specific DebugSupport driver initialization. \r
 \r
@@ -217,4 +218,86 @@ CommonHandler (
   IN EFI_SYSTEM_CONTEXT Context\r
   );\r
 \r
+/**\r
+  This is the worker function that uninstalls and removes all handlers.\r
+\r
+  @param  ExceptionType     Exception Type\r
+  @param  NewBundles        New Boundles\r
+  @param  NewCallback       New Callback\r
+\r
+  @retval EFI_ALEADY_STARTED Ivt already hooked.\r
+  @retval others             Indicates the request was not satisfied.\r
+  @retval EFI_SUCCESS        Successfully uninstalled.\r
+\r
+**/\r
+EFI_STATUS\r
+ManageIvtEntryTable (\r
+  IN  EFI_EXCEPTION_TYPE    ExceptionType,\r
+  IN  BUNDLE                NewBundles[4],\r
+  IN  VOID                  (*NewCallback) ()\r
+  );\r
+\r
+/**\r
+  Saves original IVT contents and inserts a few new bundles which are fixed up\r
+  to store the ExceptionType and then call the common handler.\r
+\r
+  @param  ExceptionType      Exception Type\r
+  @param  NewBundles         New Boundles\r
+  @param  NewCallback        New Callback\r
+\r
+**/\r
+VOID\r
+HookEntry (\r
+  IN  EFI_EXCEPTION_TYPE    ExceptionType,\r
+  IN  BUNDLE                NewBundles[4],\r
+  IN  VOID                  (*NewCallback) ()\r
+  );\r
+\r
+/**\r
+  Restores original IVT contents when unregistering a callback function.\r
+\r
+  @param  ExceptionType     Exception Type\r
+\r
+**/\r
+VOID\r
+UnhookEntry (\r
+  IN  EFI_EXCEPTION_TYPE    ExceptionType\r
+  );\r
+\r
+/**\r
+  Sets up cache flush and calls assembly function to chain external interrupt.\r
+\r
+  Records new callback in IvtEntryTable.\r
+\r
+  @param  NewCallback     New Callback.\r
+\r
+**/\r
+VOID\r
+ChainExternalInterrupt (\r
+  IN  VOID                  (*NewCallback) ()\r
+  );\r
+\r
+/**\r
+  Sets up cache flush and calls assembly function to restore external interrupt.\r
+  Removes registered callback from IvtEntryTable.\r
+\r
+**/\r
+VOID\r
+UnchainExternalInterrupt (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Given an integer number, return the physical address of the entry point in the IFT.\r
+\r
+  @param  HandlerIndex       Index of the Handler \r
+  @param  EntryPoint         IFT Entrypoint\r
+\r
+**/\r
+VOID\r
+GetHandlerEntryPoint (\r
+  UINTN                     HandlerIndex,\r
+  VOID                      **EntryPoint\r
+  );\r
+\r
 #endif\r