2016-11-16 14:24:08 +01:00
|
|
|
/** @file
|
|
|
|
Prototypes for the EBC Debugger hooks.
|
|
|
|
|
|
|
|
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
2019-04-04 01:05:13 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2016-11-16 14:24:08 +01:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _EFI_EBC_DEBUGGER_HOOK_H_
|
|
|
|
#define _EFI_EBC_DEBUGGER_HOOK_H_
|
|
|
|
|
2016-11-16 14:24:10 +01:00
|
|
|
#include <Uefi.h>
|
|
|
|
|
|
|
|
#include <Protocol/DebugSupport.h>
|
|
|
|
#include <Protocol/EbcVmTest.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
The VM interpreter calls this function when an exception is detected.
|
|
|
|
|
|
|
|
@param ExceptionType Specifies the processor exception detected.
|
|
|
|
@param ExceptionFlags Specifies the exception context.
|
|
|
|
@param VmPtr Pointer to a VM context for passing info to the
|
|
|
|
EFI debugger.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS This function completed successfully.
|
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EbcDebugSignalException (
|
|
|
|
IN EFI_EXCEPTION_TYPE ExceptionType,
|
|
|
|
IN EXCEPTION_FLAGS ExceptionFlags,
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in InitializeEbcDriver.
|
|
|
|
|
|
|
|
@param Handle - The EbcDebugProtocol handle.
|
|
|
|
@param EbcDebugProtocol - The EbcDebugProtocol interface.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookInit (
|
|
|
|
IN EFI_HANDLE Handle,
|
|
|
|
IN EFI_DEBUG_SUPPORT_PROTOCOL *EbcDebugProtocol
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in UnloadImage for EBC Interpreter.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookUnload (
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in EbcUnloadImage.
|
|
|
|
Currently do nothing here.
|
|
|
|
|
|
|
|
@param Handle The EbcImage handle.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookEbcUnloadImage (
|
|
|
|
IN EFI_HANDLE Handle
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
Hooks in EbcSupport.c
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookExecuteEbcImageEntryPoint (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in ExecuteEbcImageEntryPoint.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookEbcInterpret (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
The hook in EbcExecute, before ExecuteFunction.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookExecuteStart (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
The hook in EbcExecute, after ExecuteFunction.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookExecuteEnd (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
The hook in ExecuteCALL, before move IP.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookCALLStart (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in ExecuteCALL, after move IP.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookCALLEnd (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in ExecuteCALL, before call EbcLLCALLEX.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookCALLEXStart (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in ExecuteCALL, after call EbcLLCALLEX.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookCALLEXEnd (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in ExecuteRET, before move IP.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookRETStart (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in ExecuteRET, after move IP.
|
|
|
|
It will record trace information.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookRETEnd (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in ExecuteJMP, before move IP.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookJMPStart (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in ExecuteJMP, after move IP.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookJMPEnd (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in ExecuteJMP8, before move IP.
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookJMP8Start (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
2016-12-05 04:33:52 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
The hook in ExecuteJMP8, after move IP..
|
|
|
|
|
|
|
|
@param VmPtr - pointer to VM context.
|
|
|
|
|
|
|
|
**/
|
2016-11-16 14:24:08 +01:00
|
|
|
VOID
|
|
|
|
EbcDebuggerHookJMP8End (
|
|
|
|
IN VM_CONTEXT *VmPtr
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|