]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/EbcSimpleDebugger.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / EbcSimpleDebugger.h
1 /** @file
2 EBC Simple Debugger protocol for debug EBC code.
3
4 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef _EBC_SIMPLE_DEBUGGER_PROTOCOL_H_
11 #define _EBC_SIMPLE_DEBUGGER_PROTOCOL_H_
12
13 #include <Protocol/DebugSupport.h>
14 #include <Protocol/EbcVmTest.h>
15
16 #define EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL_GUID \
17 { \
18 0x2a72d11e, 0x7376, 0x40f6, { 0x9c, 0x68, 0x23, 0xfa, 0x2f, 0xe3, 0x63, 0xf1 } \
19 }
20
21 //
22 // Defines for a simple EBC debugger interface
23 //
24 typedef struct _EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL;
25
26 /**
27 Trig Exception on EBC VM.
28
29 @param[in] This A pointer to the EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL structure.
30 @param[in] VmPtr A pointer to a VM context.
31 @param[in] ExceptionType Exception to be trigged.
32
33 @retval EFI_UNSUPPORTED No support for it.
34 @retval EFI_SUCCESS Exception is trigged.
35
36 **/
37 typedef
38 EFI_STATUS
39 (EFIAPI *EBC_DEBUGGER_SIGNAL_EXCEPTION) (
40 IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL *This,
41 IN VM_CONTEXT *VmPtr,
42 IN EFI_EXCEPTION_TYPE ExceptionType
43 );
44
45 /**
46 Given a pointer to a new VM context, debug one or more instructions.
47
48 @param[in] This A pointer to the EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL structure.
49 @param[in] VmPtr A pointer to a VM context.
50
51 @retval EFI_UNSUPPORTED No support for it.
52 @retval EFI_SUCCESS Debug one or more instructions.
53
54 **/
55 typedef
56 VOID
57 (EFIAPI *EBC_DEBUGGER_DEBUG) (
58 IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL *This,
59 IN VM_CONTEXT *VmPtr
60 );
61
62 /**
63 Given a pointer to a new VM context, dump one or more instructions.
64
65 @param[in] This A pointer to the EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL structure.
66 @param[in] VmPtr A pointer to a VM context.
67 @param[in] DasmString Dump string buffer.
68 @param[in] DasmStringSize Dump string size.
69
70 @retval EFI_UNSUPPORTED No support for it.
71 @retval EFI_SUCCESS Dump one or more instructions.
72
73 **/
74 typedef
75 UINT32
76 (EFIAPI *EBC_DEBUGGER_DASM) (
77 IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL *This,
78 IN VM_CONTEXT *VmPtr,
79 IN UINT16 *DasmString OPTIONAL,
80 IN UINT32 DasmStringSize
81 );
82
83 /**
84 This interface allows you to configure the EBC debug support
85 driver. For example, turn on or off saving and printing of
86 delta VM even if called. Or to even disable the entire interface,
87 in which case all functions become no-ops.
88
89 @param[in] This A pointer to the EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL structure.
90 @param[in] ConfigId ID to be configured.
91 @param[in] ConfigValue Value to be set.
92
93 @retval EFI_UNSUPPORTED No support for it.
94 @retval EFI_SUCCESS Configure EBC debug.
95
96 **/
97 typedef
98 EFI_STATUS
99 (EFIAPI *EBC_DEBUGGER_CONFIGURE) (
100 IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL *This,
101 IN UINT32 ConfigId,
102 IN UINTN ConfigValue
103 );
104
105 //
106 // Prototype for the actual EBC debug support protocol interface
107 //
108 struct _EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL {
109 EBC_DEBUGGER_DEBUG Debugger;
110 EBC_DEBUGGER_SIGNAL_EXCEPTION SignalException;
111 EBC_DEBUGGER_DASM Dasm;
112 EBC_DEBUGGER_CONFIGURE Configure;
113 };
114
115 extern EFI_GUID gEfiEbcSimpleDebuggerProtocolGuid;
116
117 #endif